Received: by 2002:a05:7412:2a91:b0:fc:a2b0:25d7 with SMTP id u17csp176924rdh; Tue, 13 Feb 2024 13:13:04 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWTHI8gcA7JtI7SyTD8BnantTX7R/ePSXvxGSRUHerpLzv0FwGj9Qz53BJkn9/2I0sVSWIb/7uvnAm6TtoLXSmWEhoBXGlgBRY73tGqMA== X-Google-Smtp-Source: AGHT+IFFMmJyeJJaYFvasMds1ZTkNQB4D5bDuMpAiL3FQcNAC1UN6SQcAab7G5NFD99YJ05Had99 X-Received: by 2002:aa7:d3cc:0:b0:55f:63ac:2425 with SMTP id o12-20020aa7d3cc000000b0055f63ac2425mr551195edr.41.1707858784302; Tue, 13 Feb 2024 13:13:04 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707858784; cv=pass; d=google.com; s=arc-20160816; b=WM3w1GXFZHNhJkmfVEYduK9YIrP46L9TRT6aZUIwMsRHTDv11hPdtLKnOb5v+/4STj oLVdtkPSTi/Sksc/s7rJlc8hZw9rlcsWcfoG4tZE/3HjdTRp/ByXpDF6b/PBNJBlueqY H6SmL0stii6mGEPe6dFcMzKj0Xko2Kq8aRC7v3/fo34oVPVCyNtuXcHaeAe917F1H1Vk uVWTpHVlk01z1JboyBUcX4XDvVm3UuBITyggFYmtW1bt+Tn1WrWk36CRu6wygpTNQkjL NJGeA0OZJckCsS3m0Rx1PBE9i1EgBgly+PRY0SUhjzwIise1dTKtD4ZBvh1FRau4b0BW Q2CA== 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=7D2j8eDUL7diO4fhC1fgChNoqXQgRII6tyTbXDTQUtI=; fh=xpXHwGLcde1diGRVNdy2ixniBC4rVRvBY656YYApGU0=; b=FnFr1JOgeef3si1E2loujVcxY8uepQh9/y73B4w78vxIHT8zWd3A1Se5lWPKO1pmnk pTuzxyoDHiM7aXCQXycCl4tTpPujQ576rMp+nO5ZW5oOpWx9jJIM3Ds3osNBb+3UDlv0 xwHW2UtSgGLLI9hDgTFByfDbMrOdoNbhSpYJCYub7ewBicLm4DDwUu8fPI1ZRlPz/kui EU3LhVYY2MWx9qvj1hw9soT/osAvN6YuRWKjsFwm4P+XwN+uCTHhDME9l36HA89a2zXW jnPo4XBljza7HqKVfJ2U+7EkitIqiiOb6BQ6x7lG7xDLqt+eAYY+kcPkNAfUWxsEPADb z5xg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=EKBQKfJK; 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-64278-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64278-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; AJvYcCVdontLuG5NFtRyQQBMJoEKPGLuCU8mMZNNJMx/DVMuIv2KtNUWR+08HyQYINJw8tTt11+YwzTpEpPdL2xK5KjEO+ZLphVKmrbesrDI5w== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id b6-20020a056402350600b005619df31a97si2946135edd.446.2024.02.13.13.13.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 13:13:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-64278-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=EKBQKfJK; 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-64278-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64278-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 A58221F2255E for ; Tue, 13 Feb 2024 21:13:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7840577A0E; Tue, 13 Feb 2024 21:05:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="EKBQKfJK"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="KYeH+5CS" 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 9571377631 for ; Tue, 13 Feb 2024 21:05:16 +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=1707858318; cv=none; b=jnIFAynI/G1DAhMiPwFpmVWYsheahNPckkNNNa80tCr37WsTIqt6y9yuD2IW2jrd2BpOuzRn13kLGBBI4cEYkKvFEPtnEpWFZfyxAdljq5JrDUpS925qP5oV53kgBD4d/9o6xAKazf8oDSHZV2OLwOKrs9ls+qWk3jjKRxUsVLk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707858318; c=relaxed/simple; bh=k/szfxyZlFizXrKIW2lucYsX2npIpQI3Ye1rN8D4uRg=; h=Message-ID:From:To:Cc:Subject:References:MIME-Version: Content-Type:Date; b=Q+FRkZJeFQ1gSCISOAQ/mblNQDvHSpq4nJG/9o4i4mql9BsBqOoFS5ZKIpTo+uzrzqsXFRQO7oIo+kYsaf/MFwz2BC1hwgbAo3HYi2sV5lGLC06VPmxcTZ1Xbge/bdwN9FWVHfRf66ObnJBHZ8V1oQZBtmPV9XSIeM0Ecp7rkAs= 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=EKBQKfJK; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=KYeH+5CS; 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: <20240212154639.870883080@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1707858315; 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=7D2j8eDUL7diO4fhC1fgChNoqXQgRII6tyTbXDTQUtI=; b=EKBQKfJK9GB2YqT70t9cNIYCHrpWnwQsM8ZAgu841YMgwYer8RD6jyOChEpvg22lVdpfhg WV17+uMwdc+fw4ZKdisSQYEiW+mTMfJRaCfSEm/jj/u11C9tln4duhjs5++VcqXwqoPf0U BDMmrsRpbcXaduMIRhHcwpb4QVWDu9vzwEabfFOghbJ7Tpx6rAn8j6an9ebzphAYXfJwXR KH/bb4SE3sFTz2LEoOFBgw/6Q2CJOg7Cdd1nrHRz5SXMB5NlY/hDPR3Q4ECQqV0HUn73Zf SjnPH3jIAZ7bhOeUR1hHiRFnjxJqSi7dsmyvXMn126uDcIaGCyFQL0gYUn9gqQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1707858315; 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=7D2j8eDUL7diO4fhC1fgChNoqXQgRII6tyTbXDTQUtI=; b=KYeH+5CSf0VxBjyo6QVmmyNWEs1s7eAkT9hqy86Ag3Omt8C1QuomqzuCQ+zPeLsSbOKyVE jb82lTIiYpoq0mAQ== 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)" , Andy Shevchenko , Wei Liu Subject: [patch V3 17/22] x86/mpparse: Switch to new init callbacks References: <20240212154529.402604963@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:05:14 +0100 (CET) From: Thomas Gleixner Now that all platforms have the new split SMP configuration callbacks set up, flip the switch and remove the old callback pointer and mop up the platform code. Signed-off-by: Thomas Gleixner --- arch/x86/hyperv/hv_vtl.c | 1 - arch/x86/include/asm/mpspec.h | 9 +-------- arch/x86/include/asm/x86_init.h | 2 -- arch/x86/kernel/jailhouse.c | 8 +------- arch/x86/kernel/mpparse.c | 2 +- arch/x86/kernel/setup.c | 10 +++------- arch/x86/kernel/x86_init.c | 3 ++- arch/x86/platform/ce4100/ce4100.c | 1 - arch/x86/platform/intel-mid/intel-mid.c | 1 - arch/x86/xen/smp_pv.c | 11 +---------- 10 files changed, 9 insertions(+), 39 deletions(-) --- --- a/arch/x86/hyperv/hv_vtl.c +++ b/arch/x86/hyperv/hv_vtl.c @@ -29,7 +29,6 @@ void __init hv_vtl_init_platform(void) x86_init.mpparse.find_mptable = x86_init_noop; x86_init.mpparse.early_parse_smp_cfg = x86_init_noop; x86_init.mpparse.parse_smp_cfg = x86_init_noop; - x86_init.mpparse.get_smp_config = x86_init_uint_noop; x86_platform.get_wallclock = get_rtc_noop; x86_platform.set_wallclock = set_rtc_noop; --- a/arch/x86/include/asm/mpspec.h +++ b/arch/x86/include/asm/mpspec.h @@ -46,14 +46,9 @@ extern int smp_found_config; # define smp_found_config 0 #endif -static inline void get_smp_config(void) -{ - x86_init.mpparse.get_smp_config(0); -} - static inline void early_get_smp_config(void) { - x86_init.mpparse.get_smp_config(1); + x86_init.mpparse.early_parse_smp_cfg(); } #ifdef CONFIG_X86_MPPARSE @@ -62,14 +57,12 @@ extern int enable_update_mptable; extern void mpparse_find_mptable(void); extern void mpparse_parse_early_smp_config(void); extern void mpparse_parse_smp_config(void); -extern void mpparse_get_smp_config(unsigned int early); #else static inline void e820__memblock_alloc_reserved_mpc_new(void) { } #define enable_update_mptable 0 #define mpparse_find_mptable x86_init_noop #define mpparse_parse_early_smp_config x86_init_noop #define mpparse_parse_smp_config x86_init_noop -#define mpparse_get_smp_config x86_init_uint_noop #endif int generic_processor_info(int apicid); --- a/arch/x86/include/asm/x86_init.h +++ b/arch/x86/include/asm/x86_init.h @@ -16,14 +16,12 @@ struct irq_domain; * struct x86_init_mpparse - platform specific mpparse ops * @setup_ioapic_ids: platform specific ioapic id override * @find_mptable: Find MPTABLE early to reserve the memory region - * @get_smp_config: get the smp configuration * @early_parse_smp_cfg: Parse the SMP configuration data early before initmem_init() * @parse_smp_cfg: Parse the SMP configuration data */ struct x86_init_mpparse { void (*setup_ioapic_ids)(void); void (*find_mptable)(void); - void (*get_smp_config)(unsigned int early); void (*early_parse_smp_cfg)(void); void (*parse_smp_cfg)(void); }; --- a/arch/x86/kernel/jailhouse.c +++ b/arch/x86/kernel/jailhouse.c @@ -89,7 +89,7 @@ static void __init jailhouse_x2apic_init #endif } -static void __init jailhouse_get_smp_config(unsigned int early) +static void __init jailhouse_parse_smp_config(void) { struct ioapic_domain_cfg ioapic_cfg = { .type = IOAPIC_DOMAIN_STRICT, @@ -118,11 +118,6 @@ static void __init jailhouse_get_smp_con } } -static void __init jailhouse_parse_smp_config(void) -{ - jailhouse_get_smp_config(false); -} - static void jailhouse_no_restart(void) { pr_notice("Jailhouse: Restart not supported, halting\n"); @@ -211,7 +206,6 @@ static void __init jailhouse_init_platfo x86_init.mpparse.find_mptable = x86_init_noop; x86_init.mpparse.early_parse_smp_cfg = x86_init_noop; x86_init.mpparse.parse_smp_cfg = jailhouse_parse_smp_config; - x86_init.mpparse.get_smp_config = jailhouse_get_smp_config; x86_init.pci.arch_init = jailhouse_pci_arch_init; x86_platform.calibrate_cpu = jailhouse_get_tsc; --- a/arch/x86/kernel/mpparse.c +++ b/arch/x86/kernel/mpparse.c @@ -473,7 +473,7 @@ static int __init check_physptr(struct m /* * Scan the memory blocks for an SMP configuration block. */ -void __init mpparse_get_smp_config(unsigned int early) +static __init void mpparse_get_smp_config(unsigned int early) { struct mpf_intel *mpf; --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -1128,15 +1128,11 @@ void __init setup_arch(char **cmdline_p) early_quirks(); /* - * Read APIC and some other early information from ACPI tables. + * Parse SMP configuration. Try ACPI first and then the platform + * specific parser. */ acpi_boot_init(); - x86_dtb_parse_smp_config(); - - /* - * get boot-time SMP configuration: - */ - get_smp_config(); + x86_init.mpparse.parse_smp_cfg(); /* * Systems w/o ACPI and mptables might not have it mapped the local --- a/arch/x86/kernel/x86_init.c +++ b/arch/x86/kernel/x86_init.c @@ -71,7 +71,8 @@ struct x86_init_ops x86_init __initdata .mpparse = { .setup_ioapic_ids = x86_init_noop, .find_mptable = mpparse_find_mptable, - .get_smp_config = mpparse_get_smp_config, + .early_parse_smp_cfg = mpparse_parse_early_smp_config, + .parse_smp_cfg = mpparse_parse_smp_config, }, .irqs = { --- a/arch/x86/platform/ce4100/ce4100.c +++ b/arch/x86/platform/ce4100/ce4100.c @@ -140,7 +140,6 @@ void __init x86_ce4100_early_setup(void) x86_init.mpparse.find_mptable = x86_init_noop; x86_init.mpparse.early_parse_smp_cfg = x86_init_noop; x86_init.mpparse.parse_smp_cfg = x86_dtb_parse_smp_config; - x86_init.mpparse.get_smp_config = x86_init_uint_noop; x86_init.pci.init = ce4100_pci_init; x86_init.pci.init_irq = sdv_pci_init; --- a/arch/x86/platform/intel-mid/intel-mid.c +++ b/arch/x86/platform/intel-mid/intel-mid.c @@ -121,6 +121,5 @@ void __init x86_intel_mid_early_setup(vo x86_init.mpparse.find_mptable = x86_init_noop; x86_init.mpparse.early_parse_smp_cfg = x86_init_noop; x86_init.mpparse.parse_smp_cfg = x86_init_noop; - x86_init.mpparse.get_smp_config = x86_init_uint_noop; set_bit(MP_BUS_ISA, mp_bus_not_pci); } --- a/arch/x86/xen/smp_pv.c +++ b/arch/x86/xen/smp_pv.c @@ -148,14 +148,11 @@ int xen_smp_intr_init_pv(unsigned int cp return rc; } -static void __init _get_smp_config(unsigned int early) +static void __init xen_pv_smp_config(void) { int i, rc; unsigned int subtract = 0; - if (early) - return; - num_processors = 0; disabled_cpus = 0; for (i = 0; i < nr_cpu_ids; i++) { @@ -185,11 +182,6 @@ static void __init _get_smp_config(unsig smp_found_config = 1; } -static void __init xen_pv_smp_config(void) -{ - _get_smp_config(false); -} - static void __init xen_pv_smp_prepare_boot_cpu(void) { BUG_ON(smp_processor_id() != 0); @@ -463,5 +455,4 @@ void __init xen_smp_init(void) x86_init.mpparse.find_mptable = x86_init_noop; x86_init.mpparse.early_parse_smp_cfg = x86_init_noop; x86_init.mpparse.parse_smp_cfg = xen_pv_smp_config; - x86_init.mpparse.get_smp_config = _get_smp_config; }