diff options
author | Avi Kivity <avi@qumranet.com> | 2007-12-06 15:32:45 +0100 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-01-30 16:53:19 +0100 |
commit | e5314067f6a77688a3d36548e7618430ce4a6236 (patch) | |
tree | a03623c7ae33403d7e4de0deeb581367bef67ae3 /drivers/kvm | |
parent | KVM: x86 emulator: fix eflags preparation for emulation (diff) | |
download | linux-e5314067f6a77688a3d36548e7618430ce4a6236.tar.xz linux-e5314067f6a77688a3d36548e7618430ce4a6236.zip |
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 <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm')
-rw-r--r-- | drivers/kvm/vmx.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c index 3b44573c326e..83084348581a 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; }; |