Received: by 2002:a05:7412:2a91:b0:fc:a2b0:25d7 with SMTP id u17csp176089rdh; Tue, 13 Feb 2024 13:11:21 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV1RgQN3b6TX/Loepd6GsR/ItuEjnw33inZ5WmDFEM1TBqBWCXAY0mJd2AKVxEAwveNeHyrgfsIvbb6jWg+Ao47M1+6wj5LKuTDaLq9pQ== X-Google-Smtp-Source: AGHT+IFhPzIAbWI8JmRHfSzA0H712v6h74cWfve/WZDTPi9H6Si0L+o9LpNPR2SFs07uRWsnob6I X-Received: by 2002:a05:622a:1003:b0:42c:6e04:18f with SMTP id d3-20020a05622a100300b0042c6e04018fmr159550qte.0.1707858681177; Tue, 13 Feb 2024 13:11:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707858681; cv=pass; d=google.com; s=arc-20160816; b=yzbclMmT5uR343TmO4rIZOU20cdmVp73wiabGd7OlYvsNb65+KrrDq4BRPwOj6WmKx baQWBx1Wqe5yICWSDUgTKL6QcVfiBrZakZEchVfs1z87klIV/Ux+JukBm/UH2YHCmPmX Nv05PqWLMqS6JDxE7eDiuQuscOmhDXemC4K8rULiHAul9ucClZG9w4kuAjoos9dnfv6F 8OfEu2zU50auURcgPPfg1hhcyjfhklrt7dM+U3EXvBkhF+wqV4cNZRPG5nIVlqNI+O0l mte/EEI/fbJweGWCN+Iffd3Y6uc8nY9tLdURfIG+DYzwANGoIXbDoCHIGyKArxjRsyND oP/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=gVhd+douULzCtgDBreFZyPvTMBxpG3zFTSdanDfkXCw=; fh=pT7+7/4qriM3QrXOTCAst0TA8/mzpNOixajucs/Rr0c=; b=RpT+FXfhIwVOXS2WZXjo9ZH4P9aFyuCjmmugCdJbnEgSE6YhSJ3erlBWUsG9c7cdli wCTN8V8oO2JgjMNwXa/fb+YWHI7ziSepaMKX+D34up3SjUVzwzOFKorKsbeZJAjTZf99 jUFcsyV51+WGbZlpUB5DFnDmInl/Z0r1iv9FFINPwtACXpSfnbHy0cU7oyWdxLbbDdhU BfOgYQtgHcMuvGxg3Uv7LtYK3azj11S9GQ9B0ZK4nlLmqvxNj2FIeWWqIqDtAEJREmlO K+QsOWi2x1LJliMzUVvPnDH/Ls0RL23hEhqiwHZ2/Tjo7AwiMVtHHNqLqP6dsHdyrH6E wHVQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=lIfrOJs1; 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-64271-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64271-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; AJvYcCX/nLALRMRHSK+FyOw3gB4cR4S19YPfsnLDx35xyd2Q4n5C9+daSICP+j9eK3xWyrbB+t9yRzolwCyxD3sHAC3WsZZQnqh155WoAO+Hmw== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id b15-20020a05620a088f00b00785d69dda7csi5637803qka.38.2024.02.13.13.11.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 13:11:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-64271-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=lIfrOJs1; 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-64271-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64271-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 E4AE71C2222A for ; Tue, 13 Feb 2024 21:11:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E896F6A35C; Tue, 13 Feb 2024 21:05:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="lIfrOJs1"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="/69QRnWv" 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 A3BDD62143 for ; Tue, 13 Feb 2024 21:05:06 +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=1707858308; cv=none; b=nwatnXvbIggOCT8mHiIoBFDBtKt/JE3wyuIl7O3Gzw+SFKihPIkOob+BC6ao1pP3g94wNgH3NWgSYsiTOyagbnTsHkkLTcugnvLDtyzgBj7qj9m1/qMYhiQAj15k6os9EMnUSRHx6PKj7mktrUu78weTsPS+8kIU8tLNom8vTCk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707858308; c=relaxed/simple; bh=OH9i/6sHljeMHBBOlfRzZZbmmIB9/VmPJS89M329bvY=; h=Message-ID:From:To:Cc:Subject:References:MIME-Version: Content-Type:Date; b=MYFvXQxBDqzhifk5lfOpFT7xW7AZU7RD8PiSii4d89dsLODr5FHTBldigMYvg7PWwZTD61bokVJgkGpJp+a5/PvZTJhVzZ5YVONT4w25+secwFvZNgs80GPqPi2iLHF4hkTeL+OaPLKHZVYO8jXVkZEr9emrixerOHHSvTQaKOw= 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=lIfrOJs1; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=/69QRnWv; 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.433811243@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1707858305; 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=gVhd+douULzCtgDBreFZyPvTMBxpG3zFTSdanDfkXCw=; b=lIfrOJs1mYiD0f7xk4erYC8zZXa3nvgau6DI0WgquZB6VVevUSmoxCgstkIf92ixFVfLmn dNbgj+ulm5BOn6+j4J+7+HTQzbPA0r5y3O2k8zOMAmaHHZ4OSPVtb+mRLGUpO69XT5ghsl SzA653RUzahP4xb3Cy4tbCuUjLhEH0Rip+dw3fVh/aWcWzY9S2i9p3CGHnYR1ML6a4Pi2C o9MU1lgJDFg0CCioSgHAhyoJvv9mrWlrOmEodk+Sk+pUNFKetbX02wDIgSRhQkdLjkQDiB QDFC0cxYmaTc6lsHwplnhbCppjuK0KcMVKixeyHfn7yhwRhjRc+wpoNKPFyJ6w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1707858305; 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=gVhd+douULzCtgDBreFZyPvTMBxpG3zFTSdanDfkXCw=; b=/69QRnWvZHeR8yS1mghJRl3Asd6oA9tmlsPitBukwFEdJajmPpQdYZNRjRq7kJB3/fqyjl PK5ab7O1JJ0MWxCA== 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 10/22] x86/mpparse: Prepare for callback separation 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:04 +0100 (CET) From: Thomas Gleixner 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 int generic_processor_info(int apicid); --- 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 default_get_smp_config(unsigned int early) +void __init mpparse_get_smp_config(unsigned int early) { struct mpf_intel *mpf; @@ -538,6 +538,16 @@ void __init default_get_smp_config(unsig early_memunmap(mpf, sizeof(*mpf)); } +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 = { .setup_ioapic_ids = x86_init_noop, .find_mptable = mpparse_find_mptable, - .get_smp_config = default_get_smp_config, + .get_smp_config = mpparse_get_smp_config, }, .irqs = {