diff options
author | Jan Kiszka <jan.kiszka@siemens.com> | 2013-12-16 06:55:46 -0500 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2013-12-18 04:27:09 -0500 |
commit | ca3f257ae570c37d3da30a524a2f61ce602c6c99 (patch) | |
tree | 476d6c425876853432eaaa18dd8ef555b8f9fcbc /arch/x86/kvm | |
parent | 9357d93952143b178fa9d1f5095b8f273b01a1f1 (diff) |
KVM: nVMX: Support direct APIC access from L2
It's a pathological case, but still a valid one: If L1 disables APIC
virtualization and also allows L2 to directly write to the APIC page, we
have to forcibly enable APIC virtualization while in L2 if the in-kernel
APIC is in use.
This allows to run the direct interrupt test case in the vmx unit test
without x2APIC.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm')
-rw-r--r-- | arch/x86/kvm/vmx.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index f90320b204a9..31eb5776d854 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c | |||
@@ -7763,6 +7763,11 @@ static void prepare_vmcs02(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12) | |||
7763 | else | 7763 | else |
7764 | vmcs_write64(APIC_ACCESS_ADDR, | 7764 | vmcs_write64(APIC_ACCESS_ADDR, |
7765 | page_to_phys(vmx->nested.apic_access_page)); | 7765 | page_to_phys(vmx->nested.apic_access_page)); |
7766 | } else if (vm_need_virtualize_apic_accesses(vmx->vcpu.kvm)) { | ||
7767 | exec_control |= | ||
7768 | SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES; | ||
7769 | vmcs_write64(APIC_ACCESS_ADDR, | ||
7770 | page_to_phys(vcpu->kvm->arch.apic_access_page)); | ||
7766 | } | 7771 | } |
7767 | 7772 | ||
7768 | vmcs_write32(SECONDARY_VM_EXEC_CONTROL, exec_control); | 7773 | vmcs_write32(SECONDARY_VM_EXEC_CONTROL, exec_control); |