-
Notifications
You must be signed in to change notification settings - Fork 0
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
Port callgate generation code to ARM #333
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ayrtonm
force-pushed
the
sim/arm_rewriter
branch
from
March 26, 2024 17:28
930f527
to
2a5bb60
Compare
ayrtonm
force-pushed
the
am/scrub_registers
branch
from
March 26, 2024 17:30
15acb9c
to
d983cde
Compare
ayrtonm
force-pushed
the
am/scrub_registers
branch
2 times, most recently
from
March 26, 2024 20:45
2e9aaa1
to
914ca4b
Compare
TODO: missing ret on scrub registers |
Also x16 and x17 probably shouldn't be zeroed |
ayrtonm
force-pushed
the
am/scrub_registers
branch
2 times, most recently
from
March 27, 2024 16:19
a2d1277
to
49c38f0
Compare
ayrtonm
force-pushed
the
am/scrub_registers
branch
from
March 28, 2024 17:53
49c38f0
to
87f14f7
Compare
ayrtonm
force-pushed
the
am/scrub_registers
branch
3 times, most recently
from
April 4, 2024 19:34
05c6280
to
00e8246
Compare
ayrtonm
changed the title
Add basic register scrubbing for ARM
Port callgate generation code to ARM
Apr 4, 2024
This now has stack switching so the main thing missing from the callgates is copying arguments and return values between stacks |
ayrtonm
force-pushed
the
am/scrub_registers
branch
from
April 30, 2024 02:48
e8384e6
to
e7402cc
Compare
ayrtonm
force-pushed
the
am/scrub_registers
branch
from
April 30, 2024 03:26
e7402cc
to
73be867
Compare
sim-immunant
force-pushed
the
am/scrub_registers
branch
from
May 3, 2024 03:33
229d760
to
ea7c19b
Compare
ayrtonm
added a commit
that referenced
this pull request
May 28, 2024
This is only for testing the threads test and should be replaced by the implementation in PR #333.
fw-immunant
force-pushed
the
am/scrub_registers
branch
from
July 29, 2024 14:21
ea7c19b
to
33b80da
Compare
rinon
force-pushed
the
am/scrub_registers
branch
2 times, most recently
from
September 27, 2024 16:41
55e584e
to
19e64bd
Compare
rinon
force-pushed
the
am/scrub_registers
branch
from
October 2, 2024 18:05
22c3ad1
to
8ad5097
Compare
This is ready for review, it should handle all of the ARM ABI now (not including scalable vectors). |
Structs containing only an array are classed as arrays on ARM, in contrast to x86 where they are structs. We have to handle this case separately.
Stack relative access does not get MTE enforcement, so we can write into the destination stack before switching to the destination compartment.
Clang and its target specific ABI functions already do most of the work for us. We should rely on that instead of trying to re-create the mapping from argument types to direct or indirect argument passing.
We need more information in GenCallAsm to correctly handle indirect memory args, so we should just use the same type across DetermineAbi and GenCallAsm. This change combines the two and allows us to allocate registers directly into the abi signature. We should probably move this out of GenCallAsm but that can be done later.
X86 includes "indirect" args in the stack argument region, while ARM passes them indirectly by reference. This change simplifies how we compute the size of the stack args region to copy and does not include indirect args for ARM.
…fail due to not enforcing MTE
Memory returns on AArch64 are classified as indirect, but we don't need to preserve the address in a register after the callee.
rinon
force-pushed
the
am/scrub_registers
branch
from
October 11, 2024 21:11
d9fdc1a
to
6372a16
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I also added some basic prologue/epilogue stuff in the rewriter to get calls to scrub_registers working.