A x2apic access is handled by a wrmsr exit. This handler is called in a
critical section. So, we can't lock a mtx in the icr_low handler.
Reported by: kp
Fixes: c0f35dbf19c3c8825bd2b321d8efd582807d1940
Differential D37452
vmm: do not call mtx_lock in icr_low write handler corvink on Nov 21 2022, 2:16 PM. Authored by Tags None Referenced Files
Details A x2apic access is handled by a wrmsr exit. This handler is called in a Reported by: kp
Diff Detail
Event TimelineComment Actions Alternatively, could just add a new spin mutex lock for startup_cpus. (That's what I had planned to do). This isn't a critical performance path such that atomic ops is a big win over just having a small lock for this. @pho had reported this to me via e-mail as well. Comment Actions I think that makes more sense. When CPU scalability isn't a major concern, it's almost always better to rely on mutexes for synchronization. As an alternative to using a separate lock, I wonder if it can make sense to have vlapic_icrlo_write_handler() trigger a vmexit that gets handled in vm_run() instead? We can lock a regular mutex there.
|