From patchwork Mon Sep 7 14:03:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 249237 Delivered-To: patch@linaro.org Received: by 2002:a92:5b9c:0:0:0:0:0 with SMTP id c28csp3858654ilg; Mon, 7 Sep 2020 10:15:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyg8+7hG3QtvlQNUiWokTcOQZR6AEqeqslky2l93HuU9L2pGJUZ2aiVddK+bwjSk98unLe3 X-Received: by 2002:a17:907:20d9:: with SMTP id qq25mr17364302ejb.382.1599498940772; Mon, 07 Sep 2020 10:15:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599498940; cv=none; d=google.com; s=arc-20160816; b=kEEqmSLR1sNoJBzqhSUvV70PxkFOerorWJPAeUAfN/PrskH01JHVtL3VUx/fwZOy1R yn0gReXDrevrFXwmtdyOb5X/np3vo3baegWJH3UP+YEYWJJ/hncVNO4IerzxgHfXp5ji YaejVEVDkUgeRVEgVnIXdwuWuMVAGXO+oy7qbkkRwZ1tTcTFROaXMpi67XHLMyp0wVdW T6iepiwnc5okD5VFGJSM7l+0C2TIyVawMN2UnMMNBpzTeXQOxpHYbcwr0weGjLKAom+t MMIzTk0q5T38tUb+dxmfm2RshWeFMd0OAwaurW7obSDiloZEpIU+X3LV2ymAdyqcQUaA HjpQ== 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=Wz0U/bodFZe8izz69apflpPG/fWGTlkVij2uSiGNRTXAmocDHPTcGistB6fdotO4Uc GoUdhwma4Qh9JgeKU0ZAcq6YIhfnU/HeaTOM96IlqcgyrnZhFF1zU2GsRG/3rjKoixoz PixgwkAHssFctk2blQtg/iA4HLei9UH5gAESDzP3FRWfhciHnonjno9VwuVSAy2Lt4uQ fwf72+p2re+xAVkAVTHI9PdBMr6A5MsePOzrXKnt+J8yjCBN7IOFMAIF/d3E4/N9VoJM 3NpZevUXocXRjvE1YbDQ+fiC4q+RaZ1TPMroQ8+e69/3Oily1mg4I4YGkWx6MkbA0QU/ s//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 r7si6468757ejy.514.2020.09.07.10.15.40; Mon, 07 Sep 2020 10:15:40 -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 S1730639AbgIGRPj (ORCPT + 7 others); Mon, 7 Sep 2020 13:15:39 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:59240 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729763AbgIGOFq (ORCPT ); Mon, 7 Sep 2020 10:05:46 -0400 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 1646D9B65E56938C9A4D; Mon, 7 Sep 2020 22:05:38 +0800 (CST) Received: from lhrphicprd00229.huawei.com (10.123.41.22) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.487.0; Mon, 7 Sep 2020 22:05:28 +0800 From: Jonathan Cameron To: , , , , Lorenzo Pieralisi , , Ingo Molnar CC: Bjorn Helgaas , , Thomas Gleixner , , Dan Williams , Brice Goglin , "Sean V Kelley" , , "Hanjun Guo" , Jonathan Cameron Subject: [PATCH v10 2/6] x86: Support Generic Initiator only proximity domains Date: Mon, 7 Sep 2020 22:03:03 +0800 Message-ID: <20200907140307.571932-3-Jonathan.Cameron@huawei.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20200907140307.571932-1-Jonathan.Cameron@huawei.com> References: <20200907140307.571932-1-Jonathan.Cameron@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.123.41.22] 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. *