All of lore.kernel.org
 help / color / mirror / Atom feed
* Interrupt issues with hvm_emulate_one_vm_event()
@ 2017-05-25  9:40 Razvan Cojocaru
  2017-05-26 14:29 ` Jan Beulich
  0 siblings, 1 reply; 11+ messages in thread
From: Razvan Cojocaru @ 2017-05-25  9:40 UTC (permalink / raw)
  To: Xen-devel; +Cc: Andrew Cooper, Tamas K Lengyel, Jan Beulich

Hello,

I've noticed that, with pages marked NX and vm_event emulation, we can
end up emulating an ud2, for which hvm_emulate_one() returns
X86EMUL_EXCEPTION in hvm_emulate_one_vm_event().

This, in turn, causes a hvm_inject_event() call in the context of
hvm_do_resume(), which can, if there's already a pending event there,
cause a 101 BSOD (timer-related, if I understand correctly) or loss of
input (mouse frozen, keyboard unresponsive).

After much trial and error, I've been able to confirm this by leaving a
guest on for almost a full day with this change:

     case X86EMUL_EXCEPTION:
-        hvm_inject_event(&ctx.ctxt.event);
+        if ( !hvm_event_pending(current) )
+            hvm_inject_event(&ctx.ctxt.event);

and checking that there's been no BSOD or loss of input.

However, just losing the event here, while fine to prove that this is
indeed the problem, is not OK. But I'm not sure what an elegant / robust
way of fixing this is.

Suggestions are (as always) greatly appreciated.


Thanks,
Razvan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2017-05-29 13:23 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-25  9:40 Interrupt issues with hvm_emulate_one_vm_event() Razvan Cojocaru
2017-05-26 14:29 ` Jan Beulich
2017-05-26 14:37   ` Razvan Cojocaru
2017-05-26 15:38     ` Jan Beulich
2017-05-29 13:24       ` Razvan Cojocaru
2017-05-26 15:11   ` Andrew Cooper
2017-05-29  9:20     ` Razvan Cojocaru
2017-05-29 11:05       ` Jan Beulich
2017-05-29 11:46         ` Razvan Cojocaru
2017-05-29 12:11           ` Andrew Cooper
2017-05-29 12:22             ` Razvan Cojocaru

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.