From patchwork Mon Jul 13 15:55:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 235475 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp2959958ilg; Mon, 13 Jul 2020 08:58:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/+/wMDuQc+ePlamUFExSJ/axi7jgyt/LhpmkLV0RRSVZes5dKm0ym0v3OC5nsUXa8gWZU X-Received: by 2002:a17:906:4a17:: with SMTP id w23mr434211eju.360.1594655916075; Mon, 13 Jul 2020 08:58:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594655916; cv=none; d=google.com; s=arc-20160816; b=EOvb1iAAcbhI0C9PcNrS916ETS0vcWbmcTvPRuWz98bcM+ZgZ2uWpCLNRkiSQNy4SY pE57bF52OJx/iQ6BH/gZA2kHtJ5AZ5pGVpSM/7TRHv2DsX1W2Eaa8D4GazuJPmB0V18c WNa6/2f6sDViZdVHYi+Kwlp2pNJzPOy0j56IImWSWpbKNtuAEdHiUr2vb6D0NPMJodz7 4AJsNRSl73g5UQyhbPESDS4UF13JENtsTrYPuF1cQtoCIbI05WfpjcTJsH1E2W3CzQUi aPdhh5laB19yxNaUMnGXXVyJb498fG8vZ59obgdRWL0f2LVH2whDYBgL3/GJFr3DnKuA AJMQ== 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=nvH4qCjFd4INJcsYQ2CwOPLJE+ix6cW1iOQ8xFLxTyI=; b=w2w9//swVEvqHYkDO3MaN+9j7+LjxUSMvgwt9KSXUHmxwacj4tRYT4YfxOQ7a3phPI C9vDAqwS+PZKC1SuALgDJtKEuhinAI8TGG9JQ1m/9DkrKvNx9aIZKnJ+fi8QGbVUdQ1+ /mDwYyxer2lfRihcHHUC3rzdeGR0VMVrcXwjAo8EChtS1r8rZifNUqDO0OC1xdJcFpk+ EFkXZG8OZLk9sdjNrGroLqKLXFOEiJ+z93qzkWkSTDPOwAfafNbRIQOGW0OBS8mj+Etw LOpKIgkSwtTuJxwx8ja3uhBpBZ9Bq/UPEszc05orz1gsKthozBca+OZ2sl7KMtJOh0ar xEGA== 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 i26si9341673ejx.372.2020.07.13.08.58.35; Mon, 13 Jul 2020 08:58:36 -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 S1730098AbgGMP6f (ORCPT + 7 others); Mon, 13 Jul 2020 11:58:35 -0400 Received: from lhrrgout.huawei.com ([185.176.76.210]:2465 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729920AbgGMP6f (ORCPT ); Mon, 13 Jul 2020 11:58:35 -0400 Received: from lhreml710-chm.china.huawei.com (unknown [172.18.7.108]) by Forcepoint Email with ESMTP id 25A74AEBE8EAC5225369; Mon, 13 Jul 2020 16:58:33 +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; Mon, 13 Jul 2020 16:58:32 +0100 From: Jonathan Cameron To: , , , CC: Lorenzo Pieralisi , Bjorn Helgaas , , , Ingo Molnar , Thomas Gleixner , , Dan Williams , Brice Goglin , Jonathan Cameron Subject: [PATCH v7 2/6] x86: Support Generic Initiator only proximity domains Date: Mon, 13 Jul 2020 23:55:56 +0800 Message-ID: <20200713155600.2272743-3-Jonathan.Cameron@huawei.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20200713155600.2272743-1-Jonathan.Cameron@huawei.com> References: <20200713155600.2272743-1-Jonathan.Cameron@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.123.41.22] X-ClientProxiedBy: lhreml745-chm.china.huawei.com (10.201.108.195) 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 a3767e74c758..88b2330ef883 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -1219,6 +1219,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 8ee952038c80..7dba4648323d 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. *