-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GCS ACLE #364
GCS ACLE #364
Conversation
The only difference compared to #260 is use of non-const type for GCS pointer (an relevant change in wording). |
main/design_documents/gcs.md
Outdated
at compile time if (1) is true which can be feature tested. With (C) | ||
there is no obvious feature test for the presence of the intrinsics. | ||
|
||
The future direction is to make intrinsics available unconditionally |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is how other intrinsics are defined already in practice (gcc, clang at least)
Macro just there to indicate to the user the availability of the intrinsics.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for clarification. I've changed the wording, let me know if it's better now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 from me, just a note from me.
let see what others says.
Co-authored-by: Yury Khrustalev <yury.khrustalev@arm.com>
70ac9c6
to
a6e18dd
Compare
Co-authored-by: Yury Khrustalev <yury.khrustalev@arm.com>
LGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -1713,6 +1713,15 @@ mechanisms such as function attributes. | |||
Pointer Authentication extension (FEAT_PAuth_LR) are available on the target. | |||
It is undefined otherwise. | |||
|
|||
### Guarded Control Stack | |||
|
|||
`__ARM_FEATURE_GCS_DEFAULT` is defined to `1` if the code generation is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is set to
|
||
Checks for hardware features at runtime using the CHKFEAT hint instruction. | ||
`__chkfeat` returns a bitmask where a bit is set if the same bit in the | ||
input argument is set and the corresponding feature is enabled. (Note: for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't embed notes in a paragraph. Put the note after the table.
@@ -4820,6 +4844,60 @@ two pointers, ignoring the tags. | |||
The return value is the sign-extended result of the computation. | |||
The tag bits in the input pointers are ignored for this operation. | |||
|
|||
# Guarded Control Stack intrinsics | |||
|
|||
## Introduction |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This heading is unnecessary.
Guarded Control Stack (GCS) extension. The GCS instructions are present | ||
in the AArch64 execution state only. | ||
|
||
When GCS protection is enabled then function calls also save the return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enabled, then
|
||
When GCS protection is enabled then function calls also save the return | ||
address to a separate stack, the GCS, that is checked against the actual | ||
return address when the function returns. At runtime GCS protection can |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
runtime, GCS
|
||
Simplest is (A), but it does not allow asynchronously disabling GCS, | ||
for that at least (B) is needed since the intrinsics must do something | ||
reasonable if GCS is disabled. Asynchronous disable is e.g. needed to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is, for example, needed
|
||
(C) is similar to (B) but allows using the intrinsics even if GCS is | ||
guaranteed to be disabled. The intrinsics are expected to be used | ||
behind runtime check for (3) since they don't do anything useful |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(3) because they do not do
at compile time if (1) is true which can be feature tested. With (C) | ||
there is no obvious feature test for the presence of the intrinsics. | ||
|
||
Since intrinsics are available unconditionally and runtime checks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because intrinsics
The type of the intrinsics is based on the `void *` GCS pointer | ||
type and `uint64_t` GCS entry type. The GCS pointer could be | ||
`uint64_t *`, but void is more general in that it allows | ||
different access to the GCS (e.g. accessing entries as pointers or |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GCS, for example, accessing entries as pointers or
bytes.
type and `uint64_t` GCS entry type. The GCS pointer could be | ||
`uint64_t *`, but void is more general in that it allows | ||
different access to the GCS (e.g. accessing entries as pointers or | ||
bytes). A GCS entry is usually a code pointer, but the architecture |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A GCS entry is usually a code pointer. However, the architecture
requires it to be 8 bytes, even with ILP32, and it might be a special
token that requires bit operations to detect. Therefore, fixed width
unsigned int
type is the most appropriate.
This is to continue discussion started in #260.
name: Pull request
about: Technical issues, document format problems, bugs in scripts or feature proposal.