Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp1169767rdb; Fri, 16 Feb 2024 07:21:59 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUzI8zQgkc+CvS3N5swBt5Yzxc8WOA2IaiddTmvJ8G3/qwYtOsD4E5aTTBabGL2F7/oEyDUhuIno5zU6qBV+NjRr+zyO6u+UJ94POMdjw== X-Google-Smtp-Source: AGHT+IGTa32CC1E32xzOLUw/9Xwokvd+fQMeqDeuWQtSHEmXWRhC+Uk6lc8voKxenvJHb/cfpakh X-Received: by 2002:a17:902:8f8a:b0:1db:55cc:d226 with SMTP id z10-20020a1709028f8a00b001db55ccd226mr4325678plo.66.1708096919599; Fri, 16 Feb 2024 07:21:59 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708096919; cv=pass; d=google.com; s=arc-20160816; b=SpFCBfGVnwPeB230R/uWP5HgdbJCGR7EJ9C8WaIO/SiSP1Rpi6PvF/l80t6Szd/XhC wYmiuqMgNlS2TSFDZMfq1g73xAIuwPFozYsqaIKPW671Xh9l+Ii7lPaZeLgWqh406QjW f9v3PcdjovHy1VUuPG58uqww/detMuB21tByiHVojjMJ8IMdViJjXrcEbZ5RpUJyjPV4 19X7jw7zojaO3B6yMazPrno5Ywrw/XHN/Wm0mf9UTWhBo9fqvFGDMmXH3NExypwlTHPK QM/X2ygltYFw57+zH5vA3rengs4asIP6e1VZlKN9lnu10WmMvk9FNrtxRA47yFzqNGM2 Nm+w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:precedence:robot-unsubscribe:robot-id :message-id:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:in-reply-to:cc:subject:to:reply-to:sender :from:dkim-signature:dkim-signature:date; bh=i9SZ1GfnMuBHVW5yv9SZS4/73ty5TsHvMTRmf+02IKk=; fh=HfXWoIhgCc+vt39DMIJv/Ec0aAKnw0eFA8QxuIQTUoQ=; b=CMog5aJR+ANPKxAuNd4//gG6azTyV7VClbQi+V2YOUL4gYd2Z3A0KApOpGwjoRAYxo MSfRSHQCIglpNBFZaYOT1GvO4uvbi/CoTbAgZireRvAU3qy5xl4MPSWrrdaaRhEJpLwN LcfBy4c9kfBqzL2qFGzim1n3PXK//DARfbwLFHvxrKDSw+/idmn4Jyh1J2J5tCnLtggA XdFyT6aEutxM5SacNJM7cliEBuvcPdv/qMaNf0y91DjWseUGC642OmXUhV04bvMeKQEZ 8dVYMjUu84FPQAodBDMdsATD9xmX/YbJGpPPN8KRZ/nhMBZ3UQoc8tGsYPnN4qvfvSGK I7ag==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=FE2LLrM4; 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-68814-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68814-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id na15-20020a17090b4c0f00b002992279bb11si109562pjb.10.2024.02.16.07.21.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 07:21:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-68814-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=FE2LLrM4; 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-68814-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68814-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 9C298283797 for ; Fri, 16 Feb 2024 15:21:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 35C1F137C41; Fri, 16 Feb 2024 15:17:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="FE2LLrM4"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="EzkP9Xsk" 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 9C07F135415; Fri, 16 Feb 2024 15:17:07 +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=1708096629; cv=none; b=UtapIiy9iBRWMAqDIWAnn0SSvmMuVnRpthMFgnQOC0ScZEqD5G4FcxX7vpUZeZDj0WfbYLSNECfNNWZumW4qikryYkw8NtRUqzWyDD60JgFPmZYJQTClZrNQcc3qSyiP5BK/XpmF2B3ZD2w9CRk8clTj6TNzz97Fu/OcdXmyWy4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708096629; c=relaxed/simple; bh=Aoid/j/2kJ1H3MzhNhcYn/1lICaVzaVs8c3hTgP/iNM=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=DrTNSXeOtjJGZT1f5w1KwIvvobjgpUtGc443UgV0fzOHaRhL6mtcrgqQrjmsxArpulx08gAVfIiMM8Lm8qFth6RnDuTrykS/yBRsusjj+da6jBuWZJ11HGlXQr5eiQU9uk2D0+1BQayicQLpB/Qp+11lAE5Z3ps8n0r06kY20Hc= 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=FE2LLrM4; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=EzkP9Xsk; 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 Date: Fri, 16 Feb 2024 15:17:05 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1708096626; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=i9SZ1GfnMuBHVW5yv9SZS4/73ty5TsHvMTRmf+02IKk=; b=FE2LLrM4LKdzGglEipZYSPpQ8WTSha6la1K+6wYtuR4OZs+HAlcn8rGCWOJNkEkEfOtZlv YthUG01VSafsg0KYN47jLHHzt8l7Lbj2r0Ce2UPtZ11nQMRHbLP9g1OyU2HJoPDRNMiBOQ tPtrcLJvaGVdSU3FTSPqnOe0bNsYWAEBvTcuou3gxz75jX0Mn3JeEF7z7uB0dLHsVA7f30 LuPplnHycjxa4A7umkAjLj3jF8eqTDPelgiPNGHjzhyF6z9jMDHop66FUmiBlULcb7Pxho /mK98CmvXUAVvqchI4kNxcvgrgBJNLMdODACTwhjS9fa+Bu8RxQ3eym/HlDvuw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1708096626; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=i9SZ1GfnMuBHVW5yv9SZS4/73ty5TsHvMTRmf+02IKk=; b=EzkP9XskpTWP+/OsYKl4t7NcYaINUrapw+hr9itaphZNTXVBWVRrlBiZzRZB7nEOFVge3x 7I7EaQHtC7pErLDA== From: "tip-bot2 for Thomas Gleixner" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/apic] x86/mpparse: Use new APIC registration function Cc: Thomas Gleixner , Michael Kelley , Sohil Mehta , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20240213210251.830955273@linutronix.de> References: <20240213210251.830955273@linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <170809662543.398.9851688228218743226.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit The following commit has been merged into the x86/apic branch of tip: Commit-ID: 8098428c541212e9835c1771ee90caa968ffef4f Gitweb: https://git.kernel.org/tip/8098428c541212e9835c1771ee90caa968ffef4f Author: Thomas Gleixner AuthorDate: Tue, 13 Feb 2024 22:05:42 +01:00 Committer: Thomas Gleixner CommitterDate: Thu, 15 Feb 2024 22:07:42 +01:00 x86/mpparse: Use new APIC registration function Aside of switching over to the new interface, record the number of registered CPUs locally, which allows to make num_processors and disabled_cpus confined to the topology code. No functional change intended. Signed-off-by: Thomas Gleixner Tested-by: Michael Kelley Tested-by: Sohil Mehta Link: https://lore.kernel.org/r/20240213210251.830955273@linutronix.de --- arch/x86/include/asm/mpspec.h | 2 -- arch/x86/kernel/cpu/topology.c | 2 +- arch/x86/kernel/mpparse.c | 17 +++++++++-------- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/arch/x86/include/asm/mpspec.h b/arch/x86/include/asm/mpspec.h index 1b79d0e..c72c7ff 100644 --- a/arch/x86/include/asm/mpspec.h +++ b/arch/x86/include/asm/mpspec.h @@ -61,8 +61,6 @@ static inline void e820__memblock_alloc_reserved_mpc_new(void) { } #define mpparse_parse_smp_config x86_init_noop #endif -int generic_processor_info(int apicid); - extern DECLARE_BITMAP(phys_cpu_present_map, MAX_LOCAL_APIC); static inline void reset_phys_cpu_present_map(u32 apicid) diff --git a/arch/x86/kernel/cpu/topology.c b/arch/x86/kernel/cpu/topology.c index 3dd7e6c..669e258 100644 --- a/arch/x86/kernel/cpu/topology.c +++ b/arch/x86/kernel/cpu/topology.c @@ -133,7 +133,7 @@ static void cpu_update_apic(int cpu, u32 apicid) cpu_mark_primary_thread(cpu, apicid); } -int generic_processor_info(int apicid) +static int generic_processor_info(int apicid) { int cpu, max = nr_cpu_ids; diff --git a/arch/x86/kernel/mpparse.c b/arch/x86/kernel/mpparse.c index 9c000c4..1ccd30c 100644 --- a/arch/x86/kernel/mpparse.c +++ b/arch/x86/kernel/mpparse.c @@ -36,6 +36,8 @@ * Checksum an MP configuration block. */ +static unsigned int num_procs __initdata; + static int __init mpf_checksum(unsigned char *mp, int len) { int sum = 0; @@ -50,16 +52,15 @@ static void __init MP_processor_info(struct mpc_cpu *m) { char *bootup_cpu = ""; - if (!(m->cpuflag & CPU_ENABLED)) { - disabled_cpus++; + topology_register_apic(m->apicid, CPU_ACPIID_INVALID, m->cpuflag & CPU_ENABLED); + if (!(m->cpuflag & CPU_ENABLED)) return; - } if (m->cpuflag & CPU_BOOTPROCESSOR) bootup_cpu = " (Bootup-CPU)"; pr_info("Processor #%d%s\n", m->apicid, bootup_cpu); - generic_processor_info(m->apicid); + num_procs++; } #ifdef CONFIG_X86_IO_APIC @@ -236,9 +237,9 @@ static int __init smp_read_mpc(struct mpc_table *mpc, unsigned early) } } - if (!num_processors) + if (!num_procs && !acpi_lapic) pr_err("MPTABLE: no processors registered!\n"); - return num_processors; + return num_procs || acpi_lapic; } #ifdef CONFIG_X86_IO_APIC @@ -529,8 +530,8 @@ static __init void mpparse_get_smp_config(unsigned int early) } else BUG(); - if (!early) - pr_info("Processors: %d\n", num_processors); + if (!early && !acpi_lapic) + pr_info("Processors: %d\n", num_procs); /* * Only use the first configuration found. */