On 21.11.2022 09:33, Jan Beulich wrote: > On 18.11.2022 15:26, Roger Pau Monné wrote: >> Maybe best to add an ASSERT in vlapic_set_irq() to be sure the lapic is >> enabled, as other callers already check this before trying to inject? > > Perhaps, yes (once we've fixed paths where the check is presently > missing).
Actually - no, such an ASSERT() would then be racy against the vLAPIC being disabled elsewhere at this very moment. It would at best be valid when done on the vCPU in question. The SDM also provides for this: "The reception of any interrupt or transmission of any IPIs that are in progress when the local APIC is disabled are completed before the local APIC enters the software-disabled state." We don't follow this to the letter, but you get the point. Jan