Commit 45f12b3
Dmitrii Kuvaiskii
[PAL/Linux-SGX] Do not clobber RBX reg in stage-1 signal handler
If the enclave is entered with CSSA=1, then the enclave starts executing
the stage-1 signal handler asssembly code. This assembly code prepares
the context for the stage-2 signal handler, which will be executed in
regular context with CSSA=0 and using C code.
This stage-1 signal handler uses the RBX register as a base pointer to
the SSA[0].GPRSGX region. Closer to the end of the stage-1 handler flow,
in particular before the `.Lcssa1_exception_eexit` label, this SSA[0]
base pointer is not needed anymore, so the RBX register is used for
other purposes. In particular, RBX is used to hold the stashed RDX value
(where-to-exit address in untrusted runtime).
However, a future commit that will introduce AEX-Notify flows inside the
enclave needs to access the SSA[0].GPRSGX region at this stage (in the
`.Lcssa1_exception_eexit` label). So the RBX register must not be
overwritten. Thus, this preparatory commit does not clobber RBX, but
instead stashes RDX into another unused register, R10.
Signed-off-by: Dmitrii Kuvaiskii <[email protected]>1 parent 1f34f81 commit 45f12b3
1 file changed
+3
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
531 | 531 | | |
532 | 532 | | |
533 | 533 | | |
534 | | - | |
535 | | - | |
| 534 | + | |
| 535 | + | |
536 | 536 | | |
537 | 537 | | |
538 | 538 | | |
| |||
541 | 541 | | |
542 | 542 | | |
543 | 543 | | |
544 | | - | |
| 544 | + | |
545 | 545 | | |
546 | 546 | | |
547 | 547 | | |
| |||
0 commit comments