From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 687FBC433F5 for ; Fri, 24 Sep 2021 00:40:49 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 30ED861214 for ; Fri, 24 Sep 2021 00:40:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 30ED861214 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.194687.346873 (Exim 4.92) (envelope-from ) id 1mTZGb-0002Em-GB; Fri, 24 Sep 2021 00:40:41 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 194687.346873; Fri, 24 Sep 2021 00:40:41 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTZGb-0002Ef-DH; Fri, 24 Sep 2021 00:40:41 +0000 Received: by outflank-mailman (input) for mailman id 194687; Fri, 24 Sep 2021 00:40:40 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTZGa-00024Z-4z for xen-devel@lists.xenproject.org; Fri, 24 Sep 2021 00:40:40 +0000 Received: from mail.kernel.org (unknown [198.145.29.99]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id d197e321-b655-4bf5-ba12-363477841df3; Fri, 24 Sep 2021 00:40:35 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id C30C761211; Fri, 24 Sep 2021 00:40:34 +0000 (UTC) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: d197e321-b655-4bf5-ba12-363477841df3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1632444035; bh=4VAdznDK5uMsDeS8RiIXv+6D21mqHwaZX6t0QAUGsq8=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=J+TeqtBTERWXz2CYuEgLYUdEFU2WIv4rlesECJQoIwRNiGKfuISfNytrHTaYaccjv RioWxOkaW5wrDM76jLNWMcX2jdlqi3z1Xd8QZYT4EccyIW3tYtoZAkoMlntB4KPp0I v+DAVOk6sDG8BfaZkl60croMjWaIGiYara6g90jKtMIVfaoX7orwnYvBzL47S9P2i5 Cot7oivoopDv3W/X4hhJmN/SZlRMCvMOdiaqpFegsMFlzH6PgLeFUS824iLnmmMOae qIEjzxXUqEKwZF3moPWvBCBgvI0zWyUeqGm05xl/MhfwL0SauCo1KS6R+JEpFnyaZi +6HZLhQFVMikw== Date: Thu, 23 Sep 2021 17:40:34 -0700 (PDT) From: Stefano Stabellini X-X-Sender: sstabellini@sstabellini-ThinkPad-T480s To: Wei Chen cc: xen-devel@lists.xenproject.org, sstabellini@kernel.org, julien@xen.org, Bertrand.Marquis@arm.com, jbeulich@suse.com, andrew.cooper3@citrix.com, roger.pau@citrix.com, wl@xen.org Subject: Re: [PATCH 14/37] xen/x86: use name fw_numa to replace acpi_numa In-Reply-To: <20210923120236.3692135-15-wei.chen@arm.com> Message-ID: References: <20210923120236.3692135-1-wei.chen@arm.com> <20210923120236.3692135-15-wei.chen@arm.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII +x86 maintainers On Thu, 23 Sep 2021, Wei Chen wrote: > Xen is using acpi_numa as a switch for ACPI based NUMA. We want to > use this switch logic for other firmware based NUMA implementation, > like device tree based NUMA in follow-up patches. As Xen will never > use both ACPI and device tree based NUMA at runtime. So I rename > acpi_numa to a more generic name fw_name. This will also allow to > have the code mostly common. > > Signed-off-by: Wei Chen > --- > xen/arch/x86/numa.c | 6 +++--- > xen/arch/x86/setup.c | 2 +- > xen/arch/x86/srat.c | 10 +++++----- > xen/include/asm-x86/acpi.h | 2 +- > 4 files changed, 10 insertions(+), 10 deletions(-) > > diff --git a/xen/arch/x86/numa.c b/xen/arch/x86/numa.c > index 6bc4ade411..2ef385ae3f 100644 > --- a/xen/arch/x86/numa.c > +++ b/xen/arch/x86/numa.c > @@ -51,11 +51,11 @@ cpumask_t node_to_cpumask[MAX_NUMNODES] __read_mostly; > nodemask_t __read_mostly node_online_map = { { [0] = 1UL } }; > > bool numa_off; > -s8 acpi_numa = 0; > +s8 fw_numa = 0; > > int srat_disabled(void) > { > - return numa_off || acpi_numa < 0; > + return numa_off || fw_numa < 0; > } > > /* > @@ -315,7 +315,7 @@ static __init int numa_setup(const char *opt) > else if ( !strncmp(opt,"noacpi",6) ) > { > numa_off = false; > - acpi_numa = -1; > + fw_numa = -1; > } > #endif > else > diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c > index b101565f14..1a2093b554 100644 > --- a/xen/arch/x86/setup.c > +++ b/xen/arch/x86/setup.c > @@ -313,7 +313,7 @@ void srat_detect_node(int cpu) > node_set_online(node); > numa_set_node(cpu, node); > > - if ( opt_cpu_info && acpi_numa > 0 ) > + if ( opt_cpu_info && fw_numa > 0 ) > printk("CPU %d APIC %d -> Node %d\n", cpu, apicid, node); > } > > diff --git a/xen/arch/x86/srat.c b/xen/arch/x86/srat.c > index 9276a52138..4921830f94 100644 > --- a/xen/arch/x86/srat.c > +++ b/xen/arch/x86/srat.c > @@ -167,7 +167,7 @@ static __init void bad_srat(void) > { > int i; > printk(KERN_ERR "SRAT: SRAT not used.\n"); > - acpi_numa = -1; > + fw_numa = -1; > for (i = 0; i < MAX_LOCAL_APIC; i++) > apicid_to_node[i] = NUMA_NO_NODE; > for (i = 0; i < ARRAY_SIZE(pxm2node); i++) > @@ -242,7 +242,7 @@ acpi_numa_x2apic_affinity_init(const struct acpi_srat_x2apic_cpu_affinity *pa) > > apicid_to_node[pa->apic_id] = node; > numa_set_processor_nodes_parsed(node); > - acpi_numa = 1; > + fw_numa = 1; > > if (opt_acpi_verbose) > printk(KERN_INFO "SRAT: PXM %u -> APIC %08x -> Node %u\n", > @@ -277,7 +277,7 @@ acpi_numa_processor_affinity_init(const struct acpi_srat_cpu_affinity *pa) > } > apicid_to_node[pa->apic_id] = node; > numa_set_processor_nodes_parsed(node); > - acpi_numa = 1; > + fw_numa = 1; > > if (opt_acpi_verbose) > printk(KERN_INFO "SRAT: PXM %u -> APIC %02x -> Node %u\n", > @@ -492,7 +492,7 @@ void __init srat_parse_regions(paddr_t addr) > u64 mask; > unsigned int i; > > - if (acpi_disabled || acpi_numa < 0 || > + if (acpi_disabled || fw_numa < 0 || > acpi_table_parse(ACPI_SIG_SRAT, acpi_parse_srat)) > return; > > @@ -521,7 +521,7 @@ int __init acpi_scan_nodes(paddr_t start, paddr_t end) > for (i = 0; i < MAX_NUMNODES; i++) > cutoff_node(i, start, end); > > - if (acpi_numa <= 0) > + if (fw_numa <= 0) > return -1; > > if (!nodes_cover_memory()) { > diff --git a/xen/include/asm-x86/acpi.h b/xen/include/asm-x86/acpi.h > index 7032f3a001..83be71fec3 100644 > --- a/xen/include/asm-x86/acpi.h > +++ b/xen/include/asm-x86/acpi.h > @@ -101,7 +101,7 @@ extern unsigned long acpi_wakeup_address; > > #define ARCH_HAS_POWER_INIT 1 > > -extern s8 acpi_numa; > +extern s8 fw_numa; > extern int acpi_scan_nodes(u64 start, u64 end); > #define NR_NODE_MEMBLKS (MAX_NUMNODES*2) > > -- > 2.25.1 >