Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp450318rdb; Tue, 23 Jan 2024 04:56:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IHqnA60qcpaDbPtIfHMLAWyLBvvaMEh2wbNS/e3IAElL/2FnlwP8n5MOu4K1S+Tt4vK6jfw X-Received: by 2002:a25:abc7:0:b0:db5:50ea:d304 with SMTP id v65-20020a25abc7000000b00db550ead304mr2714737ybi.34.1706014562000; Tue, 23 Jan 2024 04:56:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706014561; cv=pass; d=google.com; s=arc-20160816; b=nnrTLx/AX9m7c+tbI0C/fT1FbQbnQRN+jlpfQmIPkohoAdDt5KSaczS2MlZE0BDJ33 vb33Z9/uI1uZ/ujrDMnfLsUN+Ux+E4FsyuZ9kAA8EWKRU7gvKl4E9t6RQ9OWihvcqTZo hgJcLlsBB13EQyNHnZU1Mvi0kv4TlgihtiCqTIySoQ5/zPkv+xPwrFdN3ObhHHYX5+so VFi9i0+fP9elOcEckQZOYskLU3XM+IMp9hxiZppUx00w1rIZH1g2X/CSr628EDzBD4B5 qqdmVDKjE8z03j4YVAgX+5QN0AaqGWLuP9avaUUZHh5MS6T+HJBTdH2b1Rbew+jvMqzm j0jg== 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=fmYc6qJRzN0mRUVfJX+xYNMGI0DYcYKnYErEVWkqbJE=; fh=Te0fDPJ/sd+7p881M6fa/oF213lBbJvGdEFWr/TLqNA=; b=ynG1OqSCGIyk1vAN06ZtDA/NcuqnSuTBwYZFic9F5mqFfM9b8LFQbE9GRk/uIZQOgF bAfT4epN1mrVGa6SS+N5KKpzPJaUJkeqRZ/l04ulWXFi5y8gWRkcLuH3UpOAPT6n7xTe pjlZxuNj2MUZ7KYBGKy9Xup7VYMX/4WQ2lCvkjrUpLCuIH20Ky1juesS8A2B65lxuKr/ JLzD0SWINbAAoU6AVWpGJV1/pLeEF9J/b0zL0MmN/DN6hc8+CKEMyAZ7tRBnfHOADLOO a/MwwuwXZRHMHMQyt2iagpdmsv5Pboctjf4dPwlPnFM5oR7XCrhCcIQEDK9JFHXyc+qd nVuQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=N5E32e75; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=Pg7qMvhH; 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-35274-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35274-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id h8-20020a0cf208000000b00681955dd564si7999565qvk.17.2024.01.23.04.56.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 04:56:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-35274-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=N5E32e75; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=Pg7qMvhH; 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-35274-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35274-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id BD2B01C22D21 for ; Tue, 23 Jan 2024 12:56:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C91CD60255; Tue, 23 Jan 2024 12:53:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="N5E32e75"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Pg7qMvhH" 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 A66655FF08 for ; Tue, 23 Jan 2024 12:53:48 +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=1706014430; cv=none; b=ojq/u4hk5nb2OhLNXdNIpDY1egRWzfl+vSabu+8Z0sOsM3tX9oMkSuU+sumB3P6KiaNeb2anDujg2Es/S+iWSJoatN64vsv3zHlTz/kzGcYGa4YeGZLGeKx7044uTthfZD0MdadMycXjcd5z429nUWqVrJxAh1hvi0W61B37iKU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706014430; c=relaxed/simple; bh=gFxZ6KbLw4Lt99rilp9cqM82dexaIth78lVoUc3FPnI=; h=Message-ID:From:To:Cc:Subject:References:MIME-Version: Content-Type:Date; b=f+rVH36zOoVLaJBgRNwxGJAfSrQanIiGc0z5HadzwC2oqN+1NdDB7CJLneirxui+jRJn2RMzeO0J4AnOCd7QnMNcOOxcfRAZ9iIaBt43p1CK5Bo3AszbSvGpen5Mnxk/B5G71IzgeZQ7Y4rguQUuGzD7buJHhKhPfjKMAq3U5x8= 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=N5E32e75; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=Pg7qMvhH; 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: <20240117115908.946275828@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1706014426; 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=fmYc6qJRzN0mRUVfJX+xYNMGI0DYcYKnYErEVWkqbJE=; b=N5E32e755CdPjnjokQF0HIWoyXW2Oon8EGUYDB/Hhb6bJ+mv02A2CSGqfx173Ho20aXoxf EGUf9t2e21nHb3W4vyXs1PO5BtZ5/kvyn05r8eK6zzz8w5FS/+XQYWPVNolyA2BaFL8DBN 5FeYjVKjHu+EM/E3AkRGKE33IWIYrn24GvPlCTY0HRIEMOqnwYQaNphO512ciB77+eewOy xvorRfkmnw42MLk/dPoBuhcV2RP1JfM7e9YzS3R0hlzF+pTfqDZTYq2PlpLYgg1XQF/WKL w31SmK+5/+xppfQkqdahY9SWaYUceBnivOP0qlbkzX/FCDdaTj47IgCp2/KoNQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1706014426; 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=fmYc6qJRzN0mRUVfJX+xYNMGI0DYcYKnYErEVWkqbJE=; b=Pg7qMvhH59ooLrRDLhSDZ0CcFRZhOPbqV562U44J8sSIdH8SYtGCSQtTdIdrxUkiucLVYF AcYH5UA/UPy2FFDg== 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)" Subject: [patch v5 10/19] x86/smpboot: Teach it about topo.amd_node_id References: <20240117115752.863482697@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, 23 Jan 2024 13:53:45 +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 --- 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 (boot_cpu_has(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)