summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/svm.c
diff options
context:
space:
mode:
authorPaolo Bonzini2015-07-29 12:05:37 +0200
committerPaolo Bonzini2015-10-01 15:06:25 +0200
commit35754c987f252e859bfa390a6816e85563afe79d (patch)
treecfb0a2d85738ea20b4421a13c2c5a8313b65f69d /arch/x86/kvm/svm.c
parentKVM: x86: replace vm_has_apicv hook with cpu_uses_apicv (diff)
downloadkernel-qcow2-linux-35754c987f252e859bfa390a6816e85563afe79d.tar.gz
kernel-qcow2-linux-35754c987f252e859bfa390a6816e85563afe79d.tar.xz
kernel-qcow2-linux-35754c987f252e859bfa390a6816e85563afe79d.zip
KVM: x86: introduce lapic_in_kernel
Avoid pointer chasing and memory barriers, and simplify the code when split irqchip (LAPIC in kernel, IOAPIC/PIC in userspace) is introduced. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/svm.c')
-rw-r--r--arch/x86/kvm/svm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 9a37e487aca0..34c089023827 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -3060,7 +3060,7 @@ static int cr8_write_interception(struct vcpu_svm *svm)
u8 cr8_prev = kvm_get_cr8(&svm->vcpu);
/* instruction emulation calls kvm_set_cr8() */
r = cr_interception(svm);
- if (irqchip_in_kernel(svm->vcpu.kvm))
+ if (lapic_in_kernel(&svm->vcpu))
return r;
if (cr8_prev <= kvm_get_cr8(&svm->vcpu))
return r;
@@ -3305,7 +3305,7 @@ static int interrupt_window_interception(struct vcpu_svm *svm)
* If the user space waits to inject interrupts, exit as soon as
* possible
*/
- if (!irqchip_in_kernel(svm->vcpu.kvm) &&
+ if (!lapic_in_kernel(&svm->vcpu) &&
kvm_run->request_interrupt_window &&
!kvm_cpu_has_interrupt(&svm->vcpu)) {
kvm_run->exit_reason = KVM_EXIT_IRQ_WINDOW_OPEN;