You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: NEM/Windows: APIC TPR loses its low 4 bits on every exit under Hyper-V #932
When VirtualBox runs a VM through Hyper-V (NEM), the guest's APIC TPR loses bits 3:0. The guest writes 0xff to the TPR and reads back 0xf0.
In NEMR3Native-win-x86.cpp, nemR3WinCopyStateFromX64Header (on nearly every exit) and nemHCWinCopyStateFromHyperV copy CR8 into VirtualBox's APIC with PDMApicSetTpr(pVCpu, cr8 << 4). CR8 only holds TPR bits 7:4, so this overwrites the low nibble the guest wrote through the APIC, even when CR8 didn't change.
Expected: the TPR keeps the value the guest wrote, as on real hardware and with VT-x/AMD-V. Only a MOV to CR8 should replace it (and clear bits 3:0).
Why it matters: guests that read back the TPR, for example to save and restore it, get a different value than they wrote. Interrupt acceptance only uses bits 7:4, so delivery itself isn't affected. It also means the APIC test bs3-apic-1 can't pass on Windows hosts with Hyper-V active, which is common on Windows 11.
How can we reproduce this?
On a Windows host with Hyper-V active (VirtualBox shows the turtle icon / uses NEM), run the Validation Kit test bs3-apic-1.
On trunk b6bea72 (Intel Core Ultra 7 270K Plus), it fails with 1202 errors. 1200 of them are "Setting TPR to 0x.. failed, read back 0x.0".
Only updating the APIC TPR when CR8 actually changed removes those 1200 errors. I'll open a PR with that fix.
The other 2 errors ("Disabling the APIC did not work (0xfee00900)", once in real mode and once in protected mode) are a separate problem and not part of this issue.
Attachment: bs3-apic-1-trunk-hyperv.txt - bs3-apic-1 output on unpatched trunk b6bea72, run through Hyper-V (NEM); the TPR failures are lines 15-1218, the 2 other errors are lines 5 and 9.
Did you upload all of your necessary log files, screenshots, etc.?
Yes, I've uploaded all pertinent files to this issue.
Update: the fix in #933 keeps TPR bits 3:0 while CR8 still equals TPR bits 7:4, but it still calls PDMApicSetTpr on every exit rather than only when CR8 changed (as written above), because setting the TPR also updates the PPR and signals pending interrupts.
Activity
ctrondlp commentedon Oct 24, 2026
Fix: #933
VMM/NEM/win: Correct the TPR sync comment, github:VirtualBoxgh-932
ctrondlp commentedon Oct 24, 2026
Update: the fix in #933 keeps TPR bits 3:0 while CR8 still equals TPR bits 7:4, but it still calls PDMApicSetTpr on every exit rather than only when CR8 changed (as written above), because setting the TPR also updates the PPR and signals pending interrupts.