From patchwork Tue Jan 10 08:49:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 13094849 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 6461DC46467 for ; Tue, 10 Jan 2023 08:54:23 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.474431.735631 (Exim 4.92) (envelope-from ) id 1pFAOc-0006k0-3W; Tue, 10 Jan 2023 08:54:14 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 474431.735631; Tue, 10 Jan 2023 08:54:14 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pFAOc-0006jt-0I; Tue, 10 Jan 2023 08:54:14 +0000 Received: by outflank-mailman (input) for mailman id 474431; Tue, 10 Jan 2023 08:54:12 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pFAOa-0005oC-41 for xen-devel@lists.xenproject.org; Tue, 10 Jan 2023 08:54:12 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on2073.outbound.protection.outlook.com [40.107.8.73]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 58b01ba2-90c4-11ed-b8d0-410ff93cb8f0; Tue, 10 Jan 2023 09:54:09 +0100 (CET) Received: from ZR2P278CA0066.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:52::20) by GVXPR08MB8234.eurprd08.prod.outlook.com (2603:10a6:150:17::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Tue, 10 Jan 2023 08:53:56 +0000 Received: from VI1EUR03FT043.eop-EUR03.prod.protection.outlook.com (2603:10a6:910:52:cafe::96) by ZR2P278CA0066.outlook.office365.com (2603:10a6:910:52::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18 via Frontend Transport; Tue, 10 Jan 2023 08:53:56 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VI1EUR03FT043.mail.protection.outlook.com (100.127.145.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18 via Frontend Transport; Tue, 10 Jan 2023 08:53:55 +0000 Received: ("Tessian outbound 3ad958cd7492:v132"); Tue, 10 Jan 2023 08:53:55 +0000 Received: from 61d7f55ca79f.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id E6FA4810-2017-46FE-9DD2-24C2ADEF3DDC.1; Tue, 10 Jan 2023 08:53:49 +0000 Received: from EUR02-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 61d7f55ca79f.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 10 Jan 2023 08:53:49 +0000 Received: from FR2P281CA0121.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:9d::12) by PAWPR08MB9892.eurprd08.prod.outlook.com (2603:10a6:102:342::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Tue, 10 Jan 2023 08:53:47 +0000 Received: from VI1EUR03FT013.eop-EUR03.prod.protection.outlook.com (2603:10a6:d10:9d:cafe::45) by FR2P281CA0121.outlook.office365.com (2603:10a6:d10:9d::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.12 via Frontend Transport; Tue, 10 Jan 2023 08:53:47 +0000 Received: from nebula.arm.com (40.67.248.234) by VI1EUR03FT013.mail.protection.outlook.com (100.127.145.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5986.18 via Frontend Transport; Tue, 10 Jan 2023 08:53:46 +0000 Received: from AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Tue, 10 Jan 2023 08:53:45 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Tue, 10 Jan 2023 08:53:44 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.86) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.16 via Frontend Transport; Tue, 10 Jan 2023 08:53:41 +0000 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: 58b01ba2-90c4-11ed-b8d0-410ff93cb8f0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0ghbs3NMlTW31HC7fLfGV4BVVb2uAXdN3Yk6On4z3OE=; b=UYdjnt2KxskTOhh7CnrBqDiDOI8770guG9plfdw15gHHXoftHCwkLhzPmeougr81rLEhrQU0Ht3a5lEcK/wtM5x8HWdFrjShiv4Ej0Fz86uH6eVgm2sJBsiOu0BCHbmpA+xqDkFhcrbda7wQ/ahkESkrr206RgCaIBNHd1gX2n0= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C X-CheckRecipientChecked: true X-CR-MTA-CID: 57ba30604fec6c7a X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Edm4yXDsKlHYiMNb9jWW0nNxhTpCGzJ4YgvTRozhkCAt0VQc3J5Kaii9ijiH0O0L6GldnHuiXWSBtnSCpXGhQJ9/sGPvoXxPCKd9y1bZCBFhHB/i1uWzkBvHX9ypx4lT0NnkDUqcmL54BPPnjwH2PYRnv57cJChPS2YZSVMHcAhzt6nb2pp4/UkBaeyD+PU0Kp5SLQojzh3ADIPtPnhI4D8smHR8iiL5Fcgr6TIHuCMQiJxoglvVxfsPcXwpNc1oG8G2hZUXLani2lt9K9H+sL+KhIzj5KBV0yf2pTAgl1JM2aXzVeuk64XrLgBDwrmrjWFwBhc3Zn/zIWIcc28H4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=0ghbs3NMlTW31HC7fLfGV4BVVb2uAXdN3Yk6On4z3OE=; b=CqpK6TLUP71Bphk0tmVXmS0cf3PWLb7rARR4AD0VdJodz6gTy9X9YX/lOJFDz+4VdqXv81KB/+FeBm+33O4KPzyxOWduQo3VGHURLiCPg6ihxrxR02uiE+fYiWnXiA7yJUXeXKAUCBwU/x1wEvDsI1sE6vxY30jEC+VUCbBl7EuENT/6kutf83QbZ0KxY72xsySAw0QiaySo9xGErzAfE2MwFCV66GW9wy2kwyIt1Ae0mR3al+ajvrdHbrRDPETle2wOQgibSYcOUUeFJOiHrp6lyJuemlPWNa2E7C+2DtgWyCKZEregffJdhC04gtGeUjZFG0wXGlsSVE6RucGHjw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0ghbs3NMlTW31HC7fLfGV4BVVb2uAXdN3Yk6On4z3OE=; b=UYdjnt2KxskTOhh7CnrBqDiDOI8770guG9plfdw15gHHXoftHCwkLhzPmeougr81rLEhrQU0Ht3a5lEcK/wtM5x8HWdFrjShiv4Ej0Fz86uH6eVgm2sJBsiOu0BCHbmpA+xqDkFhcrbda7wQ/ahkESkrr206RgCaIBNHd1gX2n0= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C From: Wei Chen To: CC: , Wei Chen , Stefano Stabellini , Julien Grall , Bertrand Marquis , Volodymyr Babchuk , Andrew Cooper , George Dunlap , Jan Beulich , Wei Liu Subject: [PATCH v2 01/17] xen/arm: use NR_MEM_BANKS to override default NR_NODE_MEMBLKS Date: Tue, 10 Jan 2023 16:49:14 +0800 Message-ID: <20230110084930.1095203-2-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230110084930.1095203-1-wei.chen@arm.com> References: <20230110084930.1095203-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: VI1EUR03FT013:EE_|PAWPR08MB9892:EE_|VI1EUR03FT043:EE_|GVXPR08MB8234:EE_ X-MS-Office365-Filtering-Correlation-Id: e59497f9-d102-4d6d-c5a6-08daf2e834da x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: WmhDGC8koXn0vc2EKsYtnqaU3vxpgT8bGu8QEnhxMUGAvItMSU8IeAoeuiW0L35D6Kmfy79qepNiMM/g9j+WFdi8pNKFTZ7aWKAPLOPR+Kfo6hkFyL9Hc7pei4RzxWXwf3C3BKo+FXhl9I9+Rs5XK+rNaBGxQDZYm6yQA1Eln+9wvNUU/bVkVqTXQY/Ps4D3nYDNx2lrXeWjTB8oapjt8DMDtB1KmBKZhVO4JIYbpYwuQYYKrERYvuZn0h9cZ5+MqQ+yOsHhOElwl4PMm8AH4AxFbLxXyV/1envd2QaMOrVLfj0SFXTTj5nBB3E7ir94ohHxUL9NHwhDa88s7OdXb7frPXf0imzqYQAt80sQqh7QlJSP5M6pQ/bWK9IoMZUsEwbS0NK5IuEnwg2JGu2L1i4T509j6aA3w0AzOYEPQDG6ibaf9EksB7R1p8qQEJTglK8H7EdfXnXmgEWff4g/CbEOBj82/QknNaELMz11PNfkMeQf7tR4cJtLPu4McMyrUHJ7gnclDi1zMpflH7rDYC9cbsSmhGaML0Vo1+tueY25QFPHmR3oz3buSpKQsg16FAaptOFGM2A+cSsoJfAF0y/6s6Bzml2zdbOEZSobjnRq1htY+Bpt+RVNrHIUIHKCqitsvsCryyFsumfQhfja8GXegcn5JDMvivb9rDJIyHyamdBFNVVm9VPW8ee2BwTk6b73+GLzw5IYNBgV/auJe/KiSKOHpoToCn/1vWcdCzg= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(376002)(39860400002)(136003)(396003)(346002)(451199015)(36840700001)(46966006)(36756003)(356005)(41300700001)(2906002)(81166007)(8936002)(82740400003)(82310400005)(5660300002)(44832011)(47076005)(426003)(36860700001)(83380400001)(86362001)(966005)(54906003)(6916009)(7696005)(40480700001)(6666004)(26005)(186003)(8676002)(478600001)(70586007)(70206006)(4326008)(316002)(2616005)(336012)(1076003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR08MB9892 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VI1EUR03FT043.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: d3ed03b6-9734-450f-b86c-08daf2e82f2e X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: I+MnnlNnQvnqdKm6zsWgIJW3MNVJVlkk7+0GI33nv61Qa1ttsYj3sTMuo8vJ5nbTxKpMP/t7HzHZSTA0OSU8sJANMbdqvLwoQhInbzjJHkqR9A9itdF/8tfGxUyfsrSLRy8+V5cKG94O+DUyapBJT6HXcly1q3ICEZAkMQV4TVdUOlJDAFMWa9HSPhBJGKjRxhpgKSi/oRKRBgG2y/pZHaNlGUMZxzJKX5G+aL5GK4I3nVzeMqIPnALYrt+kseAeKy8qV/0wK/TGLr1BURQUS/sB6yGr6EsnF9YqEJVHlBso/o5iZC0vs+Gn/Db32w+EfNESq8mejmhDIDsk8jyX7XYKKlEjAHbiF+16kmJC5Ypk1nGG3/Zhsi89kUI/x5m04frEpVD6DsmDjR8u7Btzc+wo6WF1yu0JY4iTTJdNZpvfYyXvOOW5Td5REMZSpk+hO3j6jl0nOdmP4x0T0Tjb3WoNKXq2VzgtBHcgbEj13DgFL1GbCUnM/ppKDGMt1x2afUCHH0pK/4l17BGFoNEtWR9fY0TuEMAvFnpzIkrXjqarRCaGCv94HIyc9AnXR5qdQg3tJ9GMiiCOxLNhQkDOyCkxMTsPbPV5Ca+sPgCYP3M7zICxegNj/NHrVFwLO/PqiIuEKcRblaaEm010mFN3ICeq7AbmkD8i3xp9CDBeHpLFwDNCAUirfGjaenKMOVPypyy0OyfT+VMapGJ9trwuIblmHpzc330s4fXgaK3uzSs= X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230022)(4636009)(396003)(136003)(39860400002)(376002)(346002)(451199015)(46966006)(40470700004)(36840700001)(82740400003)(81166007)(36860700001)(54906003)(8676002)(4326008)(40460700003)(86362001)(6916009)(41300700001)(70586007)(70206006)(316002)(8936002)(40480700001)(44832011)(5660300002)(2906002)(1076003)(2616005)(336012)(83380400001)(426003)(47076005)(82310400005)(966005)(7696005)(186003)(478600001)(6666004)(26005)(36756003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2023 08:53:55.8339 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e59497f9-d102-4d6d-c5a6-08daf2e834da X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: VI1EUR03FT043.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR08MB8234 As a memory range described in device tree cannot be split across multiple nodes. And it is very likely than if you have more than 64 nodes, you may need a lot more than 2 regions per node. So the default NR_NODE_MEMBLKS value (MAX_NUMNODES * 2) makes no sense on Arm. So, for Arm, we would just define NR_NODE_MEMBLKS as an alias to NR_MEM_BANKS. And in the future NR_MEM_BANKS will be user-configurable via kconfig, but for now leave NR_MEM_BANKS as 128 on Arm. This avoid to have different way to define the value based NUMA vs non-NUMA. Further discussions can be found here[1]. [1] https://lists.xenproject.org/archives/html/xen-devel/2021-09/msg02322.html Signed-off-by: Wei Chen --- v1 -> v2: 1. Add code comments to explain using NR_MEM_BANKS for Arm 2. Refine commit messages. --- xen/arch/arm/include/asm/numa.h | 19 ++++++++++++++++++- xen/include/xen/numa.h | 9 +++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/include/asm/numa.h b/xen/arch/arm/include/asm/numa.h index e2bee2bd82..7d6ae36a19 100644 --- a/xen/arch/arm/include/asm/numa.h +++ b/xen/arch/arm/include/asm/numa.h @@ -3,9 +3,26 @@ #include +#include + typedef u8 nodeid_t; -#ifndef CONFIG_NUMA +#ifdef CONFIG_NUMA + +/* + * It is very likely that if you have more than 64 nodes, you may + * need a lot more than 2 regions per node. So, for Arm, we would + * just define NR_NODE_MEMBLKS as an alias to NR_MEM_BANKS. + * And in the future NR_MEM_BANKS will be bumped for new platforms, + * but for now leave NR_MEM_BANKS as it is on Arm. This avoid to + * have different way to define the value based NUMA vs non-NUMA. + * + * Further discussions can be found here: + * https://lists.xenproject.org/archives/html/xen-devel/2021-09/msg02322.html + */ +#define NR_NODE_MEMBLKS NR_MEM_BANKS + +#else /* Fake one node for now. See also node_online_map. */ #define cpu_to_node(cpu) 0 diff --git a/xen/include/xen/numa.h b/xen/include/xen/numa.h index 29b8c2df89..b86d0851fc 100644 --- a/xen/include/xen/numa.h +++ b/xen/include/xen/numa.h @@ -13,7 +13,16 @@ #define MAX_NUMNODES 1 #endif +/* + * Some architectures may have different considerations for + * number of node memory blocks. They can define their + * NR_NODE_MEMBLKS in asm/numa.h to reflect their architectural + * implementation. If the arch does not have specific implementation, + * the following default NR_NODE_MEMBLKS will be used. + */ +#ifndef NR_NODE_MEMBLKS #define NR_NODE_MEMBLKS (MAX_NUMNODES * 2) +#endif #define vcpu_to_node(v) (cpu_to_node((v)->processor)) From patchwork Tue Jan 10 08:49:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 13094848 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 8C1F2C46467 for ; Tue, 10 Jan 2023 08:54:20 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.474430.735620 (Exim 4.92) (envelope-from ) id 1pFAOY-0006Qg-Q4; Tue, 10 Jan 2023 08:54:10 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 474430.735620; Tue, 10 Jan 2023 08:54:10 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pFAOY-0006QV-N9; Tue, 10 Jan 2023 08:54:10 +0000 Received: by outflank-mailman (input) for mailman id 474430; Tue, 10 Jan 2023 08:54:09 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pFAOX-0005s6-5v for xen-devel@lists.xenproject.org; Tue, 10 Jan 2023 08:54:09 +0000 Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02on2061.outbound.protection.outlook.com [40.107.249.61]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 57c40165-90c4-11ed-91b6-6bf2151ebd3b; Tue, 10 Jan 2023 09:54:08 +0100 (CET) Received: from AS9PR01CA0020.eurprd01.prod.exchangelabs.com (2603:10a6:20b:540::25) by PAXPR08MB7646.eurprd08.prod.outlook.com (2603:10a6:102:241::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Tue, 10 Jan 2023 08:54:05 +0000 Received: from AM7EUR03FT008.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:540:cafe::e4) by AS9PR01CA0020.outlook.office365.com (2603:10a6:20b:540::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18 via Frontend Transport; Tue, 10 Jan 2023 08:54:05 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM7EUR03FT008.mail.protection.outlook.com (100.127.141.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18 via Frontend Transport; Tue, 10 Jan 2023 08:54:05 +0000 Received: ("Tessian outbound 333ca28169fa:v132"); Tue, 10 Jan 2023 08:54:04 +0000 Received: from cd1a513c34a0.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 736A2ED2-55B1-41D7-A47A-6BC14235A46A.1; Tue, 10 Jan 2023 08:53:57 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id cd1a513c34a0.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 10 Jan 2023 08:53:57 +0000 Received: from FR0P281CA0063.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:49::11) by AS8PR08MB9315.eurprd08.prod.outlook.com (2603:10a6:20b:5a6::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Tue, 10 Jan 2023 08:53:51 +0000 Received: from VI1EUR03FT014.eop-EUR03.prod.protection.outlook.com (2603:10a6:d10:49:cafe::73) by FR0P281CA0063.outlook.office365.com (2603:10a6:d10:49::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.11 via Frontend Transport; Tue, 10 Jan 2023 08:53:50 +0000 Received: from nebula.arm.com (40.67.248.234) by VI1EUR03FT014.mail.protection.outlook.com (100.127.145.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5986.18 via Frontend Transport; Tue, 10 Jan 2023 08:53:50 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Tue, 10 Jan 2023 08:53:48 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.86) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.16 via Frontend Transport; Tue, 10 Jan 2023 08:53:45 +0000 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: 57c40165-90c4-11ed-91b6-6bf2151ebd3b DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PmYoezE2IW59ME1CxZnlcTEIFj+1tLggVIMbia4uvmE=; b=S+xLDEACULP7+KdH+nj/G3VV5LHgo4ymITLwjnMgopxVbrXQXWhbUyVRz9ogi53sk2bNSHD7T/TGduW+f/9T00ohftgTkiuDvUHGYD5oXeN2++KvwKo2agN5w2ycRJ/mA9Sn5qmzfO9hXnC7+yleeh1mNMmfODCpbvjGACVDPU8= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C X-CheckRecipientChecked: true X-CR-MTA-CID: 83c795689737a32a X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RPYvj2k1Lj2CdVKjNkT7p0alj6ZJiiZyFUrQ0HV4Mmtyd1ese3R+OykyIpydt7iUFzgnIdYeXmBQLelrIl9+PnlKb3aaIDNnTBrb0FWosBzCdHcwihxA5FbmT2HiQYLSVK01XAOb3Y5RwrWpuO+7SGLqTefQQiPaPNdXrEXHwIaF5vo+MZNH6CBS0AdYcMU2zNsOLcN7vuWc3jy5affe5q1b29n4pFcSweETtkDoucXGhY8VPRv9XG87iQiIWtaY8KgMKFFtu6f5HslJE1kLQeJJxbKFG+dex3stozwASNCHqAf1e3fa32oAtzl9KI2JMOsgduzSPvzjnHHFKiUyIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=PmYoezE2IW59ME1CxZnlcTEIFj+1tLggVIMbia4uvmE=; b=aCKm87ysa2saUVVLDBReWk2HgbAmJVGPn7fGA0UPXpPL9r7BZFJicp7bpp3ugFFaUGQfdM4NT+rlpLb7wYqXL8iseW38JQQHtCooDPJWw/zLq2G+LOHFPNCSUPs9f8GJNfmI0Wf051UFhsE6H7J0O4cdKvdvoPD4wpbPT8qncDiEvTFHFRV9qFfRiSeXzaRv9xq7JOo/CCt888ICD6/p2RKhfpISLuE+z37uasNRZ2SGG8QQFq/Qn/65D9wYRKZCj+LVF0hGLP4x/YSE6OZ0uXXf0NF9BbZsA0b09Z6bTrX95BhGXpc9W84x1+js5Ym3VpbZSPl68BzSSs+gMbkMqA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PmYoezE2IW59ME1CxZnlcTEIFj+1tLggVIMbia4uvmE=; b=S+xLDEACULP7+KdH+nj/G3VV5LHgo4ymITLwjnMgopxVbrXQXWhbUyVRz9ogi53sk2bNSHD7T/TGduW+f/9T00ohftgTkiuDvUHGYD5oXeN2++KvwKo2agN5w2ycRJ/mA9Sn5qmzfO9hXnC7+yleeh1mNMmfODCpbvjGACVDPU8= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C From: Wei Chen To: CC: , Wei Chen , Stefano Stabellini , Julien Grall , Bertrand Marquis , Volodymyr Babchuk , Andrew Cooper , George Dunlap , Jan Beulich , Wei Liu , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Subject: [PATCH v2 02/17] xen/arm: implement helpers to get and update NUMA status Date: Tue, 10 Jan 2023 16:49:15 +0800 Message-ID: <20230110084930.1095203-3-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230110084930.1095203-1-wei.chen@arm.com> References: <20230110084930.1095203-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: VI1EUR03FT014:EE_|AS8PR08MB9315:EE_|AM7EUR03FT008:EE_|PAXPR08MB7646:EE_ X-MS-Office365-Filtering-Correlation-Id: 1d688aa0-011f-468c-06a2-08daf2e83a58 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: bTZm+HdFMjwpjFhk74ZmuJGg3uJLNaJNRMl7VjLMOaUlJGDCQ0bWSEj/1dMcyUn0K24XpZVKImbVi4f9ymRMHp/qiagmo4jJ1BkkLQU40ZEcPIg6HqZIUQHWtaEJQlNauWimUUHaks2nwBCa0rO4Nd8+x7/G3vDwhUQcGzKg3aOE8csafVk2vNtVboeqxB/rPA4hlpTOD8a8GWB1z/QR98Dusg2pleIPFZ0WIb9RcOdsaxpERwWejbTE8mypQ26I3u6qB4o5+vxtup5eRJcxOsOvMEqk0cVxXo0QQaXH5eEF5AztxTQgj0TJLm7xly0c+xAYrBbsq6Mkkuc1wt6JEymO9ZlCvda+slC5f5qizknvzINBR1TpHtgXM1MHcR9VnYAPzd1Qm/8viOxuynD9NrD1mEBvXQN55ZuHkIAa5vcuPgLJYevQIbJ0rwd4WDiZnIxNb5tTB4ho4V9NtuO0YkmGXL+wHIhP5nmTOwK1sxvuK6kHK52JBvCOsemSZkFHRRiOQHiUfxBpER8TvGqlq1F/gO69QUpssYTMPmk0nO5eAAWccnJ9WRuscqARP8+DLw/IFPcdSrtVbYlZiq0QZBptM2PrFgfozIcJt2JtB91eFvP+iWcj7clzkh+vqBk1/9GBY4TXbXQHEJI3lwtpC+zgAg8aGkKKgwTLf3AiDAygTmbM8yUTT0WSfgYiw0hU8+aFyU+3UEkwHZrMpwX65fNr4Ywe9D/u23QFOvPsl3R0WeKrdJXU8C4Kt37bmS94 X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(136003)(396003)(376002)(346002)(39860400002)(451199015)(46966006)(36840700001)(356005)(81166007)(82740400003)(36860700001)(6916009)(41300700001)(8676002)(4326008)(54906003)(70586007)(86362001)(40480700001)(44832011)(8936002)(5660300002)(15650500001)(1076003)(83380400001)(2616005)(47076005)(336012)(426003)(186003)(26005)(7696005)(478600001)(82310400005)(6666004)(2906002)(316002)(70206006)(36756003)(2004002)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB9315 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT008.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 6c62addc-70e8-4869-cea6-08daf2e831a2 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JQG2fUK/dot99yd9QECpImJCMJouuwXf4n5gOoRIOxfRxI6U5YDUNguNm4rOeUsBKfHahET3UpoGq0XTBFPNSDH9K9DuE4OY7xtlVPG5rlnUVbvu9OTYJEWaD4IDFUwFfpZVEsd8WtuJwZuy9c7bPEI5EoXfixMZmJGFaWO8A5ltQOsm0dG0Ngl+d40iZfmoIuA1HE5+y9MQALfVGSZH9Q+4VLUe/KPJHEW2DJnJeFKtTHmSXcefbaKnO3sxiAf9+X8EV+1pACTje19/Mm2r5mFU9QDCZ0MxAhz32q5YjkRdRyWgzlx1vz+JEjdWol0AjQ1gRaHUT8U+7vnwmLAMFkaM7g8UQ5e6nrq6VZmY8eeuyyf/Bnwe70ktAZ9knirYqSlTd+4xuLJWaRKSx+aJLcIWaJdpZVfpWorSG+R8rthp9yYj97TXtsBu+wjoEGWG/9qSx6MlpaF38Ac4YkAfSV0j01gQaOCkHXHh7miLuN3iXAKA1uwKnzf9orGSVBVsZKqwxY0+iCuukHmuus7wGcWN4Jikdar8QrdTDGknSmLX2UJYDM8gSKWo5sL3Vv1M7b0eDqRqdrkPVW6KypYqMZXbFY4f3TNJrxN0AW2tM5i/6ctA/GHX531o8wIt9CvxEv9wY9hpKLdmHK3voUmU7j1IJdOK91dPe8pcr0tIWNc/JtZVB+GMcheUL4Grj7I0XASAmLn5issHE1vJfbNQQQCeRzc9+haf2mIYxhecDjzsAcRk7symhfQEh80I0vGa X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230022)(4636009)(376002)(39860400002)(396003)(136003)(346002)(451199015)(36840700001)(46966006)(40470700004)(83380400001)(426003)(82310400005)(47076005)(316002)(86362001)(54906003)(6916009)(36756003)(40480700001)(7696005)(81166007)(107886003)(82740400003)(186003)(336012)(26005)(40460700003)(2616005)(1076003)(2906002)(44832011)(478600001)(6666004)(5660300002)(15650500001)(8936002)(36860700001)(70206006)(41300700001)(4326008)(70586007)(8676002)(2004002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2023 08:54:05.1059 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1d688aa0-011f-468c-06a2-08daf2e83a58 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM7EUR03FT008.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB7646 NUMA has one global and one implementation specific switches. For ACPI NUMA implementation, Xen has acpi_numa, so we introduce device_tree_numa for device tree NUMA implementation. And use enumerations to indicate init, off and on status. arch_numa_disabled will get device_tree_numa status, but for arch_numa_setup we have not provided boot arguments to setup device_tree_numa. So we just return -EINVAL in this patch. Signed-off-by: Wei Chen --- v1 -> v2: 1. Use arch_numa_disabled to replace numa_enable_with_firmware. 2. Introduce enumerations for device tree numa status. 3. Use common numa_disabled, drop Arm version numa_disabled. 4. Introduce arch_numa_setup for Arm. 5. Rename bad_srat to numa_bad. 6. Add numa_enable_with_firmware helper. 7. Add numa_disabled helper. 8. Refine commit message. --- xen/arch/arm/include/asm/numa.h | 17 +++++++++++++ xen/arch/arm/numa.c | 44 +++++++++++++++++++++++++++++++++ xen/arch/x86/include/asm/numa.h | 1 - xen/include/xen/numa.h | 1 + 4 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 xen/arch/arm/numa.c diff --git a/xen/arch/arm/include/asm/numa.h b/xen/arch/arm/include/asm/numa.h index 7d6ae36a19..52ca414e47 100644 --- a/xen/arch/arm/include/asm/numa.h +++ b/xen/arch/arm/include/asm/numa.h @@ -22,6 +22,12 @@ typedef u8 nodeid_t; */ #define NR_NODE_MEMBLKS NR_MEM_BANKS +enum dt_numa_status { + DT_NUMA_INIT, + DT_NUMA_ON, + DT_NUMA_OFF, +}; + #else /* Fake one node for now. See also node_online_map. */ @@ -39,6 +45,17 @@ extern mfn_t first_valid_mfn; #define node_start_pfn(nid) (mfn_x(first_valid_mfn)) #define __node_distance(a, b) (20) +#define numa_disabled() (true) +static inline bool arch_numa_unavailable(void) +{ + return true; +} + +static inline bool arch_numa_broken(void) +{ + return true; +} + #endif #define arch_want_default_dmazone() (false) diff --git a/xen/arch/arm/numa.c b/xen/arch/arm/numa.c new file mode 100644 index 0000000000..1c02b6a25d --- /dev/null +++ b/xen/arch/arm/numa.c @@ -0,0 +1,44 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Arm Architecture support layer for NUMA. + * + * Copyright (C) 2021 Arm Ltd + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#include +#include + +static enum dt_numa_status __read_mostly device_tree_numa; + +void __init numa_fw_bad(void) +{ + printk(KERN_ERR "NUMA: device tree numa info table not used.\n"); + device_tree_numa = DT_NUMA_OFF; +} + +bool __init arch_numa_unavailable(void) +{ + return device_tree_numa != DT_NUMA_ON; +} + +bool arch_numa_disabled(void) +{ + return device_tree_numa == DT_NUMA_OFF; +} + +int __init arch_numa_setup(const char *opt) +{ + return -EINVAL; +} diff --git a/xen/arch/x86/include/asm/numa.h b/xen/arch/x86/include/asm/numa.h index 7866afa408..61efe60a95 100644 --- a/xen/arch/x86/include/asm/numa.h +++ b/xen/arch/x86/include/asm/numa.h @@ -12,7 +12,6 @@ extern unsigned int numa_node_to_arch_nid(nodeid_t n); #define ZONE_ALIGN (1UL << (MAX_ORDER+PAGE_SHIFT)) -extern bool numa_disabled(void); extern nodeid_t setup_node(unsigned int pxm); extern void srat_detect_node(int cpu); diff --git a/xen/include/xen/numa.h b/xen/include/xen/numa.h index b86d0851fc..7d7aeb3a3c 100644 --- a/xen/include/xen/numa.h +++ b/xen/include/xen/numa.h @@ -55,6 +55,7 @@ extern void numa_init_array(void); extern void numa_set_node(unsigned int cpu, nodeid_t node); extern void numa_initmem_init(unsigned long start_pfn, unsigned long end_pfn); extern void numa_fw_bad(void); +extern bool numa_disabled(void); extern int arch_numa_setup(const char *opt); extern bool arch_numa_unavailable(void); From patchwork Tue Jan 10 08:49:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 13094851 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id A747FC46467 for ; Tue, 10 Jan 2023 08:54:31 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.474437.735653 (Exim 4.92) (envelope-from ) id 1pFAOk-0007cx-SI; Tue, 10 Jan 2023 08:54:22 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 474437.735653; Tue, 10 Jan 2023 08:54:22 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pFAOk-0007cl-O3; Tue, 10 Jan 2023 08:54:22 +0000 Received: by outflank-mailman (input) for mailman id 474437; Tue, 10 Jan 2023 08:54:21 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pFAOj-0005oC-LX for xen-devel@lists.xenproject.org; Tue, 10 Jan 2023 08:54:21 +0000 Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on2040.outbound.protection.outlook.com [40.107.247.40]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 5e93e1ff-90c4-11ed-b8d0-410ff93cb8f0; Tue, 10 Jan 2023 09:54:19 +0100 (CET) Received: from AS9PR0301CA0045.eurprd03.prod.outlook.com (2603:10a6:20b:469::13) by AS4PR08MB7783.eurprd08.prod.outlook.com (2603:10a6:20b:517::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Tue, 10 Jan 2023 08:54:08 +0000 Received: from AM7EUR03FT005.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:469:cafe::5) by AS9PR0301CA0045.outlook.office365.com (2603:10a6:20b:469::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18 via Frontend Transport; Tue, 10 Jan 2023 08:54:07 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM7EUR03FT005.mail.protection.outlook.com (100.127.140.218) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18 via Frontend Transport; Tue, 10 Jan 2023 08:54:07 +0000 Received: ("Tessian outbound 8038f0863a52:v132"); Tue, 10 Jan 2023 08:54:07 +0000 Received: from 506abfabed72.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 67DB3E74-75F4-498C-8913-675EE63F1492.1; Tue, 10 Jan 2023 08:54:00 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 506abfabed72.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 10 Jan 2023 08:54:00 +0000 Received: from FR3P281CA0049.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:4a::22) by AS2PR08MB9570.eurprd08.prod.outlook.com (2603:10a6:20b:60a::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Tue, 10 Jan 2023 08:53:54 +0000 Received: from VI1EUR03FT035.eop-EUR03.prod.protection.outlook.com (2603:10a6:d10:4a:cafe::56) by FR3P281CA0049.outlook.office365.com (2603:10a6:d10:4a::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.11 via Frontend Transport; Tue, 10 Jan 2023 08:53:54 +0000 Received: from nebula.arm.com (40.67.248.234) by VI1EUR03FT035.mail.protection.outlook.com (100.127.145.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5986.18 via Frontend Transport; Tue, 10 Jan 2023 08:53:54 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Tue, 10 Jan 2023 08:53:52 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.86) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.16 via Frontend Transport; Tue, 10 Jan 2023 08:53:49 +0000 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: 5e93e1ff-90c4-11ed-b8d0-410ff93cb8f0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3aUeRUGBRNGaCgpSKVEFEGKe8AB9JhLLaUj+oRdym0E=; b=PAO6IshgIncgfGpUvO35veBmTVm6f6P1LLu6onpE7NfrSnPDrdh+lQhwumbTJXEwfS3wzlZxUsykqlflANNOZD8wxn65JCFb84NiA4pfsxNM9TqL3HATUHEMnCwMJyqLTmc25KpLynD+f0ueIKiG9lISXLRuBHFav4JONxcExeQ= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C X-CheckRecipientChecked: true X-CR-MTA-CID: 2bad1a70c48d8a12 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=V/lx093Rgg1VIfShjwQq1ohzRNs9oSNa+HDWmUcxAfm7vDJVR4R59yQiHZZwWQ4H2fQEjrLcxvcBKUUgdFtzDpaBYOMfN3rnQmfnjR7YA5Ih2lAmEpBncAyPWV75eB0LlEL+dhuosJD9kDHDB3NT8+uJH5Nj6EJtG3yQcu9efP5fLq3Xn/Ky9woedVIuh5WvZkTDim0CkWT0Ni3kJYY/E4fbuOOIC6CXMmzHA51olccHyqira4+ht4+alRSRiYDmgzVAAwHYATv8T6P/dynmv8iMcsdEIToBNlvkZpdYLRFmtWu2TOkVcIXD6GQd4MDuiQRN/h7rJN/O3RFmo7A6jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=3aUeRUGBRNGaCgpSKVEFEGKe8AB9JhLLaUj+oRdym0E=; b=Yie0lS5hpUE7rzC0dKy8sIdh25NRAb60PPW+2f9IXL36IBGKfeU4QxUSP+wSoxcYvr2BpJa4Mly/q/J9kniMoSkADxOAMqTxkX5hQmkencgKhKVvz9DiEmwQTd5q9cxXW4q4qqPISRIeLVxWxEtIIuLmDTouY1uE97JieeUkI/baOnQ+d3v7wRVeyp76uLL04LJ/WzftFpwfgvLzDHVDzzDVX+QyZTceZY3ige9d++ZfQa3nmIMNrgbp5XagIEGnbvF5DYmLLY29td/0Nekd2sDWKxnXf4M4rwmY7T5jpSNhT8yX2DAyCh9X2HmeeRMJh0NxyWiGoRpEfRRuPqejlQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3aUeRUGBRNGaCgpSKVEFEGKe8AB9JhLLaUj+oRdym0E=; b=PAO6IshgIncgfGpUvO35veBmTVm6f6P1LLu6onpE7NfrSnPDrdh+lQhwumbTJXEwfS3wzlZxUsykqlflANNOZD8wxn65JCFb84NiA4pfsxNM9TqL3HATUHEMnCwMJyqLTmc25KpLynD+f0ueIKiG9lISXLRuBHFav4JONxcExeQ= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C From: Wei Chen To: CC: , Wei Chen , Stefano Stabellini , Julien Grall , Bertrand Marquis , Volodymyr Babchuk , Andrew Cooper , George Dunlap , Jan Beulich , Wei Liu , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Subject: [PATCH v2 03/17] xen/arm: implement node distance helpers for Arm Date: Tue, 10 Jan 2023 16:49:16 +0800 Message-ID: <20230110084930.1095203-4-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230110084930.1095203-1-wei.chen@arm.com> References: <20230110084930.1095203-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: VI1EUR03FT035:EE_|AS2PR08MB9570:EE_|AM7EUR03FT005:EE_|AS4PR08MB7783:EE_ X-MS-Office365-Filtering-Correlation-Id: d6ff6283-0e07-422c-adb8-08daf2e83bc8 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: hbjNgsCSK8+bVz4REmlbUM3es/jUHi81a7rooPo68FJU8b4Z6G5bBfPCxPZvJ97ZKjHpzFXi3nSejLOfCRO4ac0GVMdonoHFJCtH4GaG8gPHdtPWOqyMGr9f4ecTTc2bHCU8EOsEmOAla56E5dhE8CuJI6LvAjLqPJ+zOW/Q2lhA0oXOTxkM/iWa7W6FJG/6MExdzZmRR02CCTQrQtjzxiiZi0NDD4R16nK4ypkVx7MUtHcwkPTN2x4JSDry63ATDcUKzwMrnrk36ByKA3oz9YFmMQzletrmwwtTQpgdX+6DHbc6eqZEGNOjrvpraDgAEV1j7XdCyD7y6VhtHwjA7P5snhl74qbdP/BHQJht6VATcISOE1qscMdH6DbkgHceXnfhw4F0c/kE9/HJVWUr+BUZMZnVBBCdbjvmHxRrPwCU5xl5KLE5zQj4kC/swUHFUpUJd6d214GxLqvgPx4UpQfd3MbwI+hwfMeL7pFHqriqFWxMIuGJOCM/jz0xqB0k8yqxc2zs49hfItZdsUCGZ+tDlJ9GfL9M5AZOfKkqlZeHHAG0mnCJyQ2idVgF0e+9PLFI1F8wGB+JYhWT6MlOV231G5tZQ/ExnXfzZ+relYMme9Ph6YD5vUcVAPAFgvc3lHho0e7dYVAMUsCJ8qjwh3feahAHQJ7Vcj+e9cd7+GDZjQP7QPvVQrsaSj/NguCGH1XRSLBOvfuIdSrS4OSWo/E+P3K8plxMzsKapolStjY= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(376002)(39860400002)(346002)(136003)(396003)(451199015)(36840700001)(46966006)(83380400001)(36860700001)(86362001)(356005)(2906002)(4326008)(82740400003)(81166007)(44832011)(8676002)(5660300002)(70586007)(8936002)(70206006)(426003)(40480700001)(41300700001)(82310400005)(186003)(26005)(336012)(2616005)(47076005)(1076003)(7696005)(316002)(6916009)(478600001)(54906003)(6666004)(36756003)(2004002)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB9570 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT005.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: cf03f6e2-3636-4159-bfff-08daf2e833c9 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VW7TrlGt2fVdKZarcjmXloyKk/QCj/J9JvtDmZ2/okup7iEfY7akz2qC0DmF6+RdD1RP54n0c7gqawZrFgSyyIvma6H58oRx0CmsWUzDh+tBVXudK7b67xIshwAaYlM64qeSPf2vVuyGfJGLgBB2yyZLr+ODA4wKYjK2M+mxiArJ7ojWiCjCTUme9A6tdFi/oftRuALDNED2osE9ZD+3QPAjjG9pubjl2lTkYC7MYiOp2l126iQ08W/RET4t5qNFes2N3MC97nSOG1pUNkQJgY96Wlg4A9DajdCILzC0a8LnMepQGUdj8xcQLJC5NfsWK2m+TiM3ey6Udr2iBlMlYVe1qUuHDB18AzIhUz82AI4b6Gl6seEDe39ifLkdxmoenGLMGKnraUb+Ssh4WDDmYbbxgm6Jw7/SZfNuoxbDIDfylfkSx90CHf/Jxfrclv9QPcDNJzmvCVfAHWtzlholCRuI72RT4pPIhUFz2R/r8fCu41dyyFWTgvF6+ZKBMGJcM0zRxKtuDtFGjghhzOMOtKccss0MWnud/PGtagX6BOpAL7gaHp+sk2WYHvjsRID2v+RorESu5UM55BglGnqAwdFtcnTJIv2weQA7MYezHeTCbjxV4U6etP1tGZP4i16HSacuuU8VjDznsoHR8JjGzASKedseA/o6QvmezuDY0blGpp+0deKC8v40iIxM/l7YfAPltgYowYr0OSb5omfLmyMUKiOz66JfAtT02PfjnHs= X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230022)(4636009)(39860400002)(346002)(396003)(136003)(376002)(451199015)(36840700001)(40470700004)(46966006)(40480700001)(36756003)(86362001)(40460700003)(316002)(7696005)(54906003)(6916009)(478600001)(6666004)(5660300002)(2906002)(44832011)(70586007)(107886003)(70206006)(8676002)(4326008)(41300700001)(36860700001)(83380400001)(82740400003)(2616005)(81166007)(26005)(8936002)(1076003)(186003)(47076005)(426003)(336012)(82310400005)(2004002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2023 08:54:07.5219 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d6ff6283-0e07-422c-adb8-08daf2e83bc8 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM7EUR03FT005.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR08MB7783 We will parse NUMA nodes distances from device tree. So we need a matrix to record the distances between any two nodes we parsed. Accordingly, we provide this node_set_distance API for device tree NUMA to set the distance for any two nodes in this patch. When NUMA initialization failed, __node_distance will return NUMA_REMOTE_DISTANCE, this will help us avoid doing rollback for distance maxtrix when NUMA initialization failed. As both x86 and Arm have implemented __node_distance, so we move its definition from asm/numa.h to xen/numa.h. At same time, the outdated u8 return value of x86 has been changed to unsigned char. Signed-off-by: Wei Chen --- v1 -> v2: 1. Use unsigned int/char instead of uint32_t/u8. 2. Re-org the commit message. --- xen/arch/arm/Makefile | 1 + xen/arch/arm/include/asm/numa.h | 14 +++++++++ xen/arch/arm/numa.c | 52 ++++++++++++++++++++++++++++++++- xen/arch/x86/include/asm/numa.h | 1 - xen/arch/x86/srat.c | 2 +- xen/include/xen/numa.h | 1 + 6 files changed, 68 insertions(+), 3 deletions(-) diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile index 4d076b278b..9073398d6e 100644 --- a/xen/arch/arm/Makefile +++ b/xen/arch/arm/Makefile @@ -38,6 +38,7 @@ obj-$(CONFIG_LIVEPATCH) += livepatch.o obj-y += mem_access.o obj-y += mm.o obj-y += monitor.o +obj-$(CONFIG_NUMA) += numa.o obj-y += p2m.o obj-y += percpu.o obj-y += platform.o diff --git a/xen/arch/arm/include/asm/numa.h b/xen/arch/arm/include/asm/numa.h index 52ca414e47..dbdb632711 100644 --- a/xen/arch/arm/include/asm/numa.h +++ b/xen/arch/arm/include/asm/numa.h @@ -28,6 +28,20 @@ enum dt_numa_status { DT_NUMA_OFF, }; +/* + * In ACPI spec, 0-9 are the reserved values for node distance, + * 10 indicates local node distance, 20 indicates remote node + * distance. Set node distance map in device tree will follow + * the ACPI's definition. + */ +#define NUMA_DISTANCE_UDF_MIN 0 +#define NUMA_DISTANCE_UDF_MAX 9 +#define NUMA_LOCAL_DISTANCE 10 +#define NUMA_REMOTE_DISTANCE 20 + +extern void numa_set_distance(nodeid_t from, nodeid_t to, + unsigned int distance); + #else /* Fake one node for now. See also node_online_map. */ diff --git a/xen/arch/arm/numa.c b/xen/arch/arm/numa.c index 1c02b6a25d..34851ceacf 100644 --- a/xen/arch/arm/numa.c +++ b/xen/arch/arm/numa.c @@ -2,7 +2,7 @@ /* * Arm Architecture support layer for NUMA. * - * Copyright (C) 2021 Arm Ltd + * Copyright (C) 2022 Arm Ltd * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -22,6 +22,11 @@ static enum dt_numa_status __read_mostly device_tree_numa; +static unsigned char __read_mostly +node_distance_map[MAX_NUMNODES][MAX_NUMNODES] = { + { 0 } +}; + void __init numa_fw_bad(void) { printk(KERN_ERR "NUMA: device tree numa info table not used.\n"); @@ -42,3 +47,48 @@ int __init arch_numa_setup(const char *opt) { return -EINVAL; } + +void __init numa_set_distance(nodeid_t from, nodeid_t to, + unsigned int distance) +{ + if ( from >= MAX_NUMNODES || to >= MAX_NUMNODES ) + { + printk(KERN_WARNING + "NUMA: invalid nodes: from=%"PRIu8" to=%"PRIu8" MAX=%"PRIu8"\n", + from, to, MAX_NUMNODES); + return; + } + + /* NUMA defines 0xff as an unreachable node and 0-9 are undefined */ + if ( distance >= NUMA_NO_DISTANCE || + (distance >= NUMA_DISTANCE_UDF_MIN && + distance <= NUMA_DISTANCE_UDF_MAX) || + (from == to && distance != NUMA_LOCAL_DISTANCE) ) + { + printk(KERN_WARNING + "NUMA: invalid distance: from=%"PRIu8" to=%"PRIu8" distance=%"PRIu32"\n", + from, to, distance); + return; + } + + node_distance_map[from][to] = distance; +} + +unsigned char __node_distance(nodeid_t from, nodeid_t to) +{ + /* When NUMA is off, any distance will be treated as remote. */ + if ( numa_disabled() ) + return NUMA_REMOTE_DISTANCE; + + /* + * Check whether the nodes are in the matrix range. + * When any node is out of range, except from and to nodes are the + * same, we treat them as unreachable (return 0xFF) + */ + if ( from >= MAX_NUMNODES || to >= MAX_NUMNODES ) + return from == to ? NUMA_LOCAL_DISTANCE : NUMA_NO_DISTANCE; + + return node_distance_map[from][to]; +} + +EXPORT_SYMBOL(__node_distance); diff --git a/xen/arch/x86/include/asm/numa.h b/xen/arch/x86/include/asm/numa.h index 61efe60a95..18b71ddfef 100644 --- a/xen/arch/x86/include/asm/numa.h +++ b/xen/arch/x86/include/asm/numa.h @@ -21,7 +21,6 @@ extern void init_cpu_to_node(void); #define arch_want_default_dmazone() (num_online_nodes() > 1) void srat_parse_regions(paddr_t addr); -extern u8 __node_distance(nodeid_t a, nodeid_t b); unsigned int arch_get_dma_bitsize(void); #endif diff --git a/xen/arch/x86/srat.c b/xen/arch/x86/srat.c index 56749ddca5..50faf5d352 100644 --- a/xen/arch/x86/srat.c +++ b/xen/arch/x86/srat.c @@ -328,7 +328,7 @@ unsigned int numa_node_to_arch_nid(nodeid_t n) return 0; } -u8 __node_distance(nodeid_t a, nodeid_t b) +unsigned char __node_distance(nodeid_t a, nodeid_t b) { unsigned index; u8 slit_val; diff --git a/xen/include/xen/numa.h b/xen/include/xen/numa.h index 7d7aeb3a3c..cff4fb8ccc 100644 --- a/xen/include/xen/numa.h +++ b/xen/include/xen/numa.h @@ -115,6 +115,7 @@ extern bool numa_memblks_available(void); extern bool numa_update_node_memblks(nodeid_t node, unsigned int arch_nid, paddr_t start, paddr_t size, bool hotplug); extern void numa_set_processor_nodes_parsed(nodeid_t node); +extern unsigned char __node_distance(nodeid_t a, nodeid_t b); #else From patchwork Tue Jan 10 08:49:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 13094847 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 1088FC6379F for ; Tue, 10 Jan 2023 08:54:18 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.474429.735609 (Exim 4.92) (envelope-from ) id 1pFAOX-0006AO-E2; Tue, 10 Jan 2023 08:54:09 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 474429.735609; Tue, 10 Jan 2023 08:54:09 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pFAOX-0006AD-As; Tue, 10 Jan 2023 08:54:09 +0000 Received: by outflank-mailman (input) for mailman id 474429; Tue, 10 Jan 2023 08:54:08 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pFAOW-0005s6-8W for xen-devel@lists.xenproject.org; Tue, 10 Jan 2023 08:54:08 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2054.outbound.protection.outlook.com [40.107.22.54]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 577127da-90c4-11ed-91b6-6bf2151ebd3b; Tue, 10 Jan 2023 09:54:07 +0100 (CET) Received: from AS8PR07CA0035.eurprd07.prod.outlook.com (2603:10a6:20b:459::27) by AS4PR08MB7687.eurprd08.prod.outlook.com (2603:10a6:20b:506::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Tue, 10 Jan 2023 08:54:05 +0000 Received: from AM7EUR03FT009.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:459:cafe::2c) by AS8PR07CA0035.outlook.office365.com (2603:10a6:20b:459::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.12 via Frontend Transport; Tue, 10 Jan 2023 08:54:05 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM7EUR03FT009.mail.protection.outlook.com (100.127.140.130) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18 via Frontend Transport; Tue, 10 Jan 2023 08:54:05 +0000 Received: ("Tessian outbound 8038f0863a52:v132"); Tue, 10 Jan 2023 08:54:05 +0000 Received: from 1a530aeacf9f.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id E72D6A2F-6BE3-4CAD-BE82-F07CD82351F6.1; Tue, 10 Jan 2023 08:53:58 +0000 Received: from EUR03-AM7-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 1a530aeacf9f.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 10 Jan 2023 08:53:58 +0000 Received: from AS9PR05CA0329.eurprd05.prod.outlook.com (2603:10a6:20b:491::35) by PA4PR08MB7572.eurprd08.prod.outlook.com (2603:10a6:102:271::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Tue, 10 Jan 2023 08:53:57 +0000 Received: from AM7EUR03FT031.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:491:cafe::6e) by AS9PR05CA0329.outlook.office365.com (2603:10a6:20b:491::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18 via Frontend Transport; Tue, 10 Jan 2023 08:53:57 +0000 Received: from nebula.arm.com (40.67.248.234) by AM7EUR03FT031.mail.protection.outlook.com (100.127.140.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5986.18 via Frontend Transport; Tue, 10 Jan 2023 08:53:56 +0000 Received: from AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Tue, 10 Jan 2023 08:53:56 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Tue, 10 Jan 2023 08:53:55 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.86) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.16 via Frontend Transport; Tue, 10 Jan 2023 08:53:53 +0000 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: 577127da-90c4-11ed-91b6-6bf2151ebd3b DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ukOHSyYJNGo1PvmsWwUlZnhKUtTLLuyk3pl7Z1kqbYk=; b=IQfayMYuPhAh9yCaVERhL4zea685Z/8WMvbuqmwEdwVpuGd3xSOYqqDfJ0QZKaXrmspo2Ik3eDSAOuKhtOJoUkhYVD5q98QbRmJLz17wzMNkusDnMfdsZGS9IWSpQq2H+WO7ANTOTBBcLuTPtCw/qEbfrgT5q7qPpY2PxbnMbg0= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C X-CheckRecipientChecked: true X-CR-MTA-CID: 8e0d06204b1326e9 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k49p0Ga7YSHbcTaLM2Yf/9a9ZP59cMtgjQBkE/WVtAwtE6NDu9XURdL5qrg5bD8UW78p6fcIbG59CItouubUY0kmPxs0YzEnCmYGas70O16RrdilfYOjNVLWCiqkMm8J0lzMZkN8JXc4GYCHgA6mVZucgnigC2pArN4eqQpEJNnhFkU5jgHeJxZDLwaXm77S9y8L4kX5YMaLntwieu/WBLnTKxSPcUJMzlkpqivGZOIUFkPvowpcIXk3PjpVJMUB8gseDMtMC30Yngbb3B1++NpgF+iMd9TYzd3cjZCQuX1Z13m0w5JbiVNZgEHALyKPKoeqTt8hAgdzYL0KNtFJmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ukOHSyYJNGo1PvmsWwUlZnhKUtTLLuyk3pl7Z1kqbYk=; b=K7UlsP3WRXewE0HeGJh5m024Fc5+fKKtRzVbukGfy7iG4POxJJhgmuuA6tgkq5mY+odNsSXRoDc7/eORIwWftKFT3PlzNp2eUsD3j7IBLoy7QDkDKvurZSw/ftNi66BziT1NU0Hzx21yRXXllUrsSHAHrfJPzfoEKNm6Lj/Djvr3ohwAxoiTEWhWyWR0ivRvFLsfwS8f+noK23b4X11BXyFjSjTb9BEkAiJ4fpWejf+DamYUCOIX2j4Wk+SK93e/MEnDYpoeQUo/EFhBkVJOy1H+apMnbEqx5vuh2NcTpWu2iVTQrwtmc31bVBjlAu5WEPnRcuXJVZ5Cts6xaR5zDQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ukOHSyYJNGo1PvmsWwUlZnhKUtTLLuyk3pl7Z1kqbYk=; b=IQfayMYuPhAh9yCaVERhL4zea685Z/8WMvbuqmwEdwVpuGd3xSOYqqDfJ0QZKaXrmspo2Ik3eDSAOuKhtOJoUkhYVD5q98QbRmJLz17wzMNkusDnMfdsZGS9IWSpQq2H+WO7ANTOTBBcLuTPtCw/qEbfrgT5q7qPpY2PxbnMbg0= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C From: Wei Chen To: CC: , Wei Chen , Stefano Stabellini , Julien Grall , Bertrand Marquis , Volodymyr Babchuk Subject: [PATCH v2 04/17] xen/arm: use arch_get_ram_range to memory ranges from bootinfo Date: Tue, 10 Jan 2023 16:49:17 +0800 Message-ID: <20230110084930.1095203-5-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230110084930.1095203-1-wei.chen@arm.com> References: <20230110084930.1095203-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM7EUR03FT031:EE_|PA4PR08MB7572:EE_|AM7EUR03FT009:EE_|AS4PR08MB7687:EE_ X-MS-Office365-Filtering-Correlation-Id: b38d74bf-f550-4b63-7f18-08daf2e83a9a x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 8qWH3Cdk6TooUHnWV6bBmMqkiv8YlWmA95yuq/P/7tr80IVpC33v1tU3OEGP/5k9QMS/p20oGjydcTymTScaaPE2ucdSZTq63pAe2W9F2EpLgXjXiz1FLLytfl/+Ekjn2A+WyHQiiBVeuvfC15zoh6ROuDg2ldcokeoeeYfjlRssS6mb1K6pewsHBTJBm+LQq36szooRGhqVAW1xqSN3hQIXhRckRWWsv2ZbmrSSY81XLYb/9lxciIRoGweteF3VM23a8OwblX3sCyWzSCQOo+Ms4fdGrwXclVflGt9HrjTEhSixh2R5vvm8L5E8lzHhYGQNmqggty7ivZ5Kv90HwhLCK/AqSvjCM0q2DbCk8NNtWYBbQaWMNE+xbLO2Flofu30lyQKL66QE4QYFART+mmjO8ynL9lxcbAntix0IxFsa+dLPvoXs5ka2YH8Q1a9eqickxuJuQhfYaLVl5NKosOrjifNfViehb3NDdQQNsPcHg56YVdJ40ZF9Tf3d9HAT9l1fd7Vds7gmAMUliUuA+EMrrKZhGP7N6SwsU6E6SAbc8++EAIRKhlMkOLVtWKSllzKjcOC+p6xAs3vTa1+A/wgNuiNQCQR5uODPtPn9uxxpR6w77cTIUVbQmDM6RfXlbltga6846yFqzBRYQqBAcyQX+BOLBX8GrtNnCZEt6aWeRkQFzNgAWRVzR9giCxF4MbEMIFDrkV1LbYKd/PpXqA== X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(39860400002)(376002)(396003)(136003)(346002)(451199015)(46966006)(36840700001)(83380400001)(36860700001)(41300700001)(70586007)(8676002)(70206006)(4326008)(5660300002)(4744005)(8936002)(36756003)(26005)(2616005)(186003)(54906003)(1076003)(81166007)(478600001)(7696005)(356005)(47076005)(86362001)(6666004)(82740400003)(82310400005)(40480700001)(6916009)(336012)(316002)(426003)(44832011)(2906002)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB7572 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT009.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: ae21e75f-961f-4e03-646b-08daf2e83555 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xVon1AF4OQ+FXef+6denCz3kTho9IgTteDaY9XB8cmZvWT/3Ep6ZrNsnDLY/zAxxmc7bo4P32Y/jzDE609bcqRd+Eo5xlmmMaD7eYCEgrtT9avQiuqynDz/tZPo54FrNLhLrOhxCNqw9qfvel3Pc33DRLlXfP/JLuOMIojtoRiWnkfviHbV9ReMA9GNUVEo9FuuDkTeGh1jIVbq1NaCXr1jrT0JjE3TFQ1nKx4DaJpvN4Wm8iboXiyQVL7HahssI5XjlWGDLzRWPQZUWVdIvlR43zLIHjoeejBxNG+jVSdAKSa4L2VM7zES4keCouwbya4WhOvAwJsLmXLoxrXYOufzB9fk/RMZTsmaNwfR7znKol+hen1tDpe3dko1lp+emClDAea3nKHWm7+O1ECmQO7zh9Afv5/dORSAzjGpjncANXw2GcjGn2wheMyC/oJqRDWwMC23TbH7yyJD4hYHkcM7qH1HXusNdR/y2FmWC+PZa0TiBDyv37J1HRiIGHEKGWIpfzePFgz8rCzciON6kpqsT3SLkvPe5z1KdxHlI+Gn2s6fpx2kvAyj14G4HqVIqLRlFSAj89vV4BeeyWMvqvMhHcfAvnwwgNh342n/LFMcSOFrwuWdJw5HJUSCq9wpsEbvSr1M3PYGTPbzgxRLMGkQyNEzYfXF0H4XG+4kDIfc+WAZdkM/RyyzH2OLg1H3op2Hrw8xFs2ipfmwmhXQ03Q== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230022)(4636009)(396003)(136003)(39860400002)(346002)(376002)(451199015)(40470700004)(36840700001)(46966006)(2906002)(36860700001)(44832011)(5660300002)(4744005)(7696005)(41300700001)(8936002)(36756003)(4326008)(83380400001)(70206006)(70586007)(8676002)(40460700003)(86362001)(47076005)(82310400005)(1076003)(336012)(2616005)(6916009)(426003)(26005)(81166007)(40480700001)(478600001)(186003)(82740400003)(316002)(6666004)(107886003)(54906003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2023 08:54:05.5259 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b38d74bf-f550-4b63-7f18-08daf2e83a9a X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM7EUR03FT009.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR08MB7687 Implement the same helper "arch_get_ram_range" as x86 for NUMA code to get memory bank from Arm bootinfo. Signed-off-by: Wei Chen --- v2 -> v3: 1. Use arch_get_ram_range instead of arch_get_memory_map. v1 -> v2: 1. Use arch_get_memory_map to replace arch_get_memory_bank_range and arch_get_memory_bank_number. --- xen/arch/arm/numa.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/xen/arch/arm/numa.c b/xen/arch/arm/numa.c index 34851ceacf..dcfcd85fcf 100644 --- a/xen/arch/arm/numa.c +++ b/xen/arch/arm/numa.c @@ -92,3 +92,14 @@ unsigned char __node_distance(nodeid_t from, nodeid_t to) } EXPORT_SYMBOL(__node_distance); + +int __init arch_get_ram_range(unsigned int idx, paddr_t *start, paddr_t *end) +{ + if ( idx >= bootinfo.mem.nr_banks ) + return -ENOENT; + + *start = bootinfo.mem.bank[idx].start; + *end = *start + bootinfo.mem.bank[idx].size; + + return 0; +} From patchwork Tue Jan 10 08:49:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 13094850 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 3913AC54EBE for ; Tue, 10 Jan 2023 08:54:30 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.474433.735642 (Exim 4.92) (envelope-from ) id 1pFAOi-0007FW-I6; Tue, 10 Jan 2023 08:54:20 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 474433.735642; Tue, 10 Jan 2023 08:54:20 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pFAOi-0007FL-EN; Tue, 10 Jan 2023 08:54:20 +0000 Received: by outflank-mailman (input) for mailman id 474433; Tue, 10 Jan 2023 08:54:19 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pFAOh-0005s6-EJ for xen-devel@lists.xenproject.org; Tue, 10 Jan 2023 08:54:19 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2044.outbound.protection.outlook.com [40.107.7.44]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 5e05ba28-90c4-11ed-91b6-6bf2151ebd3b; Tue, 10 Jan 2023 09:54:18 +0100 (CET) Received: from DB6P195CA0006.EURP195.PROD.OUTLOOK.COM (2603:10a6:4:cb::16) by PR3PR08MB5722.eurprd08.prod.outlook.com (2603:10a6:102:8f::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Tue, 10 Jan 2023 08:54:14 +0000 Received: from DBAEUR03FT036.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:cb:cafe::5b) by DB6P195CA0006.outlook.office365.com (2603:10a6:4:cb::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18 via Frontend Transport; Tue, 10 Jan 2023 08:54:14 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DBAEUR03FT036.mail.protection.outlook.com (100.127.142.193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18 via Frontend Transport; Tue, 10 Jan 2023 08:54:13 +0000 Received: ("Tessian outbound 6e565e48ed4a:v132"); Tue, 10 Jan 2023 08:54:13 +0000 Received: from e119c51c4a8a.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 51145894-0177-4CE7-B3C7-5A664C129EB9.1; Tue, 10 Jan 2023 08:54:07 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id e119c51c4a8a.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 10 Jan 2023 08:54:07 +0000 Received: from AM6PR01CA0070.eurprd01.prod.exchangelabs.com (2603:10a6:20b:e0::47) by DBAPR08MB5830.eurprd08.prod.outlook.com (2603:10a6:10:1a7::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Tue, 10 Jan 2023 08:54:00 +0000 Received: from VI1EUR03FT017.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:e0:cafe::6e) by AM6PR01CA0070.outlook.office365.com (2603:10a6:20b:e0::47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18 via Frontend Transport; Tue, 10 Jan 2023 08:54:00 +0000 Received: from nebula.arm.com (40.67.248.234) by VI1EUR03FT017.mail.protection.outlook.com (100.127.145.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5986.18 via Frontend Transport; Tue, 10 Jan 2023 08:53:59 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Tue, 10 Jan 2023 08:53:58 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.86) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.16 via Frontend Transport; Tue, 10 Jan 2023 08:53:55 +0000 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: 5e05ba28-90c4-11ed-91b6-6bf2151ebd3b DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OmlC5wFOoSJu90l/OLm3xFQ5JzZOfdDA0L7vWkxPHDc=; b=Sy43EBjYcLq8aF4up6RexB9Ji6rFuvibh5nUWFOJsnY6cMDnUZD8UnFjsuXT0/DrtY26YjebUFNJh9QhblDTyKkj6lYjnAeOVZcFBIK1tFoQ8+/ZawjAc9qkDtl47S8Zxj2v2D20Cu5YlLpgAZeAmblg4Hd9qY58nARxQ/cu6Qk= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C X-CheckRecipientChecked: true X-CR-MTA-CID: 598d340d54c7d6d4 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aEGZGb6/zZt5fGplWpgxZUBCQ+6cLrMMtFP5+0Kuh0mqcjdk+0sE0z618V/BSDCjwqx34pqXB0WJTk7lUnsvJAvWlIqdWe/OVwU6qWt83e1WcD+oxQTeo3v6KA0SMTHo9fJzJ2NmqEEfDmhIvL0+e4ErSZU5Em+PYtPz7P7R+3Zs/s5jyOfDN1f3BtIqkKzEW/c3RxCDUZ6fJxSb2yIwFeeeriU1xrZQzcIGsEIu5gL67tS7h6vpioNoD/xEV+loIUFnc62yMQVEJTgnM1/qfTquG4luUk/RRkgPXL6BTZ1Uxaidwd+kPoJsximRbXvajTq5NA4GMJpcrF5uvxzS4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=OmlC5wFOoSJu90l/OLm3xFQ5JzZOfdDA0L7vWkxPHDc=; b=ZF93L2XywmOEbBeFqAwIAZy8HIv1U1Fgqr9DS5hkQC1o4Fl/4kIYGDBznbqwFoHlfmo3tzBP1ZY7reQdTJZldEjgp0clozdoVxGdlcO2GqFSHDDOqdZAhTMfdO0F+ahyQinWuKPJr8nHwJtYDmcv2avIJJ5KyVlReoseNKBR8ydle+LieZDR2EXHjIwGKfZuoZ5VVyAehrnGutzvcrQmpsrktlbb4uqXv4Thep5eHwi5mqufS/SW7zcC+7EDA5qK40ReqBbk3IGGDtg0kwzMP+oJrJ5CUWxEHtPJgyyvx7TyXKsxo6PiHr90e0NiygL7bnqq+u7jkstMIXeMZU+Nxg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OmlC5wFOoSJu90l/OLm3xFQ5JzZOfdDA0L7vWkxPHDc=; b=Sy43EBjYcLq8aF4up6RexB9Ji6rFuvibh5nUWFOJsnY6cMDnUZD8UnFjsuXT0/DrtY26YjebUFNJh9QhblDTyKkj6lYjnAeOVZcFBIK1tFoQ8+/ZawjAc9qkDtl47S8Zxj2v2D20Cu5YlLpgAZeAmblg4Hd9qY58nARxQ/cu6Qk= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C From: Wei Chen To: CC: , Wei Chen , Stefano Stabellini , Julien Grall , Bertrand Marquis , Volodymyr Babchuk Subject: [PATCH v2 05/17] xen/arm: build NUMA cpu_to_node map in dt_smp_init_cpus Date: Tue, 10 Jan 2023 16:49:18 +0800 Message-ID: <20230110084930.1095203-6-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230110084930.1095203-1-wei.chen@arm.com> References: <20230110084930.1095203-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: VI1EUR03FT017:EE_|DBAPR08MB5830:EE_|DBAEUR03FT036:EE_|PR3PR08MB5722:EE_ X-MS-Office365-Filtering-Correlation-Id: bd4cf88b-290a-448c-d48c-08daf2e83f7a x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: SI51p/Vk9meZPDmXBPqoFHt6ZfyI+gLA1ABYTrtNS/85Ed1RuiafFjLa8TzMtnbg+IQ/iKGoUhM8y7MzbJqqzV+lZx9+xlI9GVOVbdG+rEwZo0mYO9jJkkPaKy9RIKo2IF82ejktwJmEgnpzHaGr7FWnOUSTeemIBZdmryOIP7K6ku4RsGZo1lRqiSsVE7K5zFmbzK3V9430c+b8iepZ1CGAPtkh7XnQ8f6m2MzjfY/EX01I97NemBiTlCrdNXC/qt6NPQYsqiMmsYVFn8YRyqtRuZVsdiqql2ArAlUC+mvKyBPnZRGHozB1j0cGxa+ul+Vtqt9BEYrz8V3Q6LBJNWLzCIuvLEUWBxxsCwpv0ENf2KfGz7OzXjkhkQ6E8j6fkWIqw5r+zVnbgA+aAfR4p5cq+owJsGTA8naXLErTiS+tqMFV6Dg9BPssAfwDW8EVt3zgYTPVjeAD5E4C+oXHgAJFJymN4pW0ds1I+CEeFx1hhf7GI+nNwY1r5GUzAS3lAFrIkcyZbJ6zuc4ktsK9gObITApriMVUcZwQnMdk6nc+5fk+2/Ay7bIBWT9fGpaRbJQnJ7UX5oQR4RsoaFl/ql/Y0WR9IbE9wIqWYYvLZ2X8V1D3TRSAk11qoBP90ZSW46kdo0Na2v2GuQ6zdpchMP3SCmlYjt8KvC83cTImtr72gdQ7+mq2w0jB3ccMsXMMKxfAm375n6+/v4vrv2YztQ== X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(346002)(376002)(136003)(39860400002)(396003)(451199015)(46966006)(36840700001)(5660300002)(44832011)(8936002)(41300700001)(2906002)(36756003)(54906003)(83380400001)(8676002)(70586007)(70206006)(4326008)(316002)(6916009)(7696005)(26005)(81166007)(186003)(6666004)(86362001)(478600001)(336012)(1076003)(2616005)(40480700001)(47076005)(82740400003)(356005)(426003)(82310400005)(36860700001)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR08MB5830 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT036.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 6a57a722-ad5f-4226-b963-08daf2e8370f X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lVQCwmOzH206DPJaw9vKdCl72MM1bNLoqu86R3ShS2+5Gf/tKqLwZLYp10Xk3oWlocpPaEMmhS7ZWcOi8ShIXMzqgk5nUrJYys9CDQNuQ/VoGgfb0HHnk2cNALPQitqNnv2qFMdndJNjAe2byaVIWljeyY6OVh/FGljnowLupVelDdwE5TxQlcZFIEDP7wVzXaC1p+aADa7bxyLszjTu2lQAyXlOwnOV201YNe4PzBcm+YDJTOmkP2G8asAo8XL3b87jntriroiLjLqrCCpIcxip+tjyM1A7K/iIow4zgDbNrRvRvre0WeOKj4qnTMwl2ZYyDExFfKJiwo/uc1F/91OoY1YfGOBbTZwccDxhNMEVOTljCeo74j5gswZn3DkZymZPT+Imbc8EzEC2cJMkdPbQlJqGz5yo+8X3Y6Y3kCAI1WZrE611/LduHtPCSVd1DxN4uLcST/nJyLSpq9JsPMoESZ2B9tLP9OWK9X/OUEOa/CGe01mAtdEd+oRsIjxjX8SjjcSq0iXhfCNjaXxo50u+bFqn7k03fDVpq9I1vQ901AZ/1rrhOmEBH1BigVj/PEPg8elmN7i2oDZJ0J8ykHoPuyppqml/qHINr888cp3B0X3Q4sG3J0vtNm5k4PrAX31XcfzKxI7Xca5ShayBGNColbB1t4IjYxWda0QsdAf5hwQg91bGz4uzSssBBkV1Z69svS7AGaOtPzisAype9Q== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230022)(4636009)(376002)(346002)(136003)(396003)(39860400002)(451199015)(40470700004)(36840700001)(46966006)(44832011)(2906002)(5660300002)(70206006)(36860700001)(8676002)(41300700001)(7696005)(8936002)(36756003)(70586007)(83380400001)(4326008)(316002)(86362001)(2616005)(82310400005)(426003)(336012)(6916009)(47076005)(186003)(40460700003)(1076003)(40480700001)(478600001)(81166007)(107886003)(26005)(82740400003)(54906003)(6666004);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2023 08:54:13.7539 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bd4cf88b-290a-448c-d48c-08daf2e83f7a X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DBAEUR03FT036.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR08MB5722 NUMA implementation has a cpu_to_node array to store CPU to NODE map. Xen is using CPU logical ID in runtime components, so we use CPU logical ID as CPU index in cpu_to_node. In device tree case, cpu_logical_map is created in dt_smp_init_cpus. So, when NUMA is enabled, dt_smp_init_cpus will fetch CPU NUMA id at the same time for cpu_to_node. Signed-off-by: Wei Chen --- v1 -> v2: 1. Use static inline to replace macros to perform function paramerters type check. 2. Add numa_disabled to gate the numa-node-id check for CONFIG_NUMA on but numa disabled user case. 3. Use macro instead of static inline function to stub numa_set_node. --- xen/arch/arm/include/asm/numa.h | 4 ++++ xen/arch/arm/smpboot.c | 36 +++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/xen/arch/arm/include/asm/numa.h b/xen/arch/arm/include/asm/numa.h index dbdb632711..3bc28416b4 100644 --- a/xen/arch/arm/include/asm/numa.h +++ b/xen/arch/arm/include/asm/numa.h @@ -70,6 +70,10 @@ static inline bool arch_numa_broken(void) return true; } +static inline void numa_set_node(unsigned int cpu, nodeid_t node) +{ +} + #endif #define arch_want_default_dmazone() (false) diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c index 412ae22869..5ee6ab11e9 100644 --- a/xen/arch/arm/smpboot.c +++ b/xen/arch/arm/smpboot.c @@ -118,7 +118,12 @@ static void __init dt_smp_init_cpus(void) { [0 ... NR_CPUS - 1] = MPIDR_INVALID }; + static nodeid_t node_map[NR_CPUS] __initdata = + { + [0 ... NR_CPUS - 1] = NUMA_NO_NODE + }; bool bootcpu_valid = false; + unsigned int nid = 0; int rc; mpidr = system_cpuinfo.mpidr.bits & MPIDR_HWID_MASK; @@ -169,6 +174,28 @@ static void __init dt_smp_init_cpus(void) continue; } + if ( IS_ENABLED(CONFIG_NUMA) ) + { + /* + * When CONFIG_NUMA is set, try to fetch numa infomation + * from CPU dts node, otherwise the nid is always 0. + */ + if ( !dt_property_read_u32(cpu, "numa-node-id", &nid) ) + { + printk(XENLOG_WARNING + "cpu[%d] dts path: %s: doesn't have numa information!\n", + cpuidx, dt_node_full_name(cpu)); + /* + * During the early stage of NUMA initialization, when Xen + * found any CPU dts node doesn't have numa-node-id info, the + * NUMA will be treated as off, all CPU will be set to a FAKE + * node 0. So if we get numa-node-id failed here, we should + * set nid to 0. + */ + nid = 0; + } + } + /* * 8 MSBs must be set to 0 in the DT since the reg property * defines the MPIDR[23:0] @@ -228,9 +255,13 @@ static void __init dt_smp_init_cpus(void) { printk("cpu%d init failed (hwid %"PRIregister"): %d\n", i, hwid, rc); tmp_map[i] = MPIDR_INVALID; + node_map[i] = NUMA_NO_NODE; } else + { tmp_map[i] = hwid; + node_map[i] = nid; + } } if ( !bootcpu_valid ) @@ -246,6 +277,11 @@ static void __init dt_smp_init_cpus(void) continue; cpumask_set_cpu(i, &cpu_possible_map); cpu_logical_map(i) = tmp_map[i]; + + nid = node_map[i]; + if ( nid >= MAX_NUMNODES ) + nid = 0; + numa_set_node(i, nid); } } From patchwork Tue Jan 10 08:49:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 13094853 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 1B9BBC54EBE for ; Tue, 10 Jan 2023 08:54:34 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.474443.735675 (Exim 4.92) (envelope-from ) id 1pFAOo-0008Lv-O9; Tue, 10 Jan 2023 08:54:26 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 474443.735675; Tue, 10 Jan 2023 08:54:26 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pFAOo-0008Ll-K6; Tue, 10 Jan 2023 08:54:26 +0000 Received: by outflank-mailman (input) for mailman id 474443; Tue, 10 Jan 2023 08:54:25 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pFAOn-0005oC-LN for xen-devel@lists.xenproject.org; Tue, 10 Jan 2023 08:54:25 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2074.outbound.protection.outlook.com [40.107.7.74]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 610301df-90c4-11ed-b8d0-410ff93cb8f0; Tue, 10 Jan 2023 09:54:23 +0100 (CET) Received: from AS9P251CA0012.EURP251.PROD.OUTLOOK.COM (2603:10a6:20b:50f::14) by AS8PR08MB6023.eurprd08.prod.outlook.com (2603:10a6:20b:291::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Tue, 10 Jan 2023 08:54:21 +0000 Received: from AM7EUR03FT020.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:50f:cafe::a0) by AS9P251CA0012.outlook.office365.com (2603:10a6:20b:50f::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18 via Frontend Transport; Tue, 10 Jan 2023 08:54:20 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM7EUR03FT020.mail.protection.outlook.com (100.127.140.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18 via Frontend Transport; Tue, 10 Jan 2023 08:54:20 +0000 Received: ("Tessian outbound 43b0faad5a68:v132"); Tue, 10 Jan 2023 08:54:20 +0000 Received: from 6c9be4230c91.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id B72E062C-9E7F-45B2-933D-CA866276CC5D.1; Tue, 10 Jan 2023 08:54:13 +0000 Received: from EUR01-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 6c9be4230c91.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 10 Jan 2023 08:54:13 +0000 Received: from AM6PR01CA0063.eurprd01.prod.exchangelabs.com (2603:10a6:20b:e0::40) by GV2PR08MB7956.eurprd08.prod.outlook.com (2603:10a6:150:a9::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Tue, 10 Jan 2023 08:54:09 +0000 Received: from VI1EUR03FT017.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:e0:cafe::f4) by AM6PR01CA0063.outlook.office365.com (2603:10a6:20b:e0::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18 via Frontend Transport; Tue, 10 Jan 2023 08:54:08 +0000 Received: from nebula.arm.com (40.67.248.234) by VI1EUR03FT017.mail.protection.outlook.com (100.127.145.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5986.18 via Frontend Transport; Tue, 10 Jan 2023 08:54:08 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Tue, 10 Jan 2023 08:54:00 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.86) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.16 via Frontend Transport; Tue, 10 Jan 2023 08:53:58 +0000 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: 610301df-90c4-11ed-b8d0-410ff93cb8f0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DetB4lMCYSGFHbQ+S23R1nmvP6AkNk5bezLoeuNo2NQ=; b=CjYW9OA5MiITfPRLeAQJdBtRhIIzXkoXUeLTsylRqosW0eZ5fT1/96spS8RcdECNGzla6LAu1pnAvPEJws6jZTKutIQh25/plhP6g5Q+g2qq6lLH30tl6Z2xbjAY2McqQ7OhYemVvH39LQAyf05iqCUlnd9hdLqPZ2TydNKt76c= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C X-CheckRecipientChecked: true X-CR-MTA-CID: 138f2759a09173da X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k/UZejh/sDhmr1GIIVrikmdsspgU0j0oko0y7Pq0nmGe9UN8Uju5V0Y3Fr0TF7F9NAoQGYHx+b9EO7YznfB0lyAKduICwGn+nyydzUSSeEOtlEW7KTjN/s3SbqpAzCI8Mka+g0jAOePvva6uok91EkDqRIkdO/LFo3u4tSK4G05vq2GdhABgAMGDvMRDpGDXwLV4tTda2s5fiRvbxGKES6BeJhD22w500pY64ERUjqjAIgeYU5Rv1ynzVjP58WlCOGOPo2f9W3dbAHymnBTheeMQHF+Vp48S9S8aeTU2NVHLa5ZrmirPaGOUaX4mLRf5zObTfw9Ll0xDlhK7DY1lWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=DetB4lMCYSGFHbQ+S23R1nmvP6AkNk5bezLoeuNo2NQ=; b=h81WCsFZthOa9TZtRLQfeHFDvD/QJEonb5RqdioAp6nVhSMKyWiatu3BlTi/uQvSvnT1EbG9ce9uFGuHFZzbby4gHzIOXEkez4g2lnCmH7DO6YiNkd4caR9mDBDpNqaOKKaxzihBqrcEbIw6udJdjl7AM65kkHtHiTZxscFMUAgnfmgSlJTaP8axt49B7MhvErq/L4TakHSXMcxo3K2pHkzs1YYSHh0mlY5Dv6PijnnubTp2WyXAIm9d4jtIt9TQA5tgHPSLzzVl4Fg2ucDC9ECMbPIUfM8mmEH3+qIwWyD2iJK9NVtZBCt9cpwhBGoVJVatuEbVGdQdlbS9x63lVQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DetB4lMCYSGFHbQ+S23R1nmvP6AkNk5bezLoeuNo2NQ=; b=CjYW9OA5MiITfPRLeAQJdBtRhIIzXkoXUeLTsylRqosW0eZ5fT1/96spS8RcdECNGzla6LAu1pnAvPEJws6jZTKutIQh25/plhP6g5Q+g2qq6lLH30tl6Z2xbjAY2McqQ7OhYemVvH39LQAyf05iqCUlnd9hdLqPZ2TydNKt76c= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C From: Wei Chen To: CC: , Wei Chen , Stefano Stabellini , Julien Grall , Bertrand Marquis , Volodymyr Babchuk Subject: [PATCH v2 06/17] xen/arm: Add boot and secondary CPU to NUMA system Date: Tue, 10 Jan 2023 16:49:19 +0800 Message-ID: <20230110084930.1095203-7-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230110084930.1095203-1-wei.chen@arm.com> References: <20230110084930.1095203-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: VI1EUR03FT017:EE_|GV2PR08MB7956:EE_|AM7EUR03FT020:EE_|AS8PR08MB6023:EE_ X-MS-Office365-Filtering-Correlation-Id: 6f6f6376-5ef1-4973-1930-08daf2e84397 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: aS+J3UKHWPXZoOTlJwyBHwOsVJ8zE3h4K0qY36ZEiw2IY+Pf0ED6kCVnVdrfC3unMz2KM62mpTtbZGeTF2tO844Xu5iSI77dqUiNvIcDSksnfQm4W5a54jG2UWxMUqRhN/8y2cbCOO7KzZgxsUYw2OTODNt2KxKSW1GL/dd8BXbVfeWLfkBaYRx1GsyTx3fRSnP0vliGuhPOfm6Uj90dzBoK5WXhM6jK8xHkNp6I/3GkF8FBT2+8LVWzT6V5L7/BdWt5tgkT+NF8lO/XqMsMCzGAcYHBulTSI9sMpTL1WlJq8vq21WNnH6O382DhiAxKjDms9TEI0cVbHKYvAlMXgw5xZKE0MhfvYAB0ehXEJEf+kGwocVHSKRmC+JmALb7HgclQc0zOpr0Y4wK7Z6J47zig7oH9BNc6za4jUITLZS80c41auYKQGMM+hz6vsVPrATH3uWlTn6jSBXUQLEKlneWG/RfUcBmQ42/wumqIqFcQFIxdN3LkROU3Ia/Hm/wOrXTE9n/5MXq17US2Z/fSvC8enSE8W8TaehuJZwu+GH1HHGFGxFFRDer+1e27bxQk3VCzf0xW1TuXpMUUcHKFMzhgAzCss6iuLiwryEdEQxcaENeVT+T6JW7P32ihYAWTNNRO/XJwrbD5IiiQ9jEjesuG9BujlpUW0yoiy0Dd/XrNI23Qro0pJgJD75sZ7dZ0HCEw+/Gtz1XSyi6IeH8GzQ== X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(376002)(39860400002)(396003)(136003)(346002)(451199015)(46966006)(36840700001)(83380400001)(426003)(82310400005)(47076005)(316002)(86362001)(54906003)(6916009)(40480700001)(36756003)(7696005)(356005)(81166007)(82740400003)(186003)(336012)(26005)(2616005)(1076003)(2906002)(44832011)(478600001)(6666004)(5660300002)(8936002)(36860700001)(70206006)(41300700001)(4326008)(70586007)(8676002)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR08MB7956 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT020.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: aa82329a-87e4-4135-0f00-08daf2e83c93 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GVNyi/5bICXOl0fQBUzMg1x3cmPpCFtJw1r5zASEgFs6re1mKVZzDYlPhnlISFnO20hcGGp9WdGRpt8cBiN5mqbxMTbnibjBg5+A3doKjH7phhCZUAN3EMUTHCGLeiGa37yCYgz9jVIADZHeNS/mCWtZHXV9DcsN220hgGwBG1PbJfvJ6YoUwG5NSZU7JAT4dRQQmENeYUCTtyubhYZ86YOuA4vv68LL+suzLAuLLQzt2SrpTPzWUJKxqlsUOvDEJzxgjkIkiilEHW+DM+PR7vS0e37UGHU2qTL3uL3Mr0cadlgJUqntvn2Xfr/m3CQgzRBh9pfsh/JmwIkRmzMltqFAWablQ2BECaoWBfd7Mtf9BKPm3JCCGJIhbtKC4Jykh/b2j1I+0Xt9pdehD5hNrOzZJl3Rz/NyJcdcUKg/YmSvV5TmVBnwHPum+RE6+FJncXSSfi2yZPej0K685FI3AWGBX+TUSllKkBKvOQ45FV7jp76hiDRQozKq0iTOcRDTSF9/OSN8RvSy1g06dNvf7mGqll1QYiFWXRZAVJNf7zwc8MMEmcWeh8499mhp/Gb2nHCQ+QmtoDIe9CSpROXuRytyWUbhHBZDtSg+CrHT4ITNGbzjlVFUirAgpVRE8VpAVHpVIBobu39YZear4q+wcuzpyfcTqO8AxPdYFNvqxdJRSdfV4KBPN2SPMtcEo74pSs+ya6tk1yQxao1DJwwhYw== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230022)(4636009)(346002)(376002)(136003)(39860400002)(396003)(451199015)(46966006)(40470700004)(36840700001)(5660300002)(44832011)(8936002)(41300700001)(2906002)(36756003)(54906003)(83380400001)(8676002)(70586007)(70206006)(4326008)(316002)(6916009)(7696005)(26005)(81166007)(186003)(6666004)(86362001)(478600001)(107886003)(336012)(1076003)(2616005)(40480700001)(47076005)(82740400003)(426003)(82310400005)(36860700001)(40460700003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2023 08:54:20.6031 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6f6f6376-5ef1-4973-1930-08daf2e84397 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM7EUR03FT020.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6023 In this patch, we make NUMA node online and add cpu to its NUMA node. This will make NUMA-aware components have NUMA affinity data to support their work. To keep the mostly the same behavior of x86, we use numa_detect_cpu_node to online node. The difference is that, we have prepared cpu_to_node in dt_smp_init_cpus, so we don't need to setup cpu_to_node in numa_detect_cpu_node. Signed-off-by: Wei Chen --- v2 -> v3: 1. Use unsigned int instead of int for cpu id. 2. Use static inline for stub to do type check. v1 -> v2: 1. Use numa_detect_cpu_node to online node. 2. Use macros instead of static inline functions to stub numa_detect_cpu_node. --- xen/arch/arm/include/asm/numa.h | 9 +++++++++ xen/arch/arm/numa.c | 10 ++++++++++ xen/arch/arm/setup.c | 5 +++++ 3 files changed, 24 insertions(+) diff --git a/xen/arch/arm/include/asm/numa.h b/xen/arch/arm/include/asm/numa.h index 3bc28416b4..e0c909cbb7 100644 --- a/xen/arch/arm/include/asm/numa.h +++ b/xen/arch/arm/include/asm/numa.h @@ -41,6 +41,7 @@ enum dt_numa_status { extern void numa_set_distance(nodeid_t from, nodeid_t to, unsigned int distance); +extern void numa_detect_cpu_node(unsigned int cpu); #else @@ -74,6 +75,14 @@ static inline void numa_set_node(unsigned int cpu, nodeid_t node) { } +static inline void numa_add_cpu(unsigned int cpu) +{ +} + +static inline void numa_detect_cpu_node(unsigned int cpu) +{ +} + #endif #define arch_want_default_dmazone() (false) diff --git a/xen/arch/arm/numa.c b/xen/arch/arm/numa.c index dcfcd85fcf..4dd7cf10ba 100644 --- a/xen/arch/arm/numa.c +++ b/xen/arch/arm/numa.c @@ -74,6 +74,16 @@ void __init numa_set_distance(nodeid_t from, nodeid_t to, node_distance_map[from][to] = distance; } +void numa_detect_cpu_node(unsigned int cpu) +{ + nodeid_t node = cpu_to_node[cpu]; + + if ( node == NUMA_NO_NODE ) + node = 0; + + node_set_online(node); +} + unsigned char __node_distance(nodeid_t from, nodeid_t to) { /* When NUMA is off, any distance will be treated as remote. */ diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c index 1f26f67b90..8c02cf6cd4 100644 --- a/xen/arch/arm/setup.c +++ b/xen/arch/arm/setup.c @@ -1115,6 +1115,11 @@ void __init start_xen(unsigned long boot_phys_offset, for_each_present_cpu ( i ) { + /* Detect and online node based on cpu_to_node[]. */ + numa_detect_cpu_node(i); + /* Set up node_to_cpumask based on cpu_to_node[]. */ + numa_add_cpu(i); + if ( (num_online_cpus() < nr_cpu_ids) && !cpu_online(i) ) { int ret = cpu_up(i); From patchwork Tue Jan 10 08:49:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 13094862 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 062CAC46467 for ; Tue, 10 Jan 2023 08:55:36 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.474490.735768 (Exim 4.92) (envelope-from ) id 1pFAPm-0004l2-Fj; Tue, 10 Jan 2023 08:55:26 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 474490.735768; Tue, 10 Jan 2023 08:55:26 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pFAPm-0004jr-7T; Tue, 10 Jan 2023 08:55:26 +0000 Received: by outflank-mailman (input) for mailman id 474490; Tue, 10 Jan 2023 08:55:24 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pFAOt-0005oC-Vo for xen-devel@lists.xenproject.org; Tue, 10 Jan 2023 08:54:32 +0000 Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on2060.outbound.protection.outlook.com [40.107.241.60]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 64252c3d-90c4-11ed-b8d0-410ff93cb8f0; Tue, 10 Jan 2023 09:54:29 +0100 (CET) Received: from DB3PR08CA0023.eurprd08.prod.outlook.com (2603:10a6:8::36) by AS8PR08MB8014.eurprd08.prod.outlook.com (2603:10a6:20b:573::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Tue, 10 Jan 2023 08:54:23 +0000 Received: from DBAEUR03FT046.eop-EUR03.prod.protection.outlook.com (2603:10a6:8:0:cafe::7f) by DB3PR08CA0023.outlook.office365.com (2603:10a6:8::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18 via Frontend Transport; Tue, 10 Jan 2023 08:54:23 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DBAEUR03FT046.mail.protection.outlook.com (100.127.142.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18 via Frontend Transport; Tue, 10 Jan 2023 08:54:23 +0000 Received: ("Tessian outbound 43b0faad5a68:v132"); Tue, 10 Jan 2023 08:54:23 +0000 Received: from 2c054ce7be9b.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 905571E1-3E67-479C-9FC7-959B1C3C0CE3.1; Tue, 10 Jan 2023 08:54:16 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 2c054ce7be9b.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 10 Jan 2023 08:54:16 +0000 Received: from FR3P281CA0152.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a2::6) by AM8PR08MB5570.eurprd08.prod.outlook.com (2603:10a6:20b:1d2::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Tue, 10 Jan 2023 08:54:14 +0000 Received: from VI1EUR03FT055.eop-EUR03.prod.protection.outlook.com (2603:10a6:d10:a2:cafe::9) by FR3P281CA0152.outlook.office365.com (2603:10a6:d10:a2::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.11 via Frontend Transport; Tue, 10 Jan 2023 08:54:14 +0000 Received: from nebula.arm.com (40.67.248.234) by VI1EUR03FT055.mail.protection.outlook.com (100.127.144.130) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5986.18 via Frontend Transport; Tue, 10 Jan 2023 08:54:14 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Tue, 10 Jan 2023 08:54:03 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.86) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.16 via Frontend Transport; Tue, 10 Jan 2023 08:54:01 +0000 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: 64252c3d-90c4-11ed-b8d0-410ff93cb8f0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=M0LsJ5CSUqhuJ+jKKH9S6bS+xUQ/jDtaI6zjdX/HcC4=; b=WgH4ZFzxCtwfDNF2TYm+Q3vSBwWD9rEQb4TbvG0TOlzyuovBK158ivFlfQksCTuKqgZatB1Cz8A+f8Nn1k0lhiJm52dmcxykXXCdncAAz86PloSxBXTHHgv/9kiQifdq13ZBwyaeOKUJo8sfZksjaRJqCjlzvRGgjxX9NYVqzF0= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C X-CheckRecipientChecked: true X-CR-MTA-CID: 7d9229752571d865 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R6jgDNrWZ3RsmHR7P4XYzN/NdlYbwODLleULfn9UNAYMir2VIF7zBlO7Ls27pwSvg5oIx/q7PCuQ5edJrwtAdwT46/QZLpb76MPqSVkitkvSFGOi5dH/qOtHb2jCJ9MFsvb6ObRYcQsrat8y8nVVPr4T9e0zHRAQZIXyu2z175WSSE240ZAeQWwh9Rt7GylPisUm6DxHRNA8UU0nOrLOyyszn323yM2xJ4M7zyoLvVqRkUdYPfNk7niwTR+f48MWsqnFLG/1lzgAfgWsEUK5roCx1xP9ZeHfWHsRuuxRWB4VXDMwUW0iQzBxRfHUrvuLlotJ/pLY+CjViN2X05XjoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=M0LsJ5CSUqhuJ+jKKH9S6bS+xUQ/jDtaI6zjdX/HcC4=; b=UTf5mljz33ND6pukkxyxuZg5BTqGNlTcWhypwwBfqzDDXsDjDZpHn06FfjKnZZY86SOdGH2j6B7UDOIjlwSEbdT8JmHRd12NkYiMaWWfLbK2nwzQc4Qqm3aZ5vEDtpBvaLbADi3NwDn0EsHHvQCFiO5ZNnC85vutBlzp0iLltQT28FZ+Lgq98EfjjtKFKyve5sPE5a4LJEcP8g0zRIPp7y/FuwHvMEr8tpqx7rwDyWHTTuQbwSKfi371zw7v9OWw+2g4Kmgb20CCCI5kkchlG36l0dBxt2yU3TBTNw8i0fUcDXorvpBCmXD2zKbGxlTN8OXdn9Ag7xnfakOlb05NaQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=M0LsJ5CSUqhuJ+jKKH9S6bS+xUQ/jDtaI6zjdX/HcC4=; b=WgH4ZFzxCtwfDNF2TYm+Q3vSBwWD9rEQb4TbvG0TOlzyuovBK158ivFlfQksCTuKqgZatB1Cz8A+f8Nn1k0lhiJm52dmcxykXXCdncAAz86PloSxBXTHHgv/9kiQifdq13ZBwyaeOKUJo8sfZksjaRJqCjlzvRGgjxX9NYVqzF0= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C From: Wei Chen To: CC: , Wei Chen , Stefano Stabellini , Julien Grall , Bertrand Marquis , Volodymyr Babchuk Subject: [PATCH v2 07/17] xen/arm: introduce a helper to parse device tree processor node Date: Tue, 10 Jan 2023 16:49:20 +0800 Message-ID: <20230110084930.1095203-8-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230110084930.1095203-1-wei.chen@arm.com> References: <20230110084930.1095203-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: VI1EUR03FT055:EE_|AM8PR08MB5570:EE_|DBAEUR03FT046:EE_|AS8PR08MB8014:EE_ X-MS-Office365-Filtering-Correlation-Id: 1f7a8fcb-cf41-4814-5cb6-08daf2e84566 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 1dn9LWEKyH0NMvNktotZQO1LMC0LUoKoNrL0OaDJ1rCVnG+XJJKj8ABBXnDcO40W00Rrb08qt9fWJgMn33fBt6OA/aWxVjazCfgpaelNlDGUn7ZrC1DIZDM3iTOudKyk9TOeiQOOfwV9UsjuWZ7oCRCnEhfY+woXV8k6EMT5ER5PSR/llt+2gv1QVoPSyIFiWNUYYkCKDgU+bUPrdoQdnO/FFfdAPU+gaYOiehCsfIGsPcWpHvLgkf7BAPSQmZXXzvfv7CdCVCRzU0eVVH8ZcRYr28fvtG7Gam5wfQIgclhxtcf7c3lLMlPItWnn/ySFmprS9ZRkP04vSAmCr33K1mzg9r/0q61ytraN74SS/l2h4maQRR44iMbjLVgf/9lIUh0CM2ACG9aslS4XDRQSFrsiKs4REGMk+Q3iIlELYdlgaLb+nvrX6Zdwc8FXOowA5NwsUZHIJqfGmql+lMNWe2k++lsnokavl65lsK3ppFG6bT1NtIAmcKsLRdS8j2D1zRtYs4pidexvMVU2Y2Y1TDLqtHnEh7YeUzD+vX2sSvmXDpqqOB/4qvkGH5JtCzclh8jtIDj0FxCgwnKPmvXqebMQ3GJKaOXlk9slre9qPUUMrhPXJWcsZt3BVnsWVOYr9ApVmfsGUw9OwBWwk5rHHdThKc1Jq5OQPxUGDvQGcrEcBFchpv677RV0So09ll1xS+b+PdQqO4VDf0IgCHKvB6c1EEkDSVLSHPP2uf1vmhQHdwTZKbx98Q2pKtU0yg1j X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(346002)(376002)(136003)(39860400002)(396003)(451199015)(46966006)(36840700001)(5660300002)(44832011)(8936002)(41300700001)(2906002)(36756003)(54906003)(83380400001)(8676002)(70586007)(70206006)(4326008)(316002)(6916009)(7696005)(26005)(81166007)(186003)(6666004)(86362001)(478600001)(336012)(1076003)(2616005)(40480700001)(47076005)(82740400003)(356005)(426003)(82310400005)(36860700001)(2004002)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR08MB5570 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT046.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 397c67c1-6fe2-499a-0e00-08daf2e83ff4 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UO7Y7HN+aYDoyYCIxAQOUE9CJxW5LrZTDETgW7GLoZt54HIhkzx53jEXBrev3EaQMKlHSBh1DLNIj6UJxmJg5RYkIGZqMQUNT8B32pWJ1k/JJviFUm2M5dM19v1NZP76hSTWj5tgS4oJJm/cZfWethdMjYucOsEGa501MZeSn0OWfsWYzqVP84wrG/cx5+L5BiLBI39KQpIMCP03/H9Kps969UqXRUUMYg+zLNi+535naJQLnRSlI0LxECG+sr7x3qrKF9dXFvMIkd/J82lfRZ8s4GI3Z3cekFnoq3on3z30MqxiHIUSenddJg7BqyjOvYE4EbMCINs7sbo2fvn3w91YT/Wi20gzJkukTULDiaormFudITFD1ixepUiMsP6U4xkeByEyKWe5751RdEOKFGOyzGwWBdxbfswcULAoLJhPpMRCKoOobGcQdBRHxxyFinwo1eA3OyhLyFn2wscBCRR4vt3AsmcU6YpD9y9mbfuYV+u6rRUGdwt1svJgV/FY9hl0Do0jsygfsV/rMEjMn8m3MCv9TgWkM60rVZcJUVV91eIYTffds71wv5aCmY2MQu1EvdQSMNM7ps8jRaSRTi7yqRD8w3kAdZuDcNRNBpiMKYpGTleXlcLWrlj+Q82i4/AdVPzTWadeNK7qIuwadUDRGPO3jymwFvPeo1e+xLJQIFYd/dhDCqSZWoXklYO17mbSOiNYw++IMCCBV2j4vncFphA+6xy9EhZ9FMl7fIuZmdRmua7V6mYpkM4MXHNe X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230022)(4636009)(396003)(136003)(39860400002)(376002)(346002)(451199015)(36840700001)(46966006)(40470700004)(36756003)(81166007)(70206006)(4326008)(5660300002)(44832011)(8676002)(2906002)(8936002)(70586007)(83380400001)(82740400003)(36860700001)(86362001)(7696005)(478600001)(316002)(6666004)(6916009)(54906003)(40460700003)(40480700001)(82310400005)(41300700001)(336012)(107886003)(47076005)(1076003)(26005)(186003)(2616005)(426003)(2004002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2023 08:54:23.6861 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1f7a8fcb-cf41-4814-5cb6-08daf2e84566 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DBAEUR03FT046.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB8014 Processor NUMA ID information is stored in device tree's processor node as "numa-node-id". We need a new helper to parse this ID from processor node. If we get this ID from processor node, this ID's validity still need to be checked. Once we got a invalid NUMA ID from any processor node, the device tree will be marked as NUMA information invalid. Signed-off-by: Wei Chen --- v1 -> v2: 1. Move numa_disabled from fdt_numa_processor_affinity_init to fdt_parse_numa_cpu_node. 2. Move invalid NUMA id check to fdt_parse_numa_cpu_node. 3. Return ENODATA for normal dtb without NUMA info. 4. Use NUMA status helpers instead of SRAT functions. --- xen/arch/arm/Makefile | 1 + xen/arch/arm/include/asm/numa.h | 2 ++ xen/arch/arm/numa.c | 2 +- xen/arch/arm/numa_device_tree.c | 64 +++++++++++++++++++++++++++++++++ 4 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 xen/arch/arm/numa_device_tree.c diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile index 9073398d6e..bbc68e3735 100644 --- a/xen/arch/arm/Makefile +++ b/xen/arch/arm/Makefile @@ -39,6 +39,7 @@ obj-y += mem_access.o obj-y += mm.o obj-y += monitor.o obj-$(CONFIG_NUMA) += numa.o +obj-$(CONFIG_DEVICE_TREE_NUMA) += numa_device_tree.o obj-y += p2m.o obj-y += percpu.o obj-y += platform.o diff --git a/xen/arch/arm/include/asm/numa.h b/xen/arch/arm/include/asm/numa.h index e0c909cbb7..923ffbfd42 100644 --- a/xen/arch/arm/include/asm/numa.h +++ b/xen/arch/arm/include/asm/numa.h @@ -28,6 +28,8 @@ enum dt_numa_status { DT_NUMA_OFF, }; +extern enum dt_numa_status device_tree_numa; + /* * In ACPI spec, 0-9 are the reserved values for node distance, * 10 indicates local node distance, 20 indicates remote node diff --git a/xen/arch/arm/numa.c b/xen/arch/arm/numa.c index 4dd7cf10ba..3e02cec646 100644 --- a/xen/arch/arm/numa.c +++ b/xen/arch/arm/numa.c @@ -20,7 +20,7 @@ #include #include -static enum dt_numa_status __read_mostly device_tree_numa; +enum dt_numa_status __read_mostly device_tree_numa; static unsigned char __read_mostly node_distance_map[MAX_NUMNODES][MAX_NUMNODES] = { diff --git a/xen/arch/arm/numa_device_tree.c b/xen/arch/arm/numa_device_tree.c new file mode 100644 index 0000000000..c031053d24 --- /dev/null +++ b/xen/arch/arm/numa_device_tree.c @@ -0,0 +1,64 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Arm Architecture support layer for device tree NUMA. + * + * Copyright (C) 2022 Arm Ltd + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#include +#include +#include +#include +#include + +/* Callback for device tree processor affinity */ +static int __init fdt_numa_processor_affinity_init(nodeid_t node) +{ + numa_set_processor_nodes_parsed(node); + device_tree_numa = DT_NUMA_ON; + + printk(KERN_INFO "DT: NUMA node %"PRIu8" processor parsed\n", node); + + return 0; +} + +/* Parse CPU NUMA node info */ +static int __init fdt_parse_numa_cpu_node(const void *fdt, int node) +{ + unsigned int nid; + + if ( numa_disabled() ) + return -EINVAL; + + /* + * device_tree_get_u32 will return NUMA_NO_NODE when this CPU + * DT node doesn't have numa-node-id. This can help us to + * distinguish a bad DTB and a normal DTB without NUMA info. + */ + nid = device_tree_get_u32(fdt, node, "numa-node-id", NUMA_NO_NODE); + if ( nid == NUMA_NO_NODE ) + { + numa_fw_bad(); + return -ENODATA; + } + else if ( nid >= MAX_NUMNODES ) + { + printk(XENLOG_ERR "DT: CPU numa node id %u is invalid\n", nid); + numa_fw_bad(); + return -EINVAL; + } + + return fdt_numa_processor_affinity_init(nid); +} From patchwork Tue Jan 10 08:49:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 13094852 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 24D5CC61DB3 for ; Tue, 10 Jan 2023 08:54:33 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.474438.735664 (Exim 4.92) (envelope-from ) id 1pFAOm-0007vw-F3; Tue, 10 Jan 2023 08:54:24 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 474438.735664; Tue, 10 Jan 2023 08:54:24 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pFAOm-0007v2-AD; Tue, 10 Jan 2023 08:54:24 +0000 Received: by outflank-mailman (input) for mailman id 474438; Tue, 10 Jan 2023 08:54:22 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pFAOk-0005oC-ED for xen-devel@lists.xenproject.org; Tue, 10 Jan 2023 08:54:22 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2051.outbound.protection.outlook.com [40.107.20.51]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 5eadc0bb-90c4-11ed-b8d0-410ff93cb8f0; Tue, 10 Jan 2023 09:54:19 +0100 (CET) Received: from AS9P251CA0024.EURP251.PROD.OUTLOOK.COM (2603:10a6:20b:50f::26) by AS8PR08MB10272.eurprd08.prod.outlook.com (2603:10a6:20b:62b::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Tue, 10 Jan 2023 08:54:17 +0000 Received: from AM7EUR03FT020.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:50f:cafe::a0) by AS9P251CA0024.outlook.office365.com (2603:10a6:20b:50f::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18 via Frontend Transport; Tue, 10 Jan 2023 08:54:17 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM7EUR03FT020.mail.protection.outlook.com (100.127.140.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18 via Frontend Transport; Tue, 10 Jan 2023 08:54:17 +0000 Received: ("Tessian outbound 43b0faad5a68:v132"); Tue, 10 Jan 2023 08:54:17 +0000 Received: from ce7d68c79393.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id DCA68D6C-84A1-4841-B4DA-AE16FA9E8149.1; Tue, 10 Jan 2023 08:54:10 +0000 Received: from EUR03-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id ce7d68c79393.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 10 Jan 2023 08:54:10 +0000 Received: from AS9PR04CA0143.eurprd04.prod.outlook.com (2603:10a6:20b:48a::24) by AS4PR08MB8021.eurprd08.prod.outlook.com (2603:10a6:20b:584::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Tue, 10 Jan 2023 08:54:07 +0000 Received: from AM7EUR03FT045.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:48a:cafe::74) by AS9PR04CA0143.outlook.office365.com (2603:10a6:20b:48a::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18 via Frontend Transport; Tue, 10 Jan 2023 08:54:07 +0000 Received: from nebula.arm.com (40.67.248.234) by AM7EUR03FT045.mail.protection.outlook.com (100.127.140.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5986.18 via Frontend Transport; Tue, 10 Jan 2023 08:54:07 +0000 Received: from AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Tue, 10 Jan 2023 08:54:07 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Tue, 10 Jan 2023 08:54:06 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.86) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.16 via Frontend Transport; Tue, 10 Jan 2023 08:54:04 +0000 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: 5eadc0bb-90c4-11ed-b8d0-410ff93cb8f0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OKOqbwKgR3BpQXq2D8GZb/uo0PrVqRyZlKb7VkWKCUg=; b=AXnC8dht/q3saI6VzXewmyQIF1ygQWApxX737ntEYgSF1qsK0vD6c2sA1RwMWmPf+SCr2xHX2aP0c+uPjVufXv4LGxXiZicbyTVPFVLFUqb8Bi6zbndNDBHYEpua9CfhXTpHhIgEvgs3u4qmS9b9dp6XsAV4wrltkq/IVBZcCDg= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C X-CheckRecipientChecked: true X-CR-MTA-CID: 7cb5e6b944ac46a3 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZVvzccwh/3zGxJOsUbts1FUGLsjFolK0rMjB/BlvVlK//6wTHke8+1th5q8ij6DxZrh/QsjLpR+UxOmunx6+PQQKD9jCt1L8M5j+wGeKlEXn62p6SFRn+yg0GB0Q6dnIwdD+axbqn5aWghkmlOu/oSr9Bvz/ktJ3HdFcnCCyiBSotmaLi5a9MSTrZ1lk1g/IuqNL+PwnLNz7Wu8heDRJxTLoKj6eLD83N6gVYby2iBKosPeRz0E4l3xwI6TPGUT0qMiGdBh8Wcq37uUHA69z/rQbQ/4EXT5/xMxX5vHgk1fmI6iNPM6WBQbMG61c5719+PL+lXOg5NAAtgQDZpj8Sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=OKOqbwKgR3BpQXq2D8GZb/uo0PrVqRyZlKb7VkWKCUg=; b=XfnTSQv3AhqoRJm55lqZgy4/BvOzddIojFoX+9svsbb+3WTmYzyinyeIH2vhOZ9sfDN9WSGWmztDbj2Fo0LNX9tSDIRqQ27J9eWAyursULHI+BL/iJRZfhDZftRgiPIu3NcuH2ElxbjWmrg2VO+MLqDyydvMztkaWDFng4CEjce4l9EjXBkik4sakk6afa3vePd1o2AnuW4Dw68Ac4BF9O2AqZTFn9l3RWeD1gKrxGf6RviO3N/Kn12TgLV18uc6sTgoyYIpI14n5eKrvCL/bMxYuF9CFT7m1CSRDN8iwUGpN6uFuyoqcuDQXkzgUqYSMYjsEInmV4W1QEo51z/3tA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OKOqbwKgR3BpQXq2D8GZb/uo0PrVqRyZlKb7VkWKCUg=; b=AXnC8dht/q3saI6VzXewmyQIF1ygQWApxX737ntEYgSF1qsK0vD6c2sA1RwMWmPf+SCr2xHX2aP0c+uPjVufXv4LGxXiZicbyTVPFVLFUqb8Bi6zbndNDBHYEpua9CfhXTpHhIgEvgs3u4qmS9b9dp6XsAV4wrltkq/IVBZcCDg= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C From: Wei Chen To: CC: , Wei Chen , Stefano Stabellini , Julien Grall , Bertrand Marquis , Volodymyr Babchuk Subject: [PATCH v2 08/17] xen/arm: introduce a helper to parse device tree memory node Date: Tue, 10 Jan 2023 16:49:21 +0800 Message-ID: <20230110084930.1095203-9-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230110084930.1095203-1-wei.chen@arm.com> References: <20230110084930.1095203-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM7EUR03FT045:EE_|AS4PR08MB8021:EE_|AM7EUR03FT020:EE_|AS8PR08MB10272:EE_ X-MS-Office365-Filtering-Correlation-Id: 804971e2-82c8-4155-85b5-08daf2e841d4 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: cYC1f+ENHyJAnlqwLMSVrd/QKZpp8bFQw/NYKKG7PF23sg5hOcL8aXy9meIimpkmkmoX0f108tkj+WLiA8zoksBm92kundWXXBtANT3EFsrL05GmUeibh+Rb6td7vJf1lZOnIhC5NvpF6u8h76EadVhTDTNS9nrHyMH04Z3tzFRI7jefglp/b7ZvgJTnBqWXCNzxWtsGkQHP0eX8+RFvzhblIsgg8j5if/EPGHbXA01umoe9wYjjaQeQBcxwbbNoN3cioqZMGPkYQaPL7/OqC3EwheIoyucUdgNtMWD50gK+5T33/aDVPITtDE/HPYR+0lGkHM2hLbj2Af5mRvnlRDXWRpY5qfz0Gr4JwjAGyF9TcANP53AAD2scNH/pbhgOQYlQCVyrYQmU2p4OXHPKxHrF307cQ064ST5RmCnxdx0F9HUjDrTjGRD1L6ax/P3dhi9cZkw6YKPRXvql9F7jeI/OflVpXCAQuzHMQJ3VmNzHvrAVUFDiJu1V9XCClHQ0DkMj1jLCnQg/j+bqX7FhHj3FWkPr2gBUaixh+wHECaPQo4wrZDnY4f44BqbUUe2+xXwuqQ0DmGGQ7f+XjmakcNq9gvYAAQp+Cg4yOtkyatSPpm0n6cy+NG5v/RXg/mSpeuRfFTy/QRVYhORYWOJIkHgOrqgANSi2YG/F9tDR+x42xwGZ7DQFN3WniF3oZHjkwiOi8SgirOb2EzSYyS8vSw== X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(396003)(136003)(39860400002)(376002)(346002)(451199015)(36840700001)(46966006)(36756003)(82740400003)(81166007)(356005)(86362001)(2906002)(44832011)(8676002)(70206006)(70586007)(4326008)(5660300002)(8936002)(83380400001)(36860700001)(7696005)(316002)(54906003)(6666004)(6916009)(40480700001)(82310400005)(41300700001)(1076003)(47076005)(336012)(426003)(478600001)(186003)(2616005)(26005)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR08MB8021 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT020.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: ed89b6d8-b1b3-4969-9475-08daf2e83bcb X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tASn4v6OG2BoFMYZF9AgW2RWMlFlKpGv9j/M0edEIiWzE4w4kB/48VYlPsavsFGiSwzxeXl4GGIMqH7P53um9SQqgoag6SyOikYCnS/WuzPqQ1YsVnFTf6yVE8icJiU4zANRc5hkkCeM+HlGN0MBGUUersvOKdyJOg98t872jSEdCgv9P5Bn9uRbC6ekrKg6UOM/RGUD2QvG4UoHuK99HMhVl+1GAxWxX/JcJU26h38nSX5PEz1FJFqkz8umipHIPG/wGhvnn7k9vYKkIMmMuJ2zKMcrneVyXiTEJ697+Y6r71RV8ETCltuKwSfyqZg8IzEC+AwJejMd/AvjE83dufsElbdhf7myh2z9yNHCFwzc3OM3xs5om7Jd7Zlvu4o2AWLvcyhm9ozRrEJn9Rj3SSUj/79yBbMh/BvkbPOYQ8IrRSzMnPKYddZCuTIHH8JIi8AylqPAcMJmzBTZvjFb1Zd/rwAAuMWIYnqKMa2IYxQ+boHa+56k9KyIB+MbAgquPy7BhZK2BYwcryI7u1rDO7YWjQrDQnX120qxht6DJs1VkUHTXyB6f4q1B+eHPUFQSCXkAiI0n51KEyVtUUvFmPFak4FieMd+InFxlZ2SYnK9330M39OHbJHbF51/2l/1suyWYMC2WI/I9GmSThjdoTnNuSxgCrvwzfDQ74g/3T7j+qHkZ/LGoS+wRxQCAzRL2wen8cE2/iHQ3OPyHwfnyw== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230022)(4636009)(396003)(136003)(376002)(346002)(39860400002)(451199015)(46966006)(36840700001)(40470700004)(82740400003)(81166007)(36860700001)(54906003)(41300700001)(70586007)(86362001)(8676002)(40460700003)(6916009)(70206006)(6666004)(5660300002)(316002)(40480700001)(2906002)(44832011)(2616005)(1076003)(426003)(336012)(47076005)(83380400001)(7696005)(82310400005)(26005)(107886003)(186003)(8936002)(478600001)(4326008)(36756003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2023 08:54:17.6502 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 804971e2-82c8-4155-85b5-08daf2e841d4 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM7EUR03FT020.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB10272 Memory blocks' NUMA ID information is stored in device tree's memory nodes as "numa-node-id". We need a new helper to parse and verify this ID from memory nodes. Signed-off-by: Wei Chen --- v1->v2: 1. Move numa_disabled check to fdt_parse_numa_memory_node. 2. Use numa_bad to replace bad_srat. 3. Replace tabs by spaces. 4. Align parameters. 5. return ENODATA for a normal dtb without numa info. 6. Un-addressed comment: "Why not parse numa-node-id and call fdt_numa_memory_affinity_init from xen/arch/arm/bootfdt.c:device_tree_get_meminfo. Is it because device_tree_get_meminfo is called too early?" I checked the device_tree_get_meminfo code and I think the answer is similar as I reply in RFC. I prefer a unify numa initialization entry. Don't want to make numa parse code in different places. 7. Use node id as dummy PXM for numa_update_node_memblks. --- xen/arch/arm/numa_device_tree.c | 89 +++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) diff --git a/xen/arch/arm/numa_device_tree.c b/xen/arch/arm/numa_device_tree.c index c031053d24..793a410fd4 100644 --- a/xen/arch/arm/numa_device_tree.c +++ b/xen/arch/arm/numa_device_tree.c @@ -34,6 +34,26 @@ static int __init fdt_numa_processor_affinity_init(nodeid_t node) return 0; } +/* Callback for parsing of the memory regions affinity */ +static int __init fdt_numa_memory_affinity_init(nodeid_t node, + paddr_t start, paddr_t size) +{ + if ( !numa_memblks_available() ) + { + dprintk(XENLOG_WARNING, + "Too many numa entry, try bigger NR_NODE_MEMBLKS\n"); + return -EINVAL; + } + + numa_fw_nid_name = "numa-node-id"; + if ( !numa_update_node_memblks(node, node, start, size, false) ) + return -EINVAL; + + device_tree_numa = DT_NUMA_ON; + + return 0; +} + /* Parse CPU NUMA node info */ static int __init fdt_parse_numa_cpu_node(const void *fdt, int node) { @@ -62,3 +82,72 @@ static int __init fdt_parse_numa_cpu_node(const void *fdt, int node) return fdt_numa_processor_affinity_init(nid); } + +/* Parse memory node NUMA info */ +static int __init fdt_parse_numa_memory_node(const void *fdt, int node, + const char *name, + unsigned int addr_cells, + unsigned int size_cells) +{ + unsigned int nid; + int ret = 0, len; + paddr_t addr, size; + const struct fdt_property *prop; + unsigned int idx, ranges; + const __be32 *addresses; + + if ( numa_disabled() ) + return -EINVAL; + + /* + * device_tree_get_u32 will return NUMA_NO_NODE when this memory + * DT node doesn't have numa-node-id. This can help us to + * distinguish a bad DTB and a normal DTB without NUMA info. + */ + nid = device_tree_get_u32(fdt, node, "numa-node-id", NUMA_NO_NODE); + if ( node == NUMA_NO_NODE ) + { + numa_fw_bad(); + return -ENODATA; + } + else if ( nid >= MAX_NUMNODES ) + { + printk(XENLOG_WARNING "Node id %u exceeds maximum value\n", nid); + goto invalid_data; + } + + prop = fdt_get_property(fdt, node, "reg", &len); + if ( !prop ) + { + printk(XENLOG_WARNING + "fdt: node `%s': missing `reg' property\n", name); + goto invalid_data; + } + + addresses = (const __be32 *)prop->data; + ranges = len / (sizeof(__be32)* (addr_cells + size_cells)); + for ( idx = 0; idx < ranges; idx++ ) + { + device_tree_get_reg(&addresses, addr_cells, size_cells, &addr, &size); + /* Skip zero size ranges */ + if ( !size ) + continue; + + ret = fdt_numa_memory_affinity_init(nid, addr, size); + if ( ret ) + goto invalid_data; + } + + if ( idx == 0 ) + { + printk(XENLOG_ERR + "bad property in memory node, idx=%d ret=%d\n", idx, ret); + goto invalid_data; + } + + return 0; + +invalid_data: + numa_fw_bad(); + return -EINVAL; +} From patchwork Tue Jan 10 08:49:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 13094861 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id AA263C54EBE for ; Tue, 10 Jan 2023 08:55:34 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.474487.735763 (Exim 4.92) (envelope-from ) id 1pFAPl-0004fJ-WC; Tue, 10 Jan 2023 08:55:26 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 474487.735763; Tue, 10 Jan 2023 08:55:25 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pFAPl-0004eR-Rc; Tue, 10 Jan 2023 08:55:25 +0000 Received: by outflank-mailman (input) for mailman id 474487; Tue, 10 Jan 2023 08:55:24 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pFAP1-0005oC-60 for xen-devel@lists.xenproject.org; Tue, 10 Jan 2023 08:54:39 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2040.outbound.protection.outlook.com [40.107.6.40]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 684407f9-90c4-11ed-b8d0-410ff93cb8f0; Tue, 10 Jan 2023 09:54:36 +0100 (CET) Received: from AS9PR07CA0032.eurprd07.prod.outlook.com (2603:10a6:20b:46b::26) by AS8PR08MB9930.eurprd08.prod.outlook.com (2603:10a6:20b:564::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Tue, 10 Jan 2023 08:54:34 +0000 Received: from AM7EUR03FT025.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:46b:cafe::e8) by AS9PR07CA0032.outlook.office365.com (2603:10a6:20b:46b::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.11 via Frontend Transport; Tue, 10 Jan 2023 08:54:34 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM7EUR03FT025.mail.protection.outlook.com (100.127.140.199) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18 via Frontend Transport; Tue, 10 Jan 2023 08:54:34 +0000 Received: ("Tessian outbound 43b0faad5a68:v132"); Tue, 10 Jan 2023 08:54:33 +0000 Received: from 3390037eb137.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 2F7B9D46-02EF-44CB-AE26-D0F4CB766B0F.1; Tue, 10 Jan 2023 08:54:26 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 3390037eb137.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 10 Jan 2023 08:54:26 +0000 Received: from FR3P281CA0159.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a2::19) by DU0PR08MB9875.eurprd08.prod.outlook.com (2603:10a6:10:423::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Tue, 10 Jan 2023 08:54:15 +0000 Received: from VI1EUR03FT055.eop-EUR03.prod.protection.outlook.com (2603:10a6:d10:a2:cafe::a3) by FR3P281CA0159.outlook.office365.com (2603:10a6:d10:a2::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.12 via Frontend Transport; Tue, 10 Jan 2023 08:54:15 +0000 Received: from nebula.arm.com (40.67.248.234) by VI1EUR03FT055.mail.protection.outlook.com (100.127.144.130) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5986.18 via Frontend Transport; Tue, 10 Jan 2023 08:54:15 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Tue, 10 Jan 2023 08:54:09 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.86) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.16 via Frontend Transport; Tue, 10 Jan 2023 08:54:07 +0000 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: 684407f9-90c4-11ed-b8d0-410ff93cb8f0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JD7QrIfD9JHz3fTuQsCfz4zF77DrQ2+h/779Q8LcaQg=; b=lZ9tyBRNocxLf39gyHK2PqW0/wInK5F7UD9wUV46pvLMvVjblxMPVLloJt341jM5uNGD7puh7H76ky3qYG3tRd2+3Aj72TTxrTCf7BvAfyQYTwP3m8icL+GSXYynQYx69XaUtEySS9Wy5yzX1bzK7T7iTkp1LLKzLpBsF/4eZCw= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C X-CheckRecipientChecked: true X-CR-MTA-CID: 6e8560d985ecbcc9 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Maa6RscqbOXNhihsTbC3V4BIiMLxNz4ex48uAer04W/YxSLBW4l34l9d84ao67Z+rljmRddGrOrEB0fBQz9tOJZ5Ewx1BaYSrHxCT83vaOJXV+7hHh+GsqLiuzZ5fM3Xowqsf9enwpemcM6Gss6UiMi3qm/AVOSnY0U9TGsTnjvtCHcZRNyM8a+i5pHt++rRpVtbF7CKqfIpm+riOg2Qa03h31aLkcRNXjZjiaAuoHtRQUckIPLXZnO92N5LKDBbzhRNoV813Ea4kuTl/gitNCiT6QnDga27W1eVHz/Id279lG4mCYH7JSsVTinbYKZut/vcPxSo2/YALU/7970VCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=JD7QrIfD9JHz3fTuQsCfz4zF77DrQ2+h/779Q8LcaQg=; b=l8b/PBbDnukDhWNv9cJ0dia+1FmJCzQEZZ5O43lesbsfOdeqvSj+hdxdpp+hVKty5fUrQklIpicaM9iBJCEb4kL2Jnp8tx48S/MXtATUCjifaxUJoZwch/FnKikbXZXkh6iY9e2nn/zEnsvFyL2G2+OEpti+lbu1EDHO5+/QvHyHv4eTOeKiBGj4sCr7i3iRP6w8O9uL9b0P7P2vFTH1mc3CcsylUOL6mpST02dAuXcBZfJmlJ2dMCVx6CepzvseBoOn7WV418K3l9dMpuU9BijkexOTI/S0ieBe2/XGfjYBNbv83gzCHP5dYAisWx8Gp+JllFpAFxguwmsvz0NBkQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JD7QrIfD9JHz3fTuQsCfz4zF77DrQ2+h/779Q8LcaQg=; b=lZ9tyBRNocxLf39gyHK2PqW0/wInK5F7UD9wUV46pvLMvVjblxMPVLloJt341jM5uNGD7puh7H76ky3qYG3tRd2+3Aj72TTxrTCf7BvAfyQYTwP3m8icL+GSXYynQYx69XaUtEySS9Wy5yzX1bzK7T7iTkp1LLKzLpBsF/4eZCw= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C From: Wei Chen To: CC: , Wei Chen , Stefano Stabellini , Julien Grall , Bertrand Marquis , Volodymyr Babchuk Subject: [PATCH v2 09/17] xen/arm: introduce a helper to parse device tree NUMA distance map Date: Tue, 10 Jan 2023 16:49:22 +0800 Message-ID: <20230110084930.1095203-10-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230110084930.1095203-1-wei.chen@arm.com> References: <20230110084930.1095203-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: VI1EUR03FT055:EE_|DU0PR08MB9875:EE_|AM7EUR03FT025:EE_|AS8PR08MB9930:EE_ X-MS-Office365-Filtering-Correlation-Id: c3ae5224-0cd0-4e27-de41-08daf2e84baf x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: SirlqwtpLwHm2mWKsAdonfyzexqmkx2lbTAa6R1FFEe4+2+b43/bJrXeYmWZj5M7CE6/XjyuAn7BGq89ebRYbbE81EzQzL5Ob8Bw7Tp5fbHFzSZSgNpVK3fM61RQ1j3XzN08LNXSwOgH9jWNHCX5jKZ4AGOu7KxIZppUDCgy6RIMoXYylyOnBOLEllRuTn/see1sL0G1vq3uLW1cED8d/ndCvcEGs66HaP90qmRcPtY/qrG+Mvmab+VyvaahwiP9+5qdsd2rocpNj9TNBO87Py2g4vXIiQdLy9yLujxNslYNFneegDlZmIkjieubwxhTxiBSPKUndNZ9Srih8ur+WNl0PKmFN3YEhiubM+WPUu2yF7+UCU9+hsNdKVlgzykPN9TmiMq6/mgky0QxAi/16YJvxI+XAO4go+6cm+1NkwwWHeZvFWESRawMwsM8+Dx0LpheydWvnTXTydbEY4oiIGZ/WmFfYhKmWSM9KzG9bCz7mePNXiERfUo0CMODjxnS9zFvZvsdr2y+vY4SL33yKLu6gyrmW1OyNqUK05ab7R3BBWpXY/rUXz6EerjKHQZxkVwpBK4J/2/pQErpw85DUu3JXvnhdpb/WEyWYDBz/ZMGVsfnCcunwRV8Ulv6n2E8u+oYCKmnDaK/IA5uU4ZbEB2yrg+ub+O0Iv/P2Y3CwUuNppmqdL/9fGq5M/qBt/Z1KJYlVf93etvMRfOwMYTuY+ymWo5xo9fKk4KuVRj3IuI= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(376002)(396003)(136003)(39860400002)(346002)(451199015)(36840700001)(46966006)(356005)(81166007)(82740400003)(36860700001)(86362001)(54906003)(8676002)(4326008)(6916009)(41300700001)(70586007)(70206006)(8936002)(40480700001)(5660300002)(2906002)(44832011)(1076003)(2616005)(336012)(83380400001)(426003)(47076005)(82310400005)(966005)(186003)(6666004)(26005)(316002)(7696005)(478600001)(36756003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB9875 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT025.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: ec34f7cc-6957-4d43-a18f-08daf2e8408c X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dOx2p4Nbu+Qq5yYF0i5m0xeM29ARRXdYzMPCVCdajFldRVlNWJDW+KFKTum7j+koVXpD8KtLgucfKy+Steb0nwTcSSu2g5T0vquGTjyykTd6i5d6z8GHAaedbUiev+BWtAKkp3XU0sRSZFkZiruPHPsaZgV57dWz2c6tRMQdIAUbloxktZp7qoXtiPFq3lXFimvUmG9mTavjO7xziNxoZsWPVK4csh2HgHDWxyygym7m3oHmIAa8s8EM7ifuX4vdAP5yD6rbg20tyiCv9aeSMj+Sve3ue42SjyG6rH2eM9OCdP/rEqKALDW7xV8xKqrOdm/qS8K6FeDkraj2AJ/iiu8Smm53JIIO/UF3lQbmSFcHQ+5TgzRccl3I1b8nnDvC3uRO+vTeSVdByxiL2pKWQf8ztuBxhtQBxrK2JjSaWVR9jFwpljkAd3AVh56qxWWJE23A8XrvmaCHG8F516HL1LtEM3CYBso3VEg1tLNetj5d2VElyAnIbBiqASv8SofF+cSpHkOFJjiwoxG0g9QhfrAaZYl5i7a8h7xuQQBTBb9muwarmvwKqFnHP9IXQ8ysc2PcDb132yYosPayw9C42eLuBJDXbEdsnrMiGQEcKeeHOrGFL9UrFaObDIeWe8/HHBnTlY83WuvvY1CgmVhmxlSc668UbDKpZ7ZiOS68sSitWEhEGPxSqbPh7CF2i573Svlr1WWk/CiW3ROsSb0FDwZO/8eF7264B6gCpJZsZVI= X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230022)(4636009)(396003)(136003)(39860400002)(346002)(376002)(451199015)(40470700004)(36840700001)(46966006)(2906002)(36860700001)(44832011)(5660300002)(7696005)(41300700001)(8936002)(36756003)(4326008)(83380400001)(70206006)(70586007)(8676002)(40460700003)(86362001)(47076005)(82310400005)(1076003)(336012)(2616005)(6916009)(426003)(26005)(81166007)(40480700001)(478600001)(186003)(966005)(82740400003)(316002)(6666004)(107886003)(54906003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2023 08:54:34.1716 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c3ae5224-0cd0-4e27-de41-08daf2e84baf X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM7EUR03FT025.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB9930 A NUMA aware device tree will provide a "distance-map" node to describe distance between any two nodes. This patch introduce a new helper to parse this distance map. Signed-off-by: Wei Chen --- v1 -> v2: 1. Get rid of useless braces. 2. Use new NUMA status helper. 3. Use PRIu32 to replace u in print messages. 4. Fix opposite = __node_distance(to, from). 5. disable dtb numa info table when we find an invalid data in dtb. --- xen/arch/arm/numa_device_tree.c | 107 ++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) diff --git a/xen/arch/arm/numa_device_tree.c b/xen/arch/arm/numa_device_tree.c index 793a410fd4..88056e7ef8 100644 --- a/xen/arch/arm/numa_device_tree.c +++ b/xen/arch/arm/numa_device_tree.c @@ -151,3 +151,110 @@ invalid_data: numa_fw_bad(); return -EINVAL; } + +/* Parse NUMA distance map v1 */ +static int __init fdt_parse_numa_distance_map_v1(const void *fdt, int node) +{ + const struct fdt_property *prop; + const __be32 *matrix; + unsigned int i, entry_count; + int len; + + printk(XENLOG_INFO "NUMA: parsing numa-distance-map\n"); + + prop = fdt_get_property(fdt, node, "distance-matrix", &len); + if ( !prop ) + { + printk(XENLOG_WARNING + "NUMA: No distance-matrix property in distance-map\n"); + goto invalid_data; + } + + if ( len % sizeof(__be32) != 0 ) + { + printk(XENLOG_WARNING + "distance-matrix in node is not a multiple of u32\n"); + goto invalid_data; + } + + entry_count = len / sizeof(__be32); + if ( entry_count == 0 ) + { + printk(XENLOG_WARNING "NUMA: Invalid distance-matrix\n"); + goto invalid_data; + } + + matrix = (const __be32 *)prop->data; + for ( i = 0; i + 2 < entry_count; i += 3 ) + { + unsigned int from, to, distance, opposite; + + from = dt_next_cell(1, &matrix); + to = dt_next_cell(1, &matrix); + distance = dt_next_cell(1, &matrix); + if ( (from == to && distance != NUMA_LOCAL_DISTANCE) || + (from != to && distance <= NUMA_LOCAL_DISTANCE) ) + { + printk(XENLOG_WARNING + "NUMA: Invalid distance: NODE#%"PRIu32"->NODE#%"PRIu32":%"PRIu32"\n", + from, to, distance); + goto invalid_data; + } + + printk(XENLOG_INFO "NUMA: distance: NODE#%"PRIu32"->NODE#%"PRIu32":%"PRIu32"\n", + from, to, distance); + + /* Get opposite way distance */ + opposite = __node_distance(to, from); + if ( opposite == 0 ) + { + /* Bi-directions are not set, set both */ + numa_set_distance(from, to, distance); + numa_set_distance(to, from, distance); + } + else + { + /* + * Opposite way distance has been set to a different value. + * It may be a firmware device tree bug? + */ + if ( opposite != distance ) + { + /* + * In device tree NUMA distance-matrix binding: + * https://www.kernel.org/doc/Documentation/devicetree/bindings/numa.txt + * There is a notes mentions: + * "Each entry represents distance from first node to + * second node. The distances are equal in either + * direction." + * + * That means device tree doesn't permit this case. + * But in ACPI spec, it cares to specifically permit this + * case: + * "Except for the relative distance from a System Locality + * to itself, each relative distance is stored twice in the + * matrix. This provides the capability to describe the + * scenario where the relative distances for the two + * directions between System Localities is different." + * + * That means a real machine allows such NUMA configuration. + * So, place a WARNING here to notice system administrators, + * is it the specail case that they hijack the device tree + * to support their rare machines? + */ + printk(XENLOG_WARNING + "Un-matched bi-direction! NODE#%"PRIu32"->NODE#%"PRIu32":%"PRIu32", NODE#%"PRIu32"->NODE#%"PRIu32":%"PRIu32"\n", + from, to, distance, to, from, opposite); + } + + /* Opposite way distance has been set, just set this way */ + numa_set_distance(from, to, distance); + } + } + + return 0; + +invalid_data: + numa_fw_bad(); + return -EINVAL; +} From patchwork Tue Jan 10 08:49:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 13094854 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 24461C46467 for ; Tue, 10 Jan 2023 08:54:40 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.474446.735686 (Exim 4.92) (envelope-from ) id 1pFAOt-0000bL-6k; Tue, 10 Jan 2023 08:54:31 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 474446.735686; Tue, 10 Jan 2023 08:54:31 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pFAOt-0000b3-1n; Tue, 10 Jan 2023 08:54:31 +0000 Received: by outflank-mailman (input) for mailman id 474446; Tue, 10 Jan 2023 08:54:29 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pFAOr-0005s6-Jv for xen-devel@lists.xenproject.org; Tue, 10 Jan 2023 08:54:29 +0000 Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2074.outbound.protection.outlook.com [40.107.105.74]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 62a65bd2-90c4-11ed-91b6-6bf2151ebd3b; Tue, 10 Jan 2023 09:54:26 +0100 (CET) Received: from DB8PR06CA0045.eurprd06.prod.outlook.com (2603:10a6:10:120::19) by DBAPR08MB5861.eurprd08.prod.outlook.com (2603:10a6:10:1a3::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Tue, 10 Jan 2023 08:54:23 +0000 Received: from DBAEUR03FT011.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:120:cafe::32) by DB8PR06CA0045.outlook.office365.com (2603:10a6:10:120::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18 via Frontend Transport; Tue, 10 Jan 2023 08:54:23 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DBAEUR03FT011.mail.protection.outlook.com (100.127.142.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18 via Frontend Transport; Tue, 10 Jan 2023 08:54:23 +0000 Received: ("Tessian outbound 3ad958cd7492:v132"); Tue, 10 Jan 2023 08:54:23 +0000 Received: from f4bffd900317.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 3AA26FAB-2024-4733-AA56-034F6642273B.1; Tue, 10 Jan 2023 08:54:16 +0000 Received: from EUR01-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id f4bffd900317.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 10 Jan 2023 08:54:16 +0000 Received: from AM6PR0502CA0059.eurprd05.prod.outlook.com (2603:10a6:20b:56::36) by AS2PR08MB8973.eurprd08.prod.outlook.com (2603:10a6:20b:5f9::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Tue, 10 Jan 2023 08:54:13 +0000 Received: from AM7EUR03FT064.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:56:cafe::93) by AM6PR0502CA0059.outlook.office365.com (2603:10a6:20b:56::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18 via Frontend Transport; Tue, 10 Jan 2023 08:54:13 +0000 Received: from nebula.arm.com (40.67.248.234) by AM7EUR03FT064.mail.protection.outlook.com (100.127.140.127) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5986.18 via Frontend Transport; Tue, 10 Jan 2023 08:54:13 +0000 Received: from AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Tue, 10 Jan 2023 08:54:12 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Tue, 10 Jan 2023 08:54:12 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.86) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.16 via Frontend Transport; Tue, 10 Jan 2023 08:54:09 +0000 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: 62a65bd2-90c4-11ed-91b6-6bf2151ebd3b DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xRix1bFfBrxEVUq1lAzsdtefn4r0M5T6xXFzQdn7bOs=; b=TByQ2A56Oj+s/Q6qPo4M1+1wWWTRJP8X2fVKh+IQHP3B/WKRsvf9jZ0VlDv6ES1VuxwSYkTmrlYSM2rmhGWmyKcpf599z/IdUUejg4sHtk0DXfXcQPbq4bJGpYibW9qv9153PefoZpFiCU6SaXKczprLOBeENXiyJcyospIs78s= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C X-CheckRecipientChecked: true X-CR-MTA-CID: 85e75a5faba983db X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iQbR3ZzRCvzDAoHp4L9ive+hsvhmUcqg97wd8xHLFRBHE3Jn3bTCmj7Za8dhzUoKW88Qi2CWZKqrsILSci+3yjTPhGpVmEFXMMtQprrYJ+M0ZTvu5GiPg3VUzSqXPEUsXvtxumzkJ6TMppWGroCmPI0xEYlIh7WfD6JcN7u84KTPaL32/dLOPPp9JgurcUwXFYuTV5BuShvQJvJ+K/rlnSl8hVrMoswB4ZIrELS5JoNY1uJJhaC3Px7VeceMkdh3w5slb35hMzFHB52ARVo3vrMvwi8RFtE3Bdf8F+KRpVpQFuX3FVjCAWNuOOO1bJ3j5MdXk8NoJriGVlySeufdXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=xRix1bFfBrxEVUq1lAzsdtefn4r0M5T6xXFzQdn7bOs=; b=GYLnOcdNRdhrW+SrPEnQPEETok8PHeTjMS+JWMVVMnv362bV++O/JD2R1SgpR9sJcnEjHA2X/k//u0XOFohBE+9woEiaYne/3gDmOlOLdlLhQ7K6cy9t0darbqAfdaogW3/9x1lh3BgqMn+Y9G2BPuTSwpcDkDIR2cqZ9kvfDFEIuXUAi4wcmFwH9hbZoOzYgqvvpUgqau4PHj63pk7gS00J71Gkzdm4XT7dZUNUOmST/E302/2eZJ0eyXioCFDsVS76zdYtXRbyK+FaZIbnzrwWLHCEMAqour7rQcRBBJn5aTJ7zICVU/Y2RQ2kYVlbYf/wWFxv1xY61j0KFtRzbQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xRix1bFfBrxEVUq1lAzsdtefn4r0M5T6xXFzQdn7bOs=; b=TByQ2A56Oj+s/Q6qPo4M1+1wWWTRJP8X2fVKh+IQHP3B/WKRsvf9jZ0VlDv6ES1VuxwSYkTmrlYSM2rmhGWmyKcpf599z/IdUUejg4sHtk0DXfXcQPbq4bJGpYibW9qv9153PefoZpFiCU6SaXKczprLOBeENXiyJcyospIs78s= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C From: Wei Chen To: CC: , Wei Chen , Stefano Stabellini , Julien Grall , Bertrand Marquis , Volodymyr Babchuk Subject: [PATCH v2 10/17] xen/arm: unified entry to parse all NUMA data from device tree Date: Tue, 10 Jan 2023 16:49:23 +0800 Message-ID: <20230110084930.1095203-11-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230110084930.1095203-1-wei.chen@arm.com> References: <20230110084930.1095203-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM7EUR03FT064:EE_|AS2PR08MB8973:EE_|DBAEUR03FT011:EE_|DBAPR08MB5861:EE_ X-MS-Office365-Filtering-Correlation-Id: b7d5f511-aa9a-4fd2-2bbe-08daf2e84513 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: eDEPRIrXslnvkQzfPCa7Vo7kc3fEslyGVOTpJ8Nu4WNjk9ENPS73j6L7txDMvh7u821zMtsxApJG9MCb5dblNLZLoTAgF5G2NM39iAhYUA7/JcPFMc7fCVzosCky4iqIR3OGSQ7IzScGPMFKYSVQ3D7gfo6Lc22Izc7GJVUJa3uM+1K+avAFhcKpHNWUbXWUd9sLCOrPnA3geNPbJznX/ahBG27r/ebviWuXneoJxJv/tTAowbPUaF0ybLyutx2WtiD55kPaRJkQjcfMGGJtoH43286ppH+D8gEI/7PgfTrGExzuLGKr/xq559QvzMnAdA9hK3o49gyD3ATEu+zr35+GRlU3StarhgiMKDubpES0ku7/4SrzI6YRMukxd3fyNz5+VJWnDfFrWH1Pcj54X2JhpdWs1KvEq2nqwqC3F/XGDHekgNoJUrVAfjeDu+rvtoPydCA2I/z/jt18rN5eYpuWEXI3Y/prPboUmlXFm1Z9rge6tm2bBI4KRHzc+ykw7LOZtauYcV7oJf+H5TnpEUwCDHMNgq0nxBCuQKnz7EGduf7bbQ1C836zIVGlR6nl/GiJGLMYWOq1XB8p039G2PjUbufRJ0RYL3WdYWPh+jy2bXgCfYE+xX887MD+F6uPDwdPA95kFVcZ/LthRgijhR/FXmdIWvFZq+tcUhQGT+jviu3PILC+KBQ/cMQKxjqmSY69T4MbGZY69osAfC20Pw== X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(39860400002)(396003)(346002)(136003)(376002)(451199015)(36840700001)(46966006)(82310400005)(36860700001)(478600001)(83380400001)(5660300002)(36756003)(54906003)(44832011)(2906002)(86362001)(82740400003)(8676002)(4326008)(6916009)(426003)(41300700001)(2616005)(1076003)(6666004)(40480700001)(186003)(26005)(336012)(70206006)(316002)(356005)(70586007)(47076005)(7696005)(8936002)(81166007)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB8973 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT011.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 5fb67014-4de0-43c8-fbb0-08daf2e83f34 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cMzoiPRsPavEwZ/zgF2cTpX8F7zk8zzKFzSN7Db5mKz2Wn4wLhak1nod52Oqz86buv1TNLZq9L7rc6+soQoYnV694g/lrhmDy5hYiOPdSur3GZXp4PRhtA++LN5lHmKGDPt+L/qcSCsJvZUUcaH1abkF3mN8USAI+fj7HjisGPty55nMx/wzjWtq9C8mBo45hNz9HxJ45fxSDuOOAUQZArsGr5BKkPsb+eCxfz/itAaQFnvTQzrZg6+oeeG0Lj6pCSOazIrAwDe1z4QE2Aix+A06XM3i1I2TbkjGmIIi5utxqwVcblAP5bVla+ySyM8dmvRRCNonwv+HlONUL2mVaY08K0mnioNvCZwPdqWeCTQ5de/XgrZsdfHf0d4FhIWxQmhagn14l0SFoldmWOfWgHhkLfL8Bj0JWPptGoMdc5L3gHXqVmR7OpHEUpCsMOY+GQZFJ2hf/S+xSChODfIN3SOZei4iO0HlnAm8dc5iae1GVqDinvEnclE3rIGJhtHMprAYnsMQ7Pr+07UiCabvJWIhBjwN5ZXYBNiQyEWCRtxnwEYMsbP2ClORnUTz7STxy2r06VYj7zDn65kOr8ocqmcTq3bWu98ElD95U4SWtmIejoN/xYJ33XpqVynS4XjO017D14X9ZJLvFbnDaQDngqGvr4G5ebXB3lC6UUw4O1W74SHQfKzKa6z2BKnvAJUjCLbTr6/MEdrPnBoDvJI+nQ== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230022)(4636009)(396003)(39860400002)(376002)(136003)(346002)(451199015)(40470700004)(46966006)(36840700001)(70586007)(70206006)(83380400001)(8676002)(4326008)(5660300002)(7696005)(36756003)(8936002)(41300700001)(186003)(40480700001)(81166007)(26005)(6666004)(54906003)(6916009)(82740400003)(107886003)(426003)(82310400005)(47076005)(316002)(86362001)(40460700003)(1076003)(478600001)(2616005)(336012)(44832011)(2906002)(36860700001);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2023 08:54:23.1565 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b7d5f511-aa9a-4fd2-2bbe-08daf2e84513 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DBAEUR03FT011.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR08MB5861 In this function, we scan the whole device tree to parse CPU node id, memory node id and distance-map. Though early_scan_node will invoke a handler to process memory nodes. If we want to parse memory node id in that handler, we have to embed NUMA parse code in that handler. But we still need to scan whole device tree to find CPU NUMA id and distance-map. In this case, we include memory NUMA id parse in this function too. Another benefit is that we have a unique entry for device tree NUMA data parse. Signed-off-by: Wei Chen --- v1->v2: 1. Fix typos in commit message. 2. Fix code style and align parameters. 3. Use strncmp to replace memcmp. --- xen/arch/arm/include/asm/numa.h | 1 + xen/arch/arm/numa_device_tree.c | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/xen/arch/arm/include/asm/numa.h b/xen/arch/arm/include/asm/numa.h index 923ffbfd42..1213d30ce0 100644 --- a/xen/arch/arm/include/asm/numa.h +++ b/xen/arch/arm/include/asm/numa.h @@ -44,6 +44,7 @@ extern enum dt_numa_status device_tree_numa; extern void numa_set_distance(nodeid_t from, nodeid_t to, unsigned int distance); extern void numa_detect_cpu_node(unsigned int cpu); +extern int numa_device_tree_init(const void *fdt); #else diff --git a/xen/arch/arm/numa_device_tree.c b/xen/arch/arm/numa_device_tree.c index 88056e7ef8..4009b9b6de 100644 --- a/xen/arch/arm/numa_device_tree.c +++ b/xen/arch/arm/numa_device_tree.c @@ -258,3 +258,33 @@ invalid_data: numa_fw_bad(); return -EINVAL; } + +static int __init fdt_scan_numa_nodes(const void *fdt, int node, + const char *uname, int depth, + unsigned int address_cells, + unsigned int size_cells, void *data) +{ + int len, ret = 0; + const void *prop; + + prop = fdt_getprop(fdt, node, "device_type", &len); + if ( prop ) + { + if ( strncmp(prop, "cpu", len) == 0 ) + ret = fdt_parse_numa_cpu_node(fdt, node); + else if ( strncmp(prop, "memory", len) == 0 ) + ret = fdt_parse_numa_memory_node(fdt, node, uname, + address_cells, size_cells); + } + else if ( fdt_node_check_compatible(fdt, node, + "numa-distance-map-v1") == 0 ) + ret = fdt_parse_numa_distance_map_v1(fdt, node); + + return ret; +} + +/* Initialize NUMA from device tree */ +int __init numa_device_tree_init(const void *fdt) +{ + return device_tree_for_each_node(fdt, 0, fdt_scan_numa_nodes, NULL); +} From patchwork Tue Jan 10 08:49:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 13094863 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 667B0C54EBE for ; Tue, 10 Jan 2023 08:55:46 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.474495.735785 (Exim 4.92) (envelope-from ) id 1pFAPy-0006B9-5P; Tue, 10 Jan 2023 08:55:38 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 474495.735785; Tue, 10 Jan 2023 08:55:38 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pFAPy-0006As-1k; Tue, 10 Jan 2023 08:55:38 +0000 Received: by outflank-mailman (input) for mailman id 474495; Tue, 10 Jan 2023 08:55:36 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pFAOs-0005oC-Ve for xen-devel@lists.xenproject.org; Tue, 10 Jan 2023 08:54:31 +0000 Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2065.outbound.protection.outlook.com [40.107.105.65]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 64046635-90c4-11ed-b8d0-410ff93cb8f0; Tue, 10 Jan 2023 09:54:28 +0100 (CET) Received: from DB8PR06CA0066.eurprd06.prod.outlook.com (2603:10a6:10:120::40) by PR3PR08MB5691.eurprd08.prod.outlook.com (2603:10a6:102:82::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Tue, 10 Jan 2023 08:54:26 +0000 Received: from DBAEUR03FT030.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:120:cafe::8) by DB8PR06CA0066.outlook.office365.com (2603:10a6:10:120::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18 via Frontend Transport; Tue, 10 Jan 2023 08:54:26 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DBAEUR03FT030.mail.protection.outlook.com (100.127.142.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18 via Frontend Transport; Tue, 10 Jan 2023 08:54:26 +0000 Received: ("Tessian outbound baf1b7a96f25:v132"); Tue, 10 Jan 2023 08:54:26 +0000 Received: from fdeca5795d80.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 61AE824B-371A-47A1-A627-6D734A3DBD48.1; Tue, 10 Jan 2023 08:54:18 +0000 Received: from EUR03-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id fdeca5795d80.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 10 Jan 2023 08:54:18 +0000 Received: from FR3P281CA0152.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a2::6) by PAXPR08MB6752.eurprd08.prod.outlook.com (2603:10a6:102:131::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Tue, 10 Jan 2023 08:54:17 +0000 Received: from VI1EUR03FT055.eop-EUR03.prod.protection.outlook.com (2603:10a6:d10:a2:cafe::ac) by FR3P281CA0152.outlook.office365.com (2603:10a6:d10:a2::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.11 via Frontend Transport; Tue, 10 Jan 2023 08:54:17 +0000 Received: from nebula.arm.com (40.67.248.234) by VI1EUR03FT055.mail.protection.outlook.com (100.127.144.130) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5986.18 via Frontend Transport; Tue, 10 Jan 2023 08:54:17 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Tue, 10 Jan 2023 08:54:14 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.86) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.16 via Frontend Transport; Tue, 10 Jan 2023 08:54:12 +0000 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: 64046635-90c4-11ed-b8d0-410ff93cb8f0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0gPXnqAOqOIvOq2SZnrFV2Z6dU7bFkyDMdqIXXj4RZE=; b=dLHUYEMdck3Q7r4mNSrbppoSU3bhtYwYDwjvaa+hA5dIeRLEJVpawJfFwo8QidcIDwOszznDj6q2Pqegjo2Xy5jOZcvVtf77336sjcFvo17oDHzsLyM/kEMUERFc9jXxeHrpsfW8ycI2WreiCr0tpXh8RmztRwLJfK1JKnWMIZY= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C X-CheckRecipientChecked: true X-CR-MTA-CID: fdb4868fb50ca0cb X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ea+N/6nIfTQX1zQDTrZPfLnRLTDx0+uMl03K9gBFLueweRyVU5+svrm63ncWD0Nj5p/tN6c4w+BhBAPLdmw9DnQ0JRl3fpDxlyItIL0tPSPnEgWf7CLMn+JefwPqEbX0u2EBysX2QPcfF5tb9ZeEoVWCNYeJbe8hlFC3fAnhw5vb1gkgAXs9yiWQDe5ZVw8qSkWmn9r1VPxuxcgy1cfyADHBD7PzKJTuAGEAXkiLqAOxBU53jeprvYBWD27PQ28VSupj9ucH6IhIzKiHL2VFsTT2BLxTjGccR6kuky32XOM8L7LOkyfZRjuc+bUrJfDHPaJ3FTSX7glml6WNly2ofQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=0gPXnqAOqOIvOq2SZnrFV2Z6dU7bFkyDMdqIXXj4RZE=; b=Yjs+/qYvY3LWbPPqt1nOwUT+ND+0HA/2TDbVwfwejFYNbHjUKu3FlpI1tOKXABfnIGw/e+B0KVTnlo9HDIeaBnyW3BIgh8e4kI/itxDwHhowP3aFACRITi6K+0lqxCGFs6iZ05TAFrcyWzyGI1hXNkjivc52DMHAGLukD5fAAVZRq1PoXhQ0j0zDXuqA3azmZ52UkLAai4u2K+ou0Bl2yI1HckamsJjobuFx8kOvWXp8Dbbs2NSyNjOy64Q988BNklB/9OOetFF87RqDQR7mHsdX5NKuQGlfnBDBgpgRJHZNAvXwg53zQtcezdLbwZFIQXPk5qner1XTYG6sg5Rg5A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0gPXnqAOqOIvOq2SZnrFV2Z6dU7bFkyDMdqIXXj4RZE=; b=dLHUYEMdck3Q7r4mNSrbppoSU3bhtYwYDwjvaa+hA5dIeRLEJVpawJfFwo8QidcIDwOszznDj6q2Pqegjo2Xy5jOZcvVtf77336sjcFvo17oDHzsLyM/kEMUERFc9jXxeHrpsfW8ycI2WreiCr0tpXh8RmztRwLJfK1JKnWMIZY= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C From: Wei Chen To: CC: , Wei Chen , Stefano Stabellini , Julien Grall , Bertrand Marquis , Volodymyr Babchuk Subject: [PATCH v2 11/17] xen/arm: keep guest still be NUMA unware Date: Tue, 10 Jan 2023 16:49:24 +0800 Message-ID: <20230110084930.1095203-12-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230110084930.1095203-1-wei.chen@arm.com> References: <20230110084930.1095203-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: VI1EUR03FT055:EE_|PAXPR08MB6752:EE_|DBAEUR03FT030:EE_|PR3PR08MB5691:EE_ X-MS-Office365-Filtering-Correlation-Id: aabd66b6-910a-4179-fa55-08daf2e8471c x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: WqGNSjQkcwE3hYhgl/i6TMKH6hKLRoqTgSWclNzJfnGSOP+jsoIm6RNyuxaM786eFrwi9upp3E/1vpFLtVTHpuTWEeFyFmweubKoOlVnUekjGEbYPioFVuTEQj9y1egjCcloOCh9FcP/r++oCEGHAno5WEQ675aJr6+A4iEzY4XAr6lUuSHflKUORdRVgIM8PWhhnZXg6qKbxLTjbKNSrp+ZeLT1Iv0H7GH3J/fTBiwAv/4UpDAReqTEbba+Y57cyPgHoer+4+ghJ0HoW6pNoQV8lDv+RS0QRTMhKBqNcB7BQRZnZt78vU+kcQS71EUwyJlUHDRciVJTtxYvEFhvStajLFMGFAXyoYIAQuKC+Vak5i0YbaN3rvcB9qhmbG8DCkkr18Ez+TX1amT6ZbcRXkJu6JTa4fba/NKUEUsUwmIwTuIVRV7XUz+9herG2n7kmslcs1kMQRowlg8HDl2aho6L2xgze58uX7NtyxSUlV7aaf+aDtkCJaoKpU2Zv2KEjz6/xMfbV1PtzG58Ya8DLe0tN00bkjuADq35lNp027nAploN6jsflbFJuQLdi7byCmy4KZn6nrzuy1PovYa0eaZ6LLMf10B+YyLiqRbRyRk03zNjR+YGESUlL3jVLEqjd4ysGLC+3y2JiJT96AUvil3S+aWPCnrAnMkh/jGwgjRGSTRkHj5qm3fT2TtVhBsXm5sUgt9G/NoVvIjgdGOTaQ== X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(346002)(376002)(136003)(39860400002)(396003)(451199015)(46966006)(36840700001)(5660300002)(44832011)(8936002)(41300700001)(2906002)(36756003)(54906003)(8676002)(70586007)(70206006)(4326008)(316002)(6916009)(7696005)(26005)(81166007)(186003)(6666004)(86362001)(478600001)(336012)(1076003)(2616005)(40480700001)(47076005)(82740400003)(356005)(426003)(82310400005)(36860700001)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB6752 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT030.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 317a562a-0aab-4700-6a6b-08daf2e8417d X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ALt0lGf7OtNh/WjofST4kIl941WpNam3+GFl6K343w6KEQW/H7I+hAODHHZGVxzpt38jYmG/NT37eUmy8WwGlQkecs13NBYfqquQ7Lp1ycG7aBcgh5Xmk4HziZM535+2bAhfr6e5FK1V9eRSPoBTyssNincfZTqgdfh5r+y1qsMK1NbwrNYmQOXEwF68Wt944Btb7zl3QhpcdLnHnZMQA1H9EoWUml7Ix/0KCkmDMibjC2e+ME5Icd4FjZM47uqv3utbJfgNcc2JXv4AZ0S842CtxvQ9PDMY3ITOa/NaV7t5dSDQlbvxX8/jiihL7zLJh9hb1wNoVrcwrwzeaHb1E0Swh8dGneUQ1sQCRvYv0cqwv24e1GyVu41JSCM4BoVGq/HFcBThl11sGi5DMObJ5i5l4mNCZ+gt8cMIRu9fXhQLjI7EEmPPGKNm3nCKAAj5bXy38e3esnqtu6OM85U9t2JUVNmI3Ht6aspBmY0HZM7hPWvJmAlVko6nnBwDQN9W3MHLlMOsbtrCLb90ogksg2aUFh5JR0CZcANWHEQzp7epbVHtkCTGruv4l/E5iELaaap0zoV+/QOI+RalZq8Md/JtXHho69bN8cUKIClYX7ApUChD67+6jBc+2sNsWISz3DRF2iEcMRA+BmwkWLPU2v6j27ootAxhu2evIz6uXDrzw8mxa0MQaQbMwq55627D/QJHDv0zlcZvuNi9YE52zA== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230022)(4636009)(396003)(136003)(39860400002)(376002)(346002)(451199015)(36840700001)(40470700004)(46966006)(82740400003)(81166007)(36860700001)(54906003)(8676002)(4326008)(70206006)(40460700003)(86362001)(6916009)(41300700001)(70586007)(316002)(8936002)(40480700001)(44832011)(5660300002)(2906002)(1076003)(2616005)(336012)(426003)(47076005)(82310400005)(186003)(7696005)(6666004)(478600001)(107886003)(26005)(36756003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2023 08:54:26.5762 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: aabd66b6-910a-4179-fa55-08daf2e8471c X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DBAEUR03FT030.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR08MB5691 The NUMA information provided in the host Device-Tree are only for Xen. For dom0, we want to hide them as they may be different (for now, dom0 is still not aware of NUMA) The CPU and memory nodes are recreated from scratch for the domain. So we already skip the "numa-node-id" property for these two types of nodes. However, some devices like PCIe may have "numa-node-id" property too. We have to skip them as well. Signed-off-by: Wei Chen Reviewed-by: Stefano Stabellini --- v1 -> v2: 1. Add Rb --- xen/arch/arm/domain_build.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index 829cea8de8..8258048d0e 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -1185,6 +1185,10 @@ static int __init write_properties(struct domain *d, struct kernel_info *kinfo, continue; } + /* Dom0 is currently NUMA unaware */ + if ( dt_property_name_is_equal(prop, "numa-node-id") ) + continue; + res = fdt_property(kinfo->fdt, prop->name, prop_data, prop_len); if ( res ) @@ -2540,6 +2544,8 @@ static int __init handle_node(struct domain *d, struct kernel_info *kinfo, DT_MATCH_TYPE("memory"), /* The memory mapped timer is not supported by Xen. */ DT_MATCH_COMPATIBLE("arm,armv7-timer-mem"), + /* Numa info doesn't need to be exposed to Domain-0 */ + DT_MATCH_COMPATIBLE("numa-distance-map-v1"), { /* sentinel */ }, }; static const struct dt_device_match timer_matches[] __initconst = From patchwork Tue Jan 10 08:49:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 13094855 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 2AEC5C54EBE for ; Tue, 10 Jan 2023 08:54:41 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.474450.735697 (Exim 4.92) (envelope-from ) id 1pFAOv-0000yq-HB; Tue, 10 Jan 2023 08:54:33 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 474450.735697; Tue, 10 Jan 2023 08:54:33 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pFAOv-0000yX-CQ; Tue, 10 Jan 2023 08:54:33 +0000 Received: by outflank-mailman (input) for mailman id 474450; Tue, 10 Jan 2023 08:54:31 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pFAOt-0005s6-KG for xen-devel@lists.xenproject.org; Tue, 10 Jan 2023 08:54:31 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2080.outbound.protection.outlook.com [40.107.21.80]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 64a89fc5-90c4-11ed-91b6-6bf2151ebd3b; Tue, 10 Jan 2023 09:54:29 +0100 (CET) Received: from AS9PR0301CA0031.eurprd03.prod.outlook.com (2603:10a6:20b:469::31) by DBBPR08MB5994.eurprd08.prod.outlook.com (2603:10a6:10:20d::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Tue, 10 Jan 2023 08:54:28 +0000 Received: from AM7EUR03FT005.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:469:cafe::b8) by AS9PR0301CA0031.outlook.office365.com (2603:10a6:20b:469::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18 via Frontend Transport; Tue, 10 Jan 2023 08:54:28 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM7EUR03FT005.mail.protection.outlook.com (100.127.140.218) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18 via Frontend Transport; Tue, 10 Jan 2023 08:54:27 +0000 Received: ("Tessian outbound 6e565e48ed4a:v132"); Tue, 10 Jan 2023 08:54:27 +0000 Received: from bf9eea3806c2.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 09505C98-CD7C-42E8-8219-4CA26EC3D753.1; Tue, 10 Jan 2023 08:54:22 +0000 Received: from EUR03-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id bf9eea3806c2.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 10 Jan 2023 08:54:22 +0000 Received: from FR3P281CA0138.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:95::17) by PAVPR08MB9796.eurprd08.prod.outlook.com (2603:10a6:102:2f8::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Tue, 10 Jan 2023 08:54:19 +0000 Received: from VI1EUR03FT039.eop-EUR03.prod.protection.outlook.com (2603:10a6:d10:95:cafe::60) by FR3P281CA0138.outlook.office365.com (2603:10a6:d10:95::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.11 via Frontend Transport; Tue, 10 Jan 2023 08:54:19 +0000 Received: from nebula.arm.com (40.67.248.234) by VI1EUR03FT039.mail.protection.outlook.com (100.127.144.77) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5986.18 via Frontend Transport; Tue, 10 Jan 2023 08:54:18 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Tue, 10 Jan 2023 08:54:17 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.86) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.16 via Frontend Transport; Tue, 10 Jan 2023 08:54:15 +0000 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: 64a89fc5-90c4-11ed-91b6-6bf2151ebd3b DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0tafurYy+S0foZPSXVs4MXxTgGOhH6a719Sg+5VUNEA=; b=5/AeyROb+LeKOthAZWhDuLaaOHSdhHoqXe89J+OFwYmqaEHJbQ/p26ThxEdc7/oeHPuOc2WIbPW3IHdbJMS0SvF18Vbd+UMyH1PGVR6Yzq1OFIiafVYEWOnCoPZYnm9uDaCatD3x81Uh2oP/4KHrvvQnA9UgBFTO4xlJG0iIw3Y= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C X-CheckRecipientChecked: true X-CR-MTA-CID: 827b35e3b0659489 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Yd640jTkooDsJVKnYpwGL2IyfeIc+q89tWKjGoRO2+++EWCtkw0cL5hOIvZ4TA9Oswvxi9QZYzLw5m73tnIV/FNqnfLkD5k54IpA33ovMJQytgg6n43eMZ20W+43lOCkWbNhs1YI4gDMz1O0TmQWyzXRjL7TJuvt4A7lLqHnlhJbb2wI2x3L5iJjYw8fSjw1M6R274S76TuxjHLtIxlGypGK8yEQCZNizc11d0Z9GIZfZMOwjit6EAHk8aNpiC71GVNyR74jwilKOHFI9E8+ocCKHC/FJy5f/1eVmIdDEEiQh/iaM3k6SrOp55qd1gQ9N/47akDEs2N3y2aHO1p6/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=0tafurYy+S0foZPSXVs4MXxTgGOhH6a719Sg+5VUNEA=; b=nsX61tnhkj6pgZa0K1lwVigNsujVBQSGZLIL+b1pqLR3UVX5bK3GejX/Xr1HJkvkxHZmZ3SZbyfGMg9qzb1qQtxbDqDCIEVQwE6/Xb9n7zHMohOVJBHRtvHhrx9T68KcUvC3vk/wFXclGyAj/4bu84rr8iCWuv9ciX3go+eNbrhDY6u6ifpEB738nOiDLDz7FMf8/dzU6EbYx56W1NVj69yjoaQOL11EgBmLKyJKwClLLNXgY4HpW1p9uJn/F2MsV4k6VClknhWz0DM9UeY05Z7xAgSqEJlxBWUhiE1ouXeIZLywVzj/NqWZrYAlxBmVTsQQu5sgPgEv4qZZs9mUXQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0tafurYy+S0foZPSXVs4MXxTgGOhH6a719Sg+5VUNEA=; b=5/AeyROb+LeKOthAZWhDuLaaOHSdhHoqXe89J+OFwYmqaEHJbQ/p26ThxEdc7/oeHPuOc2WIbPW3IHdbJMS0SvF18Vbd+UMyH1PGVR6Yzq1OFIiafVYEWOnCoPZYnm9uDaCatD3x81Uh2oP/4KHrvvQnA9UgBFTO4xlJG0iIw3Y= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C From: Wei Chen To: CC: , Wei Chen , Stefano Stabellini , Julien Grall , Bertrand Marquis , Volodymyr Babchuk Subject: [PATCH v2 12/17] xen/arm: enable device tree based NUMA in system init Date: Tue, 10 Jan 2023 16:49:25 +0800 Message-ID: <20230110084930.1095203-13-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230110084930.1095203-1-wei.chen@arm.com> References: <20230110084930.1095203-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: VI1EUR03FT039:EE_|PAVPR08MB9796:EE_|AM7EUR03FT005:EE_|DBBPR08MB5994:EE_ X-MS-Office365-Filtering-Correlation-Id: 138bac64-1cf9-491f-337e-08daf2e847fe x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: tFL1VHCIgog4EcjhUb5e1C+fl4yWwZDlNsu8Lz4J9UzPyTrIpY1uVdEg0imcGH7oFjObb43VZurc+6X6FrLeCPzSySIhqtzQpr0O1vlO7wFm+PcKfpysIGh7hZQxoPCXo+x+sfAhBz8P+T6ZWOqKOV/JTPGJ3BJhLnRZDb/k8UqIZsIByPeBtvqHFkRi1bqODETcn81a5Wpmyl6ngrPu/55Z+BHU6inJxr0fH+FLIWktwzc+/9FnDXROzYIPb6/h/QUp0/Reut6ORPGTksBog7vZeHWGoNhX7liMo7MIHvJX/WLe9Ur9z8nLc3XoHqE9cQgbj8GfWPprC1yeDIaBXsY+a09dQqFoiwB3hyrFwRbmpO5FXYbUq2X8uK2TZyw7lmJIAbAg8c7FJtmXf3oKwnRsWGxBb+u8HR65vz1IIHq3+BiVkYSiOpNkV0r12daMObaizryWLKHrKQbmCIUJihlVNc2cT97UkDnLodmbaD2PokC5lGr52/k9tdM034PDcsIddHvOZYQ9rl91Eg+G4H+4q6l2UJnqESKlHydVsDEmuAFC18iI95nwkgocrIublHEt2tXXhi+P2u9aCAnsQYmfS/RMMRzQqd73/eSykzhhdrcNveij7+SLgOMZezcGGB2he0cU1xpPFn9PHyDoxt1Q+irKC9SvAhq7bnsBkyCM91nPliiiADnWDy0joenzTQ2buVtU/KNwhOQzTriM/Q== X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(346002)(376002)(39860400002)(396003)(136003)(451199015)(36840700001)(46966006)(6916009)(356005)(54906003)(82310400005)(41300700001)(478600001)(2906002)(316002)(82740400003)(6666004)(36860700001)(44832011)(336012)(1076003)(83380400001)(4326008)(8676002)(86362001)(186003)(26005)(40480700001)(7696005)(5660300002)(36756003)(2616005)(81166007)(70206006)(70586007)(47076005)(426003)(8936002)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR08MB9796 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT005.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: df9ab331-527d-4f18-6fef-08daf2e84297 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /AuKOjvJa5ALwIqEwyKhhk9yBW10GhuhWy/H3Qr9VfJd045mSfOaRD2Z8dW65j2KsiDwNzi5W1k+us/bJbxxETGL1jcmauSeo5bp5wtu4M/QMuwBuovrDbFaLmAaq7btrIu7FTX2oPSEXzsYY3ELTz8DCj6ry8P1Lq/lRJ/kEv/Xi9H9CoUjgu9g7b82jxKRv+G7F3N+1+d2O/DWgENB/64WWGMN47+FAHCt597r7PSyQ9upCLeHlAuGlmjVKGXOG9lrT5pGVL1MCXZ34z8OMisLGUPb6Uw+nvTPRc/EDtYw7d9MZY78rp2h4uUreN2+X10NvdDXd9ofU6WWtxbSjQ4p9QwaEAH5BgBHrnofcYTawVMeqNcsUDMFmUgiBZtwfOkcdnlPD89JK8PhMYvFihBoowAGBRTYiuZPlphwoXBz+HBhliGKy8a8jrM6I00xybKp6TMAJA0xXyVfstIHcPZVycLtyLxRcTINf3clhwt2MzSG5wLyUssAF2wXEkiKw/FTJE80dmTG3Q19+lq1jHcTNig7K51hbjVk3sX1d30mFG+TfFj6u5g+Led3/HMeI6OXp2hn7Z5vGe/cco5iJu4lUpnbGuXf+VTpSa0EuFhEBRPhPO2hiRQKOA8tjzr3CxjLvTR7Gvj4YIeNNy2OjuOb+ca6Bec7imD3PfwLIAHz5CmsMXS73ArJSvrsDB4fHte/gWHGYRkj/36EpoaMWw== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230022)(4636009)(39860400002)(136003)(396003)(346002)(376002)(451199015)(36840700001)(46966006)(40470700004)(8676002)(8936002)(4326008)(41300700001)(82310400005)(70206006)(70586007)(5660300002)(86362001)(40480700001)(6666004)(82740400003)(107886003)(316002)(2906002)(54906003)(6916009)(44832011)(36756003)(81166007)(36860700001)(40460700003)(478600001)(1076003)(7696005)(83380400001)(47076005)(426003)(26005)(2616005)(186003)(336012);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2023 08:54:27.9897 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 138bac64-1cf9-491f-337e-08daf2e847fe X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM7EUR03FT005.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB5994 In this patch, we can start to create NUMA system that is based on device tree. Signed-off-by: Wei Chen --- v1->v2: 1. replace ~0 by INVALID_PADDR. 2. only print error messages for invalid dtb data. 3. remove unnecessary return. 4. remove the parameter of numa_init. --- xen/arch/arm/include/asm/numa.h | 5 +++ xen/arch/arm/numa.c | 57 +++++++++++++++++++++++++++++++++ xen/arch/arm/setup.c | 7 ++++ 3 files changed, 69 insertions(+) diff --git a/xen/arch/arm/include/asm/numa.h b/xen/arch/arm/include/asm/numa.h index 1213d30ce0..34eec9378c 100644 --- a/xen/arch/arm/include/asm/numa.h +++ b/xen/arch/arm/include/asm/numa.h @@ -45,6 +45,7 @@ extern void numa_set_distance(nodeid_t from, nodeid_t to, unsigned int distance); extern void numa_detect_cpu_node(unsigned int cpu); extern int numa_device_tree_init(const void *fdt); +extern void numa_init(void); #else @@ -86,6 +87,10 @@ static inline void numa_detect_cpu_node(unsigned int cpu) { } +static inline void numa_init(void) +{ +} + #endif #define arch_want_default_dmazone() (false) diff --git a/xen/arch/arm/numa.c b/xen/arch/arm/numa.c index 3e02cec646..e9081d45ce 100644 --- a/xen/arch/arm/numa.c +++ b/xen/arch/arm/numa.c @@ -18,7 +18,11 @@ * */ #include +#include +#include #include +#include +#include enum dt_numa_status __read_mostly device_tree_numa; @@ -103,6 +107,59 @@ unsigned char __node_distance(nodeid_t from, nodeid_t to) EXPORT_SYMBOL(__node_distance); +void __init numa_init(void) +{ + unsigned int idx; + paddr_t ram_start = INVALID_PADDR; + paddr_t ram_size = 0; + paddr_t ram_end = 0; + + /* NUMA has been turned off through Xen parameters */ + if ( numa_off ) + goto mem_init; + + /* Initialize NUMA from device tree when system is not ACPI booted */ + if ( acpi_disabled ) + { + int ret = numa_device_tree_init(device_tree_flattened); + if ( ret ) + { + numa_off = true; + if ( ret == -EINVAL ) + printk(XENLOG_WARNING + "Init NUMA from device tree failed, ret=%d\n", ret); + } + } + else + { + /* We don't support NUMA for ACPI boot currently */ + printk(XENLOG_WARNING + "ACPI NUMA has not been supported yet, NUMA off!\n"); + numa_off = true; + } + +mem_init: + /* + * Find the minimal and maximum address of RAM, NUMA will + * build a memory to node mapping table for the whole range. + */ + ram_start = bootinfo.mem.bank[0].start; + ram_size = bootinfo.mem.bank[0].size; + ram_end = ram_start + ram_size; + for ( idx = 1 ; idx < bootinfo.mem.nr_banks; idx++ ) + { + paddr_t bank_start = bootinfo.mem.bank[idx].start; + paddr_t bank_size = bootinfo.mem.bank[idx].size; + paddr_t bank_end = bank_start + bank_size; + + ram_size = ram_size + bank_size; + ram_start = min(ram_start, bank_start); + ram_end = max(ram_end, bank_end); + } + + numa_initmem_init(PFN_UP(ram_start), PFN_DOWN(ram_end)); +} + int __init arch_get_ram_range(unsigned int idx, paddr_t *start, paddr_t *end) { if ( idx >= bootinfo.mem.nr_banks ) diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c index 8c02cf6cd4..4cdc7e2edb 100644 --- a/xen/arch/arm/setup.c +++ b/xen/arch/arm/setup.c @@ -1031,6 +1031,13 @@ void __init start_xen(unsigned long boot_phys_offset, /* Parse the ACPI tables for possible boot-time configuration */ acpi_boot_table_init(); + /* + * Try to initialize NUMA system, if failed, the system will + * fallback to uniform system which means system has only 1 + * NUMA node. + */ + numa_init(); + end_boot_allocator(); /* From patchwork Tue Jan 10 08:49:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 13094858 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id A7BFAC46467 for ; Tue, 10 Jan 2023 08:55:26 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.474471.735730 (Exim 4.92) (envelope-from ) id 1pFAPe-0003Yu-PV; Tue, 10 Jan 2023 08:55:18 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 474471.735730; Tue, 10 Jan 2023 08:55:18 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pFAPe-0003Yg-Lr; Tue, 10 Jan 2023 08:55:18 +0000 Received: by outflank-mailman (input) for mailman id 474471; Tue, 10 Jan 2023 08:55:17 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pFAP2-0005s6-6C for xen-devel@lists.xenproject.org; Tue, 10 Jan 2023 08:54:40 +0000 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on2040.outbound.protection.outlook.com [40.107.13.40]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 6a8f16e9-90c4-11ed-91b6-6bf2151ebd3b; Tue, 10 Jan 2023 09:54:39 +0100 (CET) Received: from AM5PR1001CA0039.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:206:15::16) by AS2PR08MB9546.eurprd08.prod.outlook.com (2603:10a6:20b:60d::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Tue, 10 Jan 2023 08:54:31 +0000 Received: from AM7EUR03FT013.eop-EUR03.prod.protection.outlook.com (2603:10a6:206:15:cafe::f8) by AM5PR1001CA0039.outlook.office365.com (2603:10a6:206:15::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18 via Frontend Transport; Tue, 10 Jan 2023 08:54:31 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM7EUR03FT013.mail.protection.outlook.com (100.127.140.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18 via Frontend Transport; Tue, 10 Jan 2023 08:54:30 +0000 Received: ("Tessian outbound 8038f0863a52:v132"); Tue, 10 Jan 2023 08:54:30 +0000 Received: from e1b2afb5b038.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 4B3EF0B9-F4C2-42BD-BA0C-7BA60B2A73B3.1; Tue, 10 Jan 2023 08:54:24 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id e1b2afb5b038.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 10 Jan 2023 08:54:24 +0000 Received: from FR3P281CA0152.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a2::6) by AM9PR08MB5972.eurprd08.prod.outlook.com (2603:10a6:20b:280::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Tue, 10 Jan 2023 08:54:23 +0000 Received: from VI1EUR03FT037.eop-EUR03.prod.protection.outlook.com (2603:10a6:d10:a2:cafe::fa) by FR3P281CA0152.outlook.office365.com (2603:10a6:d10:a2::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.11 via Frontend Transport; Tue, 10 Jan 2023 08:54:23 +0000 Received: from nebula.arm.com (40.67.248.234) by VI1EUR03FT037.mail.protection.outlook.com (100.127.145.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5986.18 via Frontend Transport; Tue, 10 Jan 2023 08:54:22 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Tue, 10 Jan 2023 08:54:20 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.86) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.16 via Frontend Transport; Tue, 10 Jan 2023 08:54:18 +0000 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: 6a8f16e9-90c4-11ed-91b6-6bf2151ebd3b DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=A2FodgFJQlHN+jEOT1icBJJm4ueZE52nEYnjQXW8aSU=; b=5ngaVJMMfdKPRJlMeUfRk87msXv9iG3rhV8PHtIs0yLFbAQw+JyiFdmkhk9lmlnZDxvL0knByp0c8fDtUfkBtPGsDImLyA73TktN8cvfK4V+dBTGMkRW+Pb/DYrWdnfj1leJotguqtOh3r6CAM5ZkpdiEDXC3Qh4PeqOt3KzZFY= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C X-CheckRecipientChecked: true X-CR-MTA-CID: 48f0738268577f07 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Gujj+nN2Tey337Kxfu8v7LxzA1GHQGNgyOxScgmPs4VFlQSubR3PJqovA6W8jzFw1QJvS8hRPa2o4Bl0AseM1RIa2b65qX7NkR0xpaVo7yu8o8TDR8E/cvaiRfoCUVN5mBLp/r7Ss53ed1FA+2fxNeLw9+xPpBInTUxhvZOe4l2oI1W/VkNhNiL9jIrPG+zgGoncNTMpVNNiHcKmCrqAZDAX4ysxhwDzao8/G/gBwulqiC8PEYiXejY/RbeXTDy4h3gfr6QIs3u2dU7dfcFmcEQaizfLQ1+qlkUWQgOUV8VBra5dTs6GaVFb0kGdHG+30ez70uHnSei4VxaADegBZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=A2FodgFJQlHN+jEOT1icBJJm4ueZE52nEYnjQXW8aSU=; b=eOcBKIioqxKMO2/XlvTtP7J6moNy8nfLr9220mQ29ujOm8cTT8YKQXZtkC3PID2Y7y+9d40qmDPsNVjnObb96n2Lz9rl5QRwnRJuM5Sgl7ZOmClXvnU5s2qhHZwW/I/lV9YAETaJ4lxclLwh1PulVG+d3EhT3/IoMToyMtaX62+prFI5ULh3gARcl5hMnZh+n4UIs6iREgG6ECu8Gui7zXrh4/0ICWcEBqWLIiBNeE0BLCyXEot2PBxj68S+ZhfjUWrz/G/Y7mq/VWqntoBhpX3w/0//5d9dLLk0iCeHFu5UxH3FEtG8Y+C/35XDHve4foKfV9CUsMxIhjowK5EsHw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=A2FodgFJQlHN+jEOT1icBJJm4ueZE52nEYnjQXW8aSU=; b=5ngaVJMMfdKPRJlMeUfRk87msXv9iG3rhV8PHtIs0yLFbAQw+JyiFdmkhk9lmlnZDxvL0knByp0c8fDtUfkBtPGsDImLyA73TktN8cvfK4V+dBTGMkRW+Pb/DYrWdnfj1leJotguqtOh3r6CAM5ZkpdiEDXC3Qh4PeqOt3KzZFY= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C From: Wei Chen To: CC: , Wei Chen , Stefano Stabellini , Julien Grall , Bertrand Marquis , Volodymyr Babchuk Subject: [PATCH v2 13/17] xen/arm: implement numa_node_to_arch_nid for device tree NUMA Date: Tue, 10 Jan 2023 16:49:26 +0800 Message-ID: <20230110084930.1095203-14-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230110084930.1095203-1-wei.chen@arm.com> References: <20230110084930.1095203-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: VI1EUR03FT037:EE_|AM9PR08MB5972:EE_|AM7EUR03FT013:EE_|AS2PR08MB9546:EE_ X-MS-Office365-Filtering-Correlation-Id: f51d712c-b003-4132-0f9a-08daf2e849c5 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: KRxgqa5aoyZuuqh55H8XFhW9AR9ToiSWX1xcdhlzXNSg8e2OnrXSELdc9ro+dfZrIeaDHQQfKY6jdl/hCHOfY9KTC7y+eBTH66fwp2yNFOZKgnBVfTYrFPQA2hKxFfYezNJogunfDSLH7gdAOaxgd12hoNYDg5xEKMBmO4kQoK19ihwUlgjZOoO3CaL4pE/9vAzPHzXP7oWFFN2Z+GYJujreylGNLJuUvPs1M5ywaXcPFA+AmS8lXgwu9yxiFkZQpBLAmkCL/8tw7P9O4UhH/9TBSAsE2li4WA9WSWOAt+frdMgoGqqtr13xaOU7w/KZ3jutEHKFbQzlxCXGXPqcRkiQj1HTBlNj0XcHOyxiZ9mrMh9U4G32ufaRBytgSeActm0RJ4iXOBD/LotuXkS1tkefsylm7b1INBzjHdTOgzR0mh+JxBQWPRI2GxX4ugpPU0x5e6Q8rL7Ujz51v+jcvWnr525AxdH9P8U4M5ZKhGLv5ioPHx+bAMyLkS5C1Py4O5t6d5qCPYXOhyqC4abojlK1JF9w8W2uvc/dgI8ndQM5VhHyWsedHVtDH4m/sDpX5PT1b5gjI10hnieKfAAAy4hW9yvxlsQqqGo5ySIfwkBBEc6GbK9T2ahrVIL1dEqi+XqvHZCaLfBvNHV/V2f0B8CM4OAAtQesZqgKjxaf2zXOaNQG5P+66t5ZbJVdBJ7c88GH2QhP2Q7zFKKirYq5Vw== X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(346002)(376002)(136003)(39860400002)(396003)(451199015)(46966006)(36840700001)(5660300002)(4744005)(44832011)(8936002)(41300700001)(2906002)(36756003)(54906003)(83380400001)(8676002)(70586007)(70206006)(4326008)(316002)(6916009)(7696005)(26005)(81166007)(186003)(6666004)(86362001)(478600001)(336012)(1076003)(2616005)(40480700001)(47076005)(82740400003)(356005)(426003)(82310400005)(36860700001)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR08MB5972 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT013.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: fe8c08a8-489c-4652-ba7a-08daf2e844b3 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jssQLk84BYGbldLfDpzDNyi8hXCoJrKgNGph29yW253pBcFp8/j/11QDHeiM0ReBjjJHXFD2u7rz5vMTt1mITL6TYSBgKiNPMvim7Tju1F/hshB7lAsU90AlIaLuRX3Z6QEt9M6XV+DJNXTala26ADwGlCF49LpeJH1FO5jZ9Byerpts5v7vzs6INWnVw2srBvvA83bparPt04yodbjQbXEwMPqRQwa1hhw/IUK4WBixGdlnykCoIhQsOh8hjse1qi8lQKjofCAtmDOsNn22fcsOIXJncqydGh7fyxTH7czdF3UShQ5ulOMD+I9VoMWA9ANb0M6WLx7XsSsLn9x1iMSFtLjLJXG/V1xWY1MBYmKOdXzGPKFuOOSz/mNkuxML00oZggh8L/oWdyG7Pp8pJ7ChAuItRyzRm2fFpAkCulZ2vDRCyzG8h4EFSQETrtxSpk+15zlEPYsQmBAYGz5VYV1NZce+6P6vqTOZWesUbCgNZk4D7Wwd0mE1FJD6RDFsk8uvuumSr7TlV04tjSDaoQNl9JCyyeSXIeCCA2jt8VeTevL0DAcShX5fm2iScZ389gd4dbwecRMhIcByhGlP4D0JKWumK3tQANvlywQNxDuQtt3C0ECevmaE/xHHQobzZb56TGbtyvjIyJvBMULdh2wUaRdZ/AfkmkFOzSENRUXDvBgKbPmYVgLMa5Y/0ivcoxGD1nHlaj1UwWgmZ/HHHA== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230022)(4636009)(396003)(39860400002)(136003)(376002)(346002)(451199015)(46966006)(36840700001)(40470700004)(36860700001)(1076003)(86362001)(5660300002)(4744005)(44832011)(186003)(2906002)(26005)(36756003)(40480700001)(7696005)(6666004)(83380400001)(478600001)(40460700003)(107886003)(70586007)(8676002)(4326008)(41300700001)(336012)(70206006)(47076005)(54906003)(81166007)(426003)(6916009)(316002)(82740400003)(8936002)(82310400005)(2616005);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2023 08:54:30.9707 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f51d712c-b003-4132-0f9a-08daf2e849c5 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM7EUR03FT013.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB9546 Device tree based NUMA doesn't have the proximity domain like ACPI. So we can return node id directly as arch nid. Signed-off-by: Wei Chen --- v1 -> v2: 1. Use numa_node_to_arch_nid instead of dummy node_to_pxm. --- xen/arch/arm/include/asm/numa.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/xen/arch/arm/include/asm/numa.h b/xen/arch/arm/include/asm/numa.h index 34eec9378c..a0b8d7a11c 100644 --- a/xen/arch/arm/include/asm/numa.h +++ b/xen/arch/arm/include/asm/numa.h @@ -47,6 +47,15 @@ extern void numa_detect_cpu_node(unsigned int cpu); extern int numa_device_tree_init(const void *fdt); extern void numa_init(void); +/* + * Device tree NUMA doesn't have architecural node id. + * So we can just return node id as arch nid. + */ +static inline unsigned int numa_node_to_arch_nid(nodeid_t n) +{ + return n; +} + #else /* Fake one node for now. See also node_online_map. */ From patchwork Tue Jan 10 08:49:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 13094859 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 18F62C61DB3 for ; Tue, 10 Jan 2023 08:55:29 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.474478.735741 (Exim 4.92) (envelope-from ) id 1pFAPh-0003t7-7W; Tue, 10 Jan 2023 08:55:21 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 474478.735741; Tue, 10 Jan 2023 08:55:21 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pFAPh-0003st-42; Tue, 10 Jan 2023 08:55:21 +0000 Received: by outflank-mailman (input) for mailman id 474478; Tue, 10 Jan 2023 08:55:19 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pFAP0-0005oC-BY for xen-devel@lists.xenproject.org; Tue, 10 Jan 2023 08:54:38 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2047.outbound.protection.outlook.com [40.107.7.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 682860ce-90c4-11ed-b8d0-410ff93cb8f0; Tue, 10 Jan 2023 09:54:35 +0100 (CET) Received: from AM5PR0601CA0030.eurprd06.prod.outlook.com (2603:10a6:203:68::16) by DU0PR08MB7437.eurprd08.prod.outlook.com (2603:10a6:10:354::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Tue, 10 Jan 2023 08:54:34 +0000 Received: from AM7EUR03FT006.eop-EUR03.prod.protection.outlook.com (2603:10a6:203:68:cafe::b5) by AM5PR0601CA0030.outlook.office365.com (2603:10a6:203:68::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18 via Frontend Transport; Tue, 10 Jan 2023 08:54:33 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM7EUR03FT006.mail.protection.outlook.com (100.127.141.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18 via Frontend Transport; Tue, 10 Jan 2023 08:54:33 +0000 Received: ("Tessian outbound baf1b7a96f25:v132"); Tue, 10 Jan 2023 08:54:33 +0000 Received: from 43b39c5aa916.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 5A10E8F6-007D-4BC4-A4BA-549E0BED9E3A.1; Tue, 10 Jan 2023 08:54:26 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 43b39c5aa916.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 10 Jan 2023 08:54:26 +0000 Received: from AM6PR10CA0030.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:209:89::43) by PAVPR08MB9139.eurprd08.prod.outlook.com (2603:10a6:102:30c::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Tue, 10 Jan 2023 08:54:24 +0000 Received: from AM7EUR03FT035.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:89:cafe::e3) by AM6PR10CA0030.outlook.office365.com (2603:10a6:209:89::43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18 via Frontend Transport; Tue, 10 Jan 2023 08:54:24 +0000 Received: from nebula.arm.com (40.67.248.234) by AM7EUR03FT035.mail.protection.outlook.com (100.127.141.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5986.18 via Frontend Transport; Tue, 10 Jan 2023 08:54:24 +0000 Received: from AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Tue, 10 Jan 2023 08:54:23 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Tue, 10 Jan 2023 08:54:23 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.86) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.16 via Frontend Transport; Tue, 10 Jan 2023 08:54:20 +0000 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: 682860ce-90c4-11ed-b8d0-410ff93cb8f0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OOWzVhGTnAA1jwh+NIzceBycXKs2uJrzXGAp2en5qCg=; b=ql6UJYSdbgZcWz8+l6VSXPK8eTaGaH0KPHn8TkWej7SiQQ8JTlaaYdkZ+9SxkLeSrGxxrowXNIyLy0GAkgC9BOPwhrehnbMgAvoMz0g3Pw6MxufzQVSPCn2kPsHGeYE8ulkfRvy1AmglSoWk+hxHw5Qet+b+sDCIziRfUUnxx08= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C X-CheckRecipientChecked: true X-CR-MTA-CID: f238819d235296e5 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gd7GKiDkGt9PFTjucYpmx4GyWQ3ML7j4he/JrXK4WgtoV1sgjMSOxLMl7MXYot9g+Dv+3Uq1/Z9JTgcPKqf3Sqi5sFtZ6wEdZ527Vsn6AklmcXqPHt/OZmg1IMck7X3PlkRWDqNCLPmH7mzE9n+XiJKUQGwPJ3u4VgXiGnbsfMB6tgqL/XQqiKmbqfM4gmem5Ym106HQm7Txlw9hwxJp2tjaP5NiuCjUY3qy8YGmhsvYuHRawjzZKmV4TOTSH4ifkOowalHzLG1biIbN26teZ3uP7RNFx9s8MU+E5xkSKJNq9zQbtcAgA/wSF1sb5BODpmGw9YD+xcnG9xNZYElf3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=OOWzVhGTnAA1jwh+NIzceBycXKs2uJrzXGAp2en5qCg=; b=At+zLhsyvGZFQ4O3UhMi+eTK/YWeXLjnUQZrVxPZBqtBKyY38ImSGDFOBYtneWUvvZB8r4kUyulW571NAL8jsdM1JpelPO8nkATmg8ELekBK2KMnXHP5igqp7wb1W0dAcKeQZZEr4SfYx3kPd+Te8Ab3BSNlQw59DWtvZxnujsfWR3QEoOdoZuguGpVCa7dbiq3D+WsSvlSictCwBHhC9Ac5A4He+52Qu8IHYpF9YKf6tsCqVwaEtA8w16onO+t5pfSePTK8WP7LsRdsbrzo5b1wkmmHnmATfgeg/ejh52s1Qrj+I9mv5aFt9ovYFhR/xOBGv/XSSudbDwQEWUWykQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OOWzVhGTnAA1jwh+NIzceBycXKs2uJrzXGAp2en5qCg=; b=ql6UJYSdbgZcWz8+l6VSXPK8eTaGaH0KPHn8TkWej7SiQQ8JTlaaYdkZ+9SxkLeSrGxxrowXNIyLy0GAkgC9BOPwhrehnbMgAvoMz0g3Pw6MxufzQVSPCn2kPsHGeYE8ulkfRvy1AmglSoWk+hxHw5Qet+b+sDCIziRfUUnxx08= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C From: Wei Chen To: CC: , Wei Chen , Stefano Stabellini , Julien Grall , Bertrand Marquis , Volodymyr Babchuk Subject: [PATCH v2 14/17] xen/arm: use CONFIG_NUMA to gate node_online_map in smpboot Date: Tue, 10 Jan 2023 16:49:27 +0800 Message-ID: <20230110084930.1095203-15-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230110084930.1095203-1-wei.chen@arm.com> References: <20230110084930.1095203-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM7EUR03FT035:EE_|PAVPR08MB9139:EE_|AM7EUR03FT006:EE_|DU0PR08MB7437:EE_ X-MS-Office365-Filtering-Correlation-Id: 4411b4f5-03de-41d3-14b1-08daf2e84b7a x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: yzynJM8x5/DVIwBjxxTpsnQWlFGNjs6xlB4sbUSGq4TipO54VwCaiNPESxMAnowximu87EVKQ9KSighewqWb1h6CA8vzQN2OGqcEommpKw+pXaJcxhdUac8Ly1/Ye6Tf44cNl6/HrWRCFwh4hK8mgaGqdOEd8ibYUS/wBm5ao8r8XIsCYg65OWmCObl2btkvRHqgp8784WTHhIOR9be9f3GYWfvohYwbm3wVwUKmpx95vYzJGWMxj860dgSHxQTR8A2YTbyheddY6jyaor02WwRir91wMj+QQCzYf/+aWMUikCN8/6DHez3qBh+Y4JKjZANUiGh1U1dj2sVlpfaxgGLLKivxSzkcsgRVc+u+oCKobrEUltI+RBf+jwKmLksPMX+mo/XnIL6j9ss5xbqximchZI7DnnNbOqIMzDYA7UFVKVX7VYjngRKPvGktC+NtUgXavGs+RRv5S406S7CT3esqJX4lGOTVrI+pBPA+GrOSyKiDdC5gYN4kNDBXLikbWClOId1t6lhcfTzJmP1pHfyofDbKReUOLTjGUXQGeoYEN9v/cc6OCY/twQHft88/Nq/KacpEEIFfk4vFh2dlRmXSkJLEbzZFuulOspslr11XxxdlgfqZXznyl0BDeBYJHUo9qlosllmR6JD1bkfU2/A+vYSNPv7yHiKNQyFBJeXhNsp+u2CfyXkl5PwcGOCi2xVG3Gq7WbRbNxdJPrkDPg== X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(39860400002)(346002)(376002)(396003)(136003)(451199015)(46966006)(36840700001)(356005)(81166007)(82740400003)(7696005)(86362001)(6916009)(478600001)(40480700001)(316002)(54906003)(4744005)(8676002)(2906002)(44832011)(70586007)(41300700001)(70206006)(4326008)(426003)(336012)(8936002)(36860700001)(47076005)(83380400001)(26005)(2616005)(186003)(82310400005)(1076003)(5660300002)(36756003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR08MB9139 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT006.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: ba758de7-8bd5-4a2e-969f-08daf2e845e1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NNfJFR1/W4tHDaJY+Lk9QP3yBA+yjex+vi7DT3afDPklW5c8LfUZtJDYWlcqJthoTJNdaq775ZB5g6q8wv8NZUCs7X4am5hTkkgxxWpHAA19/ju7sqd4AbjXslfmitJ44typlTJhBCqUx8TrPDoR1hN63ZloBeVfPgdMCuD9RFXlWFWNCwpOjaRWxeijDEAGwS7Wy494hZOm8l41pQY3LnAaQV3F52eqNLr8yd46iivG3Qvwq/RVSUnBoztN3lszgzZZU6NWEw2JPFWs3Z/GktmrQ0LZPXHccw0uRcxAbT5bPZThrhcqs4lH1UkdTqaMNz+/efXeKfXOqwY1K/hs+9NcjnVXy324AOL2+paTovM+kvxHtU/2mq5+0rX65FJAkarP1r+XTIZ3pIfj4/OHcuqb3QaFucfy4DnYBEbcPkmrziaJpRUdBEU0+n5HjkurQbojTnNF0xyFiOO4ds/AEc68vMC/9+1HcscGsAgfwqESgPGi8nBhRgkcv0xRlLqQT0Asg1AfZH8utZ43e4p3ErerglgDm/h9OlQjTUIb67jfn3H1G57QpqnvQr+Lh59xo4h8AUdxOOgM1dZef3uHTShp80wlGNpAw55ni4b33tIkIRVscnvBEYiCrJxLHl+y+HTxCP08/OhZc2rDqEfETvhAay0rfXJQaYnl6GU1qjBmscXt5xXGNIi1xEhJPet/VA7FJPmEbzDMyEn4oNXUtw== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230022)(4636009)(136003)(346002)(396003)(376002)(39860400002)(451199015)(40470700004)(46966006)(36840700001)(82310400005)(6916009)(83380400001)(36860700001)(478600001)(5660300002)(44832011)(4744005)(86362001)(36756003)(2906002)(40460700003)(316002)(54906003)(4326008)(82740400003)(26005)(186003)(336012)(8936002)(2616005)(1076003)(7696005)(40480700001)(426003)(107886003)(70586007)(8676002)(70206006)(41300700001)(47076005)(81166007);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2023 08:54:33.8347 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4411b4f5-03de-41d3-14b1-08daf2e84b7a X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM7EUR03FT006.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB7437 node_online_map in smpboot still need for Arm when NUMA is turn off by Kconfig. Signed-off-by: Wei Chen --- v1 -> v2: 1. No change. --- xen/arch/arm/smpboot.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c index 5ee6ab11e9..3ae359bbeb 100644 --- a/xen/arch/arm/smpboot.c +++ b/xen/arch/arm/smpboot.c @@ -41,8 +41,10 @@ integer_param("maxcpus", max_cpus); /* CPU logical map: map xen cpuid to an MPIDR */ register_t __cpu_logical_map[NR_CPUS] = { [0 ... NR_CPUS-1] = MPIDR_INVALID }; +#ifndef CONFIG_NUMA /* Fake one node for now. See also asm/numa.h */ nodemask_t __read_mostly node_online_map = { { [0] = 1UL } }; +#endif /* Xen stack for bringing up the first CPU. */ static unsigned char __initdata cpu0_boot_stack[STACK_SIZE] From patchwork Tue Jan 10 08:49:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 13094857 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id D8BDCC46467 for ; Tue, 10 Jan 2023 08:55:20 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.474467.735719 (Exim 4.92) (envelope-from ) id 1pFAPY-0003Ac-EC; Tue, 10 Jan 2023 08:55:12 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 474467.735719; Tue, 10 Jan 2023 08:55:12 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pFAPY-0003AT-A1; Tue, 10 Jan 2023 08:55:12 +0000 Received: by outflank-mailman (input) for mailman id 474467; Tue, 10 Jan 2023 08:55:10 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pFAP6-0005s6-5Q for xen-devel@lists.xenproject.org; Tue, 10 Jan 2023 08:54:44 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2083.outbound.protection.outlook.com [40.107.7.83]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 6c11ee8f-90c4-11ed-91b6-6bf2151ebd3b; Tue, 10 Jan 2023 09:54:42 +0100 (CET) Received: from DB6PR0402CA0024.eurprd04.prod.outlook.com (2603:10a6:4:91::34) by AM7PR08MB5350.eurprd08.prod.outlook.com (2603:10a6:20b:101::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Tue, 10 Jan 2023 08:54:38 +0000 Received: from DBAEUR03FT057.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:91:cafe::7e) by DB6PR0402CA0024.outlook.office365.com (2603:10a6:4:91::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18 via Frontend Transport; Tue, 10 Jan 2023 08:54:38 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DBAEUR03FT057.mail.protection.outlook.com (100.127.142.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18 via Frontend Transport; Tue, 10 Jan 2023 08:54:38 +0000 Received: ("Tessian outbound b1d3ffe56e73:v132"); Tue, 10 Jan 2023 08:54:38 +0000 Received: from 046c96facb57.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 28559E46-02F6-4DE6-8E01-5DBAA055C8FF.1; Tue, 10 Jan 2023 08:54:29 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 046c96facb57.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 10 Jan 2023 08:54:29 +0000 Received: from FR0P281CA0052.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:48::20) by DBAPR08MB5671.eurprd08.prod.outlook.com (2603:10a6:10:1a1::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Tue, 10 Jan 2023 08:54:27 +0000 Received: from VI1EUR03FT047.eop-EUR03.prod.protection.outlook.com (2603:10a6:d10:48:cafe::ae) by FR0P281CA0052.outlook.office365.com (2603:10a6:d10:48::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.11 via Frontend Transport; Tue, 10 Jan 2023 08:54:27 +0000 Received: from nebula.arm.com (40.67.248.234) by VI1EUR03FT047.mail.protection.outlook.com (100.127.144.198) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5986.18 via Frontend Transport; Tue, 10 Jan 2023 08:54:27 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Tue, 10 Jan 2023 08:54:25 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.86) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.16 via Frontend Transport; Tue, 10 Jan 2023 08:54:23 +0000 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: 6c11ee8f-90c4-11ed-91b6-6bf2151ebd3b DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZFycWCyr9eafMdsIRMXDpPfZgceLANbgQsKdH29zQUg=; b=FUgjPEH3SDw0CgNr7/SQou9XAWOj4pzs2LG6xfK7CTKzT+fl9NmbGQ2WAvdWJDAdd/UWS9wwkup5u8/3AUI2eWytTN4kXUJN69bmq/J4+GeyMXIKdG04QsrS3dZJBQrPXAUWpFmMvrTlGoifsmdjtpxbld8UT5fegDKGHD3Wdh8= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C X-CheckRecipientChecked: true X-CR-MTA-CID: 8325e71c2a7c0b30 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KlmSe6nJSBejfbUbmXXV7b0fPyc1BbokKF+EBW8tapVmuweOXelR7KLstQ3g8Y5PpR/HR0FnJXbPEWqUaKjDQ6+P+S4hcCjcdGRYWtUxrnlaQG1p+Ftq8KveKUOLY1VlISXdAi9LaGvS53CgT1Hm/6PscyYl5XAx8RdkgqSNdIbvhAwSrhl1ryyL5hoavca3qoF5TobrhtyQg0X4ncWrytQIJab4vhOXCPRYuEbQQVRa7IinOM+9yIqE58FQIA9ZNjgBqed8g9HW3N7KGjvUewco1A95twxwAy7EtzOE9vDJvPMvfMp4+ehtJMlwfK3JqomfZvf6RHDZjerDKSdvMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ZFycWCyr9eafMdsIRMXDpPfZgceLANbgQsKdH29zQUg=; b=IeSbP0rIOSno/G6f4Qp2LgoGkCZC49cfkV4eUVi5WoxPHaYApMCrdjZzh6mSGWTM4hBS3I/Uv1/LDM6ULoBE7Q+zjDSePxMfaB13AiFaODMdsEv7VghGVIB9WUHIG77o/PPLb1qNuBpj5L335rJVSZcpiDYSNydf0MwIL1+kP+Hqvn9Y+A/zQVPqRYLmayQrHoo8pxjhGpont7mPoOnfnXfekSTdLtfs6cJIS1yE7opdJPwb5fo6KB/HtVTUUM+aSF7M2Qx3XFYey5giisGDW61CX3rdzb1PqrgCxDmva0PdROvAoKQ9LEd/M+tFKbVKU6rNzhtBPE/SjcdUhy+JEg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZFycWCyr9eafMdsIRMXDpPfZgceLANbgQsKdH29zQUg=; b=FUgjPEH3SDw0CgNr7/SQou9XAWOj4pzs2LG6xfK7CTKzT+fl9NmbGQ2WAvdWJDAdd/UWS9wwkup5u8/3AUI2eWytTN4kXUJN69bmq/J4+GeyMXIKdG04QsrS3dZJBQrPXAUWpFmMvrTlGoifsmdjtpxbld8UT5fegDKGHD3Wdh8= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C From: Wei Chen To: CC: , Henry Wang , Stefano Stabellini , Julien Grall , Bertrand Marquis , Volodymyr Babchuk Subject: [PATCH v2 15/17] xen/arm: Set correct per-cpu cpu_core_mask Date: Tue, 10 Jan 2023 16:49:28 +0800 Message-ID: <20230110084930.1095203-16-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230110084930.1095203-1-wei.chen@arm.com> References: <20230110084930.1095203-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: VI1EUR03FT047:EE_|DBAPR08MB5671:EE_|DBAEUR03FT057:EE_|AM7PR08MB5350:EE_ X-MS-Office365-Filtering-Correlation-Id: 25f7d896-3a2e-4a1b-a068-08daf2e84e16 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 1nVaoo9E+GFvT+cClWsW/NG/w3IzVI+3KObds7Prvv0MZgL3umrok29TqA/gqKByCXR7gsQOZSP85XS5mPn1DKM7qYyWQalFFc6miKFk0Ok/WSXu1GNDvZfdJAEDl7wdS/b3AMB2n6smdTJ8IAomyMO5PDmypf5SMN+0kOP0GeBXd2s+A/WzH4IDhfScDyNSCzzNvvpuyuqrFIf9h6fU4hC2D0d0IO1huIE2Wz+Zc7HoUk6LfUbxlR+hwi/TGbzCGgVBqYQIygKav9jC6HmH1OvpqrpVsev6RdvffLb2r5vdM9oi6YzXfcQxRRZjzJT+5D7N4/9VhdV4E08k0ZXGrsyBkmn8CtNNFsVvScCtalPfHNP3fTW/INL9B4xOZs1WAo3mz2KM/ng76ndQfal0V72PuWyodnn/+ys8+Z0FeD0ZejLEuIAzbqlsBjyqgCJiRY8MAcbB1JuAEgtN4A0Arqwun3/4RhqVcHa7/PCs8M1h4MpGG67qPev9q2DlmplBRHZZVm7qDLA63ng/2bhukBd3n7HWmmSJeO0pf3s71EM81+1tncuYmiq1s3nXgkFWDFPVWGgDxOaWMdbqeBHn6EIUAXhWxo5NdNcQ9VhwRLft19grdmi8iSrir9ELGuE8G0q/KlodOkZ+RVDUUll8wb11+ln9DU/bo412ip0g4KrlkZptPGDeISw8OlW+5c18egnVfp9/h9mXTWTR6OX4Zw== X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(39860400002)(136003)(396003)(376002)(346002)(451199015)(46966006)(36840700001)(83380400001)(40480700001)(47076005)(44832011)(426003)(82310400005)(36860700001)(5660300002)(336012)(2616005)(356005)(2906002)(81166007)(54906003)(86362001)(8936002)(1076003)(6916009)(316002)(8676002)(36756003)(186003)(4326008)(478600001)(41300700001)(7696005)(70586007)(82740400003)(70206006)(26005)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR08MB5671 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT057.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 2dce9913-8214-4290-eb64-08daf2e847ba X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CEB9qhTi6/UWTS54LBvP+c+c/wgi2X12rvajZwqx0nJSbg6b6nWaHG0N43VAohOvXNSkpysg1OAwGB4LjLfz8U6wmYL3eNvVZzwgz3DNwK8ChHBFrC8p60RiWCHkmI8IxqOG4yqgplhY+vwRf07onIdkJdCuNL1gopPlhC5igNk1QWwKGmOYRp9axNix5gzXu2VIv7FfeYHyEE7UjvdnW1nEh7zOiNSAvG8c3fGYyw+Uqf8UKZETFDgzZWnrItsrvbCdDhYlgUPHIjZaOLDQqbIA8CoiX1sgh/QJ9vth/j0jGCXMmePdCcMLd1IsItEYBGstwSiLmJBup+XqL+mX22Je8bj9yWU6yYMV3QtMNdjuo2+sHDx6rpChSic9aW2ccuzkj6g7ZK5uhgbIoNWPxXaseah2qVPPa6DpyDXJsPx7Bh3i3etEK8mL6kd6IO3HoR1rACm2yko7SCy4K7LKIU8ZIrF+GcQYtSZo483OoSHI5EyKIk7D/WEus5UQdCrKRKMbT099DKhEEyuhPHuU9pWScDMEC9GD+By7XvsLiNiq0vG3SZLIQTC3yYsVtEKLutqDhkjzlOBrFGaQoSNKzNXSd478TkjfP6lk1VLj95UxPAaLh1vmeYjYj66if39mOgwqpyCD5cXRabssu61IdR1lMA07A50DVVIKBKoHXwDQlSXz/zkYJgaG6MDh4OK/yqtnjceXVizEJ8zjPWE0Tw== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230022)(4636009)(376002)(346002)(136003)(396003)(39860400002)(451199015)(36840700001)(46966006)(40470700004)(44832011)(2906002)(5660300002)(36860700001)(7696005)(41300700001)(8936002)(36756003)(70206006)(83380400001)(70586007)(4326008)(8676002)(316002)(47076005)(86362001)(2616005)(336012)(82310400005)(426003)(40460700003)(1076003)(81166007)(478600001)(186003)(40480700001)(26005)(6916009)(54906003)(107886003)(82740400003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2023 08:54:38.2786 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 25f7d896-3a2e-4a1b-a068-08daf2e84e16 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DBAEUR03FT057.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR08MB5350 From: Henry Wang In the common sysctl command XEN_SYSCTL_physinfo, the cores_per_socket is calculated based on the cpu_core_mask of CPU0. Currently on Arm this is a fixed value 1 (can be checked via xl info), which is not correct. This is because during the Arm cpu online process, set_cpu_sibling_map() only sets the per-cpu cpu_core_mask for itself. cores_per_socket refers to the number of cores that belong to the same socket (NUMA node). Therefore, this commit introduces a helper function numa_set_cpu_core_mask(cpu), which sets the per-cpu cpu_core_mask to the cpus in the same NUMA node as cpu. Calling this function at the boot time can ensure the correct cpu_core_mask, leading to the correct cores_per_socket to be returned by XEN_SYSCTL_physinfo. Signed-off-by: Henry Wang --- v1 -> v2: 1. New patch --- xen/arch/arm/include/asm/numa.h | 7 +++++++ xen/arch/arm/numa.c | 11 +++++++++++ xen/arch/arm/setup.c | 5 +++++ 3 files changed, 23 insertions(+) diff --git a/xen/arch/arm/include/asm/numa.h b/xen/arch/arm/include/asm/numa.h index a0b8d7a11c..e66fb0a11f 100644 --- a/xen/arch/arm/include/asm/numa.h +++ b/xen/arch/arm/include/asm/numa.h @@ -46,6 +46,7 @@ extern void numa_set_distance(nodeid_t from, nodeid_t to, extern void numa_detect_cpu_node(unsigned int cpu); extern int numa_device_tree_init(const void *fdt); extern void numa_init(void); +extern void numa_set_cpu_core_mask(int cpu); /* * Device tree NUMA doesn't have architecural node id. @@ -62,6 +63,12 @@ static inline unsigned int numa_node_to_arch_nid(nodeid_t n) #define cpu_to_node(cpu) 0 #define node_to_cpumask(node) (cpu_online_map) +static inline void numa_set_cpu_core_mask(int cpu) +{ + cpumask_or(per_cpu(cpu_core_mask, cpu), + per_cpu(cpu_core_mask, cpu), &cpu_possible_map); +} + /* * TODO: make first_valid_mfn static when NUMA is supported on Arm, this * is required because the dummy helpers are using it. diff --git a/xen/arch/arm/numa.c b/xen/arch/arm/numa.c index e9081d45ce..ef245e39a8 100644 --- a/xen/arch/arm/numa.c +++ b/xen/arch/arm/numa.c @@ -52,6 +52,17 @@ int __init arch_numa_setup(const char *opt) return -EINVAL; } +void numa_set_cpu_core_mask(int cpu) +{ + nodeid_t node = cpu_to_node[cpu]; + + if ( node == NUMA_NO_NODE ) + node = 0; + + cpumask_or(per_cpu(cpu_core_mask, cpu), + per_cpu(cpu_core_mask, cpu), &node_to_cpumask(node)); +} + void __init numa_set_distance(nodeid_t from, nodeid_t to, unsigned int distance) { diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c index 4cdc7e2edb..d45becedee 100644 --- a/xen/arch/arm/setup.c +++ b/xen/arch/arm/setup.c @@ -1136,6 +1136,11 @@ void __init start_xen(unsigned long boot_phys_offset, } printk("Brought up %ld CPUs\n", (long)num_online_cpus()); + + /* Set per-cpu cpu_core_mask to cpus that belongs to the same NUMA node. */ + for_each_online_cpu ( i ) + numa_set_cpu_core_mask(i); + /* TODO: smp_cpus_done(); */ /* This should be done in a vpmu driver but we do not have one yet. */ From patchwork Tue Jan 10 08:49:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 13094860 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 22BBFC54EBE for ; Tue, 10 Jan 2023 08:55:32 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.474482.735752 (Exim 4.92) (envelope-from ) id 1pFAPj-0004Gp-JP; Tue, 10 Jan 2023 08:55:23 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 474482.735752; Tue, 10 Jan 2023 08:55:23 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pFAPj-0004Gc-DX; Tue, 10 Jan 2023 08:55:23 +0000 Received: by outflank-mailman (input) for mailman id 474482; Tue, 10 Jan 2023 08:55:22 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pFAP7-0005s6-5R for xen-devel@lists.xenproject.org; Tue, 10 Jan 2023 08:54:45 +0000 Received: from EUR03-VI1-obe.outbound.protection.outlook.com (mail-vi1eur03on2070.outbound.protection.outlook.com [40.107.103.70]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 6c85df74-90c4-11ed-91b6-6bf2151ebd3b; Tue, 10 Jan 2023 09:54:43 +0100 (CET) Received: from DB7PR02CA0006.eurprd02.prod.outlook.com (2603:10a6:10:52::19) by DB4PR08MB9864.eurprd08.prod.outlook.com (2603:10a6:10:3cf::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Tue, 10 Jan 2023 08:54:40 +0000 Received: from DBAEUR03FT032.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:52:cafe::2a) by DB7PR02CA0006.outlook.office365.com (2603:10a6:10:52::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18 via Frontend Transport; Tue, 10 Jan 2023 08:54:40 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DBAEUR03FT032.mail.protection.outlook.com (100.127.142.185) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18 via Frontend Transport; Tue, 10 Jan 2023 08:54:40 +0000 Received: ("Tessian outbound 8038f0863a52:v132"); Tue, 10 Jan 2023 08:54:39 +0000 Received: from b094e260e48b.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 3D2E68E8-747C-4449-9205-D2B044856754.1; Tue, 10 Jan 2023 08:54:34 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id b094e260e48b.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 10 Jan 2023 08:54:34 +0000 Received: from AS8P189CA0042.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:458::12) by DU0PR08MB7638.eurprd08.prod.outlook.com (2603:10a6:10:31f::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Tue, 10 Jan 2023 08:54:31 +0000 Received: from AM7EUR03FT052.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:458:cafe::af) by AS8P189CA0042.outlook.office365.com (2603:10a6:20b:458::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18 via Frontend Transport; Tue, 10 Jan 2023 08:54:31 +0000 Received: from nebula.arm.com (40.67.248.234) by AM7EUR03FT052.mail.protection.outlook.com (100.127.140.214) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5986.18 via Frontend Transport; Tue, 10 Jan 2023 08:54:31 +0000 Received: from AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Tue, 10 Jan 2023 08:54:29 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Tue, 10 Jan 2023 08:54:28 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.86) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.16 via Frontend Transport; Tue, 10 Jan 2023 08:54:26 +0000 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: 6c85df74-90c4-11ed-91b6-6bf2151ebd3b DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=A9xXZMbekjt/tql+kzQOe7eglF3L9li7hx3d+MOMfTs=; b=wStOQAtR9wr3xfjETfijXVkPoK6EjofHsjwj4GezKJ4hg3PfSwYIPFKFpA8QuZPm14Fa4ucszy2WmkJLHSnnBYKiKfiXsElSDF7OedleAmuwx4I8cADpSZod4MK5deiRnIWknCNiWiq7qfNnlhSWXgvtbo1QHzaRrtCZKYInBn0= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C X-CheckRecipientChecked: true X-CR-MTA-CID: 8f436cb93478cc52 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cENsEWAd+moxKaD55/XfUjNcxkB3d0km+dUiiyBnjidvB9M2rKkXh6BORZaYgRq0+3e+d9IPlSUe0PexA2S0XB6qBM9wSloOYN/WVO0y00VEPRv/6VOLFPCybf0xZSI1CwSg3wSBrKmx9hRoOWSaXHB4HnRsWivFmeIFXq/zXUrUk6w52+WzSC39xZA3DwoATN/cKIsSfk4RBsufhhXYiGw+7RXauP4Dtl2HLzu5agewHRtVwmLzEv41JfkddPWVcgFPWAgUmtpwobTDao1K3g41rIF3OpOPmMyIT2MaODJ1cqjFi7SEqUVY8G7HNYeEs1X6WyPJYgNDkPk2e64dfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=A9xXZMbekjt/tql+kzQOe7eglF3L9li7hx3d+MOMfTs=; b=GA35AQ0XgoLhZ3XdZD0y4jXu5wM4OddFCtVmlluTg9AwFPoIc3suuBCgGAYI4HjbOj6AG1VVazA/B2ofGNXXIHCFKD6SkE55pzZqPORysHZAqCgDmNfn6QrjDJE40ZqUNxFS77KSfgb9miy1UmTfYpkTKZkuSbfsP0RLLGMBT0CpodehwuDS/fyBbGQHCaBDLrD1UTNHhWCtY1tz9L8xGcJAFY4LZDgcoqiv5j5o7VvkoF9zpfUELqkfYEaEnt8mho6pywNVF3w3zJwne83lRf5hyR8ffKONPRFebEfj2bNL+rGeNffh17N1AxyQ1VzRpHzWpR1j0eOT2TLvsmbCvA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=A9xXZMbekjt/tql+kzQOe7eglF3L9li7hx3d+MOMfTs=; b=wStOQAtR9wr3xfjETfijXVkPoK6EjofHsjwj4GezKJ4hg3PfSwYIPFKFpA8QuZPm14Fa4ucszy2WmkJLHSnnBYKiKfiXsElSDF7OedleAmuwx4I8cADpSZod4MK5deiRnIWknCNiWiq7qfNnlhSWXgvtbo1QHzaRrtCZKYInBn0= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C From: Wei Chen To: CC: , Wei Chen , Stefano Stabellini , Julien Grall , Bertrand Marquis , Volodymyr Babchuk Subject: [PATCH v2 16/17] xen/arm: Provide Kconfig options for Arm to enable NUMA Date: Tue, 10 Jan 2023 16:49:29 +0800 Message-ID: <20230110084930.1095203-17-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230110084930.1095203-1-wei.chen@arm.com> References: <20230110084930.1095203-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM7EUR03FT052:EE_|DU0PR08MB7638:EE_|DBAEUR03FT032:EE_|DB4PR08MB9864:EE_ X-MS-Office365-Filtering-Correlation-Id: 87f9161b-9e2a-4ef4-bbd3-08daf2e84f2b x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: Ai2Nn49kHTWarRWtw0dy8bx2KRkaTSdeT2IEQHS6UjuznaMHQ5V+eNZqKeMGTFZhM2Dw2wWx3YmhADU92G3I/bg/9lEnJdubKjUjC8awrnVsZMKE2YmwBKeyKyx5iBuGJfTXWym79bGIkvWaSJZ3c8bburSI5SKXbpXNzth4NdMNSEq/vWnJDAOpN83FygPao93MBwpyplt+W3mrZQZaine+yu5a2iEDz1Ai2/QKBV+E7bmwEa38C+YGMWLs+TNTk4zqoyIVENWLwT/spNYA/tzzgc+rYdD0StLQgJDb1rpyh8BxA0In+WsfG0RktEkqF+jMbhflFczUphUekj3gwskhctfDnr4kfIRrqaTtB/Utro09kxKve44ZynoMLFMdhIcPErnEcrfwwvvU/vJ90FaPZNTfF/h1G0r3gU3NVkuCQmQXB0diCc7f+VEFDwhJCoE+RqHMbjwMLGNAIYBMiMiWGtFB8q3gKtahxW3+F5lP+Kj7U/ajs9lYwxChjScg4lOIMtbfSuetyfO4VpGmR+SgmT/v0e2EHxMR2wcCq6IN5nLfCvMX+uOQ/lrdlQ4/HScm31NfJxHHOwuMO2pl10LnLwJH3Y4Z3aCmWzkxVbKCK6LVo5GahWXuRbRqOB4ss79GX1GegkyjpLhD7TktJiSoR+wWeinFIa8usJN/XwMntY1jYODJaw0/HW6dbuuJamm8Be4/gtuoJWwgsaGYHQ== X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(376002)(346002)(136003)(396003)(39860400002)(451199015)(36840700001)(46966006)(2906002)(44832011)(36860700001)(2616005)(5660300002)(7696005)(41300700001)(8936002)(36756003)(70586007)(70206006)(83380400001)(8676002)(356005)(4326008)(316002)(47076005)(86362001)(336012)(82310400005)(1076003)(426003)(40480700001)(26005)(81166007)(478600001)(186003)(54906003)(6916009)(82740400003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB7638 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT032.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 7767b79c-f5eb-4540-bbee-08daf2e84a03 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: V0m2pag9oMWbbSsjJbj1ryiPS2w1nNx8mcKAKATcBt6/8yU3xIZ/cHjNvtcKniHUiLU4V3w+Vl8ICyOqcIVtQJNEkTBtQBaPdeut62oB4ZGA+84jjC80sk1i/hd2CcbCK88TEJtjgk4p1RcIUdr3cg0IwtT1U156W6YHZjz9gtL5FqW35Ew5ELgTOVD2mv8chzbDfeopJf6xxyT8G5DKmevLakKW1sCFakFfHK24wnUsC3tS7xdV6I/x/fD8c5T2uMo8OSqql+oYA1pIraUVA3BLzTgmFgorhbVbuUyJYqB3tB4CRpcOu2l28xBlSMwj0DcKHqDCUmCL+ZLGZ3vmqGwbeSyTl9qVH1FwohP+oCoO0O96Re4c8uVHantGHeXTCmKV/7d4YayOLyQm0zED/MST3sgeYj/3LtKQ1b/D0GH68jlAXCd7UBviRTLyeXU+BhhEJIDA0JPLDnEqwQUky+KLH7fQiKlkaURHkFl3Yk+iuWib5cQn6i1dr82Yll9iYYrjUdvCNgt5owEWkV9M9ZrymE3bkJGlZ2VwLuPCGHhU7frJHqo1g/4HKRG/uPWNzlCKYsM9D6q+GHb6i2DKEIiEDG7v5b4NPXAEm4CSOOxLUjnsJsyeaeDmymb/NpvbpyFMrQuNjDlQ4oVK0QD8aipSBe7DnunJlns6k/9i3nzMkzgqXN2SuRcQjSgpN7zUBu0JG3rRxNtgI9EjNcZdsw== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230022)(4636009)(346002)(396003)(39860400002)(136003)(376002)(451199015)(40470700004)(46966006)(36840700001)(107886003)(47076005)(70206006)(36860700001)(1076003)(70586007)(8676002)(82740400003)(41300700001)(86362001)(426003)(4326008)(336012)(2616005)(81166007)(478600001)(40460700003)(5660300002)(40480700001)(316002)(44832011)(6916009)(26005)(186003)(7696005)(2906002)(54906003)(36756003)(83380400001)(82310400005)(8936002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2023 08:54:40.0790 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 87f9161b-9e2a-4ef4-bbd3-08daf2e84f2b X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DBAEUR03FT032.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB4PR08MB9864 Arm platforms support both ACPI and device tree. We don't want users to select device tree NUMA or ACPI NUMA manually. We hope users can just enable NUMA for Arm, and device tree NUMA and ACPI NUMA can be selected depends on device tree feature and ACPI feature status automatically. In this case, these two kinds of NUMA support code can be co-exist in one Xen binary. Xen can check feature flags to decide using device tree or ACPI as NUMA based firmware. So in this patch, we introduce a generic option: CONFIG_ARM_NUMA for users to enable NUMA for Arm. And one CONFIG_DEVICE_TREE_NUMA option for ARM_NUMA to select when HAS_DEVICE_TREE option is enabled. Once when ACPI NUMA for Arm is supported, ACPI_NUMA can be selected here too. Signed-off-by: Wei Chen --- v1 -> v2: 1. Remove the condition of selecting DEVICE_TREE_NUMA. --- xen/arch/arm/Kconfig | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig index 239d3aed3c..e751ad50d1 100644 --- a/xen/arch/arm/Kconfig +++ b/xen/arch/arm/Kconfig @@ -39,6 +39,17 @@ config ACPI config ARM_EFI bool +config ARM_NUMA + bool "Arm NUMA (Non-Uniform Memory Access) Support (UNSUPPORTED)" if UNSUPPORTED + depends on HAS_DEVICE_TREE + select DEVICE_TREE_NUMA + help + Enable Non-Uniform Memory Access (NUMA) for Arm architecutres + +config DEVICE_TREE_NUMA + bool + select NUMA + config GICV3 bool "GICv3 driver" depends on !NEW_VGIC From patchwork Tue Jan 10 08:49:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 13094856 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id D6C43C54EBE for ; Tue, 10 Jan 2023 08:55:19 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.474465.735708 (Exim 4.92) (envelope-from ) id 1pFAPX-0002uf-5W; Tue, 10 Jan 2023 08:55:11 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 474465.735708; Tue, 10 Jan 2023 08:55:11 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pFAPX-0002uV-2V; Tue, 10 Jan 2023 08:55:11 +0000 Received: by outflank-mailman (input) for mailman id 474465; Tue, 10 Jan 2023 08:55:10 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pFAPE-0005oC-5t for xen-devel@lists.xenproject.org; Tue, 10 Jan 2023 08:54:52 +0000 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2079.outbound.protection.outlook.com [40.107.104.79]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 706f88ee-90c4-11ed-b8d0-410ff93cb8f0; Tue, 10 Jan 2023 09:54:50 +0100 (CET) Received: from DUZPR01CA0078.eurprd01.prod.exchangelabs.com (2603:10a6:10:46a::20) by AM9PR08MB6034.eurprd08.prod.outlook.com (2603:10a6:20b:2db::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Tue, 10 Jan 2023 08:54:47 +0000 Received: from DBAEUR03FT025.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:46a:cafe::fd) by DUZPR01CA0078.outlook.office365.com (2603:10a6:10:46a::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18 via Frontend Transport; Tue, 10 Jan 2023 08:54:47 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DBAEUR03FT025.mail.protection.outlook.com (100.127.142.226) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18 via Frontend Transport; Tue, 10 Jan 2023 08:54:47 +0000 Received: ("Tessian outbound b1d3ffe56e73:v132"); Tue, 10 Jan 2023 08:54:47 +0000 Received: from 6209e2cc19c6.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id D5B9000A-951A-4E52-BADB-5DAEA1383FC3.1; Tue, 10 Jan 2023 08:54:36 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 6209e2cc19c6.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 10 Jan 2023 08:54:36 +0000 Received: from DU2PR04CA0216.eurprd04.prod.outlook.com (2603:10a6:10:2b1::11) by DU0PR08MB9347.eurprd08.prod.outlook.com (2603:10a6:10:41f::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Tue, 10 Jan 2023 08:54:33 +0000 Received: from DBAEUR03FT041.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:2b1:cafe::a1) by DU2PR04CA0216.outlook.office365.com (2603:10a6:10:2b1::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18 via Frontend Transport; Tue, 10 Jan 2023 08:54:33 +0000 Received: from nebula.arm.com (40.67.248.234) by DBAEUR03FT041.mail.protection.outlook.com (100.127.142.233) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5986.18 via Frontend Transport; Tue, 10 Jan 2023 08:54:32 +0000 Received: from AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Tue, 10 Jan 2023 08:54:32 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Tue, 10 Jan 2023 08:54:31 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.86) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.16 via Frontend Transport; Tue, 10 Jan 2023 08:54:29 +0000 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: 706f88ee-90c4-11ed-b8d0-410ff93cb8f0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DCO0fihkDCNBhO3hhRTkyjVzUW8pv9QuwCGAw2orFHo=; b=9snf656RL62LLV3QLMlqWRD1bA5sBjsdFifN0MCcM1kyoGFw0u4By3BaDPFZpUWGBxuJGTnPKzMeXGodh6NujH9l7nphIP6Eqd+Q66122+c0bU1bo1s8HH6/cZfDjCGyX2Wp/YTuQIj3kUd84oShKtt98HWrwzT8KxPCcD+mX70= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C X-CheckRecipientChecked: true X-CR-MTA-CID: e1e887521e64c94f X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=T9RTdtytLXmYRaeWcnThNla6A+vtkm0MCJ05xG4ycM2uUbvMSe+GIjQIwDIuBMNGGsiSYYoCqG3EvEoJYnG21/+bpgpaQonoWoLyQ37gCWZEzaonbkHTs4lWiCVp8Agfgbh6hZVU+WbkmfR0Gfv8TYPumvgu7JZ+NGJ+C3oi8QDJ+cZh8m2JUgd1pv7dgK/z4ytxp03ShKm5fF779FwuCGWEukjPd4saDwnbjo27UVaFQ3YTws98KkmXqAVHS8EugE7iCJYC6wHd2RihHaVgz0DVY4EPmGaRS78nOQ4eZ6COfjSKHCOsYNxuM/L2ukSna+WmE0MhLIrFIUm8/7Fb6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=DCO0fihkDCNBhO3hhRTkyjVzUW8pv9QuwCGAw2orFHo=; b=AKNXnO3yPkNYTdleVc27vHUcs8IUpvjA6riOPIOQzNzTCy/8SswijdK/5vpYGBfCsafh1H3twNJnk1CCwCLsDgqr7CAU4A6szPwZg5xtGtZtzzpFqDYmi19loDjJybNI+v3WmNA9ECnb9WeOW6DP+nok58u3qOyQKL4s2/qYkVk74SjCvsyVIloG++ElXl1uU+p709K5GgXlejK/uq1yq7pGBFIqs58T79/XJjwPoQs7lcbn7uPyJ7ePb2HAPOBLr0Luj50TTpJbBK2jhSauzRQMSvz9rBf1f6yGQfFg6oJJ6P8pdfpEwuU1LVG15KdMqdQhYoeTxL2hCQaBKrWEwg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DCO0fihkDCNBhO3hhRTkyjVzUW8pv9QuwCGAw2orFHo=; b=9snf656RL62LLV3QLMlqWRD1bA5sBjsdFifN0MCcM1kyoGFw0u4By3BaDPFZpUWGBxuJGTnPKzMeXGodh6NujH9l7nphIP6Eqd+Q66122+c0bU1bo1s8HH6/cZfDjCGyX2Wp/YTuQIj3kUd84oShKtt98HWrwzT8KxPCcD+mX70= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C From: Wei Chen To: CC: , Wei Chen , Andrew Cooper , George Dunlap , "Jan Beulich" , Julien Grall , "Stefano Stabellini" , Wei Liu Subject: [PATCH v2 17/17] docs: update numa command line to support Arm Date: Tue, 10 Jan 2023 16:49:30 +0800 Message-ID: <20230110084930.1095203-18-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230110084930.1095203-1-wei.chen@arm.com> References: <20230110084930.1095203-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: DBAEUR03FT041:EE_|DU0PR08MB9347:EE_|DBAEUR03FT025:EE_|AM9PR08MB6034:EE_ X-MS-Office365-Filtering-Correlation-Id: a233f2fa-3505-4379-13df-08daf2e8537d x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: gYqbdJxhb49crfW6S5nQgUv+h9haKLbcdOx/n4owFnl/MnlejUmKJzuoDv9TxMTMd2nmJiuJWa5+joXUP5YDBGOui1hPv84lfTa7sWIbXbSC6I0Fvk44cfW4zfMy/GbupT3hu5m5cIPh1cvcjmz0eos3FzHhakigrI+wVylRLRC9Kq4H6XHoa7xHRjS9BOi43SlGf9awimkKpK00JU4m9TzpOdg6ySIvzemXwa9J3qKu8huTPvXVY2+96r2195eAEX2UxY8cvPjPVY3Ga/YQjDTG1G1yBc2fwFdZpiCIcOr8F0qFhzJI+6zHhBing5sU+zNgFqXHj0l9Z+geGvHzuYZe3dToka/N0eDToAVctWqc1/JPlMKJobJtwyqwl2LfkVZBDcFjB9OxDKw/ks28KyrgThG8QIaVdoA+5DxIlxJZdTCcWh6i66ykzvxwL8WxZRvU8ZQM3rm0TmNcUib1cUxtXUqTlx0qrLmRL5ltx/xD3p/oRn20q2fIySxS8lZQwWRSWKlnI3dMpI10ucFzHF0sEgyWpSBEMzKv7ipwy4nVODBl60RFVEoX0R0I3h7lchCnVgBi8qtbP0IPzykFAwAGlcVt7dIpd5a1eM+JHfI9wTvwhB6W9wcwZ12zLy2UV+pxwyLXpwymxxOTMervjm1JipskKyUZF0JaTKF0qsvhLDPw+PpkWe/QG/HV699R5lEkDhm+1p4WE+S0DVX88Q== X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(346002)(376002)(136003)(396003)(39860400002)(451199015)(36840700001)(46966006)(40480700001)(356005)(36756003)(86362001)(54906003)(478600001)(316002)(15650500001)(44832011)(5660300002)(7696005)(2906002)(8936002)(70206006)(70586007)(36860700001)(8676002)(6916009)(41300700001)(4326008)(82740400003)(81166007)(6666004)(82310400005)(426003)(26005)(186003)(47076005)(1076003)(83380400001)(2616005)(336012)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB9347 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT025.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 6b91dd04-ff36-4b04-0c74-08daf2e84adb X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AWhCG1PH88NBGFSOzjFy6h3+pWSWTjsZHeeH0PagxRz8JmgmAnz/Bn08a+oKGxV69CI4uuQAjcmyKwwQ0rl+DHur3AzklMy9KJF8OE+HB4MDHAN6pLWaSMuqcTNO7NjlRpNILT3fNxOS4CEMO9+uxiqcg3O4j1Y7iDupQbU+94oLSc5G6gq58Vax4ksXwInAIyEA6dtKrMAxOZQIKYA9JCJPExRLonvwIRBoypjGr+r5chc1UphkWxgNHGOM2r4olhW9VWUXHFNPT8wv3MS94Md5cVUky67p6Nx/Dl7bKIk9P5sF2wlk0dBYuZhRJaLjbaUspJmvJEOH9oZZ0m4nLM33H4nJWeRzVysttygn4fG+QWOXGvWB8gIwdENrSIU+94Th18vMSO3QgD9smwt6zLSwD+Qdo2cSi/qvFuG0FwqXrvougE1hnlctXXmGmn1KdoJAbUC22CtDMqQtiHdzIzQyp57zh84zHHVsKtwluyH5ucKRcRaGy8cEdehnL6xA9lKVQCMRRLr57fmel57b7fglHtkJBXn5/70+Qfdd2LpZ/7b9DF7u/fx5sLRnawezXlhSWUUX0Jo5frlEcblEzeHiKewvDxR9VeAzX8HsBSCcR7v1U81fe93WFIyJnM5agyuAXJblE1C2ORfOr5+eCxkJWSSI0ZdX6N7be80+yDOjO9sRHk9YS6GIClWQrzEvTRCK/hVK19pJ+pK5Pq7pOA== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230022)(4636009)(39860400002)(376002)(396003)(346002)(136003)(451199015)(46966006)(40470700004)(36840700001)(1076003)(336012)(426003)(70586007)(4326008)(47076005)(44832011)(70206006)(8936002)(8676002)(5660300002)(82310400005)(26005)(186003)(2616005)(6916009)(6666004)(86362001)(82740400003)(316002)(15650500001)(36860700001)(54906003)(2906002)(83380400001)(40480700001)(81166007)(36756003)(41300700001)(478600001)(40460700003)(7696005);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2023 08:54:47.3386 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a233f2fa-3505-4379-13df-08daf2e8537d X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DBAEUR03FT025.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR08MB6034 Current numa command in documentation is x86 only. Remove x86 from numa command's arch limitation in this patch. Signed-off-by: Wei Chen Acked-by: Jan Beulich --- v1 -> v2: 1. Update Arm NUMA status in SUPPORT.md to "Tech Preview". --- SUPPORT.md | 1 + docs/misc/xen-command-line.pandoc | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/SUPPORT.md b/SUPPORT.md index 295369998e..b73d04a028 100644 --- a/SUPPORT.md +++ b/SUPPORT.md @@ -401,6 +401,7 @@ on embedded platforms and the x86 PV shim. Enables NUMA aware scheduling in Xen Status, x86: Supported + Status, Arm: Tech Preview ## Scalability diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc index 923910f553..40da980b67 100644 --- a/docs/misc/xen-command-line.pandoc +++ b/docs/misc/xen-command-line.pandoc @@ -1878,7 +1878,7 @@ i.e. a limit on the number of guests it is possible to start each having assigned a device sharing a common interrupt line. Accepts values between 1 and 255. -### numa (x86) +### numa > `= on | off | fake= | noacpi` > Default: `on`