On Wed, Jun 14, 2023 at 11:45:49AM +0000, "Wang, Wei W" <wei.w.wang@xxxxxxxxx> wrote: > On Friday, June 9, 2023 4:11 AM, Isaku Yamahata wrote: > > How about this comment? > > > > if (unlikely(ret == TDX_SEAMCALL_UD)) { > > Where is the TDX_SEAMCALL_UD error code documented in the spec? > I failed to find it. This is not a part of the spec, but a convention of __seamcall(). Please refer to https://lore.kernel.org/all/ec640452a4385d61bec97f8b761ed1ff38898504.1685887183.git.kai.huang@xxxxxxxxx/ > > In the case of reboot or kexec, > > * kvm shutdown notifier, kvm_shutdown(), makes VMX off > > (VMXOFF) > > * while TDs can be still running to invoke SEAMCALL. It > > * results in superfluous errors or warnings. > > * If rebooting, return 0 to suppress superfluous messages. > > * If not rebooting, panic by kvm_spurious_fault(). > > */ > > kvm_spurious_fault(); > > I would put it this way: > SEAMCALLs fail with TDX_SEAMCALL_UD returned when VMX is off. > This can happen when host gets rebooted or live updated. In this case, > the instruction execution is actually ignored as KVM is shut down, so > the error code is suppressed. Other than this, the error is unexpected > and the execution can't continue as the TDX features reply on VMX to > be on. Thanks for it. I made minor fix to it. if (unlikely(ret == TDX_SEAMCALL_UD)) { /* * SEAMCALLs fail with TDX_SEAMCALL_UD returned when VMX is off. * This can happen when the host gets rebooted or live * updated. In this case, the instruction execution is ignored * as KVM is shut down, so the error code is suppressed. Other * than this, the error is unexpected and the execution can't * continue as the TDX features reply on VMX to be on. */ kvm_spurious_fault(); return 0; } -- Isaku Yamahata <isaku.yamahata@xxxxxxxxx>