提交 ef2d488c 编写于 作者: S Sean Christopherson 提交者: Paolo Bonzini

KVM: VMX: Call vmx_get_cpl() directly in handle_dr()

Use vmx_get_cpl() instead of bouncing through kvm_x86_ops.get_cpl() when
performing a CPL check on MOV DR accesses.  This avoids a RETPOLINE (when
enabled), and more importantly removes a vendor reference to kvm_x86_ops
and helps pave the way for unexporting kvm_x86_ops.
Signed-off-by: NSean Christopherson <seanjc@google.com>
Message-Id: <20220128005208.4008533-7-seanjc@google.com>
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
上级 e27bc044
...@@ -5184,7 +5184,7 @@ static int handle_dr(struct kvm_vcpu *vcpu) ...@@ -5184,7 +5184,7 @@ static int handle_dr(struct kvm_vcpu *vcpu)
if (!kvm_require_dr(vcpu, dr)) if (!kvm_require_dr(vcpu, dr))
return 1; return 1;
if (kvm_x86_ops.get_cpl(vcpu) > 0) if (vmx_get_cpl(vcpu) > 0)
goto out; goto out;
dr7 = vmcs_readl(GUEST_DR7); dr7 = vmcs_readl(GUEST_DR7);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册