Skip to content

Commit 7a262d2

Browse files
committed
Merge git://git.kernel.org/pub/scm/virt/kvm/kvm
Pull kvm bugfixes from Marcelo Tosatti. * git://git.kernel.org/pub/scm/virt/kvm/kvm: KVM: nVMX: Unconditionally uninit the MMU on nested vmexit KVM: x86: Fix APIC map calculation after re-enabling
2 parents 06f055f + 29bf08f commit 7a262d2

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

arch/x86/kvm/lapic.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1350,6 +1350,10 @@ void kvm_lapic_set_base(struct kvm_vcpu *vcpu, u64 value)
13501350
return;
13511351
}
13521352

1353+
if (!kvm_vcpu_is_bsp(apic->vcpu))
1354+
value &= ~MSR_IA32_APICBASE_BSP;
1355+
vcpu->arch.apic_base = value;
1356+
13531357
/* update jump label if enable bit changes */
13541358
if ((vcpu->arch.apic_base ^ value) & MSR_IA32_APICBASE_ENABLE) {
13551359
if (value & MSR_IA32_APICBASE_ENABLE)
@@ -1359,10 +1363,6 @@ void kvm_lapic_set_base(struct kvm_vcpu *vcpu, u64 value)
13591363
recalculate_apic_map(vcpu->kvm);
13601364
}
13611365

1362-
if (!kvm_vcpu_is_bsp(apic->vcpu))
1363-
value &= ~MSR_IA32_APICBASE_BSP;
1364-
1365-
vcpu->arch.apic_base = value;
13661366
if ((old_value ^ value) & X2APIC_ENABLE) {
13671367
if (value & X2APIC_ENABLE) {
13681368
u32 id = kvm_apic_id(apic);

arch/x86/kvm/vmx.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8283,8 +8283,7 @@ static void load_vmcs12_host_state(struct kvm_vcpu *vcpu,
82838283
vcpu->arch.cr4_guest_owned_bits = ~vmcs_readl(CR4_GUEST_HOST_MASK);
82848284
kvm_set_cr4(vcpu, vmcs12->host_cr4);
82858285

8286-
if (nested_cpu_has_ept(vmcs12))
8287-
nested_ept_uninit_mmu_context(vcpu);
8286+
nested_ept_uninit_mmu_context(vcpu);
82888287

82898288
kvm_set_cr3(vcpu, vmcs12->host_cr3);
82908289
kvm_mmu_reset_context(vcpu);

0 commit comments

Comments
 (0)