-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Arm-64: Add initial support for PAC-RET #110472
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
base: main
Are you sure you want to change the base?
Changes from all commits
33c53fa
c45b4a8
19b977a
c2c03f9
c64cc1f
cfddf71
3bf9346
042210f
435a901
e9f101c
1dae16f
a1265fb
8a05d92
98246b7
cb3879b
5a24d2a
ba343d2
e414fc7
f3b9e61
bb67312
abfe3d4
0d0fc7f
8394024
ddf6c3d
2b6bf2b
b408ec5
a5a94a7
240b551
09a6c40
1dcf083
618b79c
25c7f72
1e6b5b6
6aebd8b
b230513
b9802ed
9c216f5
f5b6ffa
57112e3
7d92dae
6ef4025
03cde20
beb7829
8e1a725
fb3ab0e
457dd89
a17e8ba
268a895
526b7c2
711d1fc
a99f639
eefb18b
8e087f5
a1298d7
36f166e
989ff17
05f8731
260a807
526717a
2c81d43
7b552e5
f36e335
a862791
8f5b485
e7bc0fa
f53b929
82b0709
7e207a4
52f63d8
79a3fbc
e1ba37b
75316bc
c9f8bd1
b8574ab
333b5b2
cecc9f4
34401fb
0bc660e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,6 +76,10 @@ typedef void * OBJECTREF; | |
|
||
#ifndef __cgencpu_h__ | ||
|
||
#if defined(TARGET_ARM64) | ||
extern "C" void* PacStripPtr(void* ptr); | ||
#endif // TARGET_ARM64 | ||
|
||
inline void SetIP(T_CONTEXT* context, PCODE rip) | ||
{ | ||
_ASSERTE(!"don't call this"); | ||
|
@@ -105,7 +109,7 @@ inline PCODE GetIP(T_CONTEXT* context) | |
#elif defined(TARGET_ARM) | ||
return (PCODE)context->Pc; | ||
#elif defined(TARGET_ARM64) | ||
return (PCODE)context->Pc; | ||
return (PCODE) PacStripPtr((void *)context->Pc); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll move these strip operations to the source while populating the context. These are temporarily added until we get all the CI issues fixed. |
||
#elif defined(TARGET_LOONGARCH64) | ||
return (PCODE)context->Pc; | ||
#elif defined(TARGET_RISCV64) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4464,6 +4464,9 @@ void CodeGen::genPushCalleeSavedRegisters() | |
} | ||
#endif // DEBUG | ||
|
||
// Sign LR as part of Pointer Authentication (PAC) support | ||
GetEmitter()->emitPacInProlog(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Either in this PR or in a follow-up PR, you might want to consider moving the pac instructions closer to where we save There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, number of things will need to be redone to get SP signing in place. |
||
|
||
// The frameType number is arbitrary, is defined below, and corresponds to one of the frame styles we | ||
// generate based on various sizes. | ||
int frameType = 0; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -125,6 +125,7 @@ CONFIG_STRING(JitInlineMethodsWithEHRange, "JitInlineMethodsWithEHRange") | |
|
||
CONFIG_INTEGER(JitLongAddress, "JitLongAddress", 0) // Force using the large pseudo instruction form for long address | ||
CONFIG_INTEGER(JitMaxUncheckedOffset, "JitMaxUncheckedOffset", 8) | ||
RELEASE_CONFIG_INTEGER(JitPacEnabled, "JitPacEnabled", 1) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. a remainder to turn it off before merging. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Leaving them enabled until CI is happy. |
||
|
||
// | ||
// MinOpts | ||
|
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.
The comment in
DwarfCfiOpcode.cs
refers to a pacibsp. Which one is correct?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.
paciaz
is a correct one for now. It would be updated once we support signing with SP.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.
Does the spec for
DW_CFA_AARCH64_negate_ra_state
opcode require specific signing or is it meant to support any type of signing?In other words, are there any unwinders that will break when we use non-standard signing with this opcode?
Uh oh!
There was an error while loading. Please reload this page.
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.
That's a good point. It's likely that an unwinder could break. I'll investigate this further. Preliminary look suggests unwinders such as gcc's unwinder reconises only unsinged or signing with SP modes.