From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 33F4C4EB862; Tue, 13 Oct 2026 12:24:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791894244; cv=none; b=SIso2jLRH5YjUmeC4fGQFvpCfU2mjKlq9cYst1QMaJe5tdpvnkXiXy3lRQNHUNSbAZHNbKDVT9/CZ/L8UWdzN+99slERCpeo4Ch3QX+Ki62qVzQdWT2tXV5Az3CFd9mhiT3BObvm44kvl8fFLzgPUO1XfboMhcOSmpcaILDVCCY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791894244; c=relaxed/simple; bh=UfQvDp8REJwB/u/78u70tVYMeU7Lahb9RzRgSz0W068=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=slYoeAnPgRmymcnz15dLW+dcQ/5IswOeQoZWRje8e9FS5mWboJGUN8ZFFf5gOafikyTM+yoDZ/3E4YoluaMUFmisgVeqlVyY0WJvLl4Lx6axhPHxu96YbDZU7ifN2vb10JX9HXa7N0LYOqyfRjUx1W81QzINDwCT7dvWQX1GLIo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Jyp3FpYa; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Jyp3FpYa" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 85E0A1F000FF; Tue, 13 Oct 2026 12:24:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1791894243; bh=L3c+a95K7JzU9c9lPdiwJrW8PvfvlqcFV25VNilokDY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Jyp3FpYaPCUVZhhHnt1OQKG/0/uA8sA/asdfwbFRLDe5xmncwSGOgJ+fCYHoYC8IK 3SmtS4YqbiDa5WbErbRJHPdvSu2NWm3jCKqKoKJXPDQx3v5kzTqudEGKy8n6ywA8mf rbm5JsLDRAO7GMFEMLavC57oufnRySDZe8WvF0LU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Gou Hao , Wentao Guan , jiazhenyuan , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Madhavan Srinivasan , Sasha Levin Subject: [PATCH 6.18 496/621] powerpc/xive: add error return value to xive_smp_probe() Date: Tue, 13 Oct 2026 13:38:11 +0200 Message-ID: <20261013112932.598996604@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261013112920.855194808@linuxfoundation.org> References: <20261013112920.855194808@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Gou Hao [ Upstream commit ab5ae5dceb86614f6c9e7488f91b652000edfdc5 ] xive_smp_probe() calls xive_init_ipis() which can fail, but its return value is currently ignored. Change xive_smp_probe() to return int so that errors can be propagated to callers. This is a preparatory patch for the next one. No functional change yet; the return value is always 0 at this point. Signed-off-by: Gou Hao Reviewed-by: Wentao Guan Reviewed-by: jiazhenyuan Reviewed-by: Cédric Le Goater Signed-off-by: Madhavan Srinivasan Link: https://patch.msgid.link/20260727104215.184786-3-gouhao@uniontech.com Stable-dep-of: 411a3c016e7a ("powerpc/xive: propagate IPI init errors to prevent use-after-free") Signed-off-by: Sasha Levin --- arch/powerpc/include/asm/xive.h | 4 ++-- arch/powerpc/sysdev/xive/common.c | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/include/asm/xive.h b/arch/powerpc/include/asm/xive.h index efb0f5effcc69..4e3e3358993c0 100644 --- a/arch/powerpc/include/asm/xive.h +++ b/arch/powerpc/include/asm/xive.h @@ -91,7 +91,7 @@ static inline bool xive_enabled(void) { return __xive_enabled; } bool xive_spapr_init(void); bool xive_native_init(void); -void xive_smp_probe(void); +int xive_smp_probe(void); int xive_smp_prepare_cpu(unsigned int cpu); void xive_smp_setup_cpu(void); void xive_smp_disable_cpu(void); @@ -153,7 +153,7 @@ static inline bool xive_enabled(void) { return false; } static inline bool xive_spapr_init(void) { return false; } static inline bool xive_native_init(void) { return false; } -static inline void xive_smp_probe(void) { } +static inline int xive_smp_probe(void) { return -EINVAL; } static inline int xive_smp_prepare_cpu(unsigned int cpu) { return -EINVAL; } static inline void xive_smp_setup_cpu(void) { } static inline void xive_smp_disable_cpu(void) { } diff --git a/arch/powerpc/sysdev/xive/common.c b/arch/powerpc/sysdev/xive/common.c index 6bc373cfef8c6..92597aae4debc 100644 --- a/arch/powerpc/sysdev/xive/common.c +++ b/arch/powerpc/sysdev/xive/common.c @@ -1274,7 +1274,7 @@ noinstr static void xive_cleanup_cpu_ipi(unsigned int cpu, struct xive_cpu *xc) xive_ops->put_ipi(cpu, xc); } -void __init xive_smp_probe(void) +int __init xive_smp_probe(void) { smp_ops->cause_ipi = xive_cause_ipi; @@ -1283,6 +1283,8 @@ void __init xive_smp_probe(void) /* Allocate and setup IPI for the boot CPU */ xive_setup_cpu_ipi(smp_processor_id()); + + return 0; } #endif /* CONFIG_SMP */ -- 2.53.0