[PATCH] KVM: x86: handle KVM_SET_VCPU_EVENTS/KVM_VCPUEVENT_VALID_SMM properly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: He Rongguang <herongguang.he@xxxxxxxxxx>

handle KVM_VCPUEVENT_VALID_SMM properly, or kvm-kmod/kernel will crash
in migration destination in gfn_to_rmap() since kvm_memslots_for_spte_role
is false, whilst (vcpu->arch.hflags & HF_SMM_MASK) is true

Signed-off-by: herongguang <herongguang.he@xxxxxxxxxx>
---
 arch/x86/kvm/x86.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 699f872..7ebcb59 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -3028,6 +3028,7 @@ static int kvm_vcpu_ioctl_x86_set_vcpu_events(struct kvm_vcpu *vcpu,
 			else
 				clear_bit(KVM_APIC_INIT, &vcpu->arch.apic->pending_events);
 		}
+		kvm_mmu_reset_context(vcpu);
 	}
 
 	kvm_make_request(KVM_REQ_EVENT, vcpu);
-- 
1.8.3.4


--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux