From patchwork Tue Aug 18 17:04:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 247904 Delivered-To: patch@linaro.org Received: by 2002:a54:3b12:0:0:0:0:0 with SMTP id j18csp3284856ect; Tue, 18 Aug 2020 10:06:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxh/lVRyrPFrCNY7L/QrUIV1ol6Xwje8/qQWrJy79KFxjhDIdqSOhtMMniZTAIQhKfp2Ky2 X-Received: by 2002:a50:e70e:: with SMTP id a14mr20177650edn.93.1597770361132; Tue, 18 Aug 2020 10:06:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597770361; cv=none; d=google.com; s=arc-20160816; b=qo8W7ydiQd9VocviF7q89LWl/And58bnVPPiV82VuliwON1sWzbSzxz1+zVjpOmq9L emPlXxv+TBBQBWYI4e7WnmOlTMmhcj+NhHA8KxJPcELppSN439fpLUThJItbHbffH7zk 5xLXmo4hAUlbwT8IK4ag1tH5C2nUWdX4GminKmzdspUNTKgVvdfqQ875PCTo5drKxXo5 jhd+xfoPwE+RBfR5uE/UpjN88DoJk5CQIvaajggPRh3ftwnW5Q5NrQyusgBuGyutqQky Hdj1JEMrH7OizKrw3m0TE7wzW15KQfg1bkhv+SNzhVUUq0GVlIYbIGi3wDPkDLqGZWtr 0IAg== 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=P1yreSWmLJ7YUzj4/3eVijc1yhoQ9l+ZrQZWzbHTP7fLlzLjUUr+PBsXn50TqTvJSU NK7HMnXI3rRyxlZ5IiBk+MiidabPJGdq/4wryExlewxIOqCvhoMIUS/MZULIvpZFwSon +QiGBkoyyOnPzEXBKsBt9y4/7vSvgOlnk0Plsb/7kEsB1pLXLxx0cHqKdOzA7esKn+P1 bxVJJEFa5VmIBfdBla2H6CAU24B2SaPBUgOpPneMo9Z1TAQDkeOJWaaFOD67w7cg4spO fe+ZH/cGC2/XcfXBrOhIPrx40cVktvZ5CwOcl7z74KZ4Nlc4tIqqO29JjRGmtTxmMwzL 4t/g== 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 f13si13730001ejq.631.2020.08.18.10.06.00; Tue, 18 Aug 2020 10:06:01 -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 S1728440AbgHRRFx (ORCPT + 7 others); Tue, 18 Aug 2020 13:05:53 -0400 Received: from lhrrgout.huawei.com ([185.176.76.210]:2656 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728417AbgHRRFi (ORCPT ); Tue, 18 Aug 2020 13:05:38 -0400 Received: from lhreml710-chm.china.huawei.com (unknown [172.18.7.106]) by Forcepoint Email with ESMTP id 5B581144BE759295DF3A; Tue, 18 Aug 2020 18:05:37 +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_CBC_SHA256) id 15.1.1913.5; Tue, 18 Aug 2020 18:05:36 +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 v8 2/6] x86: Support Generic Initiator only proximity domains Date: Wed, 19 Aug 2020 01:04:13 +0800 Message-ID: <20200818170417.1515975-3-Jonathan.Cameron@huawei.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20200818170417.1515975-1-Jonathan.Cameron@huawei.com> References: <20200818170417.1515975-1-Jonathan.Cameron@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.123.41.22] X-ClientProxiedBy: lhreml702-chm.china.huawei.com (10.201.108.51) 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. *