Re: [PATCH v3 0/8] KVM: x86: Fix emulated MOV DR{4,5} #GP bugs

From: Sean Christopherson

Date: Tue Jul 14 2026 - 15:40:09 EST


On Fri, 12 Jun 2026 16:01:05 -0700, Sean Christopherson wrote:
> Carlos' fix for a bug where KVM fails to signal #GP on emulated MOV DR to
> DR4 or DR5, plus a pile of follow-up fixes priority goofs (#UD versus #GP,
> #GP vs #DB, and #GP versus #VMEXIT on SVM). The rest are opportunistic
> cleanups.
>
> v3:
> - Fix a #UD vs #GP due to CPL>0 bug.
> - Prioritize DR7.GD=1 #DB over CPL>0 #GP on Intel.
>
> [...]

Applied to kvm-x86 misc. I still need to follow-up on Zhaoxinbehavior, but
I'm quite confident Zhaoxin follows Intel. And if I'm wrong, on-top fixups
shouldn't be difficult.

[1/8] KVM: x86: Treat any non-zero return from set_dr() as a faulting condition
https://github.com/kvm-x86/linux/commit/8f683a4dc546
[2/8] KVM: x86: Prioritize DR7.GD #DB over #GP due to illegal DR6/7 value
https://github.com/kvm-x86/linux/commit/55ac576a9bf4
[3/8] KVM: x86: Manually check DR4/5 write values to fix SVM intercept priority
https://github.com/kvm-x86/linux/commit/e27ca3dfbb73
[4/8] KVM: x86: Prioritize #UD on MOV DR over #GP due to non-zero CPL
https://github.com/kvm-x86/linux/commit/32a7188a667f
[5/8] KVM: VMX: Prioritize DR7.GD=1 #DB over CPL>0 #GP on Intel
https://github.com/kvm-x86/linux/commit/48512697c081
[6/8] KVM: x86: Use kvm_dr{6,7}_valid() to check DR{4,5,6,7} write values in emulator
https://github.com/kvm-x86/linux/commit/1f077338d1cd
[7/8] KVM: x86: WARN if MOV DR emulation hits a "too late" #GP
https://github.com/kvm-x86/linux/commit/b077cfed52b4
[8/8] KVM: x86: Read CR4.DE in emulator if and only if accessing DR4 or DR5
https://github.com/kvm-x86/linux/commit/7a642d8dcfa8

--
https://github.com/kvm-x86/linux/tree/next