diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2020-11-13 08:31:09 -0500 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2021-02-04 05:27:37 -0500 |
commit | fd238002616c5f1e44d9d8feed42580059eab87d (patch) | |
tree | f0dabcef4499701491e6c548822f8a07dba371d4 /arch | |
parent | d89d04ab6030c73b24bbe032fb474e0fb74dd891 (diff) |
KVM: cleanup DR6/DR7 reserved bits checks
kvm_dr6_valid and kvm_dr7_valid check that bits 63:32 are zero. Using
them makes it easier to review the code for inconsistencies.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kvm/x86.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 39f01a051868..a28068075f8b 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -4422,9 +4422,9 @@ static int kvm_vcpu_ioctl_x86_set_debugregs(struct kvm_vcpu *vcpu, if (dbgregs->flags) return -EINVAL; - if (dbgregs->dr6 & ~0xffffffffull) + if (!kvm_dr6_valid(dbgregs->dr6)) return -EINVAL; - if (dbgregs->dr7 & ~0xffffffffull) + if (!kvm_dr7_valid(dbgregs->dr7)) return -EINVAL; memcpy(vcpu->arch.db, dbgregs->db, sizeof(vcpu->arch.db)); |