提交 132f4f7e 编写于 作者: L Liran Alon 提交者: Paolo Bonzini

KVM: VMX: Refactor update_cr8_intercept()

No functional changes.
Reviewed-by: NJoao Martins <joao.m.martins@oracle.com>
Signed-off-by: NLiran Alon <liran.alon@oracle.com>
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
上级 49d654d8
...@@ -5981,17 +5981,14 @@ static void vmx_l1d_flush(struct kvm_vcpu *vcpu) ...@@ -5981,17 +5981,14 @@ static void vmx_l1d_flush(struct kvm_vcpu *vcpu)
static void update_cr8_intercept(struct kvm_vcpu *vcpu, int tpr, int irr) static void update_cr8_intercept(struct kvm_vcpu *vcpu, int tpr, int irr)
{ {
struct vmcs12 *vmcs12 = get_vmcs12(vcpu); struct vmcs12 *vmcs12 = get_vmcs12(vcpu);
int tpr_threshold;
if (is_guest_mode(vcpu) && if (is_guest_mode(vcpu) &&
nested_cpu_has(vmcs12, CPU_BASED_TPR_SHADOW)) nested_cpu_has(vmcs12, CPU_BASED_TPR_SHADOW))
return; return;
if (irr == -1 || tpr < irr) { tpr_threshold = (irr == -1 || tpr < irr) ? 0 : irr;
vmcs_write32(TPR_THRESHOLD, 0); vmcs_write32(TPR_THRESHOLD, tpr_threshold);
return;
}
vmcs_write32(TPR_THRESHOLD, irr);
} }
void vmx_set_virtual_apic_mode(struct kvm_vcpu *vcpu) void vmx_set_virtual_apic_mode(struct kvm_vcpu *vcpu)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册