From: Avi Kivity Date: Thu, 6 Dec 2007 14:32:45 +0000 (+0200) Subject: KVM: VMX: Avoid exit when setting cr8 if the local apic is in the kernel X-Git-Tag: v2.6.25-rc1~1138^2~56 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e5314067f6a77688a3d36548e7618430ce4a6236;p=platform%2Fkernel%2Flinux-3.10.git KVM: VMX: Avoid exit when setting cr8 if the local apic is in the kernel With apic in userspace, we must exit to userspace after a cr8 write in order to update the tpr. But if the apic is in the kernel, the exit is unnecessary. Noticed by Joerg Roedel. Signed-off-by: Avi Kivity --- diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c index 3b44573..8308434 100644 --- a/drivers/kvm/vmx.c +++ b/drivers/kvm/vmx.c @@ -1973,6 +1973,8 @@ static int handle_cr(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) vcpu_load_rsp_rip(vcpu); set_cr8(vcpu, vcpu->regs[reg]); skip_emulated_instruction(vcpu); + if (irqchip_in_kernel(vcpu->kvm)) + return 1; kvm_run->exit_reason = KVM_EXIT_SET_TPR; return 0; };