diff mbox series

[08/21] KVM: x86: Use DR7_GD macro instead of open coding check in emulator

Message ID 20220311032801.3467418-9-seanjc@google.com (mailing list archive)
State New, archived
Headers show
Series KVM: x86: Event/exception fixes and cleanups | expand

Commit Message

Sean Christopherson March 11, 2022, 3:27 a.m. UTC
Use DR7_GD in the emulator instead of open coding the check, and drop a
comically wrong comment.

Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 arch/x86/kvm/emulate.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index a60b4d20b309..648a0687120d 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -4148,8 +4148,7 @@  static int check_dr7_gd(struct x86_emulate_ctxt *ctxt)
 
 	ctxt->ops->get_dr(ctxt, 7, &dr7);
 
-	/* Check if DR7.Global_Enable is set */
-	return dr7 & (1 << 13);
+	return dr7 & DR7_GD;
 }
 
 static int check_dr_read(struct x86_emulate_ctxt *ctxt)