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 EABF8629E9 for ; Tue, 13 Feb 2024 21:04:14 +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=1707858256; cv=none; b=OkIBNpro45P3tWmaskWx5+1Vczls9NbGYD+Gz8FdC6ScQkFW83FumOLHAscjabfAcbQ4kmGX11JdMaIaR/Rk4q/26nHui/jwN/ntyZUbIIbpXl7EaXD9ed+/3XZoHX50Sr3TCBlBpG2EZmFHDta+aDIghI1F1hAcwaAG264MSc4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707858256; c=relaxed/simple; bh=RWb1lEoykiTkGHk6zCqksPw05e7o9Z5OQCILoRMlhiY=; h=Message-ID:From:To:Cc:Subject:References:MIME-Version: Content-Type:Date; b=A8EXO5CkPFbRTD6Hr0P33j9PaPMVLqYh0v0aZ2yghOQ1bG4woKmAGPoA7M8p41W7qLQfBHSNFJmqcO/uHtVT7iUqZ641PzNWkb0Gr4YnakzbDpbJ9t8h5fNcYfvRNadWgReRiGq12a8fZckFZgPEMtoDoEXBjumMiiH/2TS5Mvs= 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=LsSHLMz0; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=KS3DzFF+; 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="LsSHLMz0"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="KS3DzFF+" Message-ID: <20240212153625.082979150@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1707858253; 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: references:references; bh=UlFAs8Nix/tvFH+xhoOziGUDeHvRbRHk+x4whJ8zqu8=; b=LsSHLMz0i/FehNnINr5tNxK+W691nm1t1Cr9k7daWWCxj7LllT8nmqHkKLK7ZILRefkwya 45ixeUt15Cslb8hI/WTranwCiP93h+V/h72Q+YPspmdgS2hmRi1cZVfKn/eS4bt2po+0gP FR5mRO3/qMJ9uxgb8x4fPp5N0R7FJcoz+NEz0QVMO9/F0sep3N4qtQrVi7BfwgKL0YAzQ1 llTcvJGJuDHtI4F802BR+rmzYQHLoM8dWmrRdJLhteT9q2eZW6AkC+NNQFjcoA1nOutz0z Dv//7Ah+L4b61T1mVJ9OwLGCKloJs2u0i4uBHnt+TnTAFnJS/l4OeSFr8xbSdg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1707858253; 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: references:references; bh=UlFAs8Nix/tvFH+xhoOziGUDeHvRbRHk+x4whJ8zqu8=; b=KS3DzFF+sy7z7gAicI2h3SWyyaPXRexOL7HhUSA6b+agz4+u9vqNZCSdlse3UKWmJusLNS uB5d4PBv2yXWclBQ== From: Thomas Gleixner To: LKML Cc: x86@kernel.org, Tom Lendacky , Andrew Cooper , Arjan van de Ven , Huang Rui , Juergen Gross , Dimitri Sivanich , Sohil Mehta , K Prateek Nayak , Kan Liang , Zhang Rui , "Paul E. McKenney" , Feng Tang , Andy Shevchenko , Michael Kelley , "Peter Zijlstra (Intel)" , Wang Wendy Subject: [patch V6 10/19] x86/smpboot: Teach it about topo.amd_node_id References: <20240212153109.330805450@linutronix.de> 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 Date: Tue, 13 Feb 2024 22:04:13 +0100 (CET) From: Thomas Gleixner When switching AMD over to the new topology parser then the match functions need to look for AMD systems with the extended topology feature at the new topo.amd_node_id member which is then holding the node id information. Signed-off-by: Thomas Gleixner Tested-by: Juergen Gross Tested-by: Sohil Mehta Tested-by: Michael Kelley Tested-by: Zhang Rui Tested-by: Wang Wendy --- V6: Use cpu_feature_enabled() - Borislav --- arch/x86/kernel/smpboot.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) --- --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c @@ -488,6 +488,7 @@ static bool match_smt(struct cpuinfo_x86 if (c->topo.pkg_id == o->topo.pkg_id && c->topo.die_id == o->topo.die_id && + c->topo.amd_node_id == o->topo.amd_node_id && per_cpu_llc_id(cpu1) == per_cpu_llc_id(cpu2)) { if (c->topo.core_id == o->topo.core_id) return topology_sane(c, o, "smt"); @@ -509,10 +510,13 @@ static bool match_smt(struct cpuinfo_x86 static bool match_die(struct cpuinfo_x86 *c, struct cpuinfo_x86 *o) { - if (c->topo.pkg_id == o->topo.pkg_id && - c->topo.die_id == o->topo.die_id) - return true; - return false; + if (c->topo.pkg_id != o->topo.pkg_id || c->topo.die_id != o->topo.die_id) + return false; + + if (cpu_feature_enabled(X86_FEATURE_TOPOEXT) && topology_amd_nodes_per_pkg() > 1) + return c->topo.amd_node_id == o->topo.amd_node_id; + + return true; } static bool match_l2c(struct cpuinfo_x86 *c, struct cpuinfo_x86 *o)