fix(verify): fix non-amd64 JIT trampolines and validate under qemu
This commit is contained in:
+2
-2
@@ -43,8 +43,8 @@ TEXT ·enterJITChecked(SB), NOSPLIT, $0-16
|
||||
MOVD $SENTINEL_G, g // sentinel in g
|
||||
MOVD stack+8(FP), R3 // load prepared stack pointer
|
||||
MOVD 0(R3), R30 // load leaveJITCheckedRaw into LR
|
||||
ADD $8, R3, R3 // advance past the return slot
|
||||
MOVD R3, RSP // switch to prepared stack
|
||||
MOVD R3, RSP // SP stays on the leave slot: the kernel
|
||||
// reads its first argument at SP+8
|
||||
JMP (R0) // branch to JIT function
|
||||
|
||||
// leaveJITCheckedRaw is the raw return trampoline. It has NO Go function
|
||||
|
||||
@@ -37,8 +37,8 @@ TEXT ·enterJITChecked(SB), NOSPLIT, $0-16
|
||||
MOVV $SENTINEL_G, g // sentinel in g
|
||||
MOVV stack+8(FP), R5 // load prepared stack pointer (A1)
|
||||
MOVV 0(R5), R1 // load leaveJITCheckedRaw into RA
|
||||
ADDV $8, R5, R5 // advance past the return slot
|
||||
MOVV R5, R3 // switch to prepared stack (SP)
|
||||
MOVV R5, R3 // SP stays on the leave slot: the kernel
|
||||
// reads its first argument at SP+8
|
||||
JIRL R0, R4, 0 // jump to JIT function
|
||||
|
||||
// leaveJITCheckedRaw is the raw return trampoline. It has NO Go function
|
||||
|
||||
@@ -37,8 +37,8 @@ TEXT ·enterJITChecked(SB), NOSPLIT, $0-16
|
||||
MOV $SENTINEL_G, g // sentinel in g
|
||||
MOV stack+8(FP), X6 // load prepared stack pointer (T1)
|
||||
LD 0(X6), X1 // load leaveJITCheckedRaw into RA
|
||||
ADD $8, X6, X6 // advance past the return slot
|
||||
MOV X6, X2 // switch to prepared stack (SP)
|
||||
MOV X6, X2 // SP stays on the leave slot: the kernel
|
||||
// reads its first argument at SP+8
|
||||
JALR X0, 0(X5) // jump to JIT function
|
||||
|
||||
// leaveJITCheckedRaw is the raw return trampoline. It has NO Go function
|
||||
|
||||
@@ -20,8 +20,11 @@ TEXT ·enterJIT(SB), NOSPLIT, $0-16
|
||||
MOVD R3, savedSP(SB) // save Go stack pointer
|
||||
MOVD stack+8(FP), R3 // load prepared stack pointer
|
||||
MOVD 0(R3), R30 // load leaveJIT address into LR
|
||||
ADD $8, R3, R3 // advance past return address
|
||||
MOVD R3, RSP // switch to prepared stack
|
||||
MOVD R3, RSP // switch to the prepared stack: SP stays on
|
||||
// the leave slot, so the kernel reads its
|
||||
// first argument at SP+8 per the frame
|
||||
// convention (amd64 lays the stack out the
|
||||
// same way)
|
||||
JMP (R0) // branch to JIT function
|
||||
|
||||
// func leaveJIT()
|
||||
|
||||
@@ -16,8 +16,9 @@ TEXT ·enterJIT(SB), NOSPLIT, $0-16
|
||||
MOVV R3, savedSP(SB) // save Go stack pointer (SP)
|
||||
MOVV stack+8(FP), R5 // load prepared stack pointer (A1)
|
||||
MOVV 0(R5), R1 // load leaveJIT address into RA
|
||||
ADDV $8, R5, R5 // advance past return address
|
||||
MOVV R5, R3 // switch to prepared stack (SP)
|
||||
MOVV R5, R3 // switch to the prepared stack: SP stays on
|
||||
// the leave slot, so the kernel reads its
|
||||
// first argument at SP+8
|
||||
JIRL R0, R4, 0 // jump to JIT function
|
||||
|
||||
// func leaveJIT()
|
||||
|
||||
@@ -16,8 +16,9 @@ TEXT ·enterJIT(SB), NOSPLIT, $0-16
|
||||
MOV X2, savedSP(SB) // save Go stack pointer
|
||||
MOV stack+8(FP), X6 // load prepared stack pointer (T1)
|
||||
LD 0(X6), X1 // load leaveJIT address into RA
|
||||
ADD $8, X6, X6 // advance past return address
|
||||
MOV X6, X2 // switch to prepared stack (SP)
|
||||
MOV X6, X2 // switch to the prepared stack: SP stays on
|
||||
// the leave slot, so the kernel reads its
|
||||
// first argument at SP+8
|
||||
JALR X0, 0(X5) // jump to JIT function
|
||||
|
||||
// func leaveJIT()
|
||||
|
||||
Reference in New Issue
Block a user