On Mon, May 14, 2012 at 06:07:56PM +0300, Avi Kivity wrote: > Currently the inject_pending_event() call during guest entry happens after > kvm_mmu_reload(). This is for historical reasons - we used to > inject_pending_event() in atomic context, while kvm_mmu_reload() needs task > context. > > A problem is that nested vmx can cause the mmu context to be reset, if event > injection is intercepted and causes a #VMEXIT instead (the #VMEXIT resets > CR0/CR3/CR4). If this happens, we end up with invalid root_hpa, and since > kvm_mmu_reload() has already run, no one will fix it and we end up entering > the guest this way. > > Fix by reordering event injection to be before kvm_mmu_reload(). Use > ->cancel_injection() to undo if kvm_mmu_reload() fails. > > https://bugzilla.kernel.org/show_bug.cgi?id=42980 > > Reported-by: Luke-Jr <luke-jr+linuxbugs@xxxxxxxxxxx> > Signed-off-by: Avi Kivity <avi@xxxxxxxxxx> > --- > arch/x86/kvm/x86.c | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) Applied, thanks. -- 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