From patchwork Mon Aug 7 13:53:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 132141 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp1516935vqr; Mon, 7 Aug 2023 08:10:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGvxnOexAubSB6pjBFo/v9Nlej6CadweZREJOiwhjlyFGMomlzfmHELHviFp8/wGcvvfH3V X-Received: by 2002:a17:906:8a6d:b0:99c:c59:2280 with SMTP id hy13-20020a1709068a6d00b0099c0c592280mr8513078ejc.51.1691421035146; Mon, 07 Aug 2023 08:10:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691421035; cv=none; d=google.com; s=arc-20160816; b=RI6G89WH2lUA1uK5xQE3aP9KEEDg6W7tSZSY7fYquCI7EmaLRB9eHVUS+N2ZLtYCm/ XbwJO62ff8tyC4q2K9bu1rXwuNNVd+E8w4W9neJ1MGFyXXMdHJX6qM+gmdZABNUu4gps BwJOOooHfBc1wjPB5QpGmMi2mcgCitrI1OZK9RYTx42ENdw09iKD5DuDRTFncPRwtW1Q tnZxo8lojQQAMFmquNOsCl+mNug9xkLJr3IsLwHN4JNeu1Y4425yN+Hh9S+folInYOgP MBswy07n/wkqxsTRhu2K+h26OEZ8q6yGhdbgdVasJDLg4bPJ/3tQo1wRBWXA84JTlYIr 3nsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:mime-version:references:subject:cc:to:from :dkim-signature:dkim-signature:message-id; bh=yHYtAXx6N+Nk90fJ68YHnOml1CTtFncFuulQcHEIemo=; fh=/92WVKYrcN3rA268QXyKzVtm/UtxHeI2lnbU295XDiQ=; b=onEz5hV5MT1UM43NU1m/5huEPlltZBojgvrcmTg1WUIfgbXm0euDbzXrSk12yMVONJ t84t/GcF/JrAahhX1y68MZNzuqNJQBwMVgxs48bzxLzi3Hm4WLS/df9VYD1lZPYOxWmb v3iPn4kSu1167sBDAzcRrK8pck//YJ9JNztvbCt31Bjr9f0vIa9zDb5wz1V9avlBpldI 68FYc1LewG7m5jWpesb721Rh5OFxpWg+A87g7zDrumeL9XeLVBBwaxfw9xx+ikasdQTx y92wNtLAOpZ4xE7FXG4ofBHi7Bmkt4Rmu9E8HeESE7YSlpCLP5KO9q9x3h8piPTmCdgZ rOPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=sUlBhXS3; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g3-20020a1709061c8300b00982762e2cc4si6209470ejh.775.2023.08.07.08.10.03; Mon, 07 Aug 2023 08:10:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=sUlBhXS3; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232290AbjHGNyC (ORCPT + 99 others); Mon, 7 Aug 2023 09:54:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41290 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234687AbjHGNxR (ORCPT ); Mon, 7 Aug 2023 09:53:17 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3AEFDF3 for ; Mon, 7 Aug 2023 06:53:04 -0700 (PDT) Message-ID: <20230807135027.376971897@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1691416382; 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=yHYtAXx6N+Nk90fJ68YHnOml1CTtFncFuulQcHEIemo=; b=sUlBhXS3CeJIVrozDtyIqT0AiVrVCCwyVOZPaJcE5XbABJz6THG5116OY0/t4X0AAlVVo5 7NhxRlcpmwm2Ahm3z/odYBqqxJrwFoU4lgchBEKzhevXi/UVEisYcJkIyEmX2Ew9sukaQH 30/TMsqtsImsY8I40f4jIpH84OaqVggDb12Tf7SJECueCNwknE8CeWc/uycb2vb2koU8dT xqC17cTFcsA20QdRUEBqGRcDUCvQ4oTHAJEjJJBfTAKadit20UMxdQhH9VFdr7tJotJFin D6B5W1xqulHftJ9ArZkel4r9m8SAIOSXORvrqdv0b8dxYluopJaroGWHUQlrpA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1691416382; 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=yHYtAXx6N+Nk90fJ68YHnOml1CTtFncFuulQcHEIemo=; b=Q97rvNeZksJfDAPWmSUaS97IrlyN0EWGYpWrZNFUZyZQIiBf6fQ3z6AEMJ488VMB8r0YTX 9X+BYZJ88LHtpUDA== 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 18/53] x86/mm/numa: Move early mptable evaluation into common code References: <20230807130108.853357011@linutronix.de> MIME-Version: 1.0 Date: Mon, 7 Aug 2023 15:53:01 +0200 (CEST) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773583503371388669 X-GMAIL-MSGID: 1773583503371388669 There is no reason to have the early mptable evaluation conditionally invoked only from the AMD numa topology code. Make it explicit and invoke it from setup_arch() right after the corresponding ACPI init call. Remove the pointless wrapper and invoke x86_init::mpparse::early_parse_smp_config() directly. Signed-off-by: Thomas Gleixner --- arch/x86/include/asm/mpspec.h | 5 ----- arch/x86/kernel/setup.c | 2 ++ arch/x86/mm/amdtopology.c | 7 ------- 3 files changed, 2 insertions(+), 12 deletions(-) --- a/arch/x86/include/asm/mpspec.h +++ b/arch/x86/include/asm/mpspec.h @@ -46,11 +46,6 @@ extern int smp_found_config; # define smp_found_config 0 #endif -static inline void early_get_smp_config(void) -{ - x86_init.mpparse.early_parse_smp_cfg(); -} - #ifdef CONFIG_X86_MPPARSE extern void e820__memblock_alloc_reserved_mpc_new(void); extern int enable_update_mptable; --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -1217,7 +1217,9 @@ void __init setup_arch(char **cmdline_p) early_platform_quirks(); + /* Some platforms need the APIC registered for NUMA configuration */ early_acpi_boot_init(); + x86_init.mpparse.early_parse_smp_cfg(); initmem_init(); dma_contiguous_reserve(max_pfn_mapped << PAGE_SHIFT); --- a/arch/x86/mm/amdtopology.c +++ b/arch/x86/mm/amdtopology.c @@ -161,13 +161,6 @@ int __init amd_numa_init(void) */ cores = topology_get_domain_size(TOPO_CORE_DOMAIN); - /* - * Scan MPTABLE to map the local APIC and ensure that the boot CPU - * APIC ID is valid. This is required because on pre ACPI/SRAT - * systems IO-APICs are mapped before the boot CPU. - */ - early_get_smp_config(); - apicid = boot_cpu_physical_apicid; if (apicid > 0) pr_info("BSP APIC ID: %02x\n", apicid);