Files
Konstantin BogomolovandgVisor bot d5bf6cb7e4 Fix ring0 compatibility with Go toolchain ABI wrappers.
Initialize FPU and XCR0 in assembly before entering Go code, switch %rip
to the lower half before calling kernel syscall and exception
trampolines.

In recent Go toolchains, the compiler-generated ABI0 wrappers that bridge
assembly and internal ABI Go code zero X15. The wrapper performs a
RIP-relative load of runtime.x86HasAVX to see if AVX is available on the
host, and executes VXORPS.

This introduces two requirements in ring0:
1. When booting a vCPU, XCR0 only enables x87 state by default. Executing
   VXORPS in startGo.abi0 triggers a #UD fault if AVX is not enabled in
   XCR0. Moving fninit and xsetbv into assembly before calling startGo
   ensures AVX state is enabled before the wrapper runs.
2. The syscall and exception entrypoints execute in the upper half of the
   virtual address space where data pages are not mapped. The RIP-relative
   load of runtime.x86HasAVX faults unless we transition %rip to the lower
   half via jumpToUser before calling into Go trampolines.

PiperOrigin-RevId: 974188468
2026-08-31 18:21:37 -07:00
..
2026-03-04 14:00:13 -08:00
2026-03-04 14:00:13 -08:00
2026-06-25 10:27:28 +08:00
2022-05-17 17:48:35 -07:00
2023-02-22 18:14:26 -08:00
2026-06-25 10:27:28 +08:00