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=1796384012; b=E52gbYEkPXhAFREdAoGNhjc6vt1zr27T7IWklk+Gt/nrnNF7d4Y8t0MHAl1kSshA+Etx Ski/dgxTruBny608wy5BD/wvI3q4I7JQsR5Ce8BJx63UDVEWXowEFRFYT79+LI8qU9438 U4K/Fe6YM+xfWOGSPD2Y7BsKQ0U8Cfz52oRDjOLrufgvrLRdY4Obf9mCqniNIGsnBiXZt k/C3aORU6DXEqmJL45KrwGIFnGS36CADMqFtsexcb8OkDMtuBFx5rkTFT1bqZH2cD0yHf 3WFGlxTPuopwXuqjSd0Lahqj+KJtmLQVo6N85T6Xc0l+1jedx3KZovUIytYxF2ftvdQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796384012; 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=GzQKNpxekRDZPuzk2diU5Wso+EDfDL3fSYTgV73RueQ=; b=Nstpjn2nbVv9pqPJZ4X0Z+HCjYtgsmlRdT/t3C+FMHNxLJD+40xMlojskqFr0yjmHDbv 5ETdPVaNXhnpyoPp92Wax/bdtXvAqzYP8eTg5XG3VztbTZWpsjkFX10qUhQ7CZB7B+Jh1 t55S0yLlWcQHxBdpFxGpkdg02cg1cYbTCWf0Anu6GjOrCMtB54nwxjEU0MUmOKeZMfvBa 7BFPl1jNTYigYpQkRs2Svlk39ed/B5Z6koo+dDMrmZIOG3Dk5o9b/llGdF9SSSRYpXedX Z3dfDa8UZ6mdNjQZjhM8wmTXyHoW35e5dLUuq1xWKTGdk+2bwfdX/mWQAXiBLrNTdyg== 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=yR6ZCRzK; 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 5A869606A32C; Fri, 4 Dec 2026 11:33:32 +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=yR6ZCRzK Received: by smtp.kernel.org (Postfix) with ESMTPSA id CB2DE1F000C2; Fri, 4 Dec 2026 11:33:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796384012; bh=GzQKNpxekRDZPuzk2diU5Wso+EDfDL3fSYTgV73RueQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=yR6ZCRzKC1OhaTzQ8huPtTl8j0rdmgv8yeVPsKfhwWCvzl0HuriAwcB1SuJGdQt8D gE0sWF+6JrSIe2NpIWzu3t9L2BmhQL7TG+3zSR+EuTvO74uHTXp0dtdz+81CeriwcV 26TpLk9Bk0vYQxB9+DGewrgMjoQ2WbVm+Ufgfjuw= 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.12 418/555] KVM: PPC: Book3S HV: XICS: Update irq_type for cleanup to work Date: Fri, 4 Dec 2026 19:07:41 +0900 Message-ID: <20261204100625.653891276@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100603.988357525@linuxfoundation.org> References: <20261204100603.988357525@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.12-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 @@ -1940,6 +1940,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) @@ -2028,7 +2029,6 @@ bail: return r; } - vcpu->arch.irq_type = KVMPPC_IRQ_XICS; return 0; }