From patchwork Wed Aug 19 14:51:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 247963 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:522:0:0:0:0 with SMTP id h2csp534611ils; Wed, 19 Aug 2020 07:53:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzdX2TMF6oI2KgvT9FcsG+dHavSivsQeDhtSFuVnk/Z8R6t5BSfKWuPPCPaQal/ywGBHpCX X-Received: by 2002:a17:907:b0b:: with SMTP id h11mr26901888ejl.371.1597848830814; Wed, 19 Aug 2020 07:53:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597848830; cv=none; d=google.com; s=arc-20160816; b=s7V8lLzvuH75G9Yxk5Q4GAMP6QNKqAcsVGXlD8UP5+2FqvtxFfl6scBva0tfs+siPv YdTz6HjDjYlqzIyaYHKwekdPzU2MYluKZhsbiTZz7UdMybmwr1SD0w/bisjLF7gLd498 X6Z0SUyslF8hoBFramo+3InYHFuCUSDmKvttAgmNa+JjeucgBSHVLOk5mRPPIVmexqmf FczXgmGGw1IP4FIFf8KMRd8dz2MqQSej6nepF4/alYCq6VAlf/NhebRuF0tVH/5//1qY AV7nrJmkNFE6xbrFaO6Ls1qCg9yLL08ye28pIz1b6+OAC6SiE+0tGUkgOiPmeku1w9/5 nP6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=zQvcCDTuChWqKdR57McVWcECXFBhExGQLCMNAFrLOv0=; b=RCSOgE/f0uUf02E+TqFQHSt57D56jwXwDJGsprLVBB6+iZkJstq0zRJOD5xmp2l5UP hX+dRtwkp3YoC/l0c6J/JDCNqWgk45J2VeUMg5mzKwsQwUcPn4bSL39EJOn0YKU/M9Tl J4eEvsFg98NpQBkOnKe/ZT4Ox2IBhkaliniXi1kES7+ALzp4EengJBpffCfmSyxv2+bi uTrHF2Jr7zLxTkp2a0/LbBS1d33WFVUEN8G5+FOjrRgpkfOx++hTF01YttnDKHeC6T59 EkgTy628g02rEz78rizoGc754jbvET4VuTI1aPv0YIlF0GlLXbNyRt5faswaTCbpDt0G Ijng== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-acpi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-acpi-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c38si16528911edf.153.2020.08.19.07.53.50; Wed, 19 Aug 2020 07:53:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-acpi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-acpi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-acpi-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728145AbgHSOxn (ORCPT + 7 others); Wed, 19 Aug 2020 10:53:43 -0400 Received: from lhrrgout.huawei.com ([185.176.76.210]:2669 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726899AbgHSOxm (ORCPT ); Wed, 19 Aug 2020 10:53:42 -0400 Received: from lhreml710-chm.china.huawei.com (unknown [172.18.7.108]) by Forcepoint Email with ESMTP id 6A017F2C2594C9A58F9A; Wed, 19 Aug 2020 15:53:40 +0100 (IST) Received: from lhrphicprd00229.huawei.com (10.123.41.22) by lhreml710-chm.china.huawei.com (10.201.108.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1913.5; Wed, 19 Aug 2020 15:53:40 +0100 From: Jonathan Cameron To: , , , CC: Lorenzo Pieralisi , Bjorn Helgaas , , , Ingo Molnar , Thomas Gleixner , , Dan Williams , Brice Goglin , Sean V Kelley , , Jonathan Cameron Subject: [PATCH v9 2/6] x86: Support Generic Initiator only proximity domains Date: Wed, 19 Aug 2020 22:51:07 +0800 Message-ID: <20200819145111.1715026-3-Jonathan.Cameron@huawei.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20200819145111.1715026-1-Jonathan.Cameron@huawei.com> References: <20200819145111.1715026-1-Jonathan.Cameron@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.123.41.22] X-ClientProxiedBy: lhreml741-chm.china.huawei.com (10.201.108.191) To lhreml710-chm.china.huawei.com (10.201.108.61) X-CFilter-Loop: Reflected Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org In common with memoryless domains we only register GI domains if the proximity node is not online. If a domain is already a memory containing domain, or a memoryless domain there is nothing to do just because it also contains a Generic Initiator. Signed-off-by: Jonathan Cameron --- arch/x86/include/asm/numa.h | 2 ++ arch/x86/kernel/setup.c | 1 + arch/x86/mm/numa.c | 14 ++++++++++++++ 3 files changed, 17 insertions(+) -- 2.19.1 diff --git a/arch/x86/include/asm/numa.h b/arch/x86/include/asm/numa.h index bbfde3d2662f..f631467272a3 100644 --- a/arch/x86/include/asm/numa.h +++ b/arch/x86/include/asm/numa.h @@ -62,12 +62,14 @@ extern void numa_clear_node(int cpu); extern void __init init_cpu_to_node(void); extern void numa_add_cpu(int cpu); extern void numa_remove_cpu(int cpu); +extern void init_gi_nodes(void); #else /* CONFIG_NUMA */ static inline void numa_set_node(int cpu, int node) { } static inline void numa_clear_node(int cpu) { } static inline void init_cpu_to_node(void) { } static inline void numa_add_cpu(int cpu) { } static inline void numa_remove_cpu(int cpu) { } +static inline void init_gi_nodes(void) { } #endif /* CONFIG_NUMA */ #ifdef CONFIG_DEBUG_PER_CPU_MAPS diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 3511736fbc74..9062c146f03a 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -1218,6 +1218,7 @@ void __init setup_arch(char **cmdline_p) prefill_possible_map(); init_cpu_to_node(); + init_gi_nodes(); io_apic_init_mappings(); diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c index aa76ec2d359b..fc630dc6764e 100644 --- a/arch/x86/mm/numa.c +++ b/arch/x86/mm/numa.c @@ -747,6 +747,20 @@ static void __init init_memory_less_node(int nid) */ } +/* + * Generic Initiator Nodes may have neither CPU nor Memory. + * At this stage if either of the others were present we would + * already be online. + */ +void __init init_gi_nodes(void) +{ + int nid; + + for_each_node_state(nid, N_GENERIC_INITIATOR) + if (!node_online(nid)) + init_memory_less_node(nid); +} + /* * Setup early cpu_to_node. *