This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] ARMv8.5-A implies both FEAT_SB and FEAT_SSBS
AbandonedPublic

Authored by philipp.tomsich on Jan 23 2023, 3:02 PM.

Details

Summary

ARMv8.5-A implies SB and SSBS. This requires some adjustments to the
testcases where ARMv8.5 cores (which must implement these) have tests
that don't expect SB or (usually) SBSS to be set.

Depends on D142396

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptJan 23 2023, 3:02 PM
philipp.tomsich requested review of this revision.Jan 23 2023, 3:02 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJan 23 2023, 3:02 PM

I believe this is correct, according to at least one reference I have. FEAT_SSBS isn't spelled out very clearly in the reference manual though. Adding some more people who might be able to check.

SSBS is not mandatory from v8.5a onwards. More details/citation inline.

NB: This will need a rebase, because @dmgreen changed how crypto is handled in these bitmaps yesterday.

llvm/include/llvm/TargetParser/AArch64TargetParser.h
311

According to the A-profile Arm ARM (version I.a):

  • FEAT_SB is mandatory from v8.5 onwards, so thank you for correcting this oversight.
  • There is no language about the same for FEAT_SSBS/FEAT_SSBS2. It was added to v8.0a by v8.5a, but it doesn't seem to have been made mandatory in v8.5a, as far as I can see. There is no language in section A2 (Architectural Extensions), or in the description of the ID_AA64PFR1_EL1.SSBS register about being mandatory from certain versions (other fields in this register do have this language).
323

This bitmap is based on the v8.5a bitmap, so would need checking, but it looks like it will be correct already because v8r has SB and SSBS marked already (which is correct).

When looking at "ARM DDI 0487G.a", on page A2-68 under the heading "Additional functionality added to Armv8.0 in later releases" in the definition-list item "FEAT_SSBS, Speculative Store Bypass Safe":

This feature is OPTIONAL in Armv8.0 implementations and mandatory in Armv8.5 implementations.

There is a to FEAT_SBSS in the backlink in "A2.8 The Armv8.5 architecture extension", under the subsection "A2.8.3 Features added to earlier extensions", in the bullet-list labeled "The features that have been added to earlier architectural extensions are:"

When looking at "ARM DDI 0487G.a", on page A2-68 under the heading "Additional functionality added to Armv8.0 in later releases" in the definition-list item "FEAT_SSBS, Speculative Store Bypass Safe":

This feature is OPTIONAL in Armv8.0 implementations and mandatory in Armv8.5 implementations.

There is a to FEAT_SBSS in the backlink in "A2.8 The Armv8.5 architecture extension", under the subsection "A2.8.3 Features added to earlier extensions", in the bullet-list labeled "The features that have been added to earlier architectural extensions are:"

I cited version I.a, which is later than version G.a. Looking at the errata for version G.b, erratum R18653 (page 93) is where it was relaxed to not be mandatory from v8.5a. Errata document link: https://developer.arm.com/documentation/102105/gb-05/?lang=en (I'm just happy this was in the first errata document I looked for!)

@philipp.tomsich Reverse Ping. What are your plans for this change?

lenary resigned from this revision.Apr 13 2023, 9:59 AM
philipp.tomsich abandoned this revision.Apr 13 2023, 11:06 AM

I just saw that the last response was "unsubmitted".

Submitting and abandoning this revision (based on the discussion and the previously unsubmitted comment from my end).

llvm/include/llvm/TargetParser/AArch64TargetParser.h
311

I have now picked up I.a after I had previously referenced G.a.

Features added to earlier extensions (For ARMv8.5) lists FEAT_SBSS.
However, the Text under FEAT_SBSS/FEAT_SSBS2 no longer has the "This feature is OPTIONAL in Armv8.0 implementations and mandatory in Armv8.5 implementations." that was present in version G.a of the spec.

So it looks as if this was made optional again somewhere between G.a and I.a?