From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (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 D6F40372B45 for ; Tue, 14 Jul 2026 09:30:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.158.5 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784021424; cv=none; b=KyLFasAQV56UWc6UGamVDoEQnS2isOfWpMiTXTWRgefaWcpo9dp8XHaHrkXQfNBJYYzmoRJestXDEEYQAw6wwSGeeyhROm0wGrUMNF0U3VFHM4bQEd+7SnPsBpGOACmEqJZsDf4UIe1r/gnX+jX+PE3fj/WcJ2E75vO+FIRgYYk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784021424; c=relaxed/simple; bh=FPKcWVnHyFPt2j9KDmZyOC+QvjBQcO2qswNnKaf7PBw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=FQ6JkTnEMFPan7xw0//dF9mjllFrS/0rloDPV2/eUIR+7D5sDCTD6IzcwuXwxSCqRDuRj4B9klt7yOQilWHgb9CWtZq1FbQo6AsivtjxVLijayTkgfCm39XkG6lMUiFhunQZmiWY2loqS6zjhJNVpiorfrjhkQMLCivX/0882zo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=oSkWYJJT; arc=none smtp.client-ip=148.163.158.5 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="oSkWYJJT" Received: from pps.filterd (m0360072.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66E6fxd3547339; Tue, 14 Jul 2026 09:29:54 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-type:date:from:in-reply-to:message-id:mime-version :references:reply-to:subject:to; s=pp1; bh=KsLqHTsSjtEyTiMvODN6J o4cCBjfs+wJF6eDvu5pKs8=; b=oSkWYJJTuizqtVfu34shHhYLIH6fXXOH2pUYL 5dB9f2EHryrPGpaI2OOLJV/lgWP0eBah2t1+60V7mYHPKebO/k2D0dlK1P8XdF9Y Gc3VyglT26TXBbSM307Bar2ZY00T9Rq3m1o/CtIlgqOsARj09sorE6dvMcKjIQyD B4aiUrjWPaQd/sNAghdBBnsQl4KlBDjyWq8jkDbRXdRrNFF1NTAaL4BrpyCtX0S2 PKPCA+rfHIVJpq7kIb+70/fwG8eoPhvqMraz/K3/AjNc3o5yd9cSa1AGlJbfHDc4 RpYGQxPJdxTW3hE59Uv/ZeJFMQKUCcwUPh0kJzNN9RZOX7GyQ== Received: from ppma23.wdc07v.mail.ibm.com (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4fbegbmxh4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 14 Jul 2026 09:29:53 +0000 (GMT) Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.18.1.7/8.18.1.7) with ESMTP id 66E9JbGo031203; Tue, 14 Jul 2026 09:29:53 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4fc1nh9y26-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 14 Jul 2026 09:29:53 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (smtpav07.fra02v.mail.ibm.com [10.20.54.106]) by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 66E9TnGh50004258 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 14 Jul 2026 09:29:49 GMT Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2148E20043; Tue, 14 Jul 2026 09:29:49 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 51BA220040; Tue, 14 Jul 2026 09:29:44 +0000 (GMT) Received: from linux.ibm.com (unknown [9.126.150.29]) by smtpav07.fra02v.mail.ibm.com (Postfix) with SMTP; Tue, 14 Jul 2026 09:29:44 +0000 (GMT) Date: Tue, 14 Jul 2026 14:59:42 +0530 From: Srikar Dronamraju To: Ritesh Harjani Cc: linuxppc-dev , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Naveen N Rao , skiboot@lists.ozlabs.org, arbab@linux.ibm.com, mahesh@linux.ibm.com, chleroy@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/3] powerpc/numa: Allow cpu_to_coregroup_id without PPC_SPLPAR Message-ID: Reply-To: Srikar Dronamraju References: <20260605055242.1757485-5-srikar@linux.ibm.com> <20260605055242.1757485-7-srikar@linux.ibm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: X-TM-AS-GCONF: 00 X-Proofpoint-Reinject: loops=2 maxloops=12 X-Authority-Analysis: v=2.4 cv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pmzj3oPZNB2utw6EWluaR_b X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-14_02,2026-07-10_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 bulkscore=0 impostorscore=0 suspectscore=0 adultscore=0 priorityscore=1501 malwarescore=0 clxscore=1015 phishscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607140096 * Ritesh Harjani [2026-07-10 09:34:55]: > Srikar Dronamraju writes: > > > Make cpu_to_coregroup_id() available outside PPC_SPLPAR so it can be > > used by platforms that do not rely on the SPLPAR-specific VPHN path. > > > > Keep the existing fallback behavior by returning the core ID when > > coregroup information is unavailable. > > > > Looks like this mainly brings the cpu_to_coregroup_id() outside of > CONFIG_PPC_SPLPAR gate. > Yes, thats the intent of the patch > > Signed-off-by: Srikar Dronamraju > > --- > > Changelog from v1: > > - Handle comments from Christophe Leroy; Remove extern key word in > > declaration > > > > arch/powerpc/include/asm/topology.h | 15 +++++++-------- > > arch/powerpc/mm/numa.c | 22 ++++++++++++++++------ > > 2 files changed, 23 insertions(+), 14 deletions(-) > > > > diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm/topology.h > > index 66ed5fe1b718..385715f1ad56 100644 > > --- a/arch/powerpc/include/asm/topology.h > > +++ b/arch/powerpc/include/asm/topology.h > > @@ -71,6 +71,7 @@ extern void map_cpu_to_node(int cpu, int node); > > extern void unmap_cpu_from_node(unsigned long cpu); > > #endif /* CONFIG_HOTPLUG_CPU */ > > > > +int cpu_to_coregroup_id(int cpu); > > #else > > > > static inline int early_cpu_to_node(int cpu) { return 0; } > > @@ -107,14 +108,6 @@ static inline void map_cpu_to_node(int cpu, int node) {} > > static inline void unmap_cpu_from_node(unsigned long cpu) {} > > #endif /* CONFIG_HOTPLUG_CPU */ > > #endif /* CONFIG_SMP */ > > - > > -#endif /* CONFIG_NUMA */ > > - > > -#if defined(CONFIG_NUMA) && defined(CONFIG_PPC_SPLPAR) > > -void find_and_update_cpu_nid(int cpu); > > -extern int cpu_to_coregroup_id(int cpu); > > -#else > > -static inline void find_and_update_cpu_nid(int cpu) {} > > static inline int cpu_to_coregroup_id(int cpu) > > { > > #ifdef CONFIG_SMP > > @@ -124,6 +117,12 @@ static inline int cpu_to_coregroup_id(int cpu) > > #endif > > } > > > > +#endif /* CONFIG_NUMA */ > > + > > +#if defined(CONFIG_NUMA) && defined(CONFIG_PPC_SPLPAR) > > +void find_and_update_cpu_nid(int cpu); > > +#else > > +static inline void find_and_update_cpu_nid(int cpu) {} > > #endif /* CONFIG_NUMA && CONFIG_PPC_SPLPAR */ > > > > #include > > diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c > > index c44a80d8fc11..9aa71eb7e96b 100644 > > --- a/arch/powerpc/mm/numa.c > > +++ b/arch/powerpc/mm/numa.c > > @@ -1428,6 +1428,21 @@ void find_and_update_cpu_nid(int cpu) > > pr_debug("%s:%d cpu %d nid %d\n", __func__, __LINE__, cpu, new_nid); > > } > > > > +static int topology_update_init(void) > > +{ > > + topology_inited = 1; > > + return 0; > > +} > > +device_initcall(topology_update_init); > > + > > +#else > > +static long vphn_get_associativity(unsigned long cpu, > > + __be32 *associativity) > > +{ > > + return -1; > > +} > > +#endif /* CONFIG_PPC_SPLPAR */ > > + > > int cpu_to_coregroup_id(int cpu) > > { > > __be32 associativity[VPHN_ASSOC_BUFSIZE] = {0}; > > @@ -1453,10 +1468,5 @@ int cpu_to_coregroup_id(int cpu) > > return cpu_to_core_id(cpu); > > } > > > > -static int topology_update_init(void) > > -{ > > - topology_inited = 1; > > - return 0; > > + return coregroup_id; > > } > > These above two lines seems to be out of any function scope. So applying > only patch-1 & patch-2 will give a compile error. This needs fixing. > Yes, will fix this > -ritesh > > > -device_initcall(topology_update_init); > > -#endif /* CONFIG_PPC_SPLPAR */ > > -- > > 2.43.0 -- Thanks and Regards Srikar Dronamraju