Skip to content

Commit

Permalink
KVM: x86: Use DR7_GD macro instead of open coding check in emulator
Browse files Browse the repository at this point in the history
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>
Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com>
Link: https://lore.kernel.org/r/20220830231614.3580124-10-seanjc@google.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
sean-jc authored and bonzini committed Sep 26, 2022
1 parent 5623f75 commit 0701ec9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions arch/x86/kvm/emulate.c
Original file line number Diff line number Diff line change
Expand Up @@ -4166,8 +4166,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)
Expand Down

0 comments on commit 0701ec9

Please sign in to comment.