fix(verify): fix non-amd64 JIT trampolines and validate under qemu
This commit is contained in:
+13
-8
@@ -1049,8 +1049,11 @@ With -smoke, each NOSPLIT function is called with a zeroed argument block to
|
||||
confirm the JIT trampoline works end-to-end. This is safe only for functions
|
||||
that tolerate nil pointers and zero lengths in their arguments.
|
||||
|
||||
With -abi, each function is called with sentinel values in the callee-saved
|
||||
registers (BP, R14) and a red-zone canary below SP; violations are reported.
|
||||
With -abi, each function is called with sentinel values in the registers
|
||||
the Go ABI fixes across calls (the frame pointer and the goroutine
|
||||
pointer) plus a canary below SP; violations are reported. JIT-based
|
||||
checks run when the host matches the file's architecture (all but
|
||||
loong64, which is ground-truth only for now).
|
||||
|
||||
With -fuzz, each function with a // func signature is differentially fuzzed
|
||||
against the go-tool-asm version in a subprocess (so a crash on a partial
|
||||
@@ -1091,17 +1094,19 @@ each entry reproduces.
|
||||
}
|
||||
path := set.Arg(0)
|
||||
targetArch := arch.FromFilename(path)
|
||||
// JIT execution is enabled for amd64 kernels on amd64 hosts. The
|
||||
// non-amd64 execution trampolines are implemented but not yet
|
||||
// runtime-hardened, so other kernels take the toolchain-comparison
|
||||
// path, which needs no execution.
|
||||
if targetArch != arch.AMD64 || hostArch() != arch.AMD64 {
|
||||
// JIT execution runs when the host CPU matches the kernel's
|
||||
// architecture, except loong64: its trampoline is implemented but not
|
||||
// yet validated against real hardware (the Go runtime cannot start
|
||||
// under the available loong64 emulators), so those kernels take the
|
||||
// toolchain-comparison path.
|
||||
if targetArch != hostArch() || targetArch == arch.LOONG64 {
|
||||
switch targetArch {
|
||||
case arch.RISCV:
|
||||
// RISC-V: ground-truth only (no JIT on non-RISC-V hosts).
|
||||
return cmdVerifyRISCV(path, *groundTruth, *profile)
|
||||
case arch.LOONG64:
|
||||
// LoongArch: ground-truth only (no JIT on non-LoongArch hosts).
|
||||
// LoongArch: ground-truth only (trampoline not yet
|
||||
// hardware-validated).
|
||||
return cmdVerifyLOONG64(path, *groundTruth, *profile)
|
||||
case arch.ARM64:
|
||||
// AArch64: ground-truth only (no JIT on non-ARM64 hosts).
|
||||
|
||||
Reference in New Issue
Block a user