From patchwork Tue Feb 13 21:05:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 200617 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp810776dyb; Tue, 13 Feb 2024 13:11:39 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWeGbTEHeLIvRdAgGe3emTEbRistgiCUXkbpRVmq+VhC9+o0xDmTFV9RXSryn22wx1/LAzGhJ09D/8k7XxS91vKvQJXag== X-Google-Smtp-Source: AGHT+IHPSAPxpJ14TirFGNJ+j3+PDdPYjU1klwIoJnh+eWaW3zr8X+RmT2qDCYphWOQF+AjZKN3X X-Received: by 2002:a05:6214:3a08:b0:68c:e080:f47a with SMTP id nw8-20020a0562143a0800b0068ce080f47amr40055qvb.13.1707858699525; Tue, 13 Feb 2024 13:11:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707858699; cv=pass; d=google.com; s=arc-20160816; b=xLJVTiJU8cxlfWNvJ7ya+dvUFDEUHp2A3sJQhNijDyIemx4Cd2iSO6sG99hs/32lrh ZSmgXPiP7h9tDQ+QcVLHGMvbrtaV1bjRtKXZK9hskTmWh+YgP204zDohxrhgqxEBn52b 4pPKbnD75WOIMa69mQ58RG/XjWyomJ9sERCrd4yTe4thRZ4f1qu7QdKiWZ2vteutz4bV aOWvCxQVfsdr4JJx08uekHhsFwIDexP3d8zuwgTQJ6hVkLDTI+TYpOVsxz/55s8c25SI Ga3xouaLxW9y9AlOeBvv6b2+/Nn9sFy/qbNkzgwQosXXbQBi41Y5KzQNgbFhS0HYDZ5W u9fw== 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=llMrWt1Kw39fCMyEvjZlTz7WegsW0IGgjeWtd9mhHsU=; b=mb+hwuMkzuj7OXTTp/8R8RhtGAofiJih1W/8+0s2SsC7iiljmVH6oNbnZRUX7dSsrQ ZgyebuGiRp6eMPqW7J9+5Ub7V8nfeYS/AiXM3Bez80Fn2VU+48Mm6Z8BKMkNBeIM6h0m RBohyMWSed29Xwg2m4kxpZBdlg16LApbvcLZm2dfYU3DJquN3Jijz2ejEJTR+LyUdPXo cnBX7I7Sk9XAQeO70u24gkPLoj9ywh/yfVtwjw7lBwt96NAj4nofgzuKC/aZ0HoIuZoN Hm/mYHUeBksUL+7vA5PN9n3IcnrK7th6b6sqRG280EGc4Vft2cOxRKLkIdR6P9se756F glHQ==; 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-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64271-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de X-Forwarded-Encrypted: i=2; AJvYcCXciYOgPQgcwMmaECMt9+dz+FerUGKUR7wcZU+3HqanarBv42eOI1zszWJKFotKKgQ6p830AOlLemwAoIN8K4ZwnHtAow== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id iv10-20020ad45cea000000b0068064f2dc53si3809434qvb.434.2024.02.13.13.11.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 13:11:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-64271-ouuuleilei=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-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64271-ouuuleilei=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 542521C22916 for ; Tue, 13 Feb 2024 21:11:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AF0A66EB4E; Tue, 13 Feb 2024 21:05:10 +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 Date: Tue, 13 Feb 2024 22:05:04 +0100 (CET) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790819643667750103 X-GMAIL-MSGID: 1790819643667750103 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 = {