On Mon, May 06, 2024 at 05:29:34AM +0000, Mingwei Zhang wrote: > +void kvm_set_guest_pmi_handler(void (*handler)(void)) > +{ > + if (handler) { > + kvm_guest_pmi_handler = handler; > + } else { > + kvm_guest_pmi_handler = dummy_handler; > + synchronize_rcu(); > + } > +} > +EXPORT_SYMBOL_GPL(kvm_set_guest_pmi_handler); Just for my edification, after synchronize_rcu() nobody should observe the old handler, but what guarantees there's not still one running? I'm thinking the fact that these handlers run with IRQs disabled, and synchronize_rcu() also very much ensures all prior non-preempt sections are complete?