Re: [PATCH] KVM: Never clear KVM_REQ_VM_DEAD from a vCPU's requests

Marc Zyngier <[email protected]> Fri, 07 Aug 2026 09:20:47 +0100
Newsgroups dev.linux.lists.kvmarm,org.infradead.lists.linux-arm-kernel,org.kernel.vger.kvm,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On Thu, 06 Aug 2026 22:46:18 +0100,
Sean Christopherson <[email protected]> wrote:
> 
> Use kvm_test_request() instead of kvm_check_request() when querying
> KVM_REQ_VM_DEAD, i.e. don't clear KVM_REQ_VM_DEAD, as the entire purpose
> of KVM_REQ_VM_DEAD is to prevent the vCPU from enterring the guest ever
> again, even if userspace insists on redoing KVM_RUN.
> 
> Ensuring KVM_REQ_VM_DEAD is never cleared will allow relaxing KVM's rule
> that ioctls can't be invoked on dead VMs, to only disallow ioctls if the
> VM is bugged, i.e. if KVM hit a KVM_BUG_ON().
> 
> Opportunistically add compile-time assertions to guard against clearing
> KVM_REQ_VM_DEAD through the standard APIs.
> 
> Signed-off-by: Sean Christopherson <[email protected]>

Acked-by: Marc Zyngier <[email protected]>

	M.

-- 
Without deviation from the norm, progress is not possible.