On Thu, Nov 24, 2022 at 09:42:40AM +0100, Roger Pau Monné wrote: > On Thu, Nov 24, 2022 at 08:59:00AM +0100, Jan Beulich wrote: > > - problematic wrt evtchn_upcall_pending, once set, preventing event > > injection later on. > > As you may have inferred already, I'm inclined to suggest to drop the > > the is_vcpu_online() check from hvm_set_callback_via(). > > > > One related question here is whether vlapic_do_init() shouldn't have > > the non-architectural side effect of clearing evtchn_upcall_pending. > > While this again violates the principle of the hypervisor only ever > > setting that bit, it would deal with the risk of no further event > > injection once the flag is set, considering that vlapic_do_init() > > clears IRR (and ISR). > > That would seem sensible to me, and was kind of what I was suggesting > in: > > https://lore.kernel.org/xen-devel/Y3eO0bMKRPYJc2yQ@Air-de-Roger/
Another option would be for vcpu_mark_events_pending() to unconditionally call hvm_assert_evtchn_irq() regardless of the state of evtchn_upcall_pending. This will create some spurious events. Regards, Roger.