Commit 132f4f7e authored by Liran Alon's avatar Liran Alon Committed by Paolo Bonzini

KVM: VMX: Refactor update_cr8_intercept()

No functional changes.
Reviewed-by: default avatarJoao Martins <joao.m.martins@oracle.com>
Signed-off-by: default avatarLiran Alon <liran.alon@oracle.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 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%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment