From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.alien8.de (mail.alien8.de [65.109.113.108]) (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 96AF3EEBB for ; Sat, 28 Mar 2026 13:34:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=65.109.113.108 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774704870; cv=none; b=HLtdbASEf8Oms9Y1JZlUL+bn3Qc2Ku0ZfZc5zLEBeOddEA1H/8c/4VZKDMumYBzIdwsv4Gq1uQnVBSa0SckCBgHDE8n6WPqE2hCmk+2v/UWkES1HmhdKKXIDffGVZU9RJwoxNe1UC8rZKuHYOfxbrMdfqp4b9JgXvXrhrdIar8w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774704870; c=relaxed/simple; bh=JWWVaPQh2rEfnR6iC64LUGnpbus3cYAjfdmvvDyx61Q=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=WEH9HzPaQAF2yhp0gTGMhxsJ39XVxzfCDYT7VTNALo2AsxP2x1ZUugDz+5jUpSdSAEszwIK5Mh9sTxiZUSrQlMZEimLykNBzRgOMDrBdQJnJSKjXhFVJZ8ZW11lJdNakUHYcF6uJFl0wQWnfiSVM8uRXqQ6P63tjzfmXWOPdf5I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=alien8.de; spf=pass smtp.mailfrom=alien8.de; dkim=pass (4096-bit key) header.d=alien8.de header.i=@alien8.de header.b=QNYzTA3v; arc=none smtp.client-ip=65.109.113.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=alien8.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alien8.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (4096-bit key) header.d=alien8.de header.i=@alien8.de header.b="QNYzTA3v" Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTP id F2B4D40E0174; Sat, 28 Mar 2026 13:34:25 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at mail.alien8.de Authentication-Results: mail.alien8.de (amavisd-new); dkim=pass (4096-bit key) header.d=alien8.de Received: from mail.alien8.de ([127.0.0.1]) by localhost (mail.alien8.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 1gvVAIZZhelV; Sat, 28 Mar 2026 13:34:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=alien8; t=1774704861; bh=yT0CIlE+abpyZpWuevbPbnZJy0HR9eN7Unvm5dST4kA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=QNYzTA3vDVKTGaDY/dbqOZNCFhDmKP2UvNDc8jW/jkdYW3uQrzdcsRp3/tmPA3Q6r 8Lnka+jqgCpdZi9H31rBeBKadXeoxS7eN1r+2vdCdXUfmlp39Cmkd7NN9asT4ug4eU Rf8Wb0KpuH2Nf1zXvnl8/589G4UpwhSFnnxJkD3SFyT3+4prWGfeHCnZadAq17yw+5 SMJ3k4nD++4ezRyW8CwwBHycnDFElmvjq5fnj1AjuYUV/C2uvjSkjYq3Hi1/MXB1h8 g5W4VQl1NFM/iYD8Ee6ZWEPYdl1iuoki7hHV3/0dIgGHR0obJrH20CVLhaKQN+8ERZ 2bEnf0na0vEFGB3pC8/aB3+LGCGRYIiNP0+AE7CB69XHt+tvLoiopQ0AsF2abFFhX0 sBOyjRN/ihcwdKiso36+zu1n/oueuqO3DB0UBojE8SDvZZVVmrm+C5PO1dO1zWC1+1 2H1H7XtXhkNyCCpolC5t1EROQodxk2C89XNTEbPGKIinEeKZYLh8F/UworeYN1Jvlg CaWf6v01IXRnLRdWa85xth46jzsvh5KpYnJ0K/TiPeWBgYiJjuhkIJYgbyQo6pIHsN OnygXv4hvHoofbq/xPqY8264nBKruyJpHvCivULra2wiCeqaZSXf52JEsgQyjja0kl 9VdnmVv/Pk4pWjnUiyT1/Szg= Received: from zn.tnic (p5de8e020.dip0.t-ipconnect.de [93.232.224.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with UTF8SMTPSA id 588CF40E00DE; Sat, 28 Mar 2026 13:34:13 +0000 (UTC) Date: Sat, 28 Mar 2026 14:34:02 +0100 From: Borislav Petkov To: Fu Hao Cc: puwen@hygon.cn, tglx@kernel.org, mingo@redhat.com, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/8] x86/cpu/hygon: Adjust the die_id and logical_die_id for Hygon model 4h~8h Message-ID: <20260328133402.GTacfYymkTOQYG0Yu2@fat_crate.local> References: 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=utf-8 Content-Disposition: inline In-Reply-To: On Fri, Mar 27, 2026 at 04:07:31PM +0800, Fu Hao wrote: > The die id should be get from the NodeId field of CPUID leaf 0x8000001e ^^^^^^^^^^^^^ Pls run all your English text through an LLM so that corrects it for you. Also "die ID". > ecx for Hygon model 4h~8h processors. > > Signed-off-by: Fu Hao > --- > arch/x86/kernel/cpu/hygon.c | 15 +++++++++++++++ > 1 file changed, 15 insertions(+) > > diff --git a/arch/x86/kernel/cpu/hygon.c b/arch/x86/kernel/cpu/hygon.c > index 7f95a74e4..f39d32a68 100644 > --- a/arch/x86/kernel/cpu/hygon.c > +++ b/arch/x86/kernel/cpu/hygon.c > @@ -168,6 +168,19 @@ static void early_init_hygon(struct cpuinfo_x86 *c) > set_cpu_cap(c, X86_FEATURE_VMMCALL); > } > > +/* > + * Adjust the die_id and logical_die_id for Hygon model 4h~8h. What does "model 4h~8h" mean? Models 0x4-0x8 ? > + */ > +static void cpu_topology_fixup_hygon(struct cpuinfo_x86 *c) > +{ > + if (c->x86_model >= 0x4 && c->x86_model <= 0x8) { > + c->topo.die_id = cpuid_ecx(0x8000001e) & 0xff; > + c->topo.logical_die_id = (c->topo.die_id >> 4) * > + topology_amd_nodes_per_pkg() + > + (c->topo.die_id & 0xf); > + } > +} Does this really need to be a separate function or can you stick the if-conditional along with the comment where it needs to be executed? Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette