On Thu, Aug 03, 2023, Michal Luczaj wrote: > On 8/3/23 18:41, Sean Christopherson wrote: > > +/* > > + * Assert that a VM or vCPU ioctl() succeeded (obviously), with extra magic to > > + * detect if the ioctl() failed because KVM killed/bugged the VM. To detect a > > + * dead VM, probe KVM_CAP_USER_MEMORY, which (a) has been supported by KVM > > + * since before selftests existed and (b) should never outright fail, i.e. is > > + * supposed to return 0 or 1. If KVM kills a VM, KVM returns -EIO for all > > + * ioctl()s for the VM and its vCPUs, including KVM_CHECK_EXTENSION. > > + */ > > Do you think it's worth mentioning the ioctl() always returning -EIO in case of > kvm->mm != current->mm? I suppose that's something purely hypothetical in this > context. Hmm, probably not? Practically speaking, that scenario should really only ever happen when someone is developing a new selftest. Though I suppose a blurb in the comment wouldn't hurt.