Received: by 2002:a05:7412:2a91:b0:fc:a2b0:25d7 with SMTP id u17csp173550rdh; Tue, 13 Feb 2024 13:06:11 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWQxcc0oyvBSpwOQO9bHQWHYop4VGthDbRVVq7EJV5Mc6fbCpno1iVmyeRtqLcnD9I3Jod5KvoCSgh6dAHYhDVdC25K8E5dNfzsOTiexg== X-Google-Smtp-Source: AGHT+IEjDzl+T2ktCfLTrz1JG2bZeXcyUoakZZ7iPdK7ykJsvQfCS4UyCnryk0DVhd0QXLX8Td1o X-Received: by 2002:ac2:4303:0:b0:511:974a:3cb with SMTP id l3-20020ac24303000000b00511974a03cbmr541876lfh.67.1707858371590; Tue, 13 Feb 2024 13:06:11 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707858371; cv=pass; d=google.com; s=arc-20160816; b=oqJZjZDdkTHKh5vRfpVKNw2ue5DcrLpCohSU7icuQ0fjeC1XYQa9/lSC7Gid8HQlOm R8P0GurTVG40Im+DQp2n69u556eZrnnoXk0TNVJhVcZV3rc0MNUj4wdn6akGhRW5hmp9 bQYOmf+mxd35V2czGB4dho2rTaSN7psOt2nutxhxn6tXI8GR81lQslEVucmPNBg1fcUQ +PHiA9yI4u1fOE39UxAJzHOVa59q9eECsmnrVbAfOlrIjiUq7VDzb+FTS9GUeoDsUauf n9ntKvUOXbYzd78+9CiHLSyE34y1lmSfd0DZNpafUEZzDHMLx5tcbKIC426lo9z/iaDO M0/g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=date:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:subject:cc:to:from:dkim-signature :dkim-signature:message-id; bh=UlFAs8Nix/tvFH+xhoOziGUDeHvRbRHk+x4whJ8zqu8=; fh=FXyUXDkCwpmuxhV+bAW4TWRLfgFq/0s3GR1/yptQeSk=; b=ybPx0E6z2RVYRLqG757h4xKhrLVykfxTzhG80Gopur4iIqqOGbB2OlmozzWW/COVqk 33lVby+1g2dxfIdTjWLAc6gb+ZljwWnU7kTNNEZ4a3mwVRyQcSZAJCM31LskFLiZdx5A jv1qt7nTLzbUtELm3YOanhNa2fcmF25qAY/bU7gQkAgXFpkGsWJSanFVxMHFDWGQyiAo hSGFksqLICbsizJpkuFwSF6IusSrcEPX4RREa0KT273uUUIHJZnn28ho9IYYZQwS3+CP M3/5LHAo0Ezs3uKtYJGETt1gq/rQY1/djXev7G+YpOLblu5O6mFDZpHwy/B/qs2c0Q0P uVwQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=LsSHLMz0; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-64249-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64249-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de X-Forwarded-Encrypted: i=2; AJvYcCUtvkVW5uz46mDtp732RXopvhA525t1o0lKRmeKRe/MAQp2ONWgOx6DTp5EwpICynpzJdKsc9kJ8t5qP2cHvV/SBZg1C55Bu73lBaOpIQ== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id ci19-20020a170906c35300b00a3d276482b5si323875ejb.802.2024.02.13.13.06.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 13:06:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-64249-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=LsSHLMz0; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-64249-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64249-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 5425E1F283B8 for ; Tue, 13 Feb 2024 21:06:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3FCAE62A17; Tue, 13 Feb 2024 21:04:17 +0000 (UTC) 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+" 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 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)