Il 06/03/2014 18:33, Jan Kiszka ha scritto: > Move the check for leaving L2 on pending and intercepted IRQs or NMIs > from the *_allowed handler into a dedicated callback. Invoke this > callback at the relevant points before KVM checks if IRQs/NMIs can be > injected. The callback has the task to switch from L2 to L1 if needed > and inject the proper vmexit events. > > The rework fixes L2 wakeups from HLT and provides the foundation for > preemption timer emulation. > > Signed-off-by: Jan Kiszka <jan.kiszka@xxxxxxxxxxx> > --- > arch/x86/include/asm/kvm_host.h | 2 ++ > arch/x86/kvm/vmx.c | 67 +++++++++++++++++++++++------------------ > arch/x86/kvm/x86.c | 15 +++++++-- > 3 files changed, 53 insertions(+), 31 deletions(-) With this patch do we still need if (is_guest_mode(vcpu) && nested_exit_on_intr(vcpu)) /* * We get here if vmx_interrupt_allowed() said we can't * inject to L1 now because L2 must run. The caller will have * to make L2 exit right after entry, so we can inject to L1 * more promptly. */ return -EBUSY; in enable_irq_window? If not, enable_nmi_window and enable_irq_window can both return void. And perhaps, vmx_check_nested_events could use the preemption timer trick from Jailhouse instead of smp_send_reschedule. Paolo -- 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