On Fri, Jul 11, 2025, Chao Gao wrote: > >2. P-SEAMLDR seamcalls (specificially SEAMRET from P-SEAMLDR) clear current > > VMCS pointers, which may disrupt KVM. To prevent VMX instructions in IRQ > > context from encountering NULL current-VMCS pointers, P-SEAMLDR > > seamcalls are called with IRQ disabled. I'm uncertain if NMIs could > > cause a problem, but I believe they won't. See more information in patch 3. NMIs shouldn't be a problem. KVM does access the current VMCS in NMI context (to do VMREAD(GUEST_RIP) in response to a perf NMI), but only when KVM knows the NMI occurred in KVM's run loop. So in effect, only in KVM_RUN context, which I gotta image is mutually exclusive with tdx_fw_write(). It'd be nice if we could make the P-SEAMLDR calls completely NMI safe, but practically speaking, if KVM (or any other hypervisor) is playing with the VMCS in arbitrary NMI handlers, then we've probably got bigger issues.