From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 79250239562 for ; Fri, 15 May 2026 19:39:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778873962; cv=none; b=AX2LLbBPQNmKj3903rVe8YN9P81nOTTwV8LLzirH8q+vkoDh3M5O3770/s7zgYSBu6W4XrIajYAFoK9/WFTuROUTgTbW/3yRp0NqfS9o4BF8He4aKz1bd0ickJkSDpfvYXFt52oiYK2lS5+4ktrH3g948REWDgJ0NYrwv67LPhc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778873962; c=relaxed/simple; bh=4QcJxWe40k0GUY0ZHvOLPBEL9PRIfUI+P2/tISiVaqo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=EzbxF0qqUbQfE+YNBJG3zuqZIKM/neKBCkRFI4dVZwuvG9pPFZhBk8/Ef8cz+zHOCCw7C64TqXdlhNGpJUuLHGij8Y9qoq6EYz8xoDi+MbBh0+kAz2r0hn5fg7se823JCfQN+CGhQMwXheGHazw/RZwXNn4uS7ujDuXBsYqBRKQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=sbX0p9lm; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=q2isWp2j; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="sbX0p9lm"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="q2isWp2j" Date: Fri, 15 May 2026 21:39:17 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1778873959; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=pdX1LR/Y4YArvCEI8e4nGup40MR42Oi3iqPHACUW2kE=; b=sbX0p9lmEuCIhB+2E91+hTSAGW2JMqc9CO0TufoLs81h58ZiKPqgmmF8G9+yQldXlsSG5H 55DvUYiHQJPwRAnwDHxd1p74anlZJfpUem68ILlcNVEzY4QNRgzPL5/ueqewEnn7k43cPJ Vdx90r2UgekOVRy8/Nm3SWTSo/CsTN4MDLGFqZBd/d7DJTZ29gmWJu96kEMCBew1lousQV RAXwIAQnABkMnnBJtiN5H0rQnkoUIU9xyvSnMTeugsBcNlNznqpLpBBFf07K2PDl4ulaCA ovOQpITaGCeomfWySJW7rlfbkQEbakwmYOhxxZGVvHUcVcRO6wyC8LCuQ7N57w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1778873959; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=pdX1LR/Y4YArvCEI8e4nGup40MR42Oi3iqPHACUW2kE=; b=q2isWp2jYVUajiGfGlH9H5nBee3XzpBsusH3wv+QQnCpC5vFu/WtI9uONPHdCjeSXtrw41 e+ZnfOuNKcSqL2Dw== From: "Ahmed S. Darwish" To: "Nikola Z. Ivanov" Cc: kprateek.nayak@amd.com, tglx@kernel.org, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com, puwen@hygon.cn, mario.limonciello@amd.com, yazen.ghannam@amd.com, andrew.cooper3@citrix.com, me@mixaill.net, kai.huang@intel.com, i@rong.moe, sohil.mehta@intel.com, peterz@infradead.org, xin@zytor.com, seanjc@google.com, pawan.kumar.gupta@linux.intel.com, nikunj@amd.com, ptesarik@suse.com, nik.borisov@suse.com, suchitkarunakaran@gmail.com, x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] x86/topology: Unify srat_detect_node among amd and hygon Message-ID: References: <20260515163105.414436-1-zlatistiv@gmail.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=us-ascii Content-Disposition: inline In-Reply-To: <20260515163105.414436-1-zlatistiv@gmail.com> On Fri, 15 May 2026, Nikola Z. Ivanov wrote: > > --- a/arch/x86/kernel/cpu/cpu.h > +++ b/arch/x86/kernel/cpu/cpu.h > @@ -65,6 +65,7 @@ extern void check_null_seg_clears_base(struct cpuinfo_x86 *c); > > void cacheinfo_amd_init_llc_id(struct cpuinfo_x86 *c, u16 die_id); > void cacheinfo_hygon_init_llc_id(struct cpuinfo_x86 *c); > +void srat_detect_node(struct cpuinfo_x86 *c); > This is very confusing from the perspective of common.c. The moved srat_detect_node() function there has zero indication that it is AMD/Hygon specific. When I was refactoring the cacheinfo code some time ago, I marked the vendor-specific cacheinfo.c functions with amd and/or hygon tags to identify which is which. You see that clearly in the two lines above your new function declaration. IMHO, you need to do something similar. Please continue below. > > --- a/arch/x86/kernel/cpu/intel.c > +++ b/arch/x86/kernel/cpu/intel.c > @@ -468,7 +468,7 @@ static void intel_workarounds(struct cpuinfo_x86 *c) > } > #endif > > -static void srat_detect_node(struct cpuinfo_x86 *c) > +static void srat_detect_node_intel(struct cpuinfo_x86 *c) > { > #ifdef CONFIG_NUMA > unsigned node; > @@ -614,7 +614,7 @@ static void init_intel(struct cpuinfo_x86 *c) > set_cpu_cap(c, X86_FEATURE_PREFER_YMM); > > /* Work around errata */ > - srat_detect_node(c); > + srat_detect_node_intel(c); > I think it would be nice to have: amd_hygon_srat_detect_node() intel_srat_detect_node() This would also go better in line with the existing intel.c functions like intel_unlock_cpuid_leafs(), intel_tlb_lookup(), intel_detect_tlb(), etc. Thanks, Ahmed