提交 fd238002 编写于 作者: P Paolo Bonzini

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: NPaolo Bonzini <pbonzini@redhat.com>
上级 d89d04ab
......@@ -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));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册