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=1796381134; b=OUodXSx7lSupFnc6++ngCp2vFjk2vVwb0GozlMXy0iyfIcoytYEbJyfGhjXRfEQhCCQG hIuPTe356qsbXmBnWaTqrHIvngxFu+ZMuspVqN5fN9zsjQwWPF9bt/w2hLIjx/THqUlQw 1QsKjdjBkuD+ACfP9g8MrYP+409Xg9iLBexz+82aBgF7jJqXqtoDFOC3Co8JwXMARAIQj ghTiMc+056nFNVCQVVmn6z84U5yjDQyXC8wqOjGmRIxE+B11U+R1qDt9PZaadkh3OPrfb jayXVea42s2nIYmi85zVMSTIzUMnRiSZrgSWHoCDjLuxiNvz6nqPLwtJc8jm6rYWTJA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796381134; 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=WbVOoxh7XOdLvvIz1+pXQfDDcDlApnjXkDg0xxBfQwU=; b=1kmDUKyJuHJleYIyPhGCBdhj++TIX06LRB2YpOI6iTxlh9G1/FiQV6PleBO0Zyo/rtX8 ZBfkhNAyLihhcMdJXII/dgdHqcFlBb4qIgED/u0pD6nHz0fvHpvPYTYO1ihXSFoCTfa6q iEs3R+X3pzYyL0m67zeEfDteM6pz6lJHb7rzJTO4jnjdI7VutBsSU31KYqlB3RYHBzlhy t3FL8w72iX+CCX/9GFA4/sGaUns7wZ6VBhGqbhuf+BuUhX2fhD527n+tW/IliF+OrJen1 PgemHHZip5kixWafc+FQ0wdicEkZ5kuG6Tsd1a4i+rqqx/Ma/QQW0euW8mDfnp5lmmQ== 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=stCNxJp4; 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 9F1F4606A32C; Fri, 4 Dec 2026 10:45:34 +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=stCNxJp4 Received: by smtp.kernel.org (Postfix) with ESMTPSA id B52DB1F000C2; Fri, 4 Dec 2026 10:45:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796381134; bh=WbVOoxh7XOdLvvIz1+pXQfDDcDlApnjXkDg0xxBfQwU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=stCNxJp4Y4wsjPSDIfM1Du5I6tsoma3DM8ST3kdAfKXACZpUqOVIQO0FxJOkJ6T4N Kv4PohS/zdVgd6X0OqNtFxuL6LKdz4Tz5lYli/Es8Z7KDKrzqeipltd/rnF/nBg5bt +ZFP4mSqpkPK9cKp6g5uOAAZN/ESX8+rhEBZTbnY= 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 7.3 533/742] KVM: PPC: Book3S HV: XICS: Update irq_type for cleanup to work Date: Fri, 4 Dec 2026 19:06:37 +0900 Message-ID: <20261204100649.334812916@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100635.034361255@linuxfoundation.org> References: <20261204100635.034361255@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.3-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; }