Repository navigation
RVY libunwind patches. #832
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
Changes from all commits
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 |
|---|---|---|
|
|
@@ -1308,15 +1308,15 @@ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind15Registers_sparc6jumptoEv) | |
|
|
||
| .macro restore_fpr num, ctxreg | ||
| #ifdef __CHERI_PURE_CAPABILITY__ | ||
| fld f\num, (RISCV_FOFFSET + RISCV_FSIZE * \num)(c\ctxreg) | ||
| fld f\num, (RISCV_FOFFSET + RISCV_FSIZE * \num)(\ctxreg) | ||
|
Member
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. Please split the RVY-compatible mnemonic changes out from the c18n changes
Member
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. Also at this point the ifdef isn't needed? Nor are the GPR ones needed, so long as ILOAD/ISTORE/RISCV_ISIZE are appropriately renamed to not be I for Integer, and defined to be LY/SY/__SIZEOF_CHERI_CAPABILITY__ CHERI? Edit: Meant to include this in the original review but it was left pending... so will just do this myself :)
Contributor
Author
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. Should be fixed now. |
||
| #else | ||
| FLOAD f\num, (RISCV_FOFFSET + RISCV_FSIZE * \num)(\ctxreg) | ||
| #endif | ||
| .endm | ||
|
|
||
| .macro restore_gpr num, ctxreg | ||
| #ifdef __CHERI_PURE_CAPABILITY__ | ||
| lc c\num, (__SIZEOF_CHERI_CAPABILITY__ * \num)(c\ctxreg) | ||
| ly x\num, (__SIZEOF_CHERI_CAPABILITY__ * \num)(\ctxreg) | ||
| #else | ||
| ILOAD x\num, (RISCV_ISIZE * \num)(\ctxreg) | ||
| #endif | ||
|
|
@@ -1330,6 +1330,18 @@ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind15Registers_sparc6jumptoEv) | |
| // | ||
| .p2align 2 | ||
| DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind15Registers_riscv6jumptoEv) | ||
| #ifdef _LIBUNWIND_HAS_CHERI_LIB_C18N | ||
| // Preserve the argument in a callee-saved register instead of pushing it onto | ||
| // the stack because stack unwinding will switch the stack. | ||
| ymv s1, a0 | ||
| // Pass the target untrusted stack pointer | ||
| ly a0, (__SIZEOF_CHERI_CAPABILITY__ * 2)(s1) | ||
| // Pass the target trusted stack pointer | ||
| ly a1, (__SIZEOF_CHERI_CAPABILITY__ * 32)(s1) | ||
| call dl_c18n_unwind_trusted_stack | ||
| ymv a0, s1 | ||
| #endif | ||
|
|
||
| # if defined(__riscv_flen) | ||
| .irp i,FROM_0_TO_31 | ||
| restore_fpr \i, a0 | ||
|
|
@@ -1338,7 +1350,7 @@ DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind15Registers_riscv6jumptoEv) | |
|
|
||
| // x0 is zero | ||
| #ifdef __CHERI_PURE_CAPABILITY__ | ||
| lc c1, (__SIZEOF_CHERI_CAPABILITY__ * 0)(ca0) // restore pc into ra | ||
| ly x1, (__SIZEOF_CHERI_CAPABILITY__ * 0)(a0) // restore pc into ra | ||
| #else | ||
| ILOAD x1, (RISCV_ISIZE * 0)(a0) // restore pc into ra | ||
| #endif | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.