From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796375012; b=giPR5A/Eziyh1NrLmSP4Qfp2LUoqY8AQgepqzaEeQl/Sgnk4VBSjYG2W0jAQaAxLfjDu ZRRDhRiJTcTdxNHIgYCvDrLxH7h1+acRpKu8C4zfGcbrfCUWNIZAXR7BaBhcb2cWzuAY6 +710Cj5LQqJwM6AQQ8CyBgEy6BjVXBhyswdIng4f+Sd7iONalyTKk9e0R9rG9rxDnoiAw QDzda1DAU1qjhvC8gWjmsjXlAilq4m4rV+vC4nRNX/S48JJC7inaES9OYqyoQBTfrOp4Q VefDwURcZyOdUb+/TchCCN7DBL3OS7Y9WWTm7L0J8HeVpoQN8w0c66ZA1TIWdw2iyFg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796375012; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=4u6ucQSH+MLHCuxEbvKs1PrZug/4KPacvgI2JuANeNQ=; b=de3rm6/Og2O/6vOtp20mTZD0C7O0XXoqRmzdg9N9rHMqP9lJK4qXImnIR0wJFONcvLLc tWK3l35S2Kb21XXbvnzn9fPA0u+B5Kc3BHIGnM99D7Z9y/W8zIG2soXrkUDeRbBMOifGU +XAuGKPeIpBJOVmWUZK5Y/nB9XGkjlo7LX+d0P50yNclzTsGLqgjwipCTbWJqWLLrwC1S wQD5qhHKC9xT3d9gT0mgQdLF+H5WVOdrwgepHCRLiDig5hARmumcB43RJCBeXQGtwe9M9 9HuLVMQG+N7mBN8nNYsaHEBP7Hq2YvNICgT5iSnOI5/7EJxyOdSocamT/wL8R3Dez9w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=NGuyGuiU; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 37223606A322; Fri, 4 Dec 2026 09:03:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=NGuyGuiU Received: by smtp.kernel.org (Postfix) with ESMTPSA id A8B6A1F0092C; Fri, 4 Dec 2026 09:03:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796375011; bh=4u6ucQSH+MLHCuxEbvKs1PrZug/4KPacvgI2JuANeNQ=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=NGuyGuiU4bLNDxMbMKQovKXkknuS9DCTQhvvrcgL837kezjnlZvF/TiWKeTfx7YWs QDj8hEbn+/70QEN7HOfx0Ym5Is/lkWmNFwji2oNAKI7G6oiNAXA81Vb0W3zWuaVemo Z/niKOUM9SCu109p0YdAwHyEx6GX5SU4A7exc393+QTf6fpGRJpnvBQ2P5ci9WVmCd JAY+qpvfoREPaXHdI4FQJXHsXWYKv0zhP4fsdiUj4UDxMY5QbbmbFkEuA3Tcx0mz6w P80xu/1jtrn/gy4eYoO+kic1t9Q8FXenktkYRSJGNIwIRQ6vmBLGBjCib1vDVeHGG9 6h7MzCS2NpGTg== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v4 5/9] KVM: arm64: nv: Discard nested SError in kvm_reset_vcpu() Reply-To: sashiko-reviews@lists.linux.dev To: "Dan Carpenter" Cc: kvmarm@lists.linux.dev, kvm@vger.kernel.org, "Oliver Upton" , "Marc Zyngier" In-Reply-To: <20261204-double_exception_v4-v4-5-523921511673@pereq.eu> References: <20261204-double_exception_v4-v4-0-523921511673@pereq.eu> <20261204-double_exception_v4-v4-5-523921511673@pereq.eu> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 09:03:31 +0000 X-Mailing-List: kvm@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] KVM: arm64: non-atomic hcr_el2 RMW in kvm_reset_vcpu() races with IRQ line -- commit 5201009befa259c3dab07b05344d615312140b11 Author: Dan Carpenter KVM: arm64: nv: Discard nested SError in kvm_reset_vcpu() This commit clears the NESTED_SERROR_PENDING flag in kvm_reset_vcpu() so that pending nested SErrors are discarded on vCPU reset. > diff --git a/arch/arm64/kvm/reset.c b/arch/arm64/kvm/reset.c > index 4b1917b48edcb..1899d927164c1 100644 > --- a/arch/arm64/kvm/reset.c > +++ b/arch/arm64/kvm/reset.c > @@ -206,6 +206,7 @@ void kvm_reset_vcpu(struct kvm_vcpu *vcpu) > =20 > /* Discard a pending SError */ > vcpu->arch.hcr_el2 &=3D ~HCR_EL2_VSE; > + vcpu_clear_flag(vcpu, NESTED_SERROR_PENDING); [Severity: Medium] Can the non-atomic update to vcpu->arch.hcr_el2 (from commit "KVM: arm64: Discard a pending SError when resetting a vcpu") lose a concurrent virtual IRQ or FIQ line transition? For a VM without an in-kernel irqchip, KVM_IRQ_LINE runs without vcpu->mutex and calls vcpu_interrupt_line(), which atomically sets or clears HCR_EL2_VI or HCR_EL2_VF in vcpu->arch.hcr_el2: CPU0 CPU1 kvm_reset_vcpu() kvm_vm_ioctl(KVM_IRQ_LINE) /* holds vcpu->mutex */ kvm_vm_ioctl_irq_line() load vcpu->arch.hcr_el2 vcpu_interrupt_line() test_and_set_bit(VI, hcr) store hcr_el2 & ~HCR_EL2_VSE <-- overwrites HCR_EL2_VI When that happens, the concurrent interrupt line update is silently overwritten, leaving the guest with a missed or stuck virtual interrupt. Using clear_bit(__ffs(HCR_EL2_VSE), vcpu_hcr(vcpu)) would avoid this data race. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261204-double_exc= eption_v4-v4-0-523921511673@pereq.eu?part=3D5