From nobody Fri Dec 19 19:00:14 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AC8F5C001DB for ; Mon, 7 Aug 2023 13:53:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234571AbjHGNxi (ORCPT ); Mon, 7 Aug 2023 09:53:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234548AbjHGNw5 (ORCPT ); Mon, 7 Aug 2023 09:52:57 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1D6D1BCE for ; Mon, 7 Aug 2023 06:52:52 -0700 (PDT) Message-ID: <20230807135027.012341767@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1691416371; 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=C8gfQrn6Fv0quhrh8RYsTvXPC0AFtY95rXW+OtM42Wk=; b=DKmxB+Z4VxY3hYFXe9mL1sA7++zNl5UOjD8pk9tWSjse4jqL55SsQwtNsk9QHAscdsGB/A OPZS0QKCS9AIztKFys5IZEbY4EAEofzGyksYHySiGSFQuf7kHJcd8mCofQujbcIk5QniR9 /OKT5S72akKKvgdGUC7F6WXg0e1RsSBHRXE/N88fvGQxURY8L3845r1QOmJYvoJeKu+GTw QYkSyCt0A2XYl4cBOM/AHyukjw5zm5LoYwUFdFMiU7xdghxaYX22K49cUJl6khFyn9oxgt ZzaKMnH/b8fRQSlFR/xOqjdEJcCf9hGgbnvGmdbADZz3gsNfmMwUIllGLhGkNg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1691416371; 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=C8gfQrn6Fv0quhrh8RYsTvXPC0AFtY95rXW+OtM42Wk=; b=nwkebDq1IoFYG9EoDAFOF+lAlqAORa2af+/vjE/NHeusFrzxdp9TBeeU+AFC9IzAEougkN fwPDyaWA83oIHYDg== From: Thomas Gleixner To: LKML Cc: x86@kernel.org, Tom Lendacky , Andrew Cooper , Arjan van de Ven , Huang Rui , Juergen Gross , Dimitri Sivanich , Michael Kelley , Sohil Mehta , K Prateek Nayak , Kan Liang , Zhang Rui , "Paul E. McKenney" , Feng Tang , Andy Shevchenko Subject: [patch 11/53] x86/mpparse: Prepare for callback separation References: <20230807130108.853357011@linutronix.de> MIME-Version: 1.0 Date: Mon, 7 Aug 2023 15:52:50 +0200 (CEST) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" In preparation of splitting the get_smp_config() callback, rename default_get_smp_config() to mpparse_get_smp_config() and provide an early and late wrapper. Signed-off-by: Thomas Gleixner --- arch/x86/include/asm/mpspec.h | 12 ++++++++---- arch/x86/kernel/mpparse.c | 12 +++++++++++- arch/x86/kernel/x86_init.c | 2 +- 3 files changed, 20 insertions(+), 6 deletions(-) --- a/arch/x86/include/asm/mpspec.h +++ b/arch/x86/include/asm/mpspec.h @@ -60,12 +60,16 @@ static inline void early_get_smp_config( extern void e820__memblock_alloc_reserved_mpc_new(void); extern int enable_update_mptable; extern void mpparse_find_mptable(void); -extern void default_get_smp_config(unsigned int early); +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 default_get_smp_config x86_init_uint_noop +#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 =20 int generic_processor_info(int apicid); --- a/arch/x86/kernel/mpparse.c +++ b/arch/x86/kernel/mpparse.c @@ -476,7 +476,7 @@ static int __init check_physptr(struct m /* * Scan the memory blocks for an SMP configuration block. */ -void __init default_get_smp_config(unsigned int early) +void __init mpparse_get_smp_config(unsigned int early) { struct mpf_intel *mpf; =20 @@ -541,6 +541,16 @@ void __init default_get_smp_config(unsig early_memunmap(mpf, sizeof(*mpf)); } =20 +void __init mpparse_parse_early_smp_config(void) +{ + mpparse_get_smp_config(true); +} + +void __init mpparse_parse_smp_config(void) +{ + mpparse_get_smp_config(false); +} + static void __init smp_reserve_memory(struct mpf_intel *mpf) { memblock_reserve(mpf->physptr, get_mpc_size(mpf->physptr)); --- a/arch/x86/kernel/x86_init.c +++ b/arch/x86/kernel/x86_init.c @@ -71,7 +71,7 @@ struct x86_init_ops x86_init __initdata .mpparse =3D { .setup_ioapic_ids =3D x86_init_noop, .find_mptable =3D mpparse_find_mptable, - .get_smp_config =3D default_get_smp_config, + .get_smp_config =3D mpparse_get_smp_config, }, =20 .irqs =3D {