From e33988cbabd25418d9c0c4676067d014a2117615 Mon Sep 17 00:00:00 2001 From: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com> Date: Tue, 3 Nov 2026 11:01:08 -0800 Subject: [PATCH 1/2] Ignore x87 error pointers when reset_vcpu_simple reads back FPU state reset_vcpu_simple sets dirty FPU state and checks that it reads back unchanged. On a Windows AMD runner, FOP, FIP and FDP read back as 0. The test's dirty FSW leaves ES clear, so these pointers are undefined. AMD CPUs save them as 0 while no x87 exception is pending, and the Hyper-V register API passes x87 state through XSAVE. Stop comparing them. Fixes #1341 Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com> --- src/hyperlight_host/src/hypervisor/hyperlight_vm/x86_64.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/hyperlight_host/src/hypervisor/hyperlight_vm/x86_64.rs b/src/hyperlight_host/src/hypervisor/hyperlight_vm/x86_64.rs index 9463cea4f..f6037240a 100644 --- a/src/hyperlight_host/src/hypervisor/hyperlight_vm/x86_64.rs +++ b/src/hyperlight_host/src/hypervisor/hyperlight_vm/x86_64.rs @@ -1560,6 +1560,12 @@ mod tests { for i in 0..8 { expected_fpu.fpr[i][10..16].copy_from_slice(&got_fpu.fpr[i][10..16]); } + // The x87 error pointers are undefined while FSW.ES is clear, and AMD + // CPUs save them as 0 in that state. + assert_eq!(fpu.fsw & (1 << 7), 0); + expected_fpu.last_opcode = got_fpu.last_opcode; + expected_fpu.last_ip = got_fpu.last_ip; + expected_fpu.last_dp = got_fpu.last_dp; assert_eq!(got_fpu, expected_fpu); // Verify xsave was set by checking key dirty values in the legacy region. From 0da1537108a36d6060ae012e9d41b8e5e2195c09 Mon Sep 17 00:00:00 2001 From: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com> Date: Tue, 3 Nov 2026 11:01:03 -0800 Subject: [PATCH 2/2] Log the host CPU in build-test jobs Print the OS and hypervisor versions and the CPU model and features before building, to help debug failures that depend on the runner. Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com> --- .github/workflows/dep_build_test.yml | 29 ++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/.github/workflows/dep_build_test.yml b/.github/workflows/dep_build_test.yml index 539338765..4d1f4b7e7 100644 --- a/.github/workflows/dep_build_test.yml +++ b/.github/workflows/dep_build_test.yml @@ -126,6 +126,35 @@ jobs: name: c-guests-${{ inputs.arch }}-${{ inputs.config }} path: src/tests/c_guests/bin/${{ inputs.config }}/ + # For helping with debugging. + - name: Log CPU + continue-on-error: true + run: | + case "$RUNNER_OS" in + Linux) + echo "Kernel: $(uname -r)" + (dmesg || sudo -n dmesg) 2>/dev/null | grep -m1 'Host Build' || true + lscpu + sed '/^$/q' /proc/cpuinfo + ;; + Windows) + pwsh -NoProfile -Command ' + "OS: " + [System.Environment]::OSVersion.VersionString + Get-ChildItem "$env:SystemRoot\System32\hv*64.exe" | ForEach-Object { "Installed hypervisor: {0} {1}" -f $_.Name, $_.VersionInfo.ProductVersion } + reg query "HKLM\HARDWARE\DESCRIPTION\System\CentralProcessor\0" + # RUNNER_ARCH is X64 on Windows ARM64 runners because they run the x64 runner under emulation. + if ([System.Runtime.Intrinsics.X86.X86Base]::IsSupported) { + $r = [System.Runtime.Intrinsics.X86.X86Base]::CpuId(0x40000002, 0) + "Running hypervisor: {0}.{1}.{2}.{3}" -f ($r.Item2 -shr 16), ($r.Item2 -band 0xFFFF), $r.Item1, ($r.Item4 -band 0xFFFFFF) + foreach ($leaf in 1, 7, 0xD, 0x80000001, 0x80000008) { + $r = [System.Runtime.Intrinsics.X86.X86Base]::CpuId($leaf, 0) + "CPUID {0:X8}: {1:X8} {2:X8} {3:X8} {4:X8}" -f $leaf, $r.Item1, $r.Item2, $r.Item3, $r.Item4 + } + }' + ;; + macOS) sysctl machdep.cpu hw.optional ;; + esac + - name: Build run: just build ${{ inputs.config }}