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=1796382500; b=MpU3A8ME6Ebn7RUfYPP5ZyCyNln8koMvU6dyPL60zB4xE/EU0+2Utqoqv0IOO1OBLP18 O7F9u+0+zks3NBNDyWEiO/ou51w7edpGH01w2PxDbMfCeYin5kN2oRhj0nLemr/S3jwjw AcqpFxVR0zOol5EWf2pPljDZRpnF0rnT89ffhNeN6K6vwma38Gx0EtoN9ugCEBTJrJZOa b6c4LtyEy8LBLuEKbwb2JtrIU0SftZ9JQkAeuYVsPVJDv+xCO+Ht21JrxhWfwKbS1D4kt g+PCm39n5XgkmEvMqNoz8YTwm7ZGdYK+UrIF4Jfmb/kWwbdNiUT8YQGJuN4OSpZ7lcQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796382500; 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=mCGx60YW7Tizjw7ko9GXGAKRJ1wcJtjnRLh4iQ/f4Uk=; b=jfJf0QnoOjovOjKfyibZv6Sln7FPDBHDwF4GNSpRsdpcHAm0hUPGXrBNSyP/HbiuilzC dQALUbn8dn2x+xbRwWVXccLVR8ETGo7ysQe2g98FYDcsoEG4UYHuNn8FQsrzqKYV13/2b SDx4AOyOtxjoVc/mVBg0OQk8SFL88IJfokNb6EWD85/Bj13DBElqD2ojsvEgGKWjZr8L2 897wB5qyNWaQd+aAhueZkpo6mzARA/qdw4oHrwgBHsQG87vCRd3Fp4MRXa8bRGTjV9x+p ST25hFpVoUdAHp0ZGaSMoSrXtXpldsu0dfK/tkPGJ24JwXhQXJooFkQzEYOWB7a4Agw== 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=vB8BIqKg; 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 F1DEB606A690; Fri, 4 Dec 2026 11:08:19 +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=vB8BIqKg Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3557A1F000CE; Fri, 4 Dec 2026 11:08:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796382499; bh=mCGx60YW7Tizjw7ko9GXGAKRJ1wcJtjnRLh4iQ/f4Uk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=vB8BIqKgSdhmG3hBLVcGM06ti0u5Dg6KZGh5I39C58JAgNLCJcz6gSALsG03h6JW/ zOQjDY1MU+lJDcfMdC4z6b4zorAjNcCinme0S1SiRoIdzeVvZhzPj4bDeG//6DGBuN jWNot+LappzeJ9eHs1b6guhfpg/Fue0RSPawQwl8= 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.18 480/703] KVM: PPC: Book3S HV: XICS: Update irq_type for cleanup to work Date: Fri, 4 Dec 2026 19:06:19 +0900 Message-ID: <20261204100640.571218912@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100627.522266145@linuxfoundation.org> References: <20261204100627.522266145@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.18-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 @@ -1938,6 +1938,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) @@ -2026,7 +2027,6 @@ bail: return r; } - vcpu->arch.irq_type = KVMPPC_IRQ_XICS; return 0; }