Skip to content

KVM: x86: Fix emulated MOV DR{4,5} #GP bugs

Sean Christopherson kvm lkml sashiko-reviews 2 versions – Applied

Status from this message: Applied to kvm-x86 misc. I still need to follow-up on Zhaoxinbehavior, but

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest8 patches 13 repliesApplied
  2. v26 patches 3 repliesSuperseded

Changes in v3 from the cover letter

- Fix a #UD vs #GP due to CPL>0 bug.
- Prioritize DR7.GD=1 #DB over CPL>0 #GP on Intel.

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/8KVM: x86: Treat any non-zero return from set_dr() as a faulting conditionarch/x86/kvm/emulate.c+1 -11 reply
2/8KVM: x86: Prioritize DR7.GD #DB over #GP due to illegal DR6/7 valuearch/x86/kvm/emulate.c+6 -11 reply
3/8KVM: x86: Manually check DR4/5 write values to fix SVM intercept priorityarch/x86/kvm/emulate.c+11 -32 replies
4/8KVM: x86: Prioritize #UD on MOV DR over #GP due to non-zero CPLarch/x86/kvm/emulate.c+5 -31 reply
5/8KVM: VMX: Prioritize DR7.GD=1 #DB over CPL>0 #GP on Intelarch/x86/kvm/emulate.c arch/x86/kvm/vmx/vmx.c+9 -42 replies
6/8KVM: x86: Use kvm_dr{6,7}_valid() to check DR{4,5,6,7} write values in emulatorarch/x86/kvm/emulate.c+5 -21 reply
7/8KVM: x86: WARN if MOV DR emulation hits a "too late" #GParch/x86/kvm/emulate.c+6 -23 replies
8/8KVM: x86: Read CR4.DE in emulator if and only if accessing DR4 or DR5arch/x86/kvm/emulate.c+1 -31 reply

Reviews trailers per patch

7 of 8 patches have a Reviewed-by or Acked-by.

PatchJim Mattson
1/8R-b
2/8R-b
3/8R-b
4/8R-b
5/8
6/8R-b
7/8R-b
8/8R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

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

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.

v2: https://lore.kernel.org/all/[email protected]

v1: https://lore.kernel.org/all/[email protected]

Carlos López (1):
KVM: x86: Treat any non-zero return from set_dr() as a faulting
condition

Sean Christopherson (7):
KVM: x86: Prioritize DR7.GD #DB over #GP due to illegal DR6/7 value
KVM: x86: Manually check DR4/5 write values to fix SVM intercept
priority
KVM: x86: Prioritize #UD on MOV DR over #GP due to non-zero CPL
KVM: VMX: Prioritize DR7.GD=1 #DB over CPL>0 #GP on Intel
KVM: x86: Use kvm_dr{6,7}_valid() to check DR{4,5,6,7} write values in
emulator
KVM: x86: WARN if MOV DR emulation hits a "too late" #GP
KVM: x86: Read CR4.DE in emulator if and only if accessing DR4 or DR5

 arch/x86/kvm/emulate.c | 49 +++++++++++++++++++++++++++++++-----------
 arch/x86/kvm/vmx/vmx.c |  6 +++---
 2 files changed, 40 insertions(+), 15 deletions(-)

base-commit: c1f7303302927f9cbf4efedf70f0512cde168c65

Signature · 1 line
2.54.0.1136.gdb2ca164c4-goog