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=1796389368; b=IIMF95ZbvUwrnqX1OnVY/pu2bxs9Y2JnyiaLtlNIwETmiiFKjPMgDKAB4sOuzweKWpXQ a6qyg+0QqCk7FuAYr1olHX2v5+YsXK/iK4aVhqKzwUc7J5SRk/BUs3gEzcYspFpqNXATL uJ/pF9wpL2/XEKXhqXkFeQi+KzlWUwwzustMBH39gFbvQlLo0fq4/W5kJnnmFrog3nWAG /70nqhs5pAH+imfzmrhB5YyTZVu4glNIAYzs3ipcxTjHF7OYORUornET352trOJg8KO03 XhQa/IxFP/0CqyjqEiRq9yJERbCClxUO0S98kacbbRm9XZ8gz91T8eBoP+HCjCZ4hUA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796389368; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=zvA+eD7rAPTSOB/5Hse3IvaOd7GL8ByfOCbX14/u4ms=; b=s2IJUuCPWWxAAUvH4Hj6HXoiY8G77rMff6mjM1HY+0bcrgNeh1pD4zEYrqB16l5Dhgug 2m8lyzKbprZ0q3YNGX2BzFLSltNBJh6OT4CAe2G3m7L4pXOp93UXyDpg2QTZlhnfNwWfM Z+2n+H/j4YuWRq5vHSTsbhtmknPY8eILiEyntZZwgZuwLoeuMfBiZr96SVTnIcPUkBUls fJlhSe98/1udjMJHKCJgkDHzwzAJiZ+SV5ImgqLtT3JQV+Z/WJB/YMi0lRxqG4Ry09yko 8ANAX/1N1uxPy3OKuU563AJC9pA8YlA/PPSD6+8DoOEPwcuCl7hEefXL250oPfBkL3w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=AmAbfggV; 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 D464A606A334; Fri, 4 Dec 2026 13:02:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=AmAbfggV Received: by smtp.kernel.org (Postfix) with ESMTPSA id BD8AF1F0093A; Fri, 4 Dec 2026 13:02:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796389368; bh=zvA+eD7rAPTSOB/5Hse3IvaOd7GL8ByfOCbX14/u4ms=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=AmAbfggV0gAY4+VMfk3FETm8A9fVAAECJtNMANaseo9IHbm5dA22TLMasvk9ei3sD uIudR7uaz7c1dCdPSYL0XxdTyYH8zM3iNKyaEfBCLkbamdqjVrUvrfWYl345HkvS3A q6Pur/D8a3R1dD6LtRfSOSM2JJ/3EuKBhoDwj828= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Gautam Menghani , "Ritesh Harjani (IBM)" , Madhavan Srinivasan Subject: [PATCH 6.1 0965/1059] KVM: PPC: Book3S HV: XICS: Update irq_type for cleanup to work Date: Fri, 4 Dec 2026 19:08:16 +0900 Message-ID: <20261204100709.015541397@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100643.980430235@linuxfoundation.org> References: <20261204100643.980430235@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Gautam Menghani commit b9d9a8741752c5b42c65b1c8dffba867889b74e5 upstream. In kvmppc_xive_connect_vcpu(), if any failures are encountered, the control flow jumps to the 'bail' label where kvmppc_xive_cleanup_vcpu() is called. This cleanup function exits prematurely since vcpu->arch.irq_type is set to KVMPPC_IRQ_DEFAULT at this point. This ends up resulting in wasted memory. Fix this by setting irq_type to KVMPPC_IRQ_XICS before vcpu configuration starts. This makes XICS initialization symmetrical to XIVE initialization done in kvmppc_xive_native_connect_vcpu(). Fixes: 5af50993850a ("KVM: PPC: Book3S HV: Native usage of the XIVE interrupt controller") Cc: stable@vger.kernel.org # 4.12+ Signed-off-by: Gautam Menghani Reviewed-by: Ritesh Harjani (IBM) Signed-off-by: Madhavan Srinivasan Link: https://patch.msgid.link/20261012082922.218799-3-gautam@linux.ibm.com Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/kvm/book3s_xive.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/powerpc/kvm/book3s_xive.c +++ b/arch/powerpc/kvm/book3s_xive.c @@ -1942,6 +1942,7 @@ int kvmppc_xive_connect_vcpu(struct kvm_ xc->vp_id = vp_id; xc->mfrr = 0xff; xc->valid = true; + vcpu->arch.irq_type = KVMPPC_IRQ_XICS; r = xive_native_get_vp_info(xc->vp_id, &xc->vp_cam, &xc->vp_chip_id); if (r) @@ -2030,7 +2031,6 @@ bail: return r; } - vcpu->arch.irq_type = KVMPPC_IRQ_XICS; return 0; }