From nobody Sat May 4 03:49:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=2; a=rsa-sha256; t=1628677526; cv=pass; d=zohomail.com; s=zohoarc; b=aa1VeUJCCuVnz8o2Tg3+HAkS+JwM11aBg+gTg6OK3xiP2BoD+j42fD5DflAUfof98EF38/woV2rL7YUv0xh+aaY/KJqmaaQSheNuKhES51UMJn5yIK4feF8JeagbZYOi7WPpAfuRmjOzqOjEyB7l+0UnnbwLkrATxLTHWU+rNK0= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628677526; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=XbmZt/3Qnc8x9mhpmsFguDqJamcughb+6Xb0Z1N6iV0=; b=D24ikGhJ0kwj7ixn8W9UWvJ3YVR0DRp/taq9Z2Rbz2SaXwHYkby3t+Py6DiJ1IuV39TqO7O7x/waa9IeUsSIPOQWRg9EdUDDmZPnArrYrWtt7iWnQGTZHF7R2OSR6GT8nLsvVmWJhJDYDleWWfzVCYM3UTQ5M4OMH1UpmkehNEg= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1628677526685567.861567276939; Wed, 11 Aug 2021 03:25:26 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.165616.302645 (Exim 4.92) (envelope-from ) id 1mDlPx-0000m5-SR; Wed, 11 Aug 2021 10:25:01 +0000 Received: by outflank-mailman (output) from mailman id 165616.302645; Wed, 11 Aug 2021 10:25:01 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlPx-0000lw-On; Wed, 11 Aug 2021 10:25:01 +0000 Received: by outflank-mailman (input) for mailman id 165616; Wed, 11 Aug 2021 10:25:00 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlPw-0000en-AR for xen-devel@lists.xenproject.org; Wed, 11 Aug 2021 10:25:00 +0000 Received: from EUR02-VE1-obe.outbound.protection.outlook.com (unknown [40.107.2.47]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 60b8ffad-fa8e-11eb-a052-12813bfff9fa; Wed, 11 Aug 2021 10:24:58 +0000 (UTC) Received: from PR3P195CA0027.EURP195.PROD.OUTLOOK.COM (2603:10a6:102:b6::32) by AM5PR0802MB2401.eurprd08.prod.outlook.com (2603:10a6:203:9d::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.21; Wed, 11 Aug 2021 10:24:51 +0000 Received: from VE1EUR03FT054.eop-EUR03.prod.protection.outlook.com (2603:10a6:102:b6:cafe::5a) by PR3P195CA0027.outlook.office365.com (2603:10a6:102:b6::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:24:50 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT054.mail.protection.outlook.com (10.152.19.64) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:24:50 +0000 Received: ("Tessian outbound 077ab11054bf:v101"); Wed, 11 Aug 2021 10:24:50 +0000 Received: from e5ec0673e643.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 77AB03F5-FFF7-4056-8023-FE57619D1911.1; Wed, 11 Aug 2021 10:24:41 +0000 Received: from EUR02-VE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id e5ec0673e643.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 11 Aug 2021 10:24:41 +0000 Received: from AM6P194CA0045.EURP194.PROD.OUTLOOK.COM (2603:10a6:209:84::22) by DB8PR08MB5292.eurprd08.prod.outlook.com (2603:10a6:10:a6::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.19; Wed, 11 Aug 2021 10:24:39 +0000 Received: from AM5EUR03FT041.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:84:cafe::68) by AM6P194CA0045.outlook.office365.com (2603:10a6:209:84::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.14 via Frontend Transport; Wed, 11 Aug 2021 10:24:39 +0000 Received: from nebula.arm.com (40.67.248.234) by AM5EUR03FT041.mail.protection.outlook.com (10.152.17.186) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4415.14 via Frontend Transport; Wed, 11 Aug 2021 10:24:39 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) 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.2308.14; Wed, 11 Aug 2021 10:24:34 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Wed, 11 Aug 2021 10:24:32 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 60b8ffad-fa8e-11eb-a052-12813bfff9fa 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=XbmZt/3Qnc8x9mhpmsFguDqJamcughb+6Xb0Z1N6iV0=; b=uy8+BZx4hpeTLpsZ4odoGCPYkREJ1UFRS/uxyjXDRH0kuo1zcI636QWljJExlgzAh41s6Frd0JFl7qOFWykv4jfZnztyHdr7c3RE9AjGjKEIjidwmLihGbRZRrGfTN/3tjyhnQrT9y8GqQ4ZDYujXJJJ9PFbTmmdaau4VHEPu4U= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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; X-CheckRecipientChecked: true X-CR-MTA-CID: d5fea9b0aa8fa606 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U+aSOJkWljn8dNbM7OpivMCS/cBtjK6o/cMszEMLeqvIquURXylBvokcVqdoY6LaIeW19lPYNGYRpC9KUFnB4TIqoYAVo6RJMtVW2A0n9cr76awaR3y8KLHLHLZCje08y7K359/fTqQNfQPQd2ZaHf74p1iHFHZ5iR84U8H+IW/jlrLPk3VeEdKNoplzFHENZrcDfxbF6NB6VT3xx6Qmwar1ukbYGlwR02AWyZzFNMQQnMoboisRwgKfG1GDDLe1IKEjUqv1o7OOGUr5fpzKRl8QxQLn1/mWHaD+tGPPpJpOmvg0Jjfl1nNObbeZT6NNsnGmrdhgZVWADDO22cLFRA== 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-SenderADCheck; bh=XbmZt/3Qnc8x9mhpmsFguDqJamcughb+6Xb0Z1N6iV0=; b=Bc/XctFxJY111BIGhVY0YdrUtf2umPSqft5wkTTBRTet/8IznD2wnGBi8I+oTDQbAV7sAErPTbpQx6tuCO8ot92sK41blXWZVRl70whRMXyGniUUPKi+cPer2jEHz62wY96CKBIfSbGpkf77vfZjkD7qgU9YmrqAgs+FwR6/YWwjVslhVjkm+HQRSar9SpsEwpAVm99CYVhxIe7INkQxm1X08aAyE/8X3yh4AtqqFjNZTfCKiiTahQNXQVEfohb1s0+0yUGpgqUeP8h3glB3C+yNABTRKaclY0KcLh/NdZvgTSMfOYF7lkz51OESFXWIs5E9zunCTh5M8XP4C0r9Dg== 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=XbmZt/3Qnc8x9mhpmsFguDqJamcughb+6Xb0Z1N6iV0=; b=uy8+BZx4hpeTLpsZ4odoGCPYkREJ1UFRS/uxyjXDRH0kuo1zcI636QWljJExlgzAh41s6Frd0JFl7qOFWykv4jfZnztyHdr7c3RE9AjGjKEIjidwmLihGbRZRrGfTN/3tjyhnQrT9y8GqQ4ZDYujXJJJ9PFbTmmdaau4VHEPu4U= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; 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; From: Wei Chen To: , , , , CC: Subject: [XEN RFC PATCH 01/40] tools: Fix -Werror=maybe-uninitialized for xlu_pci_parse_bdf Date: Wed, 11 Aug 2021 18:23:44 +0800 Message-ID: <20210811102423.28908-2-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210811102423.28908-1-wei.chen@arm.com> References: <20210811102423.28908-1-wei.chen@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 36916feb-2158-4523-84cb-08d95cb2409d X-MS-TrafficTypeDiagnostic: DB8PR08MB5292:|AM5PR0802MB2401: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:6108;OLM:6108; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: MNurJbs3tCWzvpXNUWUbAYC6SghBgTn9HdIaIoQfr/jUlZ2zQiQifYjbj3eh81lBAYRfeCO6LX9bAVb7bH1USaKpm5HTWc4kctrIrhm1+wKHAQuLirex+DbFFCkk9XBxZqCgFTrRkUjc1StkK/MbLItO64N2nIV5hSHLmNTfGhoHXsTUH4Tja8x9uz5rRLrqk+esOFC58jlxNmFaS5h82sR7FiHTV8iBfCjPWmVLbiBXl3odtAwJIS+a00Rf/i9BTrMoDdtm0A4yrQDkuqb5kfuzjMa0+XGJUyeX53R+SAfU+p7jTMQIDJcaD5fCpo48sRqWzUbQsLk+KHfUctS5rq4GAPw/Krdu2t/QGMA4p4kh2Pky4iBC7t6M39SBv4VLdbnEoYR1eg3ZkfEhl5QNph+fflTKZIGgK9eQqYF1w/80KAujqa85yaxRp2aYKuQBs2JSbNqdFCg06IqKdZ27gwIqRRBp/kjhHgLX+mFjAEf9jX6nigM8T+sAVqSPU12UVLALJuOimkka9Tcdfz+w8ESi2RFTkWGii8dpC1vFJHNeMkzF5utv02lD8lmoWEV8x7YDbRRITdoCPNBJid9GV7BKe3BUT/51nRB+tLy6BRADR4TwHW8lKeLjiiv7e4nLbbFT03uxdjR+/6Y5ZYlin0YJE20NNgsIWOmKlMu3tBjY1qrj2prWXLX0VVFfXvYnZZ0UHcL/Imw2ER17uooKAvD9uEK5b3QR1ZEm7UJ5nvnSDTUHhcEAJi+zBjJx1n2rlSRwJPjB18hqqNSCdk9/6wCt1+Xby/apty71YPJFY40= 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:(4636009)(39860400002)(396003)(346002)(376002)(136003)(46966006)(36840700001)(8676002)(34070700002)(356005)(2906002)(5660300002)(44832011)(26005)(426003)(7696005)(8936002)(478600001)(36756003)(36860700001)(83380400001)(82310400003)(70586007)(186003)(86362001)(110136005)(6666004)(2616005)(316002)(47076005)(336012)(82740400003)(81166007)(1076003)(4326008)(70206006)(2101003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB5292 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT054.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 88154411-dd04-4c15-450f-08d95cb239ae X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: m8LAgk5+fjRW313BazqjOzeiFnctBZvemA47LYbJPyV3LY0WhYJYAfJLVhY8O1Qjfvvf78DqCoz05b56H98rx084vF7bLFCySBVfb0U6ZBwG8NHQWWTq+Q5tK37qRp0WivP8JbHqdJvO3jaXFKIw8MOFyzfzZBchcAsEyWp9hORRHHwR4xS11JD/sy8UwW/TsY/SQfvTuzJi+50001vyfrn2EsS3nU5yGTWHn7qaY7vR1qGKPMKEd/jzevG6zXBaBSsC64Vav3OzIDBTQK1FKOBtjdKGKIL0JnD/mnCkPCgvE8ZQPGuaHs9h50wCmGRY4aSe6VwXcDoBLv0/oojmcDFbDOY0uq0ZZWoEtpgX55/iYG5hYi0Zj60PBOtMmjWYnzstAIztD9yQOHBuZLGGsfJbHWMn3izxOKunk0wetpKO9vr3l1rSlILqbSewIkUATJrWBYE/p1YftBtXf95UTouRstowrW4sNc9krKwRB/cj9mJsWiuP+WnFJzNcUL5ClOOVDE1B9kTFQaXmg6d1qxNyTuw8TOy++6g7zWUojL7OZzLPEjAawSXqpFJCpZx48BgM7ZQNKEjOlOXUqK1Q9jHVdEF+BMmDvNpyNarN9pVCVbdb+QzuWaEXCSpG7Quoo1gZSvdtUZawJ/pBaoeoW4KF6lREnVqXtR19l4QOudOQiwMLuGl6E75XaQZUKNdkn+CM9IY0ZxRFBPgT4n6SHuJppdopyxgymq9lFBAKSKk= 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:(4636009)(136003)(376002)(396003)(39860400002)(346002)(36840700001)(46966006)(26005)(8676002)(316002)(2906002)(36860700001)(44832011)(36756003)(186003)(82310400003)(70206006)(70586007)(7696005)(81166007)(2616005)(426003)(478600001)(86362001)(82740400003)(6666004)(83380400001)(8936002)(4326008)(1076003)(110136005)(5660300002)(336012)(47076005)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2021 10:24:50.6415 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 36916feb-2158-4523-84cb-08d95cb2409d 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: VE1EUR03FT054.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0802MB2401 X-ZohoMail-DKIM: pass (identity @armh.onmicrosoft.com) X-ZM-MESSAGEID: 1628677528082100006 Content-Type: text/plain; charset="utf-8" | libxlu_pci.c: In function 'xlu_pci_parse_bdf': | libxlu_pci.c:32:18: error: 'func' may be used uninitialized in this funct= ion [-Werror=3Dmaybe-uninitialized] | 32 | pcidev->func =3D func; | | ~~~~~~~~~~~~~^~~~~~ | libxlu_pci.c:51:29: note: 'func' was declared here | 51 | unsigned dom, bus, dev, func, vslot =3D 0; | | ^~~~ | libxlu_pci.c:31:17: error: 'dev' may be used uninitialized in this functi= on [-Werror=3Dmaybe-uninitialized] | 31 | pcidev->dev =3D dev; | | ~~~~~~~~~~~~^~~~~ | libxlu_pci.c:51:24: note: 'dev' was declared here | 51 | unsigned dom, bus, dev, func, vslot =3D 0; | | ^~~ | libxlu_pci.c:30:17: error: 'bus' may be used uninitialized in this functi= on [-Werror=3Dmaybe-uninitialized] | 30 | pcidev->bus =3D bus; | | ~~~~~~~~~~~~^~~~~ | libxlu_pci.c:51:19: note: 'bus' was declared here | 51 | unsigned dom, bus, dev, func, vslot =3D 0; | | ^~~ | libxlu_pci.c:78:26: error: 'dom' may be used uninitialized in this functi= on [-Werror=3Dmaybe-uninitialized] | 78 | if ( dom & ~0xff ) | | ~~~~^~~~~~~ Signed-off-by: Wei Chen --- tools/libs/util/libxlu_pci.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/libs/util/libxlu_pci.c b/tools/libs/util/libxlu_pci.c index 551d8e3aed..b38e9aab40 100644 --- a/tools/libs/util/libxlu_pci.c +++ b/tools/libs/util/libxlu_pci.c @@ -15,7 +15,7 @@ static int parse_bdf(libxl_device_pci *pci, const char *s= tr, const char **endp) { const char *ptr =3D str; unsigned int colons =3D 0; - unsigned int domain, bus, dev, func; + unsigned int domain =3D 0, bus =3D 0, dev =3D 0, func =3D 0; int n; =20 /* Count occurrences of ':' to detrmine presence/absence of the 'domai= n' */ @@ -28,7 +28,6 @@ static int parse_bdf(libxl_device_pci *pci, const char *s= tr, const char **endp) ptr =3D str; switch (colons) { case 1: - domain =3D 0; if (sscanf(ptr, "%x:%x.%n", &bus, &dev, &n) !=3D 2) return ERROR_INVAL; break; --=20 2.25.1 From nobody Sat May 4 03:49:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=2; a=rsa-sha256; t=1628677524; cv=pass; d=zohomail.com; s=zohoarc; b=e+p0Gi9ZsgZCGqFpiJCEeJN17ek1e+3rauPcJ02yzIQA2r1J4meO154qp1Bgzlbfl/2RWs0J1EZ3tbeYgLIMomupku+BUkiMJbtc+6uvdgTcXQi5GiCc3GsFKkLQo9LP9AKJaARE4kUtA5bbxyNGeNYkpB7qdsB+1ok41bi4/Fs= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628677524; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=REMC2JEWc6kSwOzQOPs+cm02/cp1lLy6vZpviwordBA=; b=Mr/q2TN3TOL9yuqJKTN+BYw1AJsKF91appNlfR0ZamBPNOnsJk4rXvzgMhEyDcq1yPkAlDT/+Hf2xEECWvVyIgcvCcIqD1/Vp0FqhUtHLMFs3VuWjwWASuw45Xl7zv2gNOAW23sVgTBja27Q9+80MiiGZl8ViozKqYUtGr6krFE= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1628677524353199.72457241538268; Wed, 11 Aug 2021 03:25:24 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.165615.302633 (Exim 4.92) (envelope-from ) id 1mDlPv-0000TW-JD; Wed, 11 Aug 2021 10:24:59 +0000 Received: by outflank-mailman (output) from mailman id 165615.302633; Wed, 11 Aug 2021 10:24:59 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlPv-0000TP-GH; Wed, 11 Aug 2021 10:24:59 +0000 Received: by outflank-mailman (input) for mailman id 165615; Wed, 11 Aug 2021 10:24:58 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlPu-0000BQ-B7 for xen-devel@lists.xenproject.org; Wed, 11 Aug 2021 10:24:58 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (unknown [40.107.21.40]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 8f5c7161-3a04-4805-b4d6-964518a0af21; Wed, 11 Aug 2021 10:24:51 +0000 (UTC) Received: from DB8P191CA0030.EURP191.PROD.OUTLOOK.COM (2603:10a6:10:130::40) by AM7PR08MB5495.eurprd08.prod.outlook.com (2603:10a6:20b:104::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.15; Wed, 11 Aug 2021 10:24:49 +0000 Received: from DB5EUR03FT031.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:130:cafe::e2) by DB8P191CA0030.outlook.office365.com (2603:10a6:10:130::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.14 via Frontend Transport; Wed, 11 Aug 2021 10:24:49 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT031.mail.protection.outlook.com (10.152.20.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:24:49 +0000 Received: ("Tessian outbound 8529ae990a93:v101"); Wed, 11 Aug 2021 10:24:49 +0000 Received: from 8e0975189f47.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 3D8231B4-607E-4028-B13D-4B85FBF13773.1; Wed, 11 Aug 2021 10:24:42 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 8e0975189f47.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 11 Aug 2021 10:24:42 +0000 Received: from AM7PR04CA0027.eurprd04.prod.outlook.com (2603:10a6:20b:110::37) by AM5PR0802MB2498.eurprd08.prod.outlook.com (2603:10a6:203:98::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.21; Wed, 11 Aug 2021 10:24:41 +0000 Received: from AM5EUR03FT015.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:110:cafe::94) by AM7PR04CA0027.outlook.office365.com (2603:10a6:20b:110::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.13 via Frontend Transport; Wed, 11 Aug 2021 10:24:41 +0000 Received: from nebula.arm.com (40.67.248.234) by AM5EUR03FT015.mail.protection.outlook.com (10.152.16.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4415.14 via Frontend Transport; Wed, 11 Aug 2021 10:24:41 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) 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.2308.14; Wed, 11 Aug 2021 10:24:36 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Wed, 11 Aug 2021 10:24:34 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 8f5c7161-3a04-4805-b4d6-964518a0af21 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=REMC2JEWc6kSwOzQOPs+cm02/cp1lLy6vZpviwordBA=; b=7Fa1EHXx6y6ZVDYimGP9CjNnAfbWmLQedvHR9rWKlVusXTObKOpYKfbXmzMi+Wk+zeBhERdxhGuxAK+OgTkXraSIKH+2/yDX1D23PAoiK601X4AvCAHf89voRSTE85cPbta/RDXnWEAMkNl4DGmR58CO1ncSdN8tPBNb3JkaaFM= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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; X-CheckRecipientChecked: true X-CR-MTA-CID: 79bdd4d3dd8a0002 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KyR9PAoWjBH1QOpJv24cx0CTZ0nsvLnei7loTdDZkI/2ooKNX7eKwSxVItY9SZV5r4t1vpencp1WfvID/87FHtwT6IU/LV30FFRczeQ5bmPVWhueapwi5PupJqArHqjMKdvUmMHRniV7oXDhda2KFRJOxv+16dr0/93jQs1sE+ppqK06KAqTsQbOjdiBMoFohpC0atXkWTY0Dopw7bGSGwup8dVLxY01mcW7QBWmVNZuCJePatYDmg7K8v0NSSSKOGQumgeWQYYuwAuYFQi04VKr1nceRBSrfOIelG06xGP5aLlSJk+479tVFwbUDe2kNdA7SKo7d2DOxEgaect3zQ== 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-SenderADCheck; bh=REMC2JEWc6kSwOzQOPs+cm02/cp1lLy6vZpviwordBA=; b=HbsT3iP8XfP/33R/jCMp/Jknsz4XHjudjpaF2bpvVsv5YNOKx4AsRIjmKnlxxT7TkyPDEtYHzL+0Qd2W1KkbgiauhE0b26gkQUFjjvSMvRpT1HsOJTGcBmrYIftRiAbMliN3Nuj+cpx1X7A+zNqHrBOictAqrWGtzz0I4ABrn1hIhFjjYqfK6bTGAa35bxRHZNrzAmtCaHlkmr5mhNj/b8LRrnRwhwgTtEHleBkhA0zCkY42JRyxR0c1AcmxYHQ9o0EXbmRrFMZThTftvuVr7t/drWCEroa3kqyv40pLcoTpKnNMSSffhV86frTSrVnDzHNduECKmHz8eykQqyc7gQ== 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=REMC2JEWc6kSwOzQOPs+cm02/cp1lLy6vZpviwordBA=; b=7Fa1EHXx6y6ZVDYimGP9CjNnAfbWmLQedvHR9rWKlVusXTObKOpYKfbXmzMi+Wk+zeBhERdxhGuxAK+OgTkXraSIKH+2/yDX1D23PAoiK601X4AvCAHf89voRSTE85cPbta/RDXnWEAMkNl4DGmR58CO1ncSdN8tPBNb3JkaaFM= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; 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; From: Wei Chen To: , , , , CC: Subject: [XEN RFC PATCH 02/40] xen/arm: Print a 64-bit number in hex from early uart Date: Wed, 11 Aug 2021 18:23:45 +0800 Message-ID: <20210811102423.28908-3-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210811102423.28908-1-wei.chen@arm.com> References: <20210811102423.28908-1-wei.chen@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: dccde90d-4c81-49be-6fcc-08d95cb24001 X-MS-TrafficTypeDiagnostic: AM5PR0802MB2498:|AM7PR08MB5495: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:6108;OLM:6108; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: Z7rKeOpcgWYGZmqWbwZEIhrwp1+skqduyinj4OlfYPkWOdJJMX/Rc53dcJq/r5oaUGtVjwkZXpN1kcJj+gZV3zar86FuSIf5jPA5hN/l4M/D/KVvxt5LVOHD83xqIXyTvVS+0ZMSzgjYuzn+3lLdxTgMTq86VksZ4pIFiIhySCb12X0uksWiez9xNppji1UBKLU5L9B+6M1XFMF6OkKiLljsyqsttKBujdiGmd0W0is3LIUi6YLC2f/GcYk3Uf1t9L84S32NhdxlxYLjGjenwpyiDxzS0GHYRFYVSey4tCk/uiq0CxapZ6ES3MYwunrrsrqVTsIXn67vrc6DY9JXm3F2NHszn3l04zV1nE/HauMFfqyWfNrIKHt0XB8r0r32OClT1ZvZGUK5SZ7vhK0IAvD5avSUQIyGtPGXbIBh30VAd3tXyNElz+ufPssvCg6rpdyzY2xvEUvVvfXWTphN5V5BGN5+cYpLL/Ry6D9OkSQv64WIf5bgM1X1cad5qgzC2IZCvRJBKIVQfjuWQF8msaobiVpjeyg4LZZf6qxOAcYTmFajt0RKmdDO2JhfC7C5AN2flkc1Y6yAHiIFkLE9FbVgpoJhd1LwgF1ugD0mQBHfX1TrGwhKKAZSMapxxaVQii3mRaonoG4TGp4xqFUrM+UpV61uuwbpvRL8zNbZULgbGFCLqiWR9Ehz0R61CWTQbMaPr5y1LMew5esGUejptCV3OdYldbYBQ2Fb7GSLEn293nszL5T0z0ryZ5fSHtDoLlpwnnNoi1whV1rJcrd5gJmExMJ3GBnkwzzKAzNjkrU= 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:(4636009)(346002)(396003)(136003)(376002)(39850400004)(46966006)(36840700001)(83380400001)(356005)(2906002)(7696005)(36756003)(2616005)(426003)(5660300002)(86362001)(336012)(4326008)(82310400003)(44832011)(47076005)(34070700002)(36860700001)(478600001)(82740400003)(8676002)(81166007)(1076003)(186003)(70586007)(70206006)(110136005)(6666004)(26005)(316002)(8936002)(2101003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0802MB2498 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT031.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 9185d0b8-baf8-4708-cee9-08d95cb23aee X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eLXFvQErm9udb2DXQwfUR+BCa5Ld3qX+ktyO4VOYTQ+qxbRMFkIWKa+8/SZUi6wg3ZU+SdIGR5J9Br4kMKyDJxmf+FbvfpT8YHaJJNuDVw0Ei1vDmWUzu4gJ/RDR0NjPj07aY5K8brwTAB4FWgZI9Kv2B3+oExCkmo+rUeCjDzPmWEFfcvx5/akjc5oIGPKoEpwi+bvnu9nDNBm2mY7SYtYCif3P79hFjTG3NzhKcsd1KRhF/GWqA/Pfr/qOkZSbw2SWxYb/JG+JI4yIsGY6QOg4MXtu8Tifwnk3hfl1QOfLL9laGrThPn5/n53ngFxhDk8j+2/OU4Qohadk0fD0+rE3fhpDobxzn1emXkx8LzMHPTZgHdEVBpwvKz/EMFfdRzgAgovtbr77MvLVeacjKKy/Lm/3aGZk4SdZkpL+UUzC5mLEzDNDCw6onWLTEmM7NKYpBVW5k4RK8Jw0HM8DKbxDz8o0Z6HyUbdiadd34yPuvJjHxU9OA5dee3FAAFiITOvXS3hJICQYkL+Q13zE6Ro24VFUP6UB+EPd9yeBYqv93f/bTNBFyi4QD29UgdLU/9s0x8KDlBFFPFHBYl4+czMuFJoJuO5Wh8aaW8MNHWji+eU15u8YZOm/uIzg0AIZG7ajG+TXk/GTxXX0Flel8U6cSBbeXOqOaJnjmtrV9c/u+Gq5ZLSRjX4gpg7eP8Ejge79ChE2Y6sKo8nguJHkjrZAa8DbgTSgEvqtMVDW4FU= 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:(4636009)(36840700001)(46966006)(2616005)(336012)(83380400001)(86362001)(186003)(2906002)(36860700001)(1076003)(47076005)(7696005)(5660300002)(36756003)(82310400003)(4326008)(70586007)(70206006)(44832011)(8936002)(8676002)(26005)(426003)(508600001)(81166007)(316002)(110136005)(6666004)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2021 10:24:49.7325 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dccde90d-4c81-49be-6fcc-08d95cb24001 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: DB5EUR03FT031.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR08MB5495 X-ZohoMail-DKIM: pass (identity @armh.onmicrosoft.com) X-ZM-MESSAGEID: 1628677526777100001 Content-Type: text/plain; charset="utf-8" Current putn function that is using for early print only can print low 32-bit of AArch64 register. This will lose some important messages while debugging with early console. For example: (XEN) Bringing up CPU5 - CPU 0000000100000100 booting - Will be truncated to (XEN) Bringing up CPU5 - CPU 00000100 booting - In this patch, we increased the print loops and shift bits to make putn print 64-bit number. Signed-off-by: Wei Chen Acked-by: Julien Grall --- xen/arch/arm/arm64/head.S | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S index aa1f88c764..b32639d7d6 100644 --- a/xen/arch/arm/arm64/head.S +++ b/xen/arch/arm/arm64/head.S @@ -862,17 +862,18 @@ puts: ret ENDPROC(puts) =20 -/* Print a 32-bit number in hex. Specific to the PL011 UART. +/* Print a 64-bit number in hex. Specific to the PL011 UART. * x0: Number to print. * x23: Early UART base address * Clobbers x0-x3 */ +#define PRINT_MASK 0xf000000000000000 putn: adr x1, hex - mov x3, #8 + mov x3, #16 1: early_uart_ready x23, 2 - and x2, x0, #0xf0000000 /* Mask off the top nybble */ - lsr x2, x2, #28 + and x2, x0, #PRINT_MASK /* Mask off the top nybble */ + lsr x2, x2, #60 ldrb w2, [x1, x2] /* Convert to a char */ early_uart_transmit x23, w2 lsl x0, x0, #4 /* Roll it through one nybble at a ti= me */ --=20 2.25.1 From nobody Sat May 4 03:49:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=2; a=rsa-sha256; t=1628677525; cv=pass; d=zohomail.com; s=zohoarc; b=VtDeOKrvAAPxKH3CHoviE5x2Kly9yTs4h18YmLKK1oxXWrFpjngTqwGFifCy6xePKqTL2ZBgMS+WVRJ5GiTz5LuoCmK2RmQ28qXyRZF3kjN9pA93A/33GKiywv8cWyEf6K9RjiP10+MJwh43YiYNDOlijnkYVGHaOviiguqIt8s= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628677525; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=QSDZcA/RWL9vV9pltePO7Er9bgZ7P1bFBHq5K5ZpEXI=; b=Ta3d+3jJtn/ulVnFmDeQa/MSEHcECVzM/CSbFhNR5TDQ6BgU56onzsaX6+jYYfVoW807N81x0EY0An7+48RfCkRhvnZL1T8wuTrJ7u561M17XvEx7gXsdiTbstRYK2tnDY9KmNb2g6DjEe8R5ku8s90cUmVO3KjFst4SVXFRdH8= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 16286775253183.1034437051024497; Wed, 11 Aug 2021 03:25:25 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.165617.302656 (Exim 4.92) (envelope-from ) id 1mDlQ1-00016G-5q; Wed, 11 Aug 2021 10:25:05 +0000 Received: by outflank-mailman (output) from mailman id 165617.302656; Wed, 11 Aug 2021 10:25:05 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlQ1-000169-1M; Wed, 11 Aug 2021 10:25:05 +0000 Received: by outflank-mailman (input) for mailman id 165617; Wed, 11 Aug 2021 10:25:03 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlPz-0000BQ-BL for xen-devel@lists.xenproject.org; Wed, 11 Aug 2021 10:25:03 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (unknown [40.107.6.57]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 0edcda4c-df00-4efd-91ba-a593fcf1007b; Wed, 11 Aug 2021 10:24:58 +0000 (UTC) Received: from DB6PR0802CA0043.eurprd08.prod.outlook.com (2603:10a6:4:a3::29) by AM0PR08MB3299.eurprd08.prod.outlook.com (2603:10a6:208:60::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.17; Wed, 11 Aug 2021 10:24:55 +0000 Received: from DB5EUR03FT061.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:a3:cafe::4c) by DB6PR0802CA0043.outlook.office365.com (2603:10a6:4:a3::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:24:55 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT061.mail.protection.outlook.com (10.152.21.234) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:24:55 +0000 Received: ("Tessian outbound d9f41274f41a:v101"); Wed, 11 Aug 2021 10:24:55 +0000 Received: from 6eaccd0753e0.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id F39B0819-696B-4335-B644-51F7C8F87498.1; Wed, 11 Aug 2021 10:24:44 +0000 Received: from EUR01-VE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 6eaccd0753e0.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 11 Aug 2021 10:24:44 +0000 Received: from AM7PR04CA0008.eurprd04.prod.outlook.com (2603:10a6:20b:110::18) by AS8PR08MB6280.eurprd08.prod.outlook.com (2603:10a6:20b:29b::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.21; Wed, 11 Aug 2021 10:24:42 +0000 Received: from AM5EUR03FT015.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:110:cafe::2d) by AM7PR04CA0008.outlook.office365.com (2603:10a6:20b:110::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.15 via Frontend Transport; Wed, 11 Aug 2021 10:24:42 +0000 Received: from nebula.arm.com (40.67.248.234) by AM5EUR03FT015.mail.protection.outlook.com (10.152.16.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4415.14 via Frontend Transport; Wed, 11 Aug 2021 10:24:42 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) 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.2308.14; Wed, 11 Aug 2021 10:24:39 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Wed, 11 Aug 2021 10:24:37 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 0edcda4c-df00-4efd-91ba-a593fcf1007b 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=QSDZcA/RWL9vV9pltePO7Er9bgZ7P1bFBHq5K5ZpEXI=; b=4erjMjor/BUxHHBYly3vqOSvB/xsHA42KzIW7zlTecXKQzeGj2uTlHaJ74x6+wC0iTebQafkfn7vC01kLM2dqlO1fOPdLJtzfxD99n/xFqqMh8jCGmIq6qQ6AJAzL1u8hhhf7ipPQXopZlMXq7nhNfKrOx0NcVuNcdT8BnbN48k= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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; X-CheckRecipientChecked: true X-CR-MTA-CID: 03faa8a320c1bcbc X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=m+SEo2BeALNU/DnHnteFsidG4HambSxoZzxEs0OHRg2sKqI1xHkJ5f5OypcV54cbcDUWngZC5onVM+oSLBA2l1fYMnGo6JHJR7edozVHF0ez4jfxtEYIzHMx/n5dxtdaflW5aOsE3E0KvRJ4UmloUP7+D+tr/TaPvZtxGij/qDyAQTxDdFkIehgYwtFHsxgbjJwoTP5Vregdrk2fHzWXNK8KGiKFW8ImeuD4R1Z7tNv73eSOad+hTCCGMiK6dogBaFXIkvY5d0Gp9LJRKP37J4aQmMy0qiwkXflzYjq6UuCHTeSgpkzK0NgLqkkAthYwY+HODK2qqWVHvTiDlYSffg== 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-SenderADCheck; bh=QSDZcA/RWL9vV9pltePO7Er9bgZ7P1bFBHq5K5ZpEXI=; b=ZEHZ3toKix3CIpK2RPqM8uDzvifc2a5Xipl70B4bVPF2y59A238cjh9jRutNiTumRtBRq8xrTTe/S2Yae0O22K5lEl5WkGGTM41AyOtMKsznSHG0a3q9uE7pV6zdmdnWPGYTxP88/b2nZt/IKLwS7fOEbOR6QmBC44KJaMIPbWCobPBRQcz6f9SVX4hCtS3fAOnWB2J1cvYWEpYZMkBW0JyJiv4x1/hwCstJSJZ/z9r9fPGqdO0nXvZf0EKruZgPbgPl8aIKuC+aYW6YsZegI9V3S/UBzbT9tugpsSz7OSoWvp/+sxOY8QPtkO5Pap4AwUEe/tw3gtYsxqmqiFJtUw== 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=QSDZcA/RWL9vV9pltePO7Er9bgZ7P1bFBHq5K5ZpEXI=; b=4erjMjor/BUxHHBYly3vqOSvB/xsHA42KzIW7zlTecXKQzeGj2uTlHaJ74x6+wC0iTebQafkfn7vC01kLM2dqlO1fOPdLJtzfxD99n/xFqqMh8jCGmIq6qQ6AJAzL1u8hhhf7ipPQXopZlMXq7nhNfKrOx0NcVuNcdT8BnbN48k= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; 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; From: Wei Chen To: , , , , CC: Subject: [XEN RFC PATCH 03/40] xen/x86: Initialize memnodemapsize while faking NUMA node Date: Wed, 11 Aug 2021 18:23:46 +0800 Message-ID: <20210811102423.28908-4-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210811102423.28908-1-wei.chen@arm.com> References: <20210811102423.28908-1-wei.chen@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 464a32c3-251d-4f5d-da98-08d95cb24397 X-MS-TrafficTypeDiagnostic: AS8PR08MB6280:|AM0PR08MB3299: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:3631;OLM:3631; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: Z6bfNvc+NOU7Yt9Zv21nC1BoveRrI5bHcVyU5hbPXMVDDZINrjwkNkrzqu7fPpjAmblBF2JQF7Vi8rzEAKrXZ5SMnjze9xkss7kbgtfYYGcRqD7F0DcMrFoluHdgnyaRurynzQPGPvPMpHckOnTSUHuGcgthj1WMMYX6mjM6gizXtBMjzl7in+ZUtTLFtcDYi0/9s1rexMUIKDqcEtFg6mEmi6u/ngVnjsh8Cqh/JXgrWAreXK5RlWwiM6tc2LZZVyb9AJkVD3qdAbNL4aU5OvrmEE3CK8xWulLX/o5oIr/RaOV42YqbUoLpB+9E0c3+OF5v5LuJGAe6yL88UGbQVx9aiHj0DbQyDpFOl7M9n1EmH6rl8/Z2mm690CLTegYYoFv8sMnK3JJifKOE5mbehHYOKtv2tKY0wTkMSDjdiRJj+ylXKfTfHjxywhtMW55fAgzC4r2sby/Xxd6ydEe2zWUsbbDYZT8eTHOF3AlHfldfrCmtgyKHLXCU6b53pkkhrQXzlKxmMuW5l1LZzQ3aMh/U49qjRdhuis/V6Nh73lmjwSi3mJzxHrvk9JQdEBgvp0boCkBDyUE3qw0QOFDPfUw1vXUnw24OqEekl9i3HtazM91Us4x8Tndk8v/qvqaowRTwQUqPrLFyfH2jE7niH3Xl8eyG2LOtpceU4GSSU/Gd0yio0+E782P1YbNdASUjhH6n/FpWVhxkJvKzwwzOKvAPjYvcNJM5g3seVBvnyuWrlOCgoZ4UEd9z5vYgNBYH7Z0mPz/6g+GKr/K/1/4bZg== 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:(4636009)(39850400004)(396003)(346002)(136003)(376002)(46966006)(36840700001)(2616005)(34070700002)(26005)(478600001)(5660300002)(82310400003)(6666004)(4326008)(82740400003)(7696005)(44832011)(336012)(426003)(186003)(83380400001)(356005)(36860700001)(8676002)(36756003)(110136005)(1076003)(70206006)(8936002)(70586007)(81166007)(316002)(2906002)(86362001)(47076005)(36900700001)(2101003);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6280 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT061.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 2c0bdac3-9b18-4c23-53ba-08d95cb23bc4 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XTxSV2sNVXR0xHfhMgxscMI/wkR22brdxGlzGGNx/Jrt4q24sx4ES4gEbWZfLOpixb3K8JBcI9l6bOIBg4H4cQwGHoUFf1ihTTdlGXpcETVwoCLPus10CwHdSv+JkD75oqUyRC4gmLgQIlNYE4MFpnK5p7mtKXa74JGgvlUYhix/z8uqU+5DAGno7jaLHs6LhP48Q0qTYldLJYFUAJwb2kQEBmfvXTkDYSmItDMJ13+1yQhDnJhrSsvSZ4v35PPpw+UIL2aU3ABLJErwSIeejo7KWLcU8K8xmYkPuQyPKoCWu22Ugt7I0QyHfhrn8Aq8pT1jm1EOTq7VzuouvJTTK73T5vCvaiSXjOkR8YEGTS0P7dBiZgY0zW7Chosx7DSlWOEXPNtNq259a+u6qDp4dm3rVldu7DPU90v+9CSqg72Jmcx7hPLI/jf+Itl5cUX7IJGtHffKhOXf0ThOsO+v7qsVQY/646qHWJuA9a9GXcAIQM+3Tdx7fPZlXOscioHCzd0o7JG38XeY6ny7QWkw5ci9rS3w2DjzaM+FuWBNJYLikwRPacaKscX3vfekgFiPCQjntJcO/EeWwabOp79Z7n+iR4Q6MCiW7BcuoO2Jjur5ZZ4O1MWBNua9jtQ863EZVaGCGFnSieAwSiIpUQbxUi5G75TluW19uwWf7APSct4F29l8PFJTWEMGCEEXaUJjB1JYW4mTUAD5YB9aqjeiIg== 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:(4636009)(136003)(346002)(39860400002)(376002)(396003)(36840700001)(46966006)(2906002)(110136005)(316002)(336012)(426003)(81166007)(26005)(186003)(8936002)(83380400001)(8676002)(1076003)(478600001)(70586007)(44832011)(86362001)(6666004)(82310400003)(5660300002)(82740400003)(4326008)(2616005)(7696005)(47076005)(36860700001)(36756003)(70206006)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2021 10:24:55.7525 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 464a32c3-251d-4f5d-da98-08d95cb24397 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: DB5EUR03FT061.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB3299 X-ZohoMail-DKIM: pass (identity @armh.onmicrosoft.com) X-ZM-MESSAGEID: 1628677526777100002 Content-Type: text/plain; charset="utf-8" When system turns NUMA off or system lacks of NUMA support, Xen will fake a NUMA node to make system works as a single node NUMA system. In this case the memory node map doesn't need to be allocated from boot pages. But we should set the memnodemapsize to the array size of _memnodemap. Xen hadn't done it, and Xen should assert in phys_to_nid. But because x86 was using an empty macro "VIRTUAL_BUG_ON" to replace ASSERT, this bug will not be triggered. In this patch, we set memnodemapsize to ARRAY_SIZE(_memnodemap) to fix it. Signed-off-by: Wei Chen --- xen/arch/x86/numa.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xen/arch/x86/numa.c b/xen/arch/x86/numa.c index f1066c59c7..d23f4f7919 100644 --- a/xen/arch/x86/numa.c +++ b/xen/arch/x86/numa.c @@ -270,6 +270,8 @@ void __init numa_initmem_init(unsigned long start_pfn, = unsigned long end_pfn) /* setup dummy node covering all memory */ memnode_shift =3D BITS_PER_LONG - 1; memnodemap =3D _memnodemap; + memnodemapsize =3D ARRAY_SIZE(_memnodemap); + nodes_clear(node_online_map); node_set_online(0); for ( i =3D 0; i < nr_cpu_ids; i++ ) --=20 2.25.1 From nobody Sat May 4 03:49:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=2; a=rsa-sha256; t=1628677535; cv=pass; d=zohomail.com; s=zohoarc; b=FOh51rwvz9ULLlmBHyS8yJUPS2pmVjZRavnVmRp5BeQe+G7kooPo+8XRvi1imBblu/wLrYiqgZzv1RI1bNL4DPXRF0YzyPUGhroG6USTyLJBRdRBhKnV7vIqkNRQVRdnGIgVGi5zLcvPK9q/HB/b1/BjheuDIHZtXCpuvjwgw2Q= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628677535; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=+ONilfRs6Yw0UA5hM/jo7ynBsRjRbTUFfphDgQCzBbE=; b=meeOMBXjL9R7J1NVNgSIgL1dXjvo2pC6jfBekCG6uit6Wv5nONVmZe+kG361bQAd6M8QcRu8yF55TmgelDfvBYcuTch5VGiGTLGYIQCZ5maiwDu0ka7BOdxVpBgF74wqrd4oKLUlazsU+BKY/yJpeRg5lMg8lKReRw7GIrAzEZs= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1628677535950454.38995091122797; Wed, 11 Aug 2021 03:25:35 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.165626.302689 (Exim 4.92) (envelope-from ) id 1mDlQG-0002on-EX; Wed, 11 Aug 2021 10:25:20 +0000 Received: by outflank-mailman (output) from mailman id 165626.302689; Wed, 11 Aug 2021 10:25: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 1mDlQG-0002nq-AJ; Wed, 11 Aug 2021 10:25:20 +0000 Received: by outflank-mailman (input) for mailman id 165626; Wed, 11 Aug 2021 10:25:18 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlQE-0000BQ-Bu for xen-devel@lists.xenproject.org; Wed, 11 Aug 2021 10:25:18 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (unknown [40.107.7.58]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id fd9d89a5-d3a3-4741-ba50-954fbfc1dabe; Wed, 11 Aug 2021 10:25:12 +0000 (UTC) Received: from AM6P193CA0096.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:88::37) by VI1PR08MB4382.eurprd08.prod.outlook.com (2603:10a6:803:f5::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.19; Wed, 11 Aug 2021 10:25:00 +0000 Received: from VE1EUR03FT063.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:88:cafe::fb) by AM6P193CA0096.outlook.office365.com (2603:10a6:209:88::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:24:59 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT063.mail.protection.outlook.com (10.152.18.236) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:24:59 +0000 Received: ("Tessian outbound ab45ca2b67bc:v101"); Wed, 11 Aug 2021 10:24:58 +0000 Received: from e31897cafa99.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 7359A672-B132-4975-95F6-FC9733A0DB11.1; Wed, 11 Aug 2021 10:24:51 +0000 Received: from EUR03-AM5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id e31897cafa99.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 11 Aug 2021 10:24:51 +0000 Received: from AM7PR04CA0005.eurprd04.prod.outlook.com (2603:10a6:20b:110::15) by VI1PR0801MB1822.eurprd08.prod.outlook.com (2603:10a6:800:5c::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.15; Wed, 11 Aug 2021 10:24:49 +0000 Received: from AM5EUR03FT015.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:110:cafe::68) by AM7PR04CA0005.outlook.office365.com (2603:10a6:20b:110::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.13 via Frontend Transport; Wed, 11 Aug 2021 10:24:49 +0000 Received: from nebula.arm.com (40.67.248.234) by AM5EUR03FT015.mail.protection.outlook.com (10.152.16.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4415.14 via Frontend Transport; Wed, 11 Aug 2021 10:24:49 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) 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.2308.14; Wed, 11 Aug 2021 10:24:41 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Wed, 11 Aug 2021 10:24:39 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: fd9d89a5-d3a3-4741-ba50-954fbfc1dabe 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=+ONilfRs6Yw0UA5hM/jo7ynBsRjRbTUFfphDgQCzBbE=; b=W475vQAn2fpdoJ8+Ws9up4rgsyDEcKr0XzmHxeiLSkwubhvHGNYKU3aKpKGpIq3PL24beQbaS95hu48j/GETzFx8I7tfDCxUUxDV4xLHpC4zB2natIii/9jc6T/56SqJy6AwrKKsXWt8Lhma2bbUitwNqtrU10sd/oS5q0ZSqM4= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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; X-CheckRecipientChecked: true X-CR-MTA-CID: 315ae1731925a2a7 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VH0VQPASUcZTHYsvG5ERQ2pcL2rjFW2JpPh36q7TbFRNzF3arULhtxzMzzt6a/Jtdo7IvQ4oNGC8K/x3EGAp6+G2QUHOl31zVHDfWZPP0gDmjnur12YptZzzNst0RCFFw5r1aYbJuOuhVO0vs57zRYdu6/fMHXErZFXPNLCyJh++deKpefxepKOJbuee70xMkSLEmZn+sLQvIJ8t5H+MWGqKTqop5E380lepNpm9co3AdTQUDjVtbCi2m5uMXRfj+xwI1QXffdlxPSLBQzcJdLIqfHFBGgrRSCNbLojV/nsM24vIqqPoLUtAMNjcPjbJcIc4P3EVvKUKmUNEl9D6Cg== 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-SenderADCheck; bh=+ONilfRs6Yw0UA5hM/jo7ynBsRjRbTUFfphDgQCzBbE=; b=PhXzIFORhgqofwHOWrOwO72YBB1SKJStLJK1SKEKmMR0AbpmlBC/yc9lZcwr6z+J2UBrIecjRb5KrTtMwFgXhsTX5zs8d9ZX2cMtmHh13iJWzkypHcHIjPEqVhoOmDezkTpaQcPffui/5ZdSrhJPK+JCu3hZ6D5VNI5xhFL/1SBnSOOvZ+x95DZ9I3L58FvwYpK88Bh1CeGtimNcam2zmkBZ0WMMuiF8Qujg4Oaj6DDuLD+3V3BXgmmOr8BNcGfgFA+P1X15FkG4VYtFNquJIAY2w4GkrGmriEgj9dsEwA0WPG2sVJ1GeBzFdNqz5orKXGkCRM5Nhnr4pxwHV7jHkw== 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=+ONilfRs6Yw0UA5hM/jo7ynBsRjRbTUFfphDgQCzBbE=; b=W475vQAn2fpdoJ8+Ws9up4rgsyDEcKr0XzmHxeiLSkwubhvHGNYKU3aKpKGpIq3PL24beQbaS95hu48j/GETzFx8I7tfDCxUUxDV4xLHpC4zB2natIii/9jc6T/56SqJy6AwrKKsXWt8Lhma2bbUitwNqtrU10sd/oS5q0ZSqM4= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; 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; From: Wei Chen To: , , , , CC: Subject: [XEN RFC PATCH 04/40] xen/arm: return default DMA bit width when platform is not set Date: Wed, 11 Aug 2021 18:23:47 +0800 Message-ID: <20210811102423.28908-5-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210811102423.28908-1-wei.chen@arm.com> References: <20210811102423.28908-1-wei.chen@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 675fb2df-8614-4c76-0b6a-08d95cb245bc X-MS-TrafficTypeDiagnostic: VI1PR0801MB1822:|VI1PR08MB4382: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:8273;OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: mmWuGuIeI55qnbkmxcr0UQQZuYZ8/SWgpugoLOAunOA918RvHAGJGreehvlRZVi7bO+84KAFCDvVGkdGVySpjNKLy7fMwmMH9tm5wbhs7MRpKp/apgcmReQB1uXWGiRSEKzAnXvXzP4Ik3QgUiTN7to5s1M1MTS/oBb9gVnqiZBhpkP9ayZENGmpkjYfASrMjamdVQEIebC0EtJW0gbxkXvKCalpfbNWKi//v1GCOb2QDRF4k/1SwFHJKZyJ3Jsqd1aa1qBAscnzz9TNfMLTDI0qL1PcbJteDL1slIx0CHJlYL+N7VyBpAcbx1q5simPbNLdBwDT8BbJwd6lyxYxJhlT6tnWDD3P1fh0ELq6x1b7b0KoIdSPfyPwhSlv+1FNCheo2M6Xy0hfpGwie4ak+DdF8tv5xnHeeeqHuAzbuDzWdShfMA2c3PS/sq1IK3j1jAi8nhXy4cIO8QNJN+gi2FkHOValKovnKg33dPdP0SNeX1094oMohIozsPmwS3hL68bTiFhzsVZxKdp385g4o4Q55Wspep+hEX5r1Az/FlGhdp/VUwxf1Ou4shEKeWly2y+R4ER7AzsXLTMQvXIQ+SQWRcCnuyima48DxbjxzbrT2uEE8ExUXkcEDwmikrCRk+fMWmBZ1C2quoHpmlMuAgwjGvyYLK2lTZxIj4MTJIvu401Odh8rFvvA81EeCuutYnLypuMSF4rEn5Z9EBymvU3SV3dkuulijmxoVvPzcCcLtYNofdrMurPCCkHUtMH3nptmfSvoFFNZo9G1DxlEv2IC1n4Q839KuF91prbCCVY= 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:(4636009)(396003)(136003)(376002)(39850400004)(346002)(36840700001)(46966006)(81166007)(110136005)(7696005)(316002)(83380400001)(47076005)(478600001)(82740400003)(34070700002)(86362001)(6666004)(82310400003)(70206006)(70586007)(44832011)(36860700001)(8936002)(2616005)(8676002)(336012)(5660300002)(186003)(2906002)(4326008)(426003)(1076003)(36756003)(26005)(356005)(36900700001)(2101003);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0801MB1822 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT063.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 696d9156-a991-4f5f-1f75-08d95cb23fa4 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dUiae/JDPt9L/5Xv7JqfZxLvL8spMiS4TlVFFlwmOgzMDKLPbEVpEDPvblq2Ja3tvQ4OW6Ko+ojcxgE4ve6kDN08TjoMIJ3kNeRzQgbRC7Xm+pCW692MzvBn7oiFH0+/JlSMLRYuV2TQpJP8ggIliynY8r/ybzikEfeAOi81vDdylmhZyxpxSDlRxENnvZrMQ2aKKOErmJ1c2s6niBoOnb4T6GtWHrO+kRD0XeeLHt+TfBYQjfSn8gEtiMPrjB3kn1sqGy5/b0sdcp1s7LX5RxoeUTIPKkhKEmGERVYgPXpmZEc3B8i4vqvDok7Ov98YfT+p9iyryDzXwHPLmz/i+ZgcmQI9vqwe3fOjPVwO3i4A69qxra0PLsdmTUrSnliw3wqO/rjgwSdlTrPIW6ptTjwnRcftWAb7Srmni8NFWTfQJIg2NUzFR7CT/mPK4A3H/l1D7W7UkAW7Yh3mAduUgi3cZUegcyG1uqsenjDTMf/THmtvpHIk+IcBt/eXUKq/xeOgE1INOMpFvQAfXi154Mt9jIBOtQMcwrLUfMpemxbz7vul7mKP+ccUp/mjM8Ph64hLIjbiyvgMTTYSyMkcI+7ecPa+B4XOI1bfi7Ij/q4lKr+Xp6Sd2x6GGkQJYOCc5sbIJ92gHfRXploCze511EUc6XJC9J3/VXWce7vHd9pCDAWVZsa5nO1qqwU+Xh5gPEc8yDaUR0OE737roMfPMEj8ySNkvgFbH5HsB9+c6n0= 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:(4636009)(376002)(396003)(136003)(346002)(39860400002)(46966006)(36840700001)(36860700001)(70206006)(6666004)(316002)(2906002)(82310400003)(70586007)(336012)(110136005)(36756003)(47076005)(82740400003)(83380400001)(81166007)(4326008)(86362001)(186003)(5660300002)(44832011)(8676002)(26005)(8936002)(2616005)(478600001)(7696005)(1076003)(426003)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2021 10:24:59.2372 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 675fb2df-8614-4c76-0b6a-08d95cb245bc 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: VE1EUR03FT063.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB4382 X-ZohoMail-DKIM: pass (identity @armh.onmicrosoft.com) X-ZM-MESSAGEID: 1628677536779100001 Content-Type: text/plain; charset="utf-8" From: Hongda Deng In current code, arch_get_dma_bitsize will return 32 when platorm or platform->dma_bitsize is not set. It's not resonable, for Arm, we don't require to reserve DMA memory. So we set dma_bitsize always be 0. In NO-NUMA system, arch_get_dma_bitsize will not be invoked, so dma_bitsize will not be overrided by this function. But in NUMA system, once the online nodes are greater than 1, this function will be invoked. The dma_bitsize will be limited to 32. That means, only first 4GB memory can be used for DMA. But that's against our hardware design. We don't have that kind of restriction on hardware. Only platform setting can override dma_bitsize. So in this patch, we return default dma_bitsize, when platform and platorm->dma_bitsize are not set. Signed-off-by: Wei Chen Signed-off-by: Hongda Deng --- xen/arch/arm/platform.c | 4 +++- xen/common/page_alloc.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/xen/arch/arm/platform.c b/xen/arch/arm/platform.c index 4db5bbb4c5..0a27fef9a4 100644 --- a/xen/arch/arm/platform.c +++ b/xen/arch/arm/platform.c @@ -27,6 +27,7 @@ extern const struct platform_desc _splatform[], _eplatfor= m[]; /* Pointer to the current platform description */ static const struct platform_desc *platform; =20 +extern unsigned int dma_bitsize; =20 static bool __init platform_is_compatible(const struct platform_desc *plat) { @@ -157,7 +158,8 @@ bool platform_device_is_blacklisted(const struct dt_dev= ice_node *node) =20 unsigned int arch_get_dma_bitsize(void) { - return ( platform && platform->dma_bitsize ) ? platform->dma_bitsize := 32; + return ( platform && platform->dma_bitsize ) ? platform->dma_bitsize + : dma_bitsize; } =20 /* diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c index 958ba0cd92..0f0cae5a4e 100644 --- a/xen/common/page_alloc.c +++ b/xen/common/page_alloc.c @@ -227,7 +227,7 @@ static bool __read_mostly scrub_debug; * Bit width of the DMA heap -- used to override NUMA-node-first. * allocation strategy, which can otherwise exhaust low memory. */ -static unsigned int dma_bitsize; +unsigned int dma_bitsize; integer_param("dma_bits", dma_bitsize); =20 /* Offlined page list, protected by heap_lock. */ --=20 2.25.1 From nobody Sat May 4 03:49:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=2; a=rsa-sha256; t=1628677531; cv=pass; d=zohomail.com; s=zohoarc; b=gU9tsQD6fzBfdHAr66RCnnIZPP5XQ9fCOIQhyovFl1iPjHsuP0pa/+E2SSxCChU5hQZdRDMr3pF0xmVO/1mHXohGn3JgozwFKtxyAa8tSOz7Yip250jbpjPE2YR7bDrzPPT4GAQ56ZOwbEsC3dWN4X+fDA4oERU7r1X1i3W9w7Y= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628677531; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=X9Quh0tEBLns+ar8JRFuw/KOQmJhLjKjIBZgg0xnsXg=; b=TTe/gcjHvdLtsaeWJEKyjd5GJiS32B+TvxNfriwyzsnlTtMUpY9D+gHRF61NCwo0w14RevqQ5OK5mrTanZ3qLXQJCGf1Q09TY7zu5lUO34LzsctWq+RoXrS3E5edIlmxErcMxAvyONF3JpX4aAqPAKN7rDwxGfRVfkw7LaKNW0g= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1628677531460889.1547640550344; Wed, 11 Aug 2021 03:25:31 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.165619.302678 (Exim 4.92) (envelope-from ) id 1mDlQB-000247-2m; Wed, 11 Aug 2021 10:25:15 +0000 Received: by outflank-mailman (output) from mailman id 165619.302678; Wed, 11 Aug 2021 10:25:15 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlQA-00023m-Sr; Wed, 11 Aug 2021 10:25:14 +0000 Received: by outflank-mailman (input) for mailman id 165619; Wed, 11 Aug 2021 10:25:13 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlQ9-0000BQ-Bk for xen-devel@lists.xenproject.org; Wed, 11 Aug 2021 10:25:13 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (unknown [40.107.8.73]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id edef0319-e93c-4997-b111-0630fe5cd44e; Wed, 11 Aug 2021 10:25:05 +0000 (UTC) Received: from AS8P250CA0010.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:330::15) by HE1PR0801MB1820.eurprd08.prod.outlook.com (2603:10a6:3:85::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.16; Wed, 11 Aug 2021 10:25:01 +0000 Received: from AM5EUR03FT008.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:330:cafe::ba) by AS8P250CA0010.outlook.office365.com (2603:10a6:20b:330::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:25:01 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT008.mail.protection.outlook.com (10.152.16.123) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:25:01 +0000 Received: ("Tessian outbound 7b804b1d9bbf:v101"); Wed, 11 Aug 2021 10:25:00 +0000 Received: from f07ecd72b4d3.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 9B1A294A-3DFF-4105-9E76-B9013CA48E2D.1; Wed, 11 Aug 2021 10:24:54 +0000 Received: from EUR02-VE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id f07ecd72b4d3.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 11 Aug 2021 10:24:54 +0000 Received: from DB7PR03CA0095.eurprd03.prod.outlook.com (2603:10a6:10:72::36) by VI1PR0801MB1631.eurprd08.prod.outlook.com (2603:10a6:800:5c::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.21; Wed, 11 Aug 2021 10:24:46 +0000 Received: from DB5EUR03FT003.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:72:cafe::68) by DB7PR03CA0095.outlook.office365.com (2603:10a6:10:72::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.13 via Frontend Transport; Wed, 11 Aug 2021 10:24:46 +0000 Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT003.mail.protection.outlook.com (10.152.20.157) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:24:46 +0000 Received: from AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2308.14; Wed, 11 Aug 2021 10:24:44 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Wed, 11 Aug 2021 10:24:44 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Wed, 11 Aug 2021 10:24:42 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: edef0319-e93c-4997-b111-0630fe5cd44e 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=X9Quh0tEBLns+ar8JRFuw/KOQmJhLjKjIBZgg0xnsXg=; b=2eh5hJb21Lf3WOF4YqpiJr0AVtlRKXHzkZVjD2fdKTYiMPQRyrP2FfECRZ3luDtmOenT+c1YuUd16xrtiAABRZlXa9jeCZ2cPQRsYTbAPXK/b6TbKmi/2IrWEIhMs6FYXj414It9OS8+pvl63Axf+UhT1xg2qkVPA7elF9xeWio= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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; X-CheckRecipientChecked: true X-CR-MTA-CID: a89ea8ceb0cfa144 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HBMuQOK7uD9l1ovvWUo902MSVKdGnsrqP2B7kdd0qo/QVvBsGegoJvd2MO4ganAw90dkn/AUxsZ8kGVzqLocuvugdKzkJ81A0zN24XOo+Gjmr9KxDBDaomSV5f283HYZQWUdxSIymRaHGXMktX9awCDD1SAql0gQC2bXU/yag18v6uT98iP4QMudNbDDksNVpHa1FmKNrE6MPfArr6CRV9n3SyA689IZA2DkMHLVFUJ4K57sY+9l/rAA94r0EZQ0FsfZQ3nSa+G/+qzLAS0p9jglNSmEV4xWh1zdJ+8+o7QLCvPqtFa7ksy0F6BcAyNLFQ+8WuUyl0nwjVaRNCTx8w== 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-SenderADCheck; bh=X9Quh0tEBLns+ar8JRFuw/KOQmJhLjKjIBZgg0xnsXg=; b=aOZbkqqIJezjhrLmlLgFRT2T8wHr1sVZSWrC4NdRh8ej6EPlXiZRTs7ozRFnyghTGdHSVnE/F8lp2VrB+ui8ufImHOogQFwq9DKuxvZvKQ5+oHMATnaXHQT4cqVOhFd0wmcakQKzrSa4QaaYrtKB+E6qbOwJqFMLiTAqPG5cUZXtC+Q+1KaBdR0MUujjILcYOOppSlWo5D+W2xzjovtXX1nGXNrsSCf2YXDls21U2Kk5d0V0a8q4FpQtgjGNlAtNy6Ra6jXPeB7z+2YOa/x2tJN+TTBdnsBr9bebb4sZTkoMNmROI/Bh/7xfn5vvMySsOUGVo9opQHDW+jmnlc2hOw== 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=X9Quh0tEBLns+ar8JRFuw/KOQmJhLjKjIBZgg0xnsXg=; b=2eh5hJb21Lf3WOF4YqpiJr0AVtlRKXHzkZVjD2fdKTYiMPQRyrP2FfECRZ3luDtmOenT+c1YuUd16xrtiAABRZlXa9jeCZ2cPQRsYTbAPXK/b6TbKmi/2IrWEIhMs6FYXj414It9OS8+pvl63Axf+UhT1xg2qkVPA7elF9xeWio= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; 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; From: Wei Chen To: , , , , CC: Subject: [XEN RFC PATCH 05/40] xen/arm: Fix lowmem_bitsize when arch_get_dma_bitsize return 0 Date: Wed, 11 Aug 2021 18:23:48 +0800 Message-ID: <20210811102423.28908-6-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210811102423.28908-1-wei.chen@arm.com> References: <20210811102423.28908-1-wei.chen@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 85de283d-db0f-4017-0929-08d95cb2470b X-MS-TrafficTypeDiagnostic: VI1PR0801MB1631:|HE1PR0801MB1820: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:4714;OLM:4714; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: Z4IAsI0b6ngauI/JeUMz1wBAaKVpFhny3snomKpsVDwx3yTq3TckQ5mDKh9YAY3Ed6oydvj0d97ezD4NpAshzEixq6bHMFkYNECsM3qqZAJBlNiWdCAjcI7AE8HBcX+5MJzWWFgcVMEzz5+qwmS43981bSitlNZ0WHX0f94UViNpufgkFWalnbJyRVAV9hdgsMfZOVYoAymBWqcv9KdUoeX3DOZDFIF0IZ484TKg7w3sSg7CBGmQWJLd6JO6miG2rmKuROkDXkx/XQXZ9PSzZq37G8mBJCVZtxidkfcbe7c0th5hsvIU6CcUQS5rnq4fZzo2gJbvFix8tPOMUN/ciBSgUNgfmOVZ6kuzJ+s0LM7y2mgQ+3oKQHWSXQYEeQ4NGCQ1QU01Ec7duUO/4aY38QJPvK+hENVh8NCoC7zkPMs4MVKgxehGtW3eSSabzO7Tj6FEwBtC9TrWvsz3PDlCmAtY4TuIvd7UPP6ZPsigipPJY2N+chUYvISo06Nuo6un9oIit4Pee1uoahPh8R5WR3R/nEJDqUktxZ7ZdP3R1W5MzYPKISg2Ygn/NhNUK14HJH6/C56r+yqjefCzmvcU+6/NHt3xlUXsBluZnp7RnwhaqyI+oYocOdTuZj5TdQrN1r1lmf/hly3PSgILGRcD8F8FNsnhc3O3fjcB+xexXsqhd/97DFv1LmJpVW868Yo5Ij0f28JGe64I6F2Yq81dZLa4nOg5vZ9rXDRTcJVJ1b/ZIf1adRCxxaM0vWAzmlp7Pht2+fA1ADFPfDEpsUe3WPUG0aFX58nRc7b1tAFqXeU= 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:(4636009)(46966006)(36840700001)(2616005)(110136005)(81166007)(36756003)(8676002)(336012)(316002)(5660300002)(426003)(36860700001)(26005)(82310400003)(2906002)(186003)(356005)(8936002)(7696005)(4326008)(508600001)(70206006)(1076003)(70586007)(44832011)(34070700002)(86362001)(47076005)(83380400001)(36900700001)(2101003);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0801MB1631 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT008.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: c5dda8c7-6844-454a-b05d-08d95cb23df4 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9WEWsZ09KGe+kslieg86Jd5/TG255oLiZR1zpBktABw0LKwK2tmyuI/1b4Ms9OSf3Pta4m6UO31lJXCmGtoxTiu3ptCdEn7QOzoI90vMih/LyqWyZR8PbFqi2v4OlVWlGBdOOouyRArAr7JspoUVHksKInWNMZ0j4HH8UTO6p61RZ1hyNbh1S7x34YqzFKnpsTW8rhAUswUkvwvynz4q99n6TZLKc5yqp++gtmVqqNuZyTnInwKcV8C7+lW8w6WTYr+SCBIvicAqmNjgi6MkboWd2FML0mCY/EmlpdLpTX2wHHjiFf2RPLZ28N3CiCnqwIDfS1Tk6zmpV6QuIy+VrPBFoYl5nWWSSwzQqV9Vh8lxop6qjN4XFaIu84AIOK8QTwK9y3o6uZoJFTkg19zepXhm+jvw0nKSHwGsLY8lloClXfj4dR4FDlnoFCsunbDlejWk0jZRzHwZ8yQ1rSbcyV0QnZUwp1ujBq/zm+gfn8fJqeI8OB0i/s56qt0g8UIXRLyAZm+O+yZlaRFd3cU2cEaF7qGOStK4ipY+DvRIaL0cVplr71zabBkvhoUy2+N9yO9x3fOlgGXgfBEh1XK6q7uQ/p7JIpyTaRt3jKktHy5reIejRROPB5G5ypYOGWbTBFA0waa2u2chYL03H7tRy+RVDBG9mSXVL67C0YMvrc/WR+WX7l74r2dkTDrcjDKwyWi2orRQ8ItaXebsBOEEkYk9KdMvzkUkkznAuerkOY8= 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:(4636009)(136003)(396003)(346002)(376002)(39860400002)(36840700001)(46966006)(186003)(36756003)(26005)(7696005)(5660300002)(426003)(2906002)(478600001)(2616005)(336012)(82310400003)(44832011)(47076005)(1076003)(316002)(110136005)(70586007)(81166007)(82740400003)(4326008)(8936002)(83380400001)(8676002)(86362001)(70206006)(36860700001)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2021 10:25:01.4885 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 85de283d-db0f-4017-0929-08d95cb2470b 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: AM5EUR03FT008.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0801MB1820 X-ZohoMail-DKIM: pass (identity @armh.onmicrosoft.com) X-ZM-MESSAGEID: 1628677532492100001 Content-Type: text/plain; charset="utf-8" From: Hongda Deng In previous patch, we make arch_get_dma_bitsize return 0 when dma_bitsize and platform->dma_bitsize are not set. But this will affect lowmem_bitsize in allocate_memory_11 for domain0. Because this function depends lowmem_bitsize to allocate memory below 4GB. In current code, when arch_get_dma_bitsize return 0, lowmem_bitsize will be set to 0. In this case, we will get "No bank has been allocated below 0-bit." message while allocating domain0 memory. And the lowmem will be set to false. This behavior is inconsistent with what allocate_memory_11 done before, and doesn't meet this functions requirements. So we check arch_get_dma_bitsize's return value before set lowmem_bitsize. Avoid setting lowmem_bitsize to 0 by mistake. Signed-off-by: Wei Chen Signed-off-by: Hongda Deng --- xen/arch/arm/domain_build.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index 6c86d52781..cf341f349f 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -265,9 +265,18 @@ static void __init allocate_memory_11(struct domain *d, int i; =20 bool lowmem =3D true; - unsigned int lowmem_bitsize =3D min(32U, arch_get_dma_bitsize()); + unsigned int lowmem_bitsize =3D arch_get_dma_bitsize(); unsigned int bits; =20 + /* + When dma_bitsize and platform->dma_bitsize are not set, + arch_get_dma_bitsize will return 0. That means this system + doesn't need to reserve memory for DMA. But in order to + meet above requirements, we still need to try to allocate + memory below 4GB for Dom0. + */ + lowmem_bitsize =3D lowmem_bitsize ? min(32U, lowmem_bitsize) : 32U; + /* * TODO: Implement memory bank allocation when DOM0 is not direct * mapped --=20 2.25.1 From nobody Sat May 4 03:49:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=2; a=rsa-sha256; t=1628677530; cv=pass; d=zohomail.com; s=zohoarc; b=HX7Sr8IveTjm7np1O3bdEJhUH7fGjfB4uRLIQLDVfrInnmMLeAvhL96a3WyOtylHLeY8ek6j3QaQkD/ULoB5AUcZhcvyZ0lFuIar34s8wsvq4cPNemP3lcE98vLLworfLLIfdYPL6ro2oAQlo5dhJv4cHsessGFKlsjP1VSUVdc= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628677530; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=kVKHdbqA0nYwZzQvyecp9+EIwlyV0oUC0TssqSpKYD4=; b=OtQznmIVS7Y8xU0XSxqJ3kmWFgI7L/klQ50gY/Jv/YHrmB6j6Y0ZvHrq8WAEoSkc79YACchBBykDB+m34nTkyXGZZCTeF/tMqgte2zhumZpYdhBy10GOT77TqqOiqifBi5Xg3KwkpXYC5k92mlHhxnpGdRnC/gB7kq2WxxcyMjA= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 162867753052999.96625152913566; Wed, 11 Aug 2021 03:25:30 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.165618.302666 (Exim 4.92) (envelope-from ) id 1mDlQ5-0001VZ-Lq; Wed, 11 Aug 2021 10:25:09 +0000 Received: by outflank-mailman (output) from mailman id 165618.302666; Wed, 11 Aug 2021 10:25: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 1mDlQ5-0001VO-ID; Wed, 11 Aug 2021 10:25:09 +0000 Received: by outflank-mailman (input) for mailman id 165618; Wed, 11 Aug 2021 10:25:08 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlQ4-0000BQ-BT for xen-devel@lists.xenproject.org; Wed, 11 Aug 2021 10:25:08 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (unknown [2a01:111:f400:7e1a::601]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id f9537592-742e-4216-8581-8787da46ecd7; Wed, 11 Aug 2021 10:24:59 +0000 (UTC) Received: from AS8PR04CA0079.eurprd04.prod.outlook.com (2603:10a6:20b:313::24) by PR3PR08MB5753.eurprd08.prod.outlook.com (2603:10a6:102:87::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.21; Wed, 11 Aug 2021 10:24:57 +0000 Received: from VE1EUR03FT017.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:313::4) by AS8PR04CA0079.outlook.office365.com (2603:10a6:20b:313::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.13 via Frontend Transport; Wed, 11 Aug 2021 10:24:57 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT017.mail.protection.outlook.com (10.152.18.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:24:56 +0000 Received: ("Tessian outbound 8529ae990a93:v101"); Wed, 11 Aug 2021 10:24:56 +0000 Received: from 69e55c52c790.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 551884DF-DD4E-477B-97D7-AE621449E982.1; Wed, 11 Aug 2021 10:24:50 +0000 Received: from EUR01-DB5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 69e55c52c790.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 11 Aug 2021 10:24:50 +0000 Received: from DU2PR04CA0004.eurprd04.prod.outlook.com (2603:10a6:10:3b::9) by PR3PR08MB5628.eurprd08.prod.outlook.com (2603:10a6:102:8e::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.19; Wed, 11 Aug 2021 10:24:49 +0000 Received: from DB5EUR03FT007.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:3b:cafe::c2) by DU2PR04CA0004.outlook.office365.com (2603:10a6:10:3b::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:24:49 +0000 Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT007.mail.protection.outlook.com (10.152.20.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:24:49 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) 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.2308.14; Wed, 11 Aug 2021 10:24:46 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Wed, 11 Aug 2021 10:24:44 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: f9537592-742e-4216-8581-8787da46ecd7 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=kVKHdbqA0nYwZzQvyecp9+EIwlyV0oUC0TssqSpKYD4=; b=lo1WlehcOh3Ry0Us5owmBqaFJw1ohWxF2AK8yfGTAJ3B1/6jOCThrAMZb4CUChd/jFenbj4z2doCsPOq0Suf1A25tuQmmZGsRS1oJaQsBbNMq+BR2UI5IAGFGpdAYoHyGCM/RaD98CeH0BeC2BifuFkyYk3PIpRIs0kTHbjnyk4= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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; X-CheckRecipientChecked: true X-CR-MTA-CID: db3c120abeff39d6 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MfYSVHEVzEdo+xe8cd5hkYOUi6KK0a+H1+BjKcohEwsi6nmqDVP4cwFBXl1ZPjhMIxh6iLuBvEphpX57kj3Lcmmoo/6RfA+2LQKvrcWk7/f+gREzqFcmnr/ibgPkbIiOdSmK6hc00infbvO6ZBkPtdBL1pFDctJh5coaNcJjakBPLtVvAGbTVUFpU/RQRBatcxuI+TppvLILuwT4arzVLlWZeWk9n4pAXyV0vZP5MZCbWDxc8WvGr65y8wELyn1o/wrDgpxp4tov/tgF41zFELOdR9TbI2Ll2IdSTOf1qYc1HSdR50UBf8n9LZtPmDKiyvRrDiEumF5RB++iQssR0Q== 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-SenderADCheck; bh=kVKHdbqA0nYwZzQvyecp9+EIwlyV0oUC0TssqSpKYD4=; b=j3oq0oBpbVGtoJpWuf+GCI0YjLzFMwI2Z2bgyVQq3DCf3vMI++F3Gbh1RHPZgpl+UjpWFL6B40j5urzASRfPe6dpQDFAzRue2PZ5ENdbAbfz7TVIrl7OyhVlWvBCy3fi/Dx2/1hNAxjB+1JEvhlBpQl/ATAboQCSKHA+GLwfzpDtOxyLLtXTbpIQDqcTl2OaGP2wOtBhKAWZ9LjsIx2h3DD49DDPcblQwmZGlR2iZQtVbHnxHc+L2wPuoyzOfB9QtoSSZcL7KL/XQ8WA7aX0ufOoljlsaPGyF24PPkt1c0M425M4PDqZwah+NAqqZl6dw/nKjvTbU6oWfX7o+RGIdw== 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=kVKHdbqA0nYwZzQvyecp9+EIwlyV0oUC0TssqSpKYD4=; b=lo1WlehcOh3Ry0Us5owmBqaFJw1ohWxF2AK8yfGTAJ3B1/6jOCThrAMZb4CUChd/jFenbj4z2doCsPOq0Suf1A25tuQmmZGsRS1oJaQsBbNMq+BR2UI5IAGFGpdAYoHyGCM/RaD98CeH0BeC2BifuFkyYk3PIpRIs0kTHbjnyk4= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; 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; From: Wei Chen To: , , , , CC: Subject: [XEN RFC PATCH 06/40] xen: decouple NUMA from ACPI in Kconfig Date: Wed, 11 Aug 2021 18:23:49 +0800 Message-ID: <20210811102423.28908-7-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210811102423.28908-1-wei.chen@arm.com> References: <20210811102423.28908-1-wei.chen@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 959913fc-9cbf-4074-0338-08d95cb24467 X-MS-TrafficTypeDiagnostic: PR3PR08MB5628:|PR3PR08MB5753: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:6430;OLM:6430; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: M/CGGbl0pAZg84Ne2ki8WaCskNwh5I4+RlJkX+GluzEeSKDHzvG8WBDfvMRS/1rUkuzZVSt2YOAeIyvyoUKmpRbAaPCGCW5UVppdlTk/LQBFUDeRvcG0QNjxbaY4gBeZHYuoO7mbyl4qOCPyIoDbah44dMClk0mzLHpZrSnFVXm0+eNc6ASLj8PTzcMixjvNedHN6mu64k3OeFunTOZJ45ws2hEAb28OZxjE30h9Dop82Wfl/roy7fLSZ5US86G6YVRazM/4XhxbEAuMcpg9R/W0hyzTGLoXaEWvxdxMdxFp26VVvnkG5zG6Gy1OeihKR+KkS+ir1Yc/2znvyR4XGR7hxsfXOihU4Gi2YBMRqxVsT+gn4yvNRFencGCfV8UvO6yenq4aMJFvZFgUpsnbE3iYPzXcNarOqifvMgDpT/ktj2G9/NZwegV1n4H2RmSXJLZk4Co01C3vG2iPS36Jwbnb0hgQDhmuVN+XT93Ixo0JH6chIJj7mXnmzWpZsu0gLERSLlGcc3ilIqcnQv63cACcV3PkXtbmbhRiKh/d2uNXtgkvh13ayagehGQuFKNt1T7R7IM8+Yw8DWMKaIndaOF5D16dQ+zUx5hGyeqXkvQuwA+UAhfjtbAbc8g5mHZ2Va9kG8gnBywYdFIQbI391p+WwwS95eXOHVzsgXZWsT7AcVA8O4qYkFVz+wdDPA/07OCqaJxjkB3eeyt22j/FTU7yefla5cmlNOxqe0F0cxF7Wj5ax9xNPu+CoconNsePT01IQdWERhvQcXmtMCL7xRk3pcT35KY6bxxYrLt82Q4= 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:(4636009)(39860400002)(396003)(136003)(376002)(346002)(36840700001)(46966006)(8676002)(7696005)(336012)(316002)(26005)(426003)(83380400001)(36860700001)(8936002)(110136005)(36756003)(82310400003)(1076003)(47076005)(34070700002)(356005)(44832011)(82740400003)(70586007)(70206006)(81166007)(5660300002)(478600001)(2616005)(186003)(4326008)(2906002)(86362001)(36900700001)(2101003);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR08MB5628 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT017.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 0c417f11-cd95-4a0e-1d75-08d95cb23f94 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 183ptZiCG4uWNUrFG+W+z7pFOk0ikPTXbJDJSabPKWiB2Sy4BtITQ4zkuRc4NcuNC+LujUdE1k37MjWS96R5Ow2jw5xTOlZapnXy/BabFkS5OWIa848n7Eg+euqUtdT36phQli/QeAXz8KkxH+nxS+v3fUTZYx+TkUai3yUNLNjBW0uLuCHmzjrckRsyDAtP9xtErSjdB/ihEycrYuHPBwgEyHSbpllGcrjcX9KQlVa7/i1h8Syyl8S/Bu6t/LICe7WM0kEym/COfgQKh0PHrmp57Ex7Zn/3ZzZxIcF/8oBW5/Sr9S6+gvgSLpcW3xbs6Rxy/3wO36O7wBTaYyqJr3stSshuaFKwVy8U59ME0A4/mNPgjqft4c+DqdAzwPAwYx0tnklPDt5TJW84FORORqLozd8QoC9kAscTe+vxVpHarFmQlROll1Vx9HiSVVcTQ9oyZumABLLLNPec3HqKC6N/JXNvNGMF/g3fRmozlXDnR2HUQwYF6Gzn86jSd/v966IW3yBNSkxnk0PNDlQR8yQWYS/wmXIHrI5bQCMTRbuSBBx0qhDgrbsXUz87wsNOb9J0MFFJGMojlpegJOpoKCtzY4o35ADVhgP/Ohp5JJMJ5W1aYsevLu3BaUy7dKR2OveVvUvF5EL7OT016Gg7CBWcghV68r+RS5kU0ZM7ZoLnfYOcFKjjoMKG/W/TDhgj5EBoGSijiOzraz+DqlNjpm/rx066tFXwuXTDAxgkL0A= 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:(4636009)(46966006)(36840700001)(70206006)(81166007)(8936002)(26005)(4326008)(110136005)(2616005)(36860700001)(70586007)(316002)(7696005)(8676002)(5660300002)(508600001)(426003)(82310400003)(186003)(2906002)(1076003)(47076005)(44832011)(83380400001)(86362001)(336012)(36756003)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2021 10:24:56.9972 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 959913fc-9cbf-4074-0338-08d95cb24467 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: VE1EUR03FT017.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR08MB5753 X-ZohoMail-DKIM: pass (identity @armh.onmicrosoft.com) X-ZM-MESSAGEID: 1628678435696100001 Content-Type: text/plain; charset="utf-8" In current Xen code only implments x86 ACPI-based NUMA support. So in Xen Kconfig system, NUMA equals to ACPI_NUMA. x86 selects NUMA by default, and CONFIG_ACPI_NUMA is hardcode in config.h. In this patch series, we introduced device tree based NUMA for Arm. That means we will have two NUMA implemetations, so in this patch we decouple NUMA from ACPI based NUMA in Kconfig. Make NUMA as a common feature, that device tree based NUMA also can select it. Signed-off-by: Wei Chen Reviewed-by: Jan Beulich --- xen/arch/x86/Kconfig | 2 +- xen/common/Kconfig | 3 +++ xen/drivers/acpi/Kconfig | 3 ++- xen/drivers/acpi/Makefile | 2 +- xen/include/asm-x86/config.h | 1 - 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig index 9b164db641..7414aef113 100644 --- a/xen/arch/x86/Kconfig +++ b/xen/arch/x86/Kconfig @@ -24,7 +24,7 @@ config X86 select HAS_UBSAN select HAS_VPCI if HVM select NEEDS_LIBELF - select NUMA + select ACPI_NUMA =20 config ARCH_DEFCONFIG string diff --git a/xen/common/Kconfig b/xen/common/Kconfig index 0ddd18e11a..b1f1145613 100644 --- a/xen/common/Kconfig +++ b/xen/common/Kconfig @@ -67,6 +67,9 @@ config MEM_ACCESS config NEEDS_LIBELF bool =20 +config NUMA + bool + menu "Speculative hardening" =20 config SPECULATIVE_HARDEN_ARRAY diff --git a/xen/drivers/acpi/Kconfig b/xen/drivers/acpi/Kconfig index b64d3731fb..e3f3d8f4b1 100644 --- a/xen/drivers/acpi/Kconfig +++ b/xen/drivers/acpi/Kconfig @@ -5,5 +5,6 @@ config ACPI config ACPI_LEGACY_TABLES_LOOKUP bool =20 -config NUMA +config ACPI_NUMA bool + select NUMA diff --git a/xen/drivers/acpi/Makefile b/xen/drivers/acpi/Makefile index 4f8e97228e..2fc5230253 100644 --- a/xen/drivers/acpi/Makefile +++ b/xen/drivers/acpi/Makefile @@ -3,7 +3,7 @@ obj-y +=3D utilities/ obj-$(CONFIG_X86) +=3D apei/ =20 obj-bin-y +=3D tables.init.o -obj-$(CONFIG_NUMA) +=3D numa.o +obj-$(CONFIG_ACPI_NUMA) +=3D numa.o obj-y +=3D osl.o obj-$(CONFIG_HAS_CPUFREQ) +=3D pmstat.o =20 diff --git a/xen/include/asm-x86/config.h b/xen/include/asm-x86/config.h index 883c2ef0df..9a6f0a6edf 100644 --- a/xen/include/asm-x86/config.h +++ b/xen/include/asm-x86/config.h @@ -31,7 +31,6 @@ /* Intel P4 currently has largest cache line (L2 line size is 128 bytes). = */ #define CONFIG_X86_L1_CACHE_SHIFT 7 =20 -#define CONFIG_ACPI_NUMA 1 #define CONFIG_ACPI_SRAT 1 #define CONFIG_ACPI_CSTATE 1 =20 --=20 2.25.1 From nobody Sat May 4 03:49:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=2; a=rsa-sha256; t=1628677543; cv=pass; d=zohomail.com; s=zohoarc; b=MngrdCt/RHdRsjFTNWHHtk7oVMxfMr8uRdb/30DMX5sOZtlFWlT2mgzTgsVPMDnouyJ+YlY8gwueLCnA4+cIahVaXivgWHNyPbO6WqCs7PwJ+XN76LLv6/tZGSovo/QGjTEeWz6I1hik75hAqfmByPBOHQFYeJowoGQOykuGWQk= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628677543; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Qscw3U+NFWcsOhhhUNwOzHkuFBQ4mz07I7kS8fX8DWQ=; b=jMaVJFDfCG0JSTnIokpBYq/fn2oX/rT9mHup3y3wOC9CDKWOrerAF2Ab9dE4Vs0ABimQivEJwOzxw1t24qbA6tb2aMSFgKpNSPNpYz8FXYHxUgrSxKzZASaUZtL46e5fddKMdPj3N9hRhvsyo9yDBE1caItUAP+M6pGSxPnFqp4= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1628677543426824.2888565042003; Wed, 11 Aug 2021 03:25:43 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.165638.302722 (Exim 4.92) (envelope-from ) id 1mDlQP-0004IF-Vv; Wed, 11 Aug 2021 10:25:29 +0000 Received: by outflank-mailman (output) from mailman id 165638.302722; Wed, 11 Aug 2021 10:25:29 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlQP-0004Hr-RF; Wed, 11 Aug 2021 10:25:29 +0000 Received: by outflank-mailman (input) for mailman id 165638; Wed, 11 Aug 2021 10:25:28 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlQO-0000BQ-CE for xen-devel@lists.xenproject.org; Wed, 11 Aug 2021 10:25:28 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (unknown [2a01:111:f400:7e1a::607]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 7a47376d-7980-4979-9aac-45c90a18e58a; Wed, 11 Aug 2021 10:25:14 +0000 (UTC) Received: from AM6P194CA0103.EURP194.PROD.OUTLOOK.COM (2603:10a6:209:8f::44) by DBBPR08MB4886.eurprd08.prod.outlook.com (2603:10a6:10:f4::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.16; Wed, 11 Aug 2021 10:25:13 +0000 Received: from VE1EUR03FT007.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:8f:cafe::7) by AM6P194CA0103.outlook.office365.com (2603:10a6:209:8f::44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.14 via Frontend Transport; Wed, 11 Aug 2021 10:25:12 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT007.mail.protection.outlook.com (10.152.18.114) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:25:12 +0000 Received: ("Tessian outbound d9f41274f41a:v101"); Wed, 11 Aug 2021 10:25:11 +0000 Received: from ce4876d35bfe.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 893CF637-3F22-4663-ACE3-C33D05646C66.1; Wed, 11 Aug 2021 10:25:03 +0000 Received: from EUR03-VE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id ce4876d35bfe.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 11 Aug 2021 10:25:03 +0000 Received: from AM6P191CA0012.EURP191.PROD.OUTLOOK.COM (2603:10a6:209:8b::25) by AM0PR08MB2963.eurprd08.prod.outlook.com (2603:10a6:208:56::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.17; Wed, 11 Aug 2021 10:25:01 +0000 Received: from AM5EUR03FT045.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:8b:cafe::e1) by AM6P191CA0012.outlook.office365.com (2603:10a6:209:8b::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.13 via Frontend Transport; Wed, 11 Aug 2021 10:25:01 +0000 Received: from nebula.arm.com (40.67.248.234) by AM5EUR03FT045.mail.protection.outlook.com (10.152.17.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:25:01 +0000 Received: from AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2308.14; Wed, 11 Aug 2021 10:24:49 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Wed, 11 Aug 2021 10:24:49 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Wed, 11 Aug 2021 10:24:46 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 7a47376d-7980-4979-9aac-45c90a18e58a 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=Qscw3U+NFWcsOhhhUNwOzHkuFBQ4mz07I7kS8fX8DWQ=; b=kzcqq/F4H/nQ5f4WWeAewcZLeA8IB0MFpOcHisoXdUtstgejvP3kMYxv1d7SJUotd2beBMytbyXQnvDByhtFtCMdmk8z22On1NiAmW41W5Sw4Tcf/PrCIJ7OCgTNu8WER+Gg8a0RKQDor8f9sA1aBpWiO+lkvpBRaUwJjQKvcdg= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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; X-CheckRecipientChecked: true X-CR-MTA-CID: 03a2f52b0b86c7d2 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aOeWnvg/TdnfAJixsahZGMiuRsyGpzxnmQMu0sYNhPMJ9FkclurEGDECsSOMjGONsFygvmwSl1es28E7j4mplqm+5rM6WF5Mmus4Exas03NQYlgNet9v4b9AVUujy90z2nfSgccyqbfY92/F4M7iHtKGvmhtx2i7nw55NecgNcSLKEwHihgS8+J1z9qsTlYZW3o0sOaZ7YMphDS5Tnou4tfJNqBYWTXkkRAzNjSRrn4y4wJPbBOm/WcpstDo7KyZtdT0uWkeRBtbjz2PCJ68E2eftfQfejF6Hm0H/5F1VBXrgs1aN/qa/8rT3vrZtQQROgT3G6U4VLmQ8Jt/huTQbA== 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-SenderADCheck; bh=Qscw3U+NFWcsOhhhUNwOzHkuFBQ4mz07I7kS8fX8DWQ=; b=mqhfG0LaUfPUzlNXZuVnvILbIjkG1DoOmKuzvN3Y2Yd8nPi2h4j9Cr13O8q0L4U0KNpVEIJxOdthO3Korqxjoq+u/4r4Inl7ArwvEVWi3wJdX2Ds6B02oyHKl/jZZ7sGzd8GiyD70cgJLcKPe/+5LpwojXWCECYECwIorQbijNjK6qzgwTw4ToRIUKf4MDNZFHcVUdA9h9+/N2Yqcc2gFazlg2v8Bmla2AbaQ5BGgZ7+RUuF0BjOQmwqrn8wA0U8zgZ9VjduQcRvTd7cnPREG+okaL6FT5lPFcv+tWfhmhv4zi4pXw+qXRZVGbU0KvtTV5RIJGhFkTHzEIfM3RctZw== 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=Qscw3U+NFWcsOhhhUNwOzHkuFBQ4mz07I7kS8fX8DWQ=; b=kzcqq/F4H/nQ5f4WWeAewcZLeA8IB0MFpOcHisoXdUtstgejvP3kMYxv1d7SJUotd2beBMytbyXQnvDByhtFtCMdmk8z22On1NiAmW41W5Sw4Tcf/PrCIJ7OCgTNu8WER+Gg8a0RKQDor8f9sA1aBpWiO+lkvpBRaUwJjQKvcdg= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; 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; From: Wei Chen To: , , , , CC: Subject: [XEN RFC PATCH 07/40] xen/arm: use !CONFIG_NUMA to keep fake NUMA API Date: Wed, 11 Aug 2021 18:23:50 +0800 Message-ID: <20210811102423.28908-8-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210811102423.28908-1-wei.chen@arm.com> References: <20210811102423.28908-1-wei.chen@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c6df47ce-2890-42cb-2702-08d95cb24d8c X-MS-TrafficTypeDiagnostic: AM0PR08MB2963:|DBBPR08MB4886: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:4125;OLM:4125; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: lLVwSVvqTZpELEsnUuFRCbiavzSA85DzYyLNJz2JwpRgJ7uwQmCeqYLnyrm659wouKxt5Q98b/qJBh7ZgeiuTy0ggayvKnJC6v5CB53fIYhNGWy0PTCLnhY7xU0R2tb11GWVuHdDPdH9unjH5qjJ86+59adjK1JJG5Bdz0dvKfficDNVJq3bK0Drsf/6sLmiwM+nMc+vRbc2izEiDJ+8tjrpuz93HKOQsaNaDn8Mv/Vb5UuJG/Ih3bQVkius13OQLAjgiivGsYudT9FsYMUl/1TFkYXxu3NonLi2fk3GkBKbpixzAcP+neVkr5neRuCVhFpgJkQ7Kn5l28kiZX4cGYc1kUSztYANQ0Ngnca9/4OeIUCO8pM4UKyQESuJ5sUKYQr0ijr2sh3sqAueyDO2c7N9GQq4CCgHW6edzSx5Ly0mGwpMFILLR6mXbLfPrOSeJKzaF5ldu25sbDrDk3UxLzpEbOfnW/sA2PF0J2naOf6wy0MfzjVAOYnb3g+8eR1ZzzileWQFjcjCUJ2BMaYhuf44YZEdp7SfpeVxFWSxl9crq/Zs3CacIBLXrwVlKOTfL+iJCcmh18HgJL47zbfyje8bK4HRypG13Z/kgK73jfIaGoDocOgdNTcZsYcGIJeHKK/VMnVBTT0N1Q8VnvLO/dfPh1BHz+vzWV6Y+VpT0nHKT5Fc+4Eqtn0FhmuIMrzDrIy2fshCAG7/ceVgUnPxA/0SXo/rM2Cm/D07lmXBd4igLMrpCch+O+mmjSrMN/9f40v/dDiZ14OCuuLWw7bupOaglKrO7F+05+j92UlXys4= 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:(4636009)(136003)(346002)(376002)(39850400004)(396003)(36840700001)(46966006)(356005)(36860700001)(83380400001)(2616005)(26005)(34070700002)(478600001)(44832011)(82740400003)(5660300002)(316002)(8936002)(70586007)(8676002)(70206006)(1076003)(6666004)(4326008)(36756003)(81166007)(86362001)(186003)(4744005)(82310400003)(336012)(7696005)(426003)(47076005)(2906002)(110136005)(2101003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB2963 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT007.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 786e330a-11c5-4e59-2d2d-08d95cb246d1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5eOgCvQvkw+U2VCCql7n4ww9RL2z6QAcWe0/ya36iIKKujLrToRWB93etChW8BWd8V35xXS8gxGslHoJzKHDsoakbsci9L8taJDubtd5kHMBYmIwUQd2cekVQDXeZiHLNW32W5n3t/EBVR7iePqlZBFhUJzfuNsYBpWF7biFb37SOgbwN63qEep9e7yPrhLco0k0c3dwdJT6Fd7PCaL7ePKWwF6kJPw9DPh5kwWYR/fVAgKAf5QZpCPRtt2NTUDaI/6TmmYEhfvwyc3KDaqXA4wjNaPiVz/nNZk0SCgvMZDNoU1iEVFuJoIXOOkLVrrCjwtZJ2pW6b8h7+c/NXwuNw3Y6ckR59SysnWTCMqzqsyXPRWhCAT947WoBpyeLyiKBLF3KP8mVXerZdGEl9yWg5+qhfcQnCiiRiBUtWncAGLG7bmimQen8gv3wRbOF7s3uBnR5YwuK6+liHmPBmEFaf4aXVe6Wt5PzL2WElh9nkcocf0feIbn1mSIjPg2DfY4xv89+JTHl2udig0bQvCvikTFgcNZSuBSe/veIOjx/u4BSWutvWWRQSJm5/5rQjp0O2zHVo4aPQnhaywMegKc7++Hd6DwXP+oCuiF9RfZ3UL00FXdloYD4okAt9js+a/Vud6rgUI4C7r2b67M9NNDWhy2ID3ssGuuGlTpcUT15L//Gh4Uu5vVk6G0gU76sXPZGNMLsIQRXHJ8eZjECdz2U6rBcMaZuxkjrJpMmlWQZPk= 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:(4636009)(376002)(136003)(346002)(396003)(39850400004)(46966006)(36840700001)(6666004)(36756003)(2616005)(478600001)(81166007)(44832011)(316002)(426003)(2906002)(110136005)(86362001)(26005)(186003)(4326008)(336012)(82310400003)(1076003)(83380400001)(5660300002)(8936002)(8676002)(4744005)(82740400003)(70586007)(70206006)(47076005)(7696005)(36860700001)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2021 10:25:12.3421 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c6df47ce-2890-42cb-2702-08d95cb24d8c 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: VE1EUR03FT007.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB4886 X-ZohoMail-DKIM: pass (identity @armh.onmicrosoft.com) X-ZM-MESSAGEID: 1628677545406100001 Content-Type: text/plain; charset="utf-8" Only Arm64 supports NUMA, the CONFIG_NUMA could not be enabled for Arm32. Even in Arm64, users still can disable the CONFIG_NUMA through Kconfig option. In this case, keep current fake NUMA API, will make Arm code still can work with NUMA aware memory allocation and scheduler. Signed-off-by: Wei Chen --- xen/include/asm-arm/numa.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xen/include/asm-arm/numa.h b/xen/include/asm-arm/numa.h index 31a6de4e23..ab9c4a2448 100644 --- a/xen/include/asm-arm/numa.h +++ b/xen/include/asm-arm/numa.h @@ -5,6 +5,8 @@ =20 typedef u8 nodeid_t; =20 +#if !defined(CONFIG_NUMA) + /* Fake one node for now. See also node_online_map. */ #define cpu_to_node(cpu) 0 #define node_to_cpumask(node) (cpu_online_map) @@ -25,6 +27,8 @@ extern mfn_t first_valid_mfn; #define node_start_pfn(nid) (mfn_x(first_valid_mfn)) #define __node_distance(a, b) (20) =20 +#endif + #endif /* __ARCH_ARM_NUMA_H */ /* * Local variables: --=20 2.25.1 From nobody Sat May 4 03:49:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=2; a=rsa-sha256; t=1628677550; cv=pass; d=zohomail.com; s=zohoarc; b=SzRdxq4qpMVe4f+xZSKT5hv/2xaT71yev0sOARx68VVxIt6nSkaPZiMxMwPBDCKuQZ1l7ig+Oq/flUq1XG752j2Vk6bdEnKyxcvcURlivU2Hb4cYRunJhRCZEUjHy44QXcz796YTWhFVzh2cEsTIaxjaW/0BoB6+Abp/Zpje/pM= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628677550; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=TClhxrxl6qSnMv1gYK81n4014+4dXYvGoukVIaGd8Xw=; b=OhK2PVQqCWRnheY40Holhcusrd2gabtdKBewJ0g6vgAmreGacnhQXcJDSNTXwsOQash2zry8wsjqoPOXpRVuU5H0MGUBU0T9KJAN/Dts/SpAs9TgX4iv/Fa9/vay0wI/MimRFGKAH16nbEZ3MTsXMzLtIc9Podpgcf4l3pad16M= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1628677550008465.56342234373074; Wed, 11 Aug 2021 03:25:50 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.165642.302732 (Exim 4.92) (envelope-from ) id 1mDlQT-0004oe-CA; Wed, 11 Aug 2021 10:25:33 +0000 Received: by outflank-mailman (output) from mailman id 165642.302732; Wed, 11 Aug 2021 10:25: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 1mDlQT-0004oK-6r; Wed, 11 Aug 2021 10:25:33 +0000 Received: by outflank-mailman (input) for mailman id 165642; Wed, 11 Aug 2021 10:25:31 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlQR-0002Qj-F0 for xen-devel@lists.xenproject.org; Wed, 11 Aug 2021 10:25:31 +0000 Received: from EUR01-VE1-obe.outbound.protection.outlook.com (unknown [40.107.14.89]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 70d698ea-fa8e-11eb-a052-12813bfff9fa; Wed, 11 Aug 2021 10:25:25 +0000 (UTC) Received: from AM7PR04CA0008.eurprd04.prod.outlook.com (2603:10a6:20b:110::18) by AS8PR08MB6280.eurprd08.prod.outlook.com (2603:10a6:20b:29b::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.21; Wed, 11 Aug 2021 10:25:23 +0000 Received: from VE1EUR03FT050.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:110:cafe::6c) by AM7PR04CA0008.outlook.office365.com (2603:10a6:20b:110::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.15 via Frontend Transport; Wed, 11 Aug 2021 10:25:23 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT050.mail.protection.outlook.com (10.152.19.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.14 via Frontend Transport; Wed, 11 Aug 2021 10:25:23 +0000 Received: ("Tessian outbound 7b804b1d9bbf:v101"); Wed, 11 Aug 2021 10:25:23 +0000 Received: from cb0805c421e9.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id E34D7B39-1354-4DD9-9092-6B475D6125D9.1; Wed, 11 Aug 2021 10:25:16 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id cb0805c421e9.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 11 Aug 2021 10:25:16 +0000 Received: from DB6PR07CA0191.eurprd07.prod.outlook.com (2603:10a6:6:42::21) by HE1PR0801MB1659.eurprd08.prod.outlook.com (2603:10a6:3:86::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.17; Wed, 11 Aug 2021 10:25:13 +0000 Received: from DB5EUR03FT034.eop-EUR03.prod.protection.outlook.com (2603:10a6:6:42:cafe::67) by DB6PR07CA0191.outlook.office365.com (2603:10a6:6:42::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.5 via Frontend Transport; Wed, 11 Aug 2021 10:25:13 +0000 Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT034.mail.protection.outlook.com (10.152.20.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4415.14 via Frontend Transport; Wed, 11 Aug 2021 10:25:12 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) 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.2308.14; Wed, 11 Aug 2021 10:24:51 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Wed, 11 Aug 2021 10:24:49 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 70d698ea-fa8e-11eb-a052-12813bfff9fa 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=TClhxrxl6qSnMv1gYK81n4014+4dXYvGoukVIaGd8Xw=; b=KzR68+vexDymW0QDHLVzL/AzITDSfRkxFNhCfbF3g4Nsis7j9DyB9cz8L3ZlmxUMMfl6EN7+4JGIxNgcZVJhYsKxVNXZCxRePN34JtXjLVjcsmgMgp610v7GVIsh9A1poQjFYp5suFyHyZMUlgCHkJh1NuKK959KCCwJksii42w= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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; X-CheckRecipientChecked: true X-CR-MTA-CID: d78d04ce681d2b3b X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UZdJ33f4gjR0SwyXbINPHOrDgYW0+BwMMNHS6W6eLF9zusuCsARrdD8hbIsUJSW0fiNVAGTPNKwgeuKz1nRpQS8WHDZG3FkMu/3rUt7ro/7Ob668/04c35/hhkr24cT8B79jc9CfWU8fo2+g72punwIsucQ1xdXIGGE3j+H3Z4MLZn3tGEBy6Ov5ecFisEpG+EE2WjPmvchOn6f5GipaI+ALBuuYQkhyspJOOsbpafH9zPytXxrozzleB/9zZKWtr1j0Dm4wFhlVZs8x4BlBc9BUqZN41718OwU+9f1Sb5pc4IaShk1e7I5WLWfJK3oh1nUWeIHZ7RhRJA90CzaK8Q== 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-SenderADCheck; bh=TClhxrxl6qSnMv1gYK81n4014+4dXYvGoukVIaGd8Xw=; b=mu20WjhuKQSZBtltK3rqBUTo/bpZXEzdglvErrzJ+fe0pBwE8ffN5dksfDz2l5LaT6BrawfaWK3DD386AhLDcg/NmU9hi4AomXy4kabO0SJoMeXSCMiOTExtlClCvieVGkRDDgGr3sjoeOmApnChI6HD+durNfjtTYeShx3aEEujYOvI3R1L5+QiklRpA+z+UpTNH9abkInsjZi6c9uvqi0NSH9Wqsqu1YlT2CL8zP776OaGSHwYgbUv9Ev3xmzyl9w86ZzBiMour4SxAewpB8ASM3roqXTQK61GXuCQ/1Nw+4ZeXoZjlT8hDqahFVtoGfIBZJOMkXi/iXOghRVs/A== 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=TClhxrxl6qSnMv1gYK81n4014+4dXYvGoukVIaGd8Xw=; b=KzR68+vexDymW0QDHLVzL/AzITDSfRkxFNhCfbF3g4Nsis7j9DyB9cz8L3ZlmxUMMfl6EN7+4JGIxNgcZVJhYsKxVNXZCxRePN34JtXjLVjcsmgMgp610v7GVIsh9A1poQjFYp5suFyHyZMUlgCHkJh1NuKK959KCCwJksii42w= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; 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; From: Wei Chen To: , , , , CC: Subject: [XEN RFC PATCH 08/40] xen/x86: Move NUMA memory node map functions to common Date: Wed, 11 Aug 2021 18:23:51 +0800 Message-ID: <20210811102423.28908-9-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210811102423.28908-1-wei.chen@arm.com> References: <20210811102423.28908-1-wei.chen@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ed566965-dbcb-4644-869c-08d95cb2542d X-MS-TrafficTypeDiagnostic: HE1PR0801MB1659:|AS8PR08MB6280: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:5797;OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: mjC5l9u2glMuoqMqEFihDEpYCZ0lpPgWP/CBz4PWdv7jJyMZL1JOgpIYuaoBFb6NsE5vkQoY16CE7RjiY7aZV20BxK1N4gGMWHQmtasLgYIz1bjRKmjDiMfL92NZL01D6bjryD0VcDKJrndRGZRj8PSFbB+CXuHS/loDEtOJfAjgiW05NA6UglklyIcbyBEBkfk0anbl3g1T7kgQMlws9Sh2BH6ZGdIJ8pNIcbpxAzDfqb1rL5iiRv1ZYSjW5M+BFsxcM3xASyg4yKAVH7kzx/Y1tbOsSojQ0aCLKxGHkGZlNoFvigfIslNVQx1EEo+pAsd5VxyQTHioRFqrMmZJFRFK0rhLiUJAREdI+kYepvCVwcDUK20+sXIgk5XLPkmE6Hlp5fu6DS2v9NOE39d/KwFLyVfCGaANvaH9HWkYMTejDdpuXUDbjtSvG5+sab4exyK62dllWzpXRwR3qUUwUVpr+Nr1SLzkZwE+ELyk/imPdSRaPVW4uCUPE0K146Y+/KHXXzGSxMzAHpstelSvxodM+wz7r4aNaztRE7tgh/CkILTzrKuClolrP6hs1QPe2MAlc2LDh0wsoteqdBrO/SgvJc9gJ/ilNN3vfmZmlzA4rpDDoiEis4QvhRVCrvimGy2YRiboNvdCkBFYglVyG6bB+pApxB21E0zvZR1AcXjnQSP7bjjCI5kF0Viq3iv7qNWTpZdH5Lp6Nw3K2Bigd/2ZHOAFTHU+7rLIq+iAPtKQZng1nwyGY3ua1u30Kx3cMOuUIkWBy60PCHXe6ltGWj2a0/jkM9bFgm6YlI70fPE= 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:(4636009)(346002)(396003)(136003)(376002)(39860400002)(36840700001)(46966006)(336012)(1076003)(2616005)(26005)(426003)(47076005)(34070700002)(44832011)(81166007)(186003)(82740400003)(86362001)(4326008)(8676002)(5660300002)(7696005)(83380400001)(110136005)(70206006)(356005)(70586007)(316002)(36860700001)(36756003)(82310400003)(478600001)(2906002)(30864003)(6666004)(8936002)(2101003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0801MB1659 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT050.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 8f8ddc93-d814-417a-dddd-08d95cb24ddd X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eVa4CFSYupvRPt6wFaAbpzbCKiRS5xW5a1b+lO86QjDGG2E+jD5pJIsuCS+zU7YnN0C8A2Uj9Lox3sF1Ol23//lsLww/GErYPnHUGbopCK5dwjpLwixCgVCKpfjEQebAYB47IPS8GS+zgEQG1S6MYQ6GNS4bHCkqSR053RvrZwQxNfzxIYxN6tQa2tgMGIoGKpGhzVcLkb+6WbF4/L7OCgiyikjfrjxlfgOiUyuJ/MX4EFVrh5I0qIK8wkKHlu4bLZt1wYnC/haO20rLWfePb1ux+oSQQy1lyHhPfng0ooGjI29N7OIDpEDjUYSxJOSPD6y3WVwfnCGYZxgqymp3uW31Sgj8sksr5tTAX6ZU3rI9NwopRwRl2w+QnLk2eAWMN7+aosV9HU8KTUUOrBHdYsEpQ9AjkxOkTrV52sEaBDa7vHDY5DaNcTKfbYCHOoPN6QDD1o3QDjkCBdeoud4nZoR3alrxlLyWkIpWq8vjlHwPd4vP0Eo6KXEEYChBX4oDdAAQkoRU0eBJLWqGVUoncrK/R+XWnVnVLBHEeNz+FtfQmOl4YloFoNqvyzGS2dyqkBiEo4+cH7waArGPz/QHXFPOTT3fu2DPBzyr9YfUuFbpYPBtFD8cO368LVu96s+1LGHClL3oxv5ec4CuxnJMgzZQEwSo5zC4Tkf3lrFVnni/dap4RMIBJhV//qn+OhEjbimTxH6Or6Z9zEDA9dHsO7jUAiaGtQLBFNdqYWstHCY= 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:(4636009)(39850400004)(396003)(346002)(136003)(376002)(46966006)(36840700001)(2616005)(26005)(478600001)(5660300002)(82310400003)(6666004)(4326008)(82740400003)(7696005)(44832011)(336012)(426003)(186003)(83380400001)(36860700001)(8676002)(36756003)(110136005)(1076003)(70206006)(8936002)(70586007)(81166007)(316002)(2906002)(30864003)(86362001)(47076005)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2021 10:25:23.4260 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ed566965-dbcb-4644-869c-08d95cb2542d 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: VE1EUR03FT050.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6280 X-ZohoMail-DKIM: pass (identity @armh.onmicrosoft.com) X-ZM-MESSAGEID: 1628677552068100001 Content-Type: text/plain; charset="utf-8" In the later patches we will add NUMA support to Arm. Arm NUMA support will follow current memory node map management as x86. So this part of code can be common, in this case, we move this part of code from arch/x86 to common. Signed-off-by: Wei Chen --- xen/arch/x86/numa.c | 114 -------------------------------- xen/common/Makefile | 1 + xen/common/numa.c | 131 +++++++++++++++++++++++++++++++++++++ xen/include/asm-x86/numa.h | 29 -------- xen/include/xen/numa.h | 35 ++++++++++ 5 files changed, 167 insertions(+), 143 deletions(-) create mode 100644 xen/common/numa.c diff --git a/xen/arch/x86/numa.c b/xen/arch/x86/numa.c index d23f4f7919..a6211be121 100644 --- a/xen/arch/x86/numa.c +++ b/xen/arch/x86/numa.c @@ -29,14 +29,6 @@ custom_param("numa", numa_setup); /* from proto.h */ #define round_up(x,y) ((((x)+(y))-1) & (~((y)-1))) =20 -struct node_data node_data[MAX_NUMNODES]; - -/* Mapping from pdx to node id */ -int memnode_shift; -static typeof(*memnodemap) _memnodemap[64]; -unsigned long memnodemapsize; -u8 *memnodemap; - nodeid_t cpu_to_node[NR_CPUS] __read_mostly =3D { [0 ... NR_CPUS-1] =3D NUMA_NO_NODE }; @@ -58,112 +50,6 @@ int srat_disabled(void) return numa_off || acpi_numa < 0; } =20 -/* - * Given a shift value, try to populate memnodemap[] - * Returns : - * 1 if OK - * 0 if memnodmap[] too small (of shift too small) - * -1 if node overlap or lost ram (shift too big) - */ -static int __init populate_memnodemap(const struct node *nodes, - int numnodes, int shift, nodeid_t *n= odeids) -{ - unsigned long spdx, epdx; - int i, res =3D -1; - - memset(memnodemap, NUMA_NO_NODE, memnodemapsize * sizeof(*memnodemap)); - for ( i =3D 0; i < numnodes; i++ ) - { - spdx =3D paddr_to_pdx(nodes[i].start); - epdx =3D paddr_to_pdx(nodes[i].end - 1) + 1; - if ( spdx >=3D epdx ) - continue; - if ( (epdx >> shift) >=3D memnodemapsize ) - return 0; - do { - if ( memnodemap[spdx >> shift] !=3D NUMA_NO_NODE ) - return -1; - - if ( !nodeids ) - memnodemap[spdx >> shift] =3D i; - else - memnodemap[spdx >> shift] =3D nodeids[i]; - - spdx +=3D (1UL << shift); - } while ( spdx < epdx ); - res =3D 1; - } - - return res; -} - -static int __init allocate_cachealigned_memnodemap(void) -{ - unsigned long size =3D PFN_UP(memnodemapsize * sizeof(*memnodemap)); - unsigned long mfn =3D mfn_x(alloc_boot_pages(size, 1)); - - memnodemap =3D mfn_to_virt(mfn); - mfn <<=3D PAGE_SHIFT; - size <<=3D PAGE_SHIFT; - printk(KERN_DEBUG "NUMA: Allocated memnodemap from %lx - %lx\n", - mfn, mfn + size); - memnodemapsize =3D size / sizeof(*memnodemap); - - return 0; -} - -/* - * The LSB of all start and end addresses in the node map is the value of = the - * maximum possible shift. - */ -static int __init extract_lsb_from_nodes(const struct node *nodes, - int numnodes) -{ - int i, nodes_used =3D 0; - unsigned long spdx, epdx; - unsigned long bitfield =3D 0, memtop =3D 0; - - for ( i =3D 0; i < numnodes; i++ ) - { - spdx =3D paddr_to_pdx(nodes[i].start); - epdx =3D paddr_to_pdx(nodes[i].end - 1) + 1; - if ( spdx >=3D epdx ) - continue; - bitfield |=3D spdx; - nodes_used++; - if ( epdx > memtop ) - memtop =3D epdx; - } - if ( nodes_used <=3D 1 ) - i =3D BITS_PER_LONG - 1; - else - i =3D find_first_bit(&bitfield, sizeof(unsigned long)*8); - memnodemapsize =3D (memtop >> i) + 1; - return i; -} - -int __init compute_hash_shift(struct node *nodes, int numnodes, - nodeid_t *nodeids) -{ - int shift; - - shift =3D extract_lsb_from_nodes(nodes, numnodes); - if ( memnodemapsize <=3D ARRAY_SIZE(_memnodemap) ) - memnodemap =3D _memnodemap; - else if ( allocate_cachealigned_memnodemap() ) - return -1; - printk(KERN_DEBUG "NUMA: Using %d for the hash shift.\n", shift); - - if ( populate_memnodemap(nodes, numnodes, shift, nodeids) !=3D 1 ) - { - printk(KERN_INFO "Your memory is not aligned you need to " - "rebuild your hypervisor with a bigger NODEMAPSIZE " - "shift=3D%d\n", shift); - return -1; - } - - return shift; -} /* initialize NODE_DATA given nodeid and start/end */ void __init setup_node_bootmem(nodeid_t nodeid, u64 start, u64 end) {=20 diff --git a/xen/common/Makefile b/xen/common/Makefile index 54de70d422..f8f667e90a 100644 --- a/xen/common/Makefile +++ b/xen/common/Makefile @@ -54,6 +54,7 @@ obj-y +=3D wait.o obj-bin-y +=3D warning.init.o obj-$(CONFIG_XENOPROF) +=3D xenoprof.o obj-y +=3D xmalloc_tlsf.o +obj-$(CONFIG_NUMA) +=3D numa.o =20 obj-bin-$(CONFIG_X86) +=3D $(foreach n,decompress bunzip2 unxz unlzma lzo = unlzo unlz4 unzstd earlycpio,$(n).init.o) =20 diff --git a/xen/common/numa.c b/xen/common/numa.c new file mode 100644 index 0000000000..e65b6a6676 --- /dev/null +++ b/xen/common/numa.c @@ -0,0 +1,131 @@ +/* + * Generic VM initialization for x86-64 NUMA setups. + * Copyright 2002,2003 Andi Kleen, SuSE Labs. + * Adapted for Xen: Ryan Harper + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct node_data node_data[MAX_NUMNODES]; + +/* Mapping from pdx to node id */ +int memnode_shift; +typeof(*memnodemap) _memnodemap[64]; +unsigned long memnodemapsize; +u8 *memnodemap; + +/* + * Given a shift value, try to populate memnodemap[] + * Returns : + * 1 if OK + * 0 if memnodmap[] too small (of shift too small) + * -1 if node overlap or lost ram (shift too big) + */ +static int __init populate_memnodemap(const struct node *nodes, + int numnodes, int shift, nodeid_t *n= odeids) +{ + unsigned long spdx, epdx; + int i, res =3D -1; + + memset(memnodemap, NUMA_NO_NODE, memnodemapsize * sizeof(*memnodemap)); + for ( i =3D 0; i < numnodes; i++ ) + { + spdx =3D paddr_to_pdx(nodes[i].start); + epdx =3D paddr_to_pdx(nodes[i].end - 1) + 1; + if ( spdx >=3D epdx ) + continue; + if ( (epdx >> shift) >=3D memnodemapsize ) + return 0; + do { + if ( memnodemap[spdx >> shift] !=3D NUMA_NO_NODE ) + return -1; + + if ( !nodeids ) + memnodemap[spdx >> shift] =3D i; + else + memnodemap[spdx >> shift] =3D nodeids[i]; + + spdx +=3D (1UL << shift); + } while ( spdx < epdx ); + res =3D 1; + } + + return res; +} + +static int __init allocate_cachealigned_memnodemap(void) +{ + unsigned long size =3D PFN_UP(memnodemapsize * sizeof(*memnodemap)); + unsigned long mfn =3D mfn_x(alloc_boot_pages(size, 1)); + + memnodemap =3D mfn_to_virt(mfn); + mfn <<=3D PAGE_SHIFT; + size <<=3D PAGE_SHIFT; + printk(KERN_DEBUG "NUMA: Allocated memnodemap from %lx - %lx\n", + mfn, mfn + size); + memnodemapsize =3D size / sizeof(*memnodemap); + + return 0; +} + +/* + * The LSB of all start and end addresses in the node map is the value of = the + * maximum possible shift. + */ +static int __init extract_lsb_from_nodes(const struct node *nodes, + int numnodes) +{ + int i, nodes_used =3D 0; + unsigned long spdx, epdx; + unsigned long bitfield =3D 0, memtop =3D 0; + + for ( i =3D 0; i < numnodes; i++ ) + { + spdx =3D paddr_to_pdx(nodes[i].start); + epdx =3D paddr_to_pdx(nodes[i].end - 1) + 1; + if ( spdx >=3D epdx ) + continue; + bitfield |=3D spdx; + nodes_used++; + if ( epdx > memtop ) + memtop =3D epdx; + } + if ( nodes_used <=3D 1 ) + i =3D BITS_PER_LONG - 1; + else + i =3D find_first_bit(&bitfield, sizeof(unsigned long)*8); + memnodemapsize =3D (memtop >> i) + 1; + return i; +} + +int __init compute_hash_shift(struct node *nodes, int numnodes, + nodeid_t *nodeids) +{ + int shift; + + shift =3D extract_lsb_from_nodes(nodes, numnodes); + if ( memnodemapsize <=3D ARRAY_SIZE(_memnodemap) ) + memnodemap =3D _memnodemap; + else if ( allocate_cachealigned_memnodemap() ) + return -1; + printk(KERN_DEBUG "NUMA: Using %d for the hash shift.\n", shift); + + if ( populate_memnodemap(nodes, numnodes, shift, nodeids) !=3D 1 ) + { + printk(KERN_INFO "Your memory is not aligned you need to " + "rebuild your hypervisor with a bigger NODEMAPSIZE " + "shift=3D%d\n", shift); + return -1; + } + + return shift; +} diff --git a/xen/include/asm-x86/numa.h b/xen/include/asm-x86/numa.h index bada2c0bb9..abe5617d01 100644 --- a/xen/include/asm-x86/numa.h +++ b/xen/include/asm-x86/numa.h @@ -26,7 +26,6 @@ extern int compute_hash_shift(struct node *nodes, int num= nodes, extern nodeid_t pxm_to_node(unsigned int pxm); =20 #define ZONE_ALIGN (1UL << (MAX_ORDER+PAGE_SHIFT)) -#define VIRTUAL_BUG_ON(x)=20 =20 extern void numa_add_cpu(int cpu); extern void numa_init_array(void); @@ -47,34 +46,6 @@ static inline void clear_node_cpumask(int cpu) cpumask_clear_cpu(cpu, &node_to_cpumask[cpu_to_node(cpu)]); } =20 -/* Simple perfect hash to map pdx to node numbers */ -extern int memnode_shift;=20 -extern unsigned long memnodemapsize; -extern u8 *memnodemap; - -struct node_data { - unsigned long node_start_pfn; - unsigned long node_spanned_pages; -}; - -extern struct node_data node_data[]; - -static inline __attribute__((pure)) nodeid_t phys_to_nid(paddr_t addr) -{=20 - nodeid_t nid; - VIRTUAL_BUG_ON((paddr_to_pdx(addr) >> memnode_shift) >=3D memnodemapsize); - nid =3D memnodemap[paddr_to_pdx(addr) >> memnode_shift];=20 - VIRTUAL_BUG_ON(nid >=3D MAX_NUMNODES || !node_data[nid]);=20 - return nid;=20 -}=20 - -#define NODE_DATA(nid) (&(node_data[nid])) - -#define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn) -#define node_spanned_pages(nid) (NODE_DATA(nid)->node_spanned_pages) -#define node_end_pfn(nid) (NODE_DATA(nid)->node_start_pfn + \ - NODE_DATA(nid)->node_spanned_pages) - extern int valid_numa_range(u64 start, u64 end, nodeid_t node); =20 void srat_parse_regions(u64 addr); diff --git a/xen/include/xen/numa.h b/xen/include/xen/numa.h index 7aef1a88dc..39e8a4e00a 100644 --- a/xen/include/xen/numa.h +++ b/xen/include/xen/numa.h @@ -18,4 +18,39 @@ (((d)->vcpu !=3D NULL && (d)->vcpu[0] !=3D NULL) \ ? vcpu_to_node((d)->vcpu[0]) : NUMA_NO_NODE) =20 +/* The following content can be used when NUMA feature is enabled */ +#if defined(CONFIG_NUMA) + +/* Simple perfect hash to map pdx to node numbers */ +extern int memnode_shift; +extern unsigned long memnodemapsize; +extern u8 *memnodemap; +extern typeof(*memnodemap) _memnodemap[64]; + +struct node_data { + unsigned long node_start_pfn; + unsigned long node_spanned_pages; +}; + +extern struct node_data node_data[]; +#define VIRTUAL_BUG_ON(x) + +static inline __attribute__((pure)) nodeid_t phys_to_nid(paddr_t addr) +{ + nodeid_t nid; + VIRTUAL_BUG_ON((paddr_to_pdx(addr) >> memnode_shift) >=3D memnodemapsize); + nid =3D memnodemap[paddr_to_pdx(addr) >> memnode_shift]; + VIRTUAL_BUG_ON(nid >=3D MAX_NUMNODES || !node_data[nid]); + return nid; +} + +#define NODE_DATA(nid) (&(node_data[nid])) + +#define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn) +#define node_spanned_pages(nid) (NODE_DATA(nid)->node_spanned_pages) +#define node_end_pfn(nid) (NODE_DATA(nid)->node_start_pfn + \ + NODE_DATA(nid)->node_spanned_pages) + +#endif /* CONFIG_NUMA */ + #endif /* _XEN_NUMA_H */ --=20 2.25.1 From nobody Sat May 4 03:49:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=2; a=rsa-sha256; t=1628677933; cv=pass; d=zohomail.com; s=zohoarc; b=JduwvdxOubXCtxu2xYK+hLFoteAKe7G+WHPRzWm4SptFH47203USQBPfKXclAU6A27STNVenyCf5X6TS0IXh0WPr4ifunwZChwsM5oxZeOKLBsWm6x0YpMB5M6yggC6GrHd8I+n0akfKwOPkp2ybeMWJHNRmJYXDRfX8/BfeUno= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628677933; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=EmnzUhju9srN188tSaExwiieGSbzaEkgNMCpBSvyPLA=; b=bOmh9i3+zIxkvZuxt0WV7S97RdlX/9WH9B0XYbPxGMpdbSZR0/ZCVEdUKEs7qrN9GnHbeL/tRJToa/4i7VyDd1qlfNwdGgQeZJdiHFZoiSMvKo+YIh4ffPEScBLHYKJzYciyElJntonK6oKIcPf8GMIO0FByZpmh/87tqefevKU= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 162867793325034.908270492094516; Wed, 11 Aug 2021 03:32:13 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.165808.303047 (Exim 4.92) (envelope-from ) id 1mDlWf-0005PF-Qr; Wed, 11 Aug 2021 10:31:57 +0000 Received: by outflank-mailman (output) from mailman id 165808.303047; Wed, 11 Aug 2021 10:31:57 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlWe-0005Ma-VB; Wed, 11 Aug 2021 10:31:56 +0000 Received: by outflank-mailman (input) for mailman id 165808; Wed, 11 Aug 2021 10:31:54 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlQi-0000BQ-DC for xen-devel@lists.xenproject.org; Wed, 11 Aug 2021 10:25:48 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (unknown [40.107.22.82]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id ee7cf173-2a8d-4b89-a047-364952b5b166; Wed, 11 Aug 2021 10:25:23 +0000 (UTC) Received: from AM5PR0602CA0008.eurprd06.prod.outlook.com (2603:10a6:203:a3::18) by HE1PR0802MB2186.eurprd08.prod.outlook.com (2603:10a6:3:c2::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.21; Wed, 11 Aug 2021 10:25:20 +0000 Received: from VE1EUR03FT040.eop-EUR03.prod.protection.outlook.com (2603:10a6:203:a3:cafe::c5) by AM5PR0602CA0008.outlook.office365.com (2603:10a6:203:a3::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:25:20 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT040.mail.protection.outlook.com (10.152.18.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:25:20 +0000 Received: ("Tessian outbound 8529ae990a93:v101"); Wed, 11 Aug 2021 10:25:20 +0000 Received: from 3358db577759.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 0A4C8296-03E9-4151-BF62-673E17BFBE0D.1; Wed, 11 Aug 2021 10:25:14 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 3358db577759.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 11 Aug 2021 10:25:14 +0000 Received: from DB6P18901CA0011.EURP189.PROD.OUTLOOK.COM (2603:10a6:4:16::21) by AM0PR08MB4402.eurprd08.prod.outlook.com (2603:10a6:208:147::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.19; Wed, 11 Aug 2021 10:25:13 +0000 Received: from DB5EUR03FT038.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:16:cafe::1f) by DB6P18901CA0011.outlook.office365.com (2603:10a6:4:16::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.13 via Frontend Transport; Wed, 11 Aug 2021 10:25:13 +0000 Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT038.mail.protection.outlook.com (10.152.21.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:25:13 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) 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.2308.14; Wed, 11 Aug 2021 10:24:53 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Wed, 11 Aug 2021 10:24:51 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: ee7cf173-2a8d-4b89-a047-364952b5b166 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=EmnzUhju9srN188tSaExwiieGSbzaEkgNMCpBSvyPLA=; b=Ipy4ShwT/1eiEWDVn5MMEvFRuYed8PJZC4QFJ1cNf5KlU0snfZG4Fnuiee1X+Jfcw+p7Y2QHXyuN72MMv6vUUz4byKAs0F7WwEpDj907Bwow+cISSWand9c0KRqlbU4m/+64qXLQVGl4REgFjjja6gQ4tY3INA8vHGr9NKGLeJo= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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; X-CheckRecipientChecked: true X-CR-MTA-CID: fab414aca7c3e418 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CLMu0kFdbJv6AV1F86TAiPhZQjiKAPY8d9PpnRq94AHALBqy2g+6CFZN+d+40ICLTVk8bkz2kJPzbs07/j0IX0+czFqmShK4KbNad7hWIzY2orUV3DJGgPYrbJ1PNm5Px1RZ7NK7PdvTDR1o/JxXHAo17eUJ+d0Ygn/i/1wSXVsFBLP8c+gHFmMuv4bdqL15Bkr2Yt61tW16arFT1zT1NHIO5wOZqh2ev1TxrQLc2G4P24APWEt9ivFrjHab1L0d+pdrc11iJb03dxeNO1Wr8cnjJS7l7UWc/+uLDTNgN3WwQuOzkNquyt/iWDsiJOOxaIkghLQKar37Dzw33hyoZQ== 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-SenderADCheck; bh=EmnzUhju9srN188tSaExwiieGSbzaEkgNMCpBSvyPLA=; b=fsaNLtGBM66gxt1G+aQqANQOp/e+5dS4QZEA2NgvtQrqWvi5nJxQ/vv96M2l52YdFIM9nLsbmYLvO1Ix2PGAMJKy1ns+cuJw94pKtAJnS2L1GeP3R2QKya5eRGMc2t/uYozxaAZ1zyJMMb0fo9RPf/eW2X3RgFpVxCX5kxMPNsCJtsw/dy9S2mRDT2NGZ9gzx6HeiPuamx2gGQqG23hTPQty0kbtwUggxfaJDmoHlV0RPvRDk4PDCGrBu0WRIN4UqZoFQq0eZXodayua1q85HAyA6maPMPxUSU58eAM66eiIT6JcKQ+jf8/HS+J3hI+xOUwJCtTgBEeBypHWmgoUTA== 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=EmnzUhju9srN188tSaExwiieGSbzaEkgNMCpBSvyPLA=; b=Ipy4ShwT/1eiEWDVn5MMEvFRuYed8PJZC4QFJ1cNf5KlU0snfZG4Fnuiee1X+Jfcw+p7Y2QHXyuN72MMv6vUUz4byKAs0F7WwEpDj907Bwow+cISSWand9c0KRqlbU4m/+64qXLQVGl4REgFjjja6gQ4tY3INA8vHGr9NKGLeJo= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; 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; From: Wei Chen To: , , , , CC: Subject: [XEN RFC PATCH 09/40] xen/x86: Move numa_add_cpu_node to common Date: Wed, 11 Aug 2021 18:23:52 +0800 Message-ID: <20210811102423.28908-10-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210811102423.28908-1-wei.chen@arm.com> References: <20210811102423.28908-1-wei.chen@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a9c0dbb9-090e-4792-2728-08d95cb2527e X-MS-TrafficTypeDiagnostic: AM0PR08MB4402:|HE1PR0802MB2186: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:5797;OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: XWBzrLD3+PECD9WHYpVOtLbtv6qSWXpBjNPRLH5D1vf9pJ1v5G9PlNwEVt3lctpGMzXXPNagv8HxbXmvXBjnvR9ijMsYFOVOJO1HA3gYrFQvSejAPbDJdiBPcBJNOW+rw88umFQAA3JCPHWaG4kdHdboRWdZNLrQ6kVVffaFWVSMDaREMdN0h3tVevMP/bS0GGEiG9ZCziR9nq6Jm0yHxxe0jsaonPbPRh9zYdKeRj0/+qiM4Lu0PF7H1eM1vnuc31EAEjQgWTQ1eWppbgd8rj+gIXT06+LiHQLzEva4jnFM1G9Nj0YF5YCiAVxZBtnIR+T4e2ETLiBGog9pCsjInexmCYpTnS0JUTIilA0bWtwdMYZPtRl8f/ayIrMb6HUVXn5G7MUVxGSfqgxIF5H4uIGDMIzIbWoqTKQu1MPgXtCX7vRrIrEKoxXunwjuqp+nyg1DEtt9tqk3m4pdniJa7KfGygW48fnuGzN158GnJhAN43DmocLEnvrBcgrajAsETzVdHhiFj2Rve48hhawgemB+Ii2y0QgUw4jxI5yiW8JfFgZJhquDOpKx6f0pZRD0x94+GnXmNOnl1muKoTcC0wOPNcpWew2Al7fcxelS0en4b7REIJI97sRA59JEMUPky3f90O67ZwWO+E9F59/TJMPwMck8K1pm4VyKVpXHMTpAAu0Mqoue8/Wbn1PhNxb43kBoFLpvUr018iZPLq/5gIHewa0UAlWMf7lmqYC94XAnsiRM12jiMnXrSJuHZVxwXXCdBS712uwbQv2PvE6V0SdeMDZ5d6TzeisZPYLxjhQ= 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:(4636009)(39850400004)(396003)(376002)(346002)(136003)(46966006)(36840700001)(8676002)(316002)(356005)(44832011)(36860700001)(110136005)(5660300002)(82310400003)(8936002)(47076005)(36756003)(426003)(2616005)(7696005)(34070700002)(336012)(2906002)(186003)(26005)(70206006)(81166007)(83380400001)(1076003)(82740400003)(70586007)(478600001)(4326008)(86362001)(36900700001)(2101003);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB4402 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT040.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 555b3839-2917-4d27-9769-08d95cb24e02 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZqLoNq7nbiZkyWxq3DqfCZWdzhz6rDdEZvBHOIlVjUAeKMS2jSZYuhvoMxFViGlrBOgFqAWwHp/H1HvniV3EUqSOpWEh6Ol6gtJsjoAut53qTJO7NELLoRIXvBLiRj1t4uqa0FAvayXkx7a/OUIdJaOc6um6aHpvHPMQ7VXIz7hpT03JnLuIHh7CZiuNkb02yFiIfW7VSLnn+QxamVGQsA7Q1Cc22BATwP6GIrexiZ5oaoZhCtAUGBrsILLFMnsJu2iw1BoV/j7u4jl4SYBUTB7gFi8+J07Qs7FEkFgwcZ/uVe85NVMo6wt6iS2RN6TSBVbczDLal0yt3ZWT2C+w7KwE6UPMWbo6419hbCNGMarRjMwxdIDQViq9mlAknmIlJMiGT2cUtn05q2o6ETRYpCY4jPWUCSSzCBE9dPBwvXOV76In0FaHaOQB9GaIC9xghvW53J16axpLiFqDujNY+WZ+xJhOC2JXIzoqKI2RhWL5yCgyFUVmGcsOZGqOUO6k+ovJ9FIkSmqDK5cjXJGi/cYpmmDzw4G2JBKTJjSOmclbtcEwOuTvER5P4WB1ZV6Lh5tvKn5dxNZ4UvaWYk0AH8V+uIojTGdNkaRHVbwsPgih62S4G04SuMmIyj3JYvwmRfCUKxuUpwFy4x76d9fYO15OL7jmK3KfH5O6kiYmMaAzRINCStn/4bd18+Pt0VuvZ78E6A8VpF9du3w9e9Xgwvu4umP4txcDG2SRKhUWy7U= 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:(4636009)(39850400004)(396003)(136003)(376002)(346002)(36840700001)(46966006)(83380400001)(426003)(2616005)(7696005)(44832011)(8936002)(2906002)(70206006)(47076005)(478600001)(8676002)(316002)(1076003)(186003)(82740400003)(36756003)(4326008)(81166007)(110136005)(26005)(82310400003)(336012)(86362001)(36860700001)(5660300002)(70586007)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2021 10:25:20.6409 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a9c0dbb9-090e-4792-2728-08d95cb2527e 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: VE1EUR03FT040.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0802MB2186 X-ZohoMail-DKIM: pass (identity @armh.onmicrosoft.com) X-ZM-MESSAGEID: 1628677935186100001 Content-Type: text/plain; charset="utf-8" This function will be reused by Arm later, so we move it from arch/x86 to common. But we keep cpu_to_node and node_to_cpumask to x86 header file. Because cpu_to_node and node_to_cpumask have different implementation for x86 and Arm. We will move them to common header file when we change the Arm implementation in later patches. Signed-off-by: Wei Chen --- xen/arch/x86/numa.c | 9 --------- xen/common/numa.c | 11 +++++++++++ xen/include/asm-x86/numa.h | 1 - xen/include/xen/numa.h | 2 ++ 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/xen/arch/x86/numa.c b/xen/arch/x86/numa.c index a6211be121..f2626b3968 100644 --- a/xen/arch/x86/numa.c +++ b/xen/arch/x86/numa.c @@ -29,16 +29,12 @@ custom_param("numa", numa_setup); /* from proto.h */ #define round_up(x,y) ((((x)+(y))-1) & (~((y)-1))) =20 -nodeid_t cpu_to_node[NR_CPUS] __read_mostly =3D { - [0 ... NR_CPUS-1] =3D NUMA_NO_NODE -}; /* * Keep BIOS's CPU2node information, should not be used for memory allocai= on */ nodeid_t apicid_to_node[MAX_LOCAL_APIC] =3D { [0 ... MAX_LOCAL_APIC-1] =3D NUMA_NO_NODE }; -cpumask_t node_to_cpumask[MAX_NUMNODES] __read_mostly; =20 nodemask_t __read_mostly node_online_map =3D { { [0] =3D 1UL } }; =20 @@ -167,11 +163,6 @@ void __init numa_initmem_init(unsigned long start_pfn,= unsigned long end_pfn) (u64)end_pfn << PAGE_SHIFT); } =20 -void numa_add_cpu(int cpu) -{ - cpumask_set_cpu(cpu, &node_to_cpumask[cpu_to_node(cpu)]); -}=20 - void numa_set_node(int cpu, nodeid_t node) { cpu_to_node[cpu] =3D node; diff --git a/xen/common/numa.c b/xen/common/numa.c index e65b6a6676..9b6f23dfc1 100644 --- a/xen/common/numa.c +++ b/xen/common/numa.c @@ -23,6 +23,12 @@ typeof(*memnodemap) _memnodemap[64]; unsigned long memnodemapsize; u8 *memnodemap; =20 +nodeid_t cpu_to_node[NR_CPUS] __read_mostly =3D { + [0 ... NR_CPUS-1] =3D NUMA_NO_NODE +}; + +cpumask_t node_to_cpumask[MAX_NUMNODES] __read_mostly; + /* * Given a shift value, try to populate memnodemap[] * Returns : @@ -129,3 +135,8 @@ int __init compute_hash_shift(struct node *nodes, int n= umnodes, =20 return shift; } + +void numa_add_cpu(int cpu) +{ + cpumask_set_cpu(cpu, &node_to_cpumask[cpu_to_node(cpu)]); +} diff --git a/xen/include/asm-x86/numa.h b/xen/include/asm-x86/numa.h index abe5617d01..07ff78ea1b 100644 --- a/xen/include/asm-x86/numa.h +++ b/xen/include/asm-x86/numa.h @@ -27,7 +27,6 @@ extern nodeid_t pxm_to_node(unsigned int pxm); =20 #define ZONE_ALIGN (1UL << (MAX_ORDER+PAGE_SHIFT)) =20 -extern void numa_add_cpu(int cpu); extern void numa_init_array(void); extern bool numa_off; =20 diff --git a/xen/include/xen/numa.h b/xen/include/xen/numa.h index 39e8a4e00a..f9769cba4b 100644 --- a/xen/include/xen/numa.h +++ b/xen/include/xen/numa.h @@ -51,6 +51,8 @@ static inline __attribute__((pure)) nodeid_t phys_to_nid(= paddr_t addr) #define node_end_pfn(nid) (NODE_DATA(nid)->node_start_pfn + \ NODE_DATA(nid)->node_spanned_pages) =20 +extern void numa_add_cpu(int cpu); + #endif /* CONFIG_NUMA */ =20 #endif /* _XEN_NUMA_H */ --=20 2.25.1 From nobody Sat May 4 03:49:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=2; a=rsa-sha256; t=1628677539; cv=pass; d=zohomail.com; s=zohoarc; b=JnGT4swVpyW2byBX6qaMN6qupcrZaXGPmGjG2PukBnVuwalkM/JHCkF+joeLcLQrxyc6eziiCaz+9sDqqMqgYAQ5MpF6PXVvZMgKVyh2BH1piMaB3Pxe55i1AUDsFdELCyAxKrBoyG+6kqXjAVJl+fbyfyzDwGfp/U9uA+4KokQ= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628677539; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=yC1y+9c87f0UwnCrstHNg1I3E3rdhAZoIxzbKmzwRo8=; b=GA8gzAxoZByGLCSe3Pi1le3ivNQm91ZOGpKfotQNBRkaN+yUsMUQbzhOUKcfFwOFSx6OR9hOHmY3KZxLYHQHkiK+C4qk8ICGba4Kum5g6kUCXtkDdJMH8i+5DUBG7OOo1MKhxyO7n9fTVbSeJ06uWyW2gA3KDaW8Sap5nIiLwTw= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1628677539566187.73458839917373; Wed, 11 Aug 2021 03:25:39 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.165634.302700 (Exim 4.92) (envelope-from ) id 1mDlQK-0003S6-W3; Wed, 11 Aug 2021 10:25:24 +0000 Received: by outflank-mailman (output) from mailman id 165634.302700; Wed, 11 Aug 2021 10:25: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 1mDlQK-0003R7-Rw; Wed, 11 Aug 2021 10:25:24 +0000 Received: by outflank-mailman (input) for mailman id 165634; Wed, 11 Aug 2021 10:25:23 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlQJ-0000BQ-C1 for xen-devel@lists.xenproject.org; Wed, 11 Aug 2021 10:25:23 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (unknown [40.107.6.72]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 5bb3f0cb-7f39-4dd8-a055-c25af50621cb; Wed, 11 Aug 2021 10:25:14 +0000 (UTC) Received: from AM6P192CA0062.EURP192.PROD.OUTLOOK.COM (2603:10a6:209:82::39) by AM4PR0802MB2129.eurprd08.prod.outlook.com (2603:10a6:200:5d::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.21; Wed, 11 Aug 2021 10:25:08 +0000 Received: from AM5EUR03FT034.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:82:cafe::4b) by AM6P192CA0062.outlook.office365.com (2603:10a6:209:82::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.14 via Frontend Transport; Wed, 11 Aug 2021 10:25:08 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT034.mail.protection.outlook.com (10.152.16.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.14 via Frontend Transport; Wed, 11 Aug 2021 10:25:07 +0000 Received: ("Tessian outbound 077ab11054bf:v101"); Wed, 11 Aug 2021 10:25:07 +0000 Received: from a16bea742b4c.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id B64856EC-77FB-4548-917B-837E6E508F1C.1; Wed, 11 Aug 2021 10:25:02 +0000 Received: from EUR02-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id a16bea742b4c.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 11 Aug 2021 10:25:02 +0000 Received: from DB9PR01CA0016.eurprd01.prod.exchangelabs.com (2603:10a6:10:1d8::21) by AS8PR08MB6374.eurprd08.prod.outlook.com (2603:10a6:20b:338::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.13; Wed, 11 Aug 2021 10:24:59 +0000 Received: from DB5EUR03FT045.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:1d8:cafe::ae) by DB9PR01CA0016.outlook.office365.com (2603:10a6:10:1d8::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.14 via Frontend Transport; Wed, 11 Aug 2021 10:24:59 +0000 Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT045.mail.protection.outlook.com (10.152.21.164) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:24:59 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) 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.2308.14; Wed, 11 Aug 2021 10:24:56 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Wed, 11 Aug 2021 10:24:54 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 5bb3f0cb-7f39-4dd8-a055-c25af50621cb 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=yC1y+9c87f0UwnCrstHNg1I3E3rdhAZoIxzbKmzwRo8=; b=iR0KxxiLWFg5mq2ieLeoh941OaA6hums/6tyNvOvVxRyGhv2K8Q7dhTgvcLtynV40Tt3fmSzAnpX/D0vw9O/giGEQDiQ8JRFV6A+/4sfK2nn20Y0prPseumD+pZzweVcn/0jbEmxq90T1x/WMWi1M142FP70v/7JpKri1GCQkj0= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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; X-CheckRecipientChecked: true X-CR-MTA-CID: ac0cb8f489a23c67 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S0nK7IOKYkG47WFN7au4Iy1q/pSuZ5TUAy82tNeUFVgASM8f5I3uIRDryLcXaPed1oswHzjOTXOjYvuinWPsb6gAKLLmMhT86apAgRANUg3YxzFNusS784qeXW0RnGz7ytneDAQXF7lwnHJW3C9RClniKmH31TLj6IUn5CTGjx9ZlLHDnUDmxB2bWjLLVI9A2tvJA95uwxilv+4o9Mxa83f4sDkvVx9Z7pvLpWH0HbJe0ViQcmegAbRRqNF/8YfkxCjFLd0k4SWitKX5fLVAKK/jBTGmwJbmHmKHXOT2dQqTa+Tkw+4CEDkT8b35U4M4w1do65AyPXsuersM9lDyBw== 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-SenderADCheck; bh=yC1y+9c87f0UwnCrstHNg1I3E3rdhAZoIxzbKmzwRo8=; b=SuvoDjZICGqn/1qJXl6DogTFBzjmApNxBLB6Ls+tzajsY6wbo0DjdxsD5Eii9e1w88UB0N7XvlheQpFbstye99LnBfn/zTFg1mqwWlVbEjLqCUbUZvpwmDk7ZJT0aWeaBOl5jFnxu7M2wwgjOKBrJcRBC7h1MK7lKEDMpdPaCxIuc8PB7viBHJ728mQxMIa96HI+lQtEipcpTZIO1Ada/0UzynPO9Mno4TjdQhGFXKnqGi34QJeOiwKEW54hSzX7rVnPY8oRuPDxmQ/iKkmaz/XtJ1wOtqh8kJOg5BV9WzXFWzTO5/Md8D373FTlvfzosx8oXgkBck9Q5uXbPXe6eQ== 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=yC1y+9c87f0UwnCrstHNg1I3E3rdhAZoIxzbKmzwRo8=; b=iR0KxxiLWFg5mq2ieLeoh941OaA6hums/6tyNvOvVxRyGhv2K8Q7dhTgvcLtynV40Tt3fmSzAnpX/D0vw9O/giGEQDiQ8JRFV6A+/4sfK2nn20Y0prPseumD+pZzweVcn/0jbEmxq90T1x/WMWi1M142FP70v/7JpKri1GCQkj0= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; 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; From: Wei Chen To: , , , , CC: Subject: [XEN RFC PATCH 10/40] xen/x86: Move NR_NODE_MEMBLKS macro to common Date: Wed, 11 Aug 2021 18:23:53 +0800 Message-ID: <20210811102423.28908-11-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210811102423.28908-1-wei.chen@arm.com> References: <20210811102423.28908-1-wei.chen@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 539a3f84-f619-4bff-341a-08d95cb24aec X-MS-TrafficTypeDiagnostic: AS8PR08MB6374:|AM4PR0802MB2129: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:820;OLM:820; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: SViw6guEkDkhzEZtUF5EQnh4oyl7z3li6QoNBoBpR9/vEidq+TJKvTJALoSRtzKXGq7kVug62zek+sgNmCVB611oodiyFLE2815mg9p228vcf/RnlKT0PGxU48MqKKdjWkDujphJscUK6RHoVm6tSY1/RHnU5byOvg1C9HpAw4jVrLG+C9EbJMYM1v9atbFhJMk2EyFiaKc7deoyAhTgusk+1Ixje/FYFsGe8sfU4Gxv3APLJOGvLv2YKixodNaIWkis90zoNvUVH4hrgjzd7Nbmzu1e8HzYNUHIkwa1DeyW2IMW9EIt19IH8BBfwgg47Uf9WNK7SyNRAhkn0463P1bAZVaQQ6dU2dOoa+VW03O8c25c8KJuimjfqda3cK1NKkSxgEM08onpON/1CCDNtZjwP0tozMmhgwzZ4eQIyF+9SXz5j/a7rNUmS5ihb+ZzNTX1xyZxBn1hiBvmqeb8eMSm3OXghQ/7IKQKPppxs6hzX0R4OZGR9X9drValQkVSkIU0B0tFAd4/mYQLlcUIp2yqAoloJQrSDHE3FvlCycyKyKCSocchnkPavmHXr9pZ6lM7+UvK7vq32hmrJ/Xmde7BUSAA4ay26bCsVXGDvzD21iYSxbhSVuQRDKIv9I8nEgzE1AQJC01yhPfLBpakAkY3wW+6JycL1dfS9nsAd98a6kdW229A934UpsyB74oMnCvi4v8YRYPhyDlDLHfNwzQuKGCeqrz8/x6SjcNd07Gyp/PPn9NOOYmx2WbipkJLMUdbGrLjbIoBnIGaK2uO37wU3q++cEp9ehhHkBXu6Eo= 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:(4636009)(396003)(376002)(346002)(39860400002)(136003)(36840700001)(46966006)(316002)(36756003)(86362001)(5660300002)(2616005)(47076005)(44832011)(336012)(110136005)(82310400003)(356005)(26005)(83380400001)(4326008)(8676002)(426003)(70586007)(34070700002)(186003)(81166007)(8936002)(1076003)(7696005)(478600001)(36860700001)(70206006)(2906002)(82740400003)(36900700001)(2101003);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6374 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT034.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 6ea05fbb-1078-4a78-0879-08d95cb245d2 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: EvzSVJBTnieBu/e3AF59eRqC6jeZHJSP1mEIJkjUDiCwMT1EbjIfaglli4xyPFnK3/UzzQhBKqM0G1twazJLGlutyZdcET8Dh3pNG0vnItxcWQpViSUTUHzteNcAvETHjywIfkqnudP09Y0popO1cJnAy9Qi/qft6BIOSnjCEROWS1DY8HYwbkicupzuTMUtZzr/UBYC4Va20vDE2g7gON8fLOz9g5NIFLqI/FkJZOQuNn/YzJKmAzSWFPe0Zegu3tVtmtfPGv0uUv79Xn6kT8rApvoMR87ENTFsDFQs6vGpRd6DQX7LVcZlK0qe+qehTXlj5VQp1OeSV2M2j9AxGbu8tyfrfDGNJSyYd9UxXxaKuJG8HEUN6gJanWpIfaKmpQgCGSPy13TAJUhtE8+kCsWIYwe33p5oco1Yc4F46nauHCG/U9Uf8kIswgzXLOxm6SSOeeRklr1457eQh17PfkXJlzYCkpbbqyroN5TZWsY1KcAqQgeOwu9xLz8dwFeCiRjJHuL0Ube5BbxpfUwW5U0XHzffSllGG7V6xJvaLUAmDqP/5S173ieGaF+kTHlFBHI1G+AF5Z60Bp5iIAK+KKb6Vsg3wMLuicCgpjz6J0EfLPfVbHrwT/QH2Pfgqp8HoApraLZMXaX2MGdM784LxB3nQsVvGqBTQxzCPqiDDx6FZLHa1dL2U+ZrS9kFvcBDp0PAas1NSyzcB6906BUF9HJkDveHQbXR0+cMb0mR3+o= 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:(4636009)(376002)(396003)(136003)(39850400004)(346002)(36840700001)(46966006)(83380400001)(426003)(2616005)(7696005)(44832011)(8936002)(2906002)(70206006)(47076005)(478600001)(8676002)(1076003)(316002)(36756003)(186003)(82740400003)(4326008)(82310400003)(26005)(81166007)(110136005)(336012)(86362001)(36860700001)(70586007)(5660300002)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2021 10:25:07.9974 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 539a3f84-f619-4bff-341a-08d95cb24aec 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: AM5EUR03FT034.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR0802MB2129 X-ZohoMail-DKIM: pass (identity @armh.onmicrosoft.com) X-ZM-MESSAGEID: 1628677541144100001 Content-Type: text/plain; charset="utf-8" Not only x86 ACPI need this macro. Device tree based NUMA also needs this macro to present max memory block number. So we move it from x86 ACPI header file to common NUMA header file. Signed-off-by: Wei Chen --- xen/include/asm-x86/acpi.h | 1 - xen/include/xen/numa.h | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/include/asm-x86/acpi.h b/xen/include/asm-x86/acpi.h index 7032f3a001..d347500a3c 100644 --- a/xen/include/asm-x86/acpi.h +++ b/xen/include/asm-x86/acpi.h @@ -103,7 +103,6 @@ extern unsigned long acpi_wakeup_address; =20 extern s8 acpi_numa; extern int acpi_scan_nodes(u64 start, u64 end); -#define NR_NODE_MEMBLKS (MAX_NUMNODES*2) =20 extern struct acpi_sleep_info acpi_sinfo; #define acpi_video_flags bootsym(video_flags) diff --git a/xen/include/xen/numa.h b/xen/include/xen/numa.h index f9769cba4b..5af74b357f 100644 --- a/xen/include/xen/numa.h +++ b/xen/include/xen/numa.h @@ -11,6 +11,7 @@ #define NUMA_NO_DISTANCE 0xFF =20 #define MAX_NUMNODES (1 << NODES_SHIFT) +#define NR_NODE_MEMBLKS (MAX_NUMNODES*2) =20 #define vcpu_to_node(v) (cpu_to_node((v)->processor)) =20 --=20 2.25.1 From nobody Sat May 4 03:49:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=2; a=rsa-sha256; t=1628677550; cv=pass; d=zohomail.com; s=zohoarc; b=nu1K3kIFgytgLbJE0kQ74NVsYX3nBUWhlrINwqhv57qjoMTzxJ0IkcJy0qz/urT8MtWXs8iDJYdGSvENY6zXNh1xNochB929wvuIW8nRaqus7ltRshBp3RkIga1/FVmQ/esZYEsOvfdKtj7a2XIJt6guCfgIkbHPcZiqboOm4EA= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628677550; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=JhtM44GZuI/12WEDyvg/X/JAT+76nirV+G6Sqv4vRg0=; b=Gm5ZhWJ/4EpMq1wLn1IZPfUuK1z22gxNoFJqdUlnMiPpIbYOT6/Yk6UMsCWhpq7W7UmgSBQO6Sx242nj/1vmpU4k6GsjRKKjYyEv12ewP/IdNpKgW3DbmywsudA26k7UpP8fVsWIwB52qCxxD5z+617nFJEjgQxAEyB/LaqIfMA= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1628677550451876.7759062748579; Wed, 11 Aug 2021 03:25:50 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.165644.302742 (Exim 4.92) (envelope-from ) id 1mDlQV-0005Av-1u; Wed, 11 Aug 2021 10:25:35 +0000 Received: by outflank-mailman (output) from mailman id 165644.302742; Wed, 11 Aug 2021 10:25:35 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlQU-0005AD-RZ; Wed, 11 Aug 2021 10:25:34 +0000 Received: by outflank-mailman (input) for mailman id 165644; Wed, 11 Aug 2021 10:25:33 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlQT-0000BQ-CR for xen-devel@lists.xenproject.org; Wed, 11 Aug 2021 10:25:33 +0000 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (unknown [2a01:111:f400:fe1e::62e]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 058c3040-97d5-4e0f-9c77-41e2e1bb8c05; Wed, 11 Aug 2021 10:25:16 +0000 (UTC) Received: from AS8PR04CA0045.eurprd04.prod.outlook.com (2603:10a6:20b:312::20) by VI1PR08MB2685.eurprd08.prod.outlook.com (2603:10a6:802:1d::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.17; Wed, 11 Aug 2021 10:25:12 +0000 Received: from VE1EUR03FT006.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:312:cafe::40) by AS8PR04CA0045.outlook.office365.com (2603:10a6:20b:312::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.17 via Frontend Transport; Wed, 11 Aug 2021 10:25:12 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT006.mail.protection.outlook.com (10.152.18.116) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:25:12 +0000 Received: ("Tessian outbound ab45ca2b67bc:v101"); Wed, 11 Aug 2021 10:25:12 +0000 Received: from 031a7dee3bae.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 0A59B839-8235-43B7-B458-7FAB70575D20.1; Wed, 11 Aug 2021 10:25:05 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 031a7dee3bae.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 11 Aug 2021 10:25:05 +0000 Received: from DB9PR01CA0023.eurprd01.prod.exchangelabs.com (2603:10a6:10:1d8::28) by HE1PR0802MB2202.eurprd08.prod.outlook.com (2603:10a6:3:c2::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.21; Wed, 11 Aug 2021 10:25:03 +0000 Received: from DB5EUR03FT045.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:1d8:cafe::c8) by DB9PR01CA0023.outlook.office365.com (2603:10a6:10:1d8::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:25:03 +0000 Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT045.mail.protection.outlook.com (10.152.21.164) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:25:03 +0000 Received: from AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2308.14; Wed, 11 Aug 2021 10:24:59 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Wed, 11 Aug 2021 10:24:59 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Wed, 11 Aug 2021 10:24:56 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 058c3040-97d5-4e0f-9c77-41e2e1bb8c05 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=JhtM44GZuI/12WEDyvg/X/JAT+76nirV+G6Sqv4vRg0=; b=3dI+0aXefwLx6vS2aoMegWSThioPZeOxADmdX4FWMgS3f5H5EbEbnbHC3jBwJrM8OzcFoOO06wmM7PlUenQJyVpL26Jx498LPmXzmu0y7j7IKyRcwzyRuT6X2psihdzAcd3FF5118cCUwBHOMj4MUW7PVQDmtsu4AA1QUFOMyU0= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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; X-CheckRecipientChecked: true X-CR-MTA-CID: ae4dbbd4b10260f4 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AwEOme3D76IyzSEK5VHA/thX5mZgudvBc0qhoaPDvw00ytUGSkR4Sf6tY5LmI4hNk08n4ro12lwy2zbbia34wSP6Q5bowXBIH6s2S6mxNykKgnjupw0LxLtfqGEXGFiHYp2pS3vXouwlSlwYWj2h5v0Adkh2ewPDQ9IzO4nuHRapmVzHmP+A2LtsE496vOcUZ9+4sLiBlC85m8WL3Ox6R7bPkRQqfKMNFt17AGWJKWBddyVTV3Lm4YSaqYBNy1idPumffNix0axRQckTmGglm2I8w6ZTn3Sok2SJDyY2fCjBPQyPGwjQ3iMfYeDkaNTDRnNywobmEqlR+B5K54m0FA== 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-SenderADCheck; bh=JhtM44GZuI/12WEDyvg/X/JAT+76nirV+G6Sqv4vRg0=; b=UNPR2tFhClJlI42ra10zk/x3VTXSq6O20RQlf6I4fSGcibTynEFreiXZJmuqGagBd7mHx3hLEyB2WVcyz5k7VtCNDQpgX42DUxZvTsdwymUArMStg73Rs7wv6fMyrPvM/J/eziiiFWogFey3r5p9HeKtCH7jiTgyGrrUxmnbex46VrZxP+2y82zdJ+WRWUGPf5+AK0d4oQawzbtuIZxXZVW6y+oSGPPxh813xYCw2UGZLvi3ga7nxxoMXQfTTUuo5DstyeZEw9LrXe+3EtlW6BVJnMtpcsYTWkToyREPjR6KrlVtEzkYJJguGolxTkSN0gJP3hPb92MrjnQNIYgFVg== 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=JhtM44GZuI/12WEDyvg/X/JAT+76nirV+G6Sqv4vRg0=; b=3dI+0aXefwLx6vS2aoMegWSThioPZeOxADmdX4FWMgS3f5H5EbEbnbHC3jBwJrM8OzcFoOO06wmM7PlUenQJyVpL26Jx498LPmXzmu0y7j7IKyRcwzyRuT6X2psihdzAcd3FF5118cCUwBHOMj4MUW7PVQDmtsu4AA1QUFOMyU0= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; 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; From: Wei Chen To: , , , , CC: Subject: [XEN RFC PATCH 11/40] xen/x86: Move NUMA nodes and memory block ranges to common Date: Wed, 11 Aug 2021 18:23:54 +0800 Message-ID: <20210811102423.28908-12-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210811102423.28908-1-wei.chen@arm.com> References: <20210811102423.28908-1-wei.chen@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 332dcda5-4f26-42dc-5d83-08d95cb24dad X-MS-TrafficTypeDiagnostic: HE1PR0802MB2202:|VI1PR08MB2685: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:327;OLM:327; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: y1rXWeO/Q2/iehKh+mwWoUiLgm93hg3uuS/qNVJDYq+CY+DL0AUw1M7zC/wCuKWOdLUjLXPotv1KiPhLQCs2FULAfa3gnSXbr/OxwwzaEYMH6Ik/JbqPcye3jRidU53i8sR8euQ9+ksA+TpN0XO8eoCzFlOwjEnpRDHBe8vAHwswvCKoOXFzIEhzV50rIYOABB4LrlfzKPoOf0D1MEyuos4MjDXhGx/NSyCRRfwrMFks1Vq6HrNcRjMOxtSj1o7ct25gmmdF+oNG3m6R593ZFgCwKp1lXdq58xnRTIjpKYQXRQZpiwJO0myY3ExCnwICgGqXrshUS199VZhfCWhBFmxg0X7H6YDit+bQXDA2g60As/9rAxPtHRnaFuNWZ7ptQ2cmo7nM7NpAq1q30z566YmREd1U9PBYY2DVBSTRcdUTm1L79RO3h9fAUXojJooNeEIx2KH73JdtKMkM7fqq+/PBHXjev+mmT5kmVbjNSNoj9lJ+tHQqXko7npPNyJInHi2bBGFJwpJJrszud0PFSLjVC6700oM+0Osfwaz+q4Bh71J/tc5q6FWwatB5rzAnGws7M8G6dAbdqIDvtwH+lMJpzs1w8al9BrMMlU0CKL+LyBZsm4SysOPj8smNGkezkk78pEt+cG519IzQ+/4KbKH42Uxm/VzD5e2kDFihyfMkRrFSMGAg7x5LvmYPqhcLqjnrEW8ALTinZE4hYygvXs/ppFbS1vKEfsR/vkQ+hliHakn/HvG5OnVLdhaYAfRRh/KqNLWTx3JXMOLbnj7TYHhnMC8AR7ZZZl+SsuLkTi0= 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:(4636009)(46966006)(36840700001)(8936002)(83380400001)(508600001)(8676002)(356005)(426003)(186003)(81166007)(82310400003)(5660300002)(7696005)(86362001)(336012)(2906002)(26005)(2616005)(70206006)(44832011)(36860700001)(316002)(110136005)(1076003)(36756003)(70586007)(34070700002)(47076005)(4326008)(2101003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0802MB2202 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT006.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: af221aef-f66e-4d9b-91dd-08d95cb24820 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fLUfA5fTN1/lmWS6jSqKehlcjiZIDqKBwYC8HVhgTdDfYLPZWHYdIP8emm7soqz0szmGYKruOJLJ/D7z+lnrmOHBlT9Ep6W3bdZq/jf/bUU1xyYATdkI26yTquRXVcD+Eu/cR5uM1DQNqu5SUs0XUkdWL//pqgeLnZlB0U1H0H9iunXzUH9j5VXXtgjVcEQOLSa31JAsFoJO0L4k8gObzHX9R68R7GpnE7YsJgICqCdGq60S9QvXL2KebolEo2GbnxWepwUiaolAKadmQ11VwjTMAY8vRO5+DPKVvZdZBe8vQOuka7w1QvAJKrT7/xtkmL/oHQhb5sXZ+zBGJ9V8xBysyGv80s2qHvm0lVXPEGjd8sLqOiV4M+k51uKpjSTePEZyg57mSpfFG+WmIkJzIlsEaenx34BmEouAgxLBV8N/0bYoW1p06QRIGayNodeA+qGpbkZHTc/dJjUYz29WGEmN6V/sSuNgaFqXjAwozqQNAC5zuoCKi7mbjcf8biD123vmjoJRbS2JFhCNcB17l4izv/t+D32enJndKzop5B0nqzygBj+m1D4Bnt5sJUY2sfGnVarjvg0DRmu49KFBIsrbnXq4t0Nmxote4uz7sCol/JIXgqirMQt5lwM7HBB9eVF1r6HORGZ1Sjst1zdZd94x0JnSvhRzPCJ1clwqzv8+fMoxcbJPCNGuiTY52os+ZnritHzvh4/xbXkAEC6jOx6O7dHpnj2pzbnKSQavpZ8= 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:(4636009)(376002)(136003)(396003)(39850400004)(346002)(46966006)(36840700001)(83380400001)(4326008)(82310400003)(47076005)(2906002)(36860700001)(1076003)(82740400003)(81166007)(36756003)(478600001)(70206006)(7696005)(70586007)(26005)(44832011)(336012)(8676002)(186003)(426003)(8936002)(2616005)(110136005)(86362001)(316002)(5660300002)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2021 10:25:12.5627 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 332dcda5-4f26-42dc-5d83-08d95cb24dad 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: VE1EUR03FT006.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB2685 X-ZohoMail-DKIM: pass (identity @armh.onmicrosoft.com) X-ZM-MESSAGEID: 1628677552155100002 Content-Type: text/plain; charset="utf-8" These data structures and functions are used to create the mapping between node and memory blocks. In device tree based NUMA, we will reuse these data structures and functions, so we move this part of code from x86 to common. Signed-off-by: Wei Chen --- xen/arch/x86/srat.c | 50 ------------------------------------- xen/common/numa.c | 51 ++++++++++++++++++++++++++++++++++++++ xen/include/asm-x86/numa.h | 8 ------ xen/include/xen/numa.h | 15 +++++++++++ 4 files changed, 66 insertions(+), 58 deletions(-) diff --git a/xen/arch/x86/srat.c b/xen/arch/x86/srat.c index 6b77b98201..6d68b8a614 100644 --- a/xen/arch/x86/srat.c +++ b/xen/arch/x86/srat.c @@ -26,7 +26,6 @@ static struct acpi_table_slit *__read_mostly acpi_slit; =20 static nodemask_t memory_nodes_parsed __initdata; static nodemask_t processor_nodes_parsed __initdata; -static struct node nodes[MAX_NUMNODES] __initdata; =20 struct pxm2node { unsigned pxm; @@ -37,9 +36,6 @@ static struct pxm2node __read_mostly pxm2node[MAX_NUMNODE= S] =3D =20 static unsigned node_to_pxm(nodeid_t n); =20 -static int num_node_memblks; -static struct node node_memblk_range[NR_NODE_MEMBLKS]; -static nodeid_t memblk_nodeid[NR_NODE_MEMBLKS]; static __initdata DECLARE_BITMAP(memblk_hotplug, NR_NODE_MEMBLKS); =20 static inline bool node_found(unsigned idx, unsigned pxm) @@ -104,52 +100,6 @@ nodeid_t setup_node(unsigned pxm) return node; } =20 -int valid_numa_range(u64 start, u64 end, nodeid_t node) -{ - int i; - - for (i =3D 0; i < num_node_memblks; i++) { - struct node *nd =3D &node_memblk_range[i]; - - if (nd->start <=3D start && nd->end >=3D end && - memblk_nodeid[i] =3D=3D node) - return 1; - } - - return 0; -} - -static __init int conflicting_memblks(u64 start, u64 end) -{ - int i; - - for (i =3D 0; i < num_node_memblks; i++) { - struct node *nd =3D &node_memblk_range[i]; - if (nd->start =3D=3D nd->end) - continue; - if (nd->end > start && nd->start < end) - return i; - if (nd->end =3D=3D end && nd->start =3D=3D start) - return i; - } - return -1; -} - -static __init void cutoff_node(int i, u64 start, u64 end) -{ - struct node *nd =3D &nodes[i]; - if (nd->start < start) { - nd->start =3D start; - if (nd->end < nd->start) - nd->start =3D nd->end; - } - if (nd->end > end) { - nd->end =3D end; - if (nd->start > nd->end) - nd->start =3D nd->end; - } -} - static __init void bad_srat(void) { int i; diff --git a/xen/common/numa.c b/xen/common/numa.c index 9b6f23dfc1..1facc8fe2b 100644 --- a/xen/common/numa.c +++ b/xen/common/numa.c @@ -29,6 +29,11 @@ nodeid_t cpu_to_node[NR_CPUS] __read_mostly =3D { =20 cpumask_t node_to_cpumask[MAX_NUMNODES] __read_mostly; =20 +struct node nodes[MAX_NUMNODES] __initdata; +int num_node_memblks; +struct node node_memblk_range[NR_NODE_MEMBLKS]; +nodeid_t memblk_nodeid[NR_NODE_MEMBLKS]; + /* * Given a shift value, try to populate memnodemap[] * Returns : @@ -136,6 +141,52 @@ int __init compute_hash_shift(struct node *nodes, int = numnodes, return shift; } =20 +int valid_numa_range(u64 start, u64 end, nodeid_t node) +{ + int i; + + for (i =3D 0; i < num_node_memblks; i++) { + struct node *nd =3D &node_memblk_range[i]; + + if (nd->start <=3D start && nd->end >=3D end && + memblk_nodeid[i] =3D=3D node) + return 1; + } + + return 0; +} + +int __init conflicting_memblks(u64 start, u64 end) +{ + int i; + + for (i =3D 0; i < num_node_memblks; i++) { + struct node *nd =3D &node_memblk_range[i]; + if (nd->start =3D=3D nd->end) + continue; + if (nd->end > start && nd->start < end) + return i; + if (nd->end =3D=3D end && nd->start =3D=3D start) + return i; + } + return -1; +} + +void __init cutoff_node(int i, u64 start, u64 end) +{ + struct node *nd =3D &nodes[i]; + if (nd->start < start) { + nd->start =3D start; + if (nd->end < nd->start) + nd->start =3D nd->end; + } + if (nd->end > end) { + nd->end =3D end; + if (nd->start > nd->end) + nd->start =3D nd->end; + } +} + void numa_add_cpu(int cpu) { cpumask_set_cpu(cpu, &node_to_cpumask[cpu_to_node(cpu)]); diff --git a/xen/include/asm-x86/numa.h b/xen/include/asm-x86/numa.h index 07ff78ea1b..e8a92ad9df 100644 --- a/xen/include/asm-x86/numa.h +++ b/xen/include/asm-x86/numa.h @@ -17,12 +17,6 @@ extern cpumask_t node_to_cpumask[]; #define node_to_first_cpu(node) (__ffs(node_to_cpumask[node])) #define node_to_cpumask(node) (node_to_cpumask[node]) =20 -struct node {=20 - u64 start,end;=20 -}; - -extern int compute_hash_shift(struct node *nodes, int numnodes, - nodeid_t *nodeids); extern nodeid_t pxm_to_node(unsigned int pxm); =20 #define ZONE_ALIGN (1UL << (MAX_ORDER+PAGE_SHIFT)) @@ -45,8 +39,6 @@ static inline void clear_node_cpumask(int cpu) cpumask_clear_cpu(cpu, &node_to_cpumask[cpu_to_node(cpu)]); } =20 -extern int valid_numa_range(u64 start, u64 end, nodeid_t node); - void srat_parse_regions(u64 addr); extern u8 __node_distance(nodeid_t a, nodeid_t b); unsigned int arch_get_dma_bitsize(void); diff --git a/xen/include/xen/numa.h b/xen/include/xen/numa.h index 5af74b357f..67b79a73a3 100644 --- a/xen/include/xen/numa.h +++ b/xen/include/xen/numa.h @@ -54,6 +54,21 @@ static inline __attribute__((pure)) nodeid_t phys_to_nid= (paddr_t addr) =20 extern void numa_add_cpu(int cpu); =20 +struct node { + u64 start,end; +}; + +extern struct node nodes[MAX_NUMNODES]; +extern int num_node_memblks; +extern struct node node_memblk_range[NR_NODE_MEMBLKS]; +extern nodeid_t memblk_nodeid[NR_NODE_MEMBLKS]; + +extern int compute_hash_shift(struct node *nodes, int numnodes, + nodeid_t *nodeids); +extern int conflicting_memblks(u64 start, u64 end); +extern void cutoff_node(int i, u64 start, u64 end); +extern int valid_numa_range(u64 start, u64 end, nodeid_t node); + #endif /* CONFIG_NUMA */ =20 #endif /* _XEN_NUMA_H */ --=20 2.25.1 From nobody Sat May 4 03:49:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=2; a=rsa-sha256; t=1628677544; cv=pass; d=zohomail.com; s=zohoarc; b=doj1ibk79laJ8rM3t/PE058q7ObVB47LRYERNXh6D1WbZllyzdd8zhbDaTyijtkmi6lesbTfwXW/JIZC85/6eGjHfBI+H9U7m4zhnf6U2TlPDJ+rLARmrYKZfGEbOw8gr6cwzSYQGTXaqkLBM2/+OIAbKKsSCBOsqNKRy83qBYI= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628677544; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=/By6TFLKETxqpP5+PvBGPeS8Y880B33FwtMWH566dSA=; b=c7szEo8fC+8LelvPGKcMo7heXJxCmyDqi4kcRzO36HJgdjknHDzQbzVmeGN8WFa7Jdr/JORnGQqoPzYslxGngwN42dtIyUumbs4QILpg6uyUv+s0c0eWmuBz0LgA2ug3XCbILic64LASI786DNNpX2L858+jSrGEA0+4n3HNQ9A= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1628677544236345.0820072282701; Wed, 11 Aug 2021 03:25:44 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.165636.302711 (Exim 4.92) (envelope-from ) id 1mDlQO-0003uP-CD; Wed, 11 Aug 2021 10:25:28 +0000 Received: by outflank-mailman (output) from mailman id 165636.302711; Wed, 11 Aug 2021 10:25:28 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlQO-0003u5-6V; Wed, 11 Aug 2021 10:25:28 +0000 Received: by outflank-mailman (input) for mailman id 165636; Wed, 11 Aug 2021 10:25:26 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlQM-0002Qj-Eq for xen-devel@lists.xenproject.org; Wed, 11 Aug 2021 10:25:26 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (unknown [40.107.22.56]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 6decab1a-fa8e-11eb-a052-12813bfff9fa; Wed, 11 Aug 2021 10:25:20 +0000 (UTC) Received: from AM6P194CA0084.EURP194.PROD.OUTLOOK.COM (2603:10a6:209:8f::25) by VI1PR08MB2926.eurprd08.prod.outlook.com (2603:10a6:802:1f::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.19; Wed, 11 Aug 2021 10:25:17 +0000 Received: from VE1EUR03FT007.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:8f:cafe::87) by AM6P194CA0084.outlook.office365.com (2603:10a6:209:8f::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.15 via Frontend Transport; Wed, 11 Aug 2021 10:25:17 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT007.mail.protection.outlook.com (10.152.18.114) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:25:17 +0000 Received: ("Tessian outbound d9f41274f41a:v101"); Wed, 11 Aug 2021 10:25:17 +0000 Received: from 624525df80f4.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 917ED75A-EEED-4471-BA86-41FC4B9EBF27.1; Wed, 11 Aug 2021 10:25:10 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 624525df80f4.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 11 Aug 2021 10:25:10 +0000 Received: from DB9PR01CA0003.eurprd01.prod.exchangelabs.com (2603:10a6:10:1d8::8) by DB7PR08MB3532.eurprd08.prod.outlook.com (2603:10a6:10:4f::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.19; Wed, 11 Aug 2021 10:25:08 +0000 Received: from DB5EUR03FT045.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:1d8:cafe::60) by DB9PR01CA0003.outlook.office365.com (2603:10a6:10:1d8::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.15 via Frontend Transport; Wed, 11 Aug 2021 10:25:08 +0000 Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT045.mail.protection.outlook.com (10.152.21.164) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:25:08 +0000 Received: from AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2308.14; Wed, 11 Aug 2021 10:25:01 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Wed, 11 Aug 2021 10:25:01 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Wed, 11 Aug 2021 10:24:59 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 6decab1a-fa8e-11eb-a052-12813bfff9fa 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=/By6TFLKETxqpP5+PvBGPeS8Y880B33FwtMWH566dSA=; b=zAuVpOWu9jXqVQnjWG+9JD0a2FlLi2ojOOOi+giG1ytg+tGCaO1QbU8TVyoEeNKsK67Z9/r3rZ1O+Vr4xYaWC7UkxF815i2CmatjCLYkIayxSJ6Gq4pRCMXLQoyvcD0+iyMWGBKQ8uxMqZmmOH7OjfrDAqV5V+/pTMJzQoY5Ric= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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; X-CheckRecipientChecked: true X-CR-MTA-CID: 5f374230a6a1f1ac X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UInEoIYnZNaj/GgjiTV8Xp24+XMf65wWmRzwY8+QveyVW0X7dzY1nBvIfuZ/dZDe5pKcFwOCCmPHYlXzBzDS7gZe0AkgdnnLuFiBh49n0F5e1v9A6AuV0tyB47sBO+glIedsBft9KLHHGnVcFQwr5PbeEEqPEgLqrPge7peSyIOVBDWXs5fGpdEvLhyflkSuuiF0G4t5pOypYlR3/ixBpiB/SjCV+gKJPqnFspHUcjBdBodFwvYe/o/GsOdKgwHAQlMpiVVwe0mOGajlI8TWXNMjQVFhq408zkK2CTlnr1HujrDf2Glj/giaNbArjfoq3x3+4j+JNeaF5r4z1J9+pA== 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-SenderADCheck; bh=/By6TFLKETxqpP5+PvBGPeS8Y880B33FwtMWH566dSA=; b=fItnWJRs5HYKkdcZB7Y2e02h3p/Ia9moWliWT2YBR0OWnxC8D4wZsItkpBIG6lK+U7YBlAeVWvQLiGItOZFCTdq+NwRRJl/DIOpVL52Jam7Q9EXGZY8T4knaBYn/qXUgQD2tK1LJcRom07yuVIdyRkUQeFPn0Ctl8bwvNtFFAzIxGSwThiq2s4fG8/K6cq2nT0VrBBKmxTF3b3tIMlU9ytTVS++GRAnTZ9rp/X4Mzm3Rypx/phBCqGaDz7vCDoBKfRT00xsLv/Cs8G9OyyVweyMDcqGmGFmnb1doFvMZ2H0oGArTctnhsjOhpUaRp57qhDNlFtYhptTGBw01i/73Rg== 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=/By6TFLKETxqpP5+PvBGPeS8Y880B33FwtMWH566dSA=; b=zAuVpOWu9jXqVQnjWG+9JD0a2FlLi2ojOOOi+giG1ytg+tGCaO1QbU8TVyoEeNKsK67Z9/r3rZ1O+Vr4xYaWC7UkxF815i2CmatjCLYkIayxSJ6Gq4pRCMXLQoyvcD0+iyMWGBKQ8uxMqZmmOH7OjfrDAqV5V+/pTMJzQoY5Ric= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; 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; From: Wei Chen To: , , , , CC: Subject: [XEN RFC PATCH 12/40] xen/x86: Move numa_initmem_init to common Date: Wed, 11 Aug 2021 18:23:55 +0800 Message-ID: <20210811102423.28908-13-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210811102423.28908-1-wei.chen@arm.com> References: <20210811102423.28908-1-wei.chen@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 18c7e52f-8f8f-4487-447f-08d95cb2507d X-MS-TrafficTypeDiagnostic: DB7PR08MB3532:|VI1PR08MB2926: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:2958;OLM:2958; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: R9xbNYIBhO7mky218ALecJMWS54a8BLg7LFw+NSOcrlW8mEhPxCIOJVTasZu/QfnXWtEgmoMj/nzO5OkGkQCJRvv6wo9ni76FuuKL8mU3chVvO2a64xmiWHn0YuvOmAry3IvCbaZX3RUbmxWNscCqI3WVn69YeA11a2yJl3bRSUEFnUl/1shTfAhW40FoZM1rOAzKIj+Ba8DGWR9Dd5MDaDqGaAfq5NMw4CTJfNiGF1NKqjcMnkRT+xY0bhWUMa7RrhvFwco0PSPmJAf1u/g7sqH8AQ5B9kKaSTL2uHTTl2kZ3QJEtFEooYs8FLmWgIw2Pakc/onymvBGPHrAjlcgIY965e/tRLvnMPXhQeQBJSq2ijvoW8AEX39jyZm/ZU/65aBfADBYcd1XgShKyAohIkoZfhlWpLCt6LknQH96Wr8q5GtXH95Z0Dkd9nH7RNGbSbLmHMdcZZJaGYYPEJzSpdQ3nLjwSVtfjCbRN0QdF6GzBDW7U3jGnq8YiDM//WqJ9wPqUn67DyZngzYfh6jLotJn0SJUmtEQ3IrsFEM4ZLQbsbhUWjIvmvNAmQZlprffaqZ0bI6ou8CqMO9a9PpO5pcmnO5vETlDV+CGLUVWKB0xvB4b15qcXryIfOZvv9TChDwqFM5dzNlyiCDpsMLuwhkeDUekU7pxZgpP5oK9vv307FKgoG1PhPnOJXBkJXg/Ox0kVXW5BP3jycoPHizOQNgyaTvtWWzHb77FxB8kSYpgq6K8k3V6LO36v6MrJ0+roUy1QwY1ZkUOk3VsNxRx6znBiCIxauH34SnLCAYQ/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:(4636009)(396003)(39860400002)(346002)(376002)(136003)(36840700001)(46966006)(1076003)(70206006)(70586007)(8936002)(36756003)(30864003)(6666004)(26005)(5660300002)(8676002)(36860700001)(478600001)(7696005)(186003)(336012)(44832011)(110136005)(81166007)(86362001)(2906002)(47076005)(83380400001)(426003)(356005)(34070700002)(82310400003)(4326008)(316002)(2616005)(82740400003)(2101003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB3532 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT007.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 19502cd9-45f5-4588-a911-08d95cb24b40 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YTf+EyQrRhxYGNgHB5VlWLzO01bPGkSQDqzTzt1AcOECeXf+yz+rjMBMMss2xBj2PSsJIDbGknor03s+TdPEraGro0BWWxlSG87smJF5JbynCgSEBVkBrrRWhFP8Tb88b2A8cPQDVnuCprWV0f1n3hjMWv0TSo/3+tINMHDC+vBbm5laa38lyZbT/rBy8uj2QfP9fjayc7E6H0iaWccdO3Yu5Zpf7Htbo1rXwQ/KG+HF7xuaudvnuj/jOiwXtAfo00N0+JJou6fHqWwkf/oXjP1j509A5u985hJ94va1A0o9LXYyVMeKNLzB+LMChRJKEvQ8dxa3kMd9+rEL8ol4mG2e8gtnkAbC5QH87IiJrsCvejaTnn4KaLL25Y/i9hNblMAW5J6i/Svrzzp8z0VrHIr4TOy1Lbn62QQQwQWUne2IlIWuQHTIEK1csZBkF01bev6BxjyknQcVnP1TGse7aAlfljo1n0KlWJksU2dnDYPBKP0O2LRRz4wTm8ohN+pAqnFWJTL0FrZo6w2X3Xzz51cYGZtPye5KmkVlANqQrqmeTo72mObnw1dl1R5D70viEYI+fLytA33j3LJ+Xspm4xUo0V0pfT+4lqcBrM8A2r53A3UawFe4K27a7FA++t7a8KhcwSkyLxO4qRjCwf08sQ1H/fqWa87llQ8MxrfvipOuusnDcOrXIhL1obZUUzIP+jK6Q3guV1X/ztA1te9sNBD7plp46pxe4bbUKJ9XdY0= 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:(4636009)(376002)(346002)(39860400002)(136003)(396003)(36840700001)(46966006)(2906002)(70586007)(36756003)(70206006)(81166007)(82740400003)(8676002)(44832011)(336012)(82310400003)(26005)(1076003)(186003)(8936002)(7696005)(478600001)(83380400001)(4326008)(6666004)(5660300002)(316002)(110136005)(86362001)(426003)(36860700001)(2616005)(30864003)(47076005)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2021 10:25:17.2387 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 18c7e52f-8f8f-4487-447f-08d95cb2507d 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: VE1EUR03FT007.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB2926 X-ZohoMail-DKIM: pass (identity @armh.onmicrosoft.com) X-ZM-MESSAGEID: 1628677545564100003 Content-Type: text/plain; charset="utf-8" This function can be reused by Arm device tree based NUMA support. So we move it from x86 to common, as well as its related variables and functions: setup_node_bootmem, numa_init_array and numa_emulation. As numa_initmem_init has been moved to common, _memnodemap is not used cross files. We can restore _memnodemap to static. Signed-off-by: Wei Chen --- xen/arch/x86/numa.c | 118 ---------------------------------- xen/common/numa.c | 122 +++++++++++++++++++++++++++++++++++- xen/include/asm-x86/numa.h | 5 -- xen/include/asm-x86/setup.h | 1 - xen/include/xen/numa.h | 8 ++- 5 files changed, 128 insertions(+), 126 deletions(-) diff --git a/xen/arch/x86/numa.c b/xen/arch/x86/numa.c index f2626b3968..6908738305 100644 --- a/xen/arch/x86/numa.c +++ b/xen/arch/x86/numa.c @@ -38,7 +38,6 @@ nodeid_t apicid_to_node[MAX_LOCAL_APIC] =3D { =20 nodemask_t __read_mostly node_online_map =3D { { [0] =3D 1UL } }; =20 -bool numa_off; s8 acpi_numa =3D 0; =20 int srat_disabled(void) @@ -46,123 +45,6 @@ int srat_disabled(void) return numa_off || acpi_numa < 0; } =20 -/* initialize NODE_DATA given nodeid and start/end */ -void __init setup_node_bootmem(nodeid_t nodeid, u64 start, u64 end) -{=20 - unsigned long start_pfn, end_pfn; - - start_pfn =3D start >> PAGE_SHIFT; - end_pfn =3D end >> PAGE_SHIFT; - - NODE_DATA(nodeid)->node_start_pfn =3D start_pfn; - NODE_DATA(nodeid)->node_spanned_pages =3D end_pfn - start_pfn; - - node_set_online(nodeid); -}=20 - -void __init numa_init_array(void) -{ - int rr, i; - - /* There are unfortunately some poorly designed mainboards around - that only connect memory to a single CPU. This breaks the 1:1 cpu->= node - mapping. To avoid this fill in the mapping for all possible - CPUs, as the number of CPUs is not known yet. - We round robin the existing nodes. */ - rr =3D first_node(node_online_map); - for ( i =3D 0; i < nr_cpu_ids; i++ ) - { - if ( cpu_to_node[i] !=3D NUMA_NO_NODE ) - continue; - numa_set_node(i, rr); - rr =3D cycle_node(rr, node_online_map); - } -} - -#ifdef CONFIG_NUMA_EMU -static int numa_fake __initdata =3D 0; - -/* Numa emulation */ -static int __init numa_emulation(u64 start_pfn, u64 end_pfn) -{ - int i; - struct node nodes[MAX_NUMNODES]; - u64 sz =3D ((end_pfn - start_pfn)< 1 ) - { - u64 x =3D 1; - while ( (x << 1) < sz ) - x <<=3D 1; - if ( x < sz/2 ) - printk(KERN_ERR "Numa emulation unbalanced. Complain to mainta= iner\n"); - sz =3D x; - } - - memset(&nodes,0,sizeof(nodes)); - for ( i =3D 0; i < numa_fake; i++ ) - { - nodes[i].start =3D (start_pfn<> 20); - node_set_online(i); - } - memnode_shift =3D compute_hash_shift(nodes, numa_fake, NULL); - if ( memnode_shift < 0 ) - { - memnode_shift =3D 0; - printk(KERN_ERR "No NUMA hash function found. Emulation disabled.\= n"); - return -1; - } - for_each_online_node ( i ) - setup_node_bootmem(i, nodes[i].start, nodes[i].end); - numa_init_array(); - - return 0; -} -#endif - -void __init numa_initmem_init(unsigned long start_pfn, unsigned long end_p= fn) -{=20 - int i; - -#ifdef CONFIG_NUMA_EMU - if ( numa_fake && !numa_emulation(start_pfn, end_pfn) ) - return; -#endif - -#ifdef CONFIG_ACPI_NUMA - if ( !numa_off && !acpi_scan_nodes((u64)start_pfn << PAGE_SHIFT, - (u64)end_pfn << PAGE_SHIFT) ) - return; -#endif - - printk(KERN_INFO "%s\n", - numa_off ? "NUMA turned off" : "No NUMA configuration found"); - - printk(KERN_INFO "Faking a node at %016"PRIx64"-%016"PRIx64"\n", - (u64)start_pfn << PAGE_SHIFT, - (u64)end_pfn << PAGE_SHIFT); - /* setup dummy node covering all memory */ - memnode_shift =3D BITS_PER_LONG - 1; - memnodemap =3D _memnodemap; - memnodemapsize =3D ARRAY_SIZE(_memnodemap); - - nodes_clear(node_online_map); - node_set_online(0); - for ( i =3D 0; i < nr_cpu_ids; i++ ) - numa_set_node(i, 0); - cpumask_copy(&node_to_cpumask[0], cpumask_of(0)); - setup_node_bootmem(0, (u64)start_pfn << PAGE_SHIFT, - (u64)end_pfn << PAGE_SHIFT); -} - void numa_set_node(int cpu, nodeid_t node) { cpu_to_node[cpu] =3D node; diff --git a/xen/common/numa.c b/xen/common/numa.c index 1facc8fe2b..26c0006d04 100644 --- a/xen/common/numa.c +++ b/xen/common/numa.c @@ -14,12 +14,13 @@ #include #include #include +#include =20 struct node_data node_data[MAX_NUMNODES]; =20 /* Mapping from pdx to node id */ int memnode_shift; -typeof(*memnodemap) _memnodemap[64]; +static typeof(*memnodemap) _memnodemap[64]; unsigned long memnodemapsize; u8 *memnodemap; =20 @@ -34,6 +35,8 @@ int num_node_memblks; struct node node_memblk_range[NR_NODE_MEMBLKS]; nodeid_t memblk_nodeid[NR_NODE_MEMBLKS]; =20 +bool numa_off; + /* * Given a shift value, try to populate memnodemap[] * Returns : @@ -191,3 +194,120 @@ void numa_add_cpu(int cpu) { cpumask_set_cpu(cpu, &node_to_cpumask[cpu_to_node(cpu)]); } + +/* initialize NODE_DATA given nodeid and start/end */ +void __init setup_node_bootmem(nodeid_t nodeid, u64 start, u64 end) +{ + unsigned long start_pfn, end_pfn; + + start_pfn =3D start >> PAGE_SHIFT; + end_pfn =3D end >> PAGE_SHIFT; + + NODE_DATA(nodeid)->node_start_pfn =3D start_pfn; + NODE_DATA(nodeid)->node_spanned_pages =3D end_pfn - start_pfn; + + node_set_online(nodeid); +} + +void __init numa_init_array(void) +{ + int rr, i; + + /* There are unfortunately some poorly designed mainboards around + that only connect memory to a single CPU. This breaks the 1:1 cpu->= node + mapping. To avoid this fill in the mapping for all possible + CPUs, as the number of CPUs is not known yet. + We round robin the existing nodes. */ + rr =3D first_node(node_online_map); + for ( i =3D 0; i < nr_cpu_ids; i++ ) + { + if ( cpu_to_node[i] !=3D NUMA_NO_NODE ) + continue; + numa_set_node(i, rr); + rr =3D cycle_node(rr, node_online_map); + } +} + +#ifdef CONFIG_NUMA_EMU +int numa_fake __initdata =3D 0; + +/* Numa emulation */ +static int __init numa_emulation(u64 start_pfn, u64 end_pfn) +{ + int i; + struct node nodes[MAX_NUMNODES]; + u64 sz =3D ((end_pfn - start_pfn)< 1 ) + { + u64 x =3D 1; + while ( (x << 1) < sz ) + x <<=3D 1; + if ( x < sz/2 ) + printk(KERN_ERR "Numa emulation unbalanced. Complain to mainta= iner\n"); + sz =3D x; + } + + memset(&nodes,0,sizeof(nodes)); + for ( i =3D 0; i < numa_fake; i++ ) + { + nodes[i].start =3D (start_pfn<> 20); + node_set_online(i); + } + memnode_shift =3D compute_hash_shift(nodes, numa_fake, NULL); + if ( memnode_shift < 0 ) + { + memnode_shift =3D 0; + printk(KERN_ERR "No NUMA hash function found. Emulation disabled.\= n"); + return -1; + } + for_each_online_node ( i ) + setup_node_bootmem(i, nodes[i].start, nodes[i].end); + numa_init_array(); + + return 0; +} +#endif + +void __init numa_initmem_init(unsigned long start_pfn, unsigned long end_p= fn) +{ + int i; + +#ifdef CONFIG_NUMA_EMU + if ( numa_fake && !numa_emulation(start_pfn, end_pfn) ) + return; +#endif + +#ifdef CONFIG_ACPI_NUMA + if ( !numa_off && !acpi_scan_nodes((u64)start_pfn << PAGE_SHIFT, + (u64)end_pfn << PAGE_SHIFT) ) + return; +#endif + + printk(KERN_INFO "%s\n", + numa_off ? "NUMA turned off" : "No NUMA configuration found"); + + printk(KERN_INFO "Faking a node at %016"PRIx64"-%016"PRIx64"\n", + (u64)start_pfn << PAGE_SHIFT, + (u64)end_pfn << PAGE_SHIFT); + /* setup dummy node covering all memory */ + memnode_shift =3D BITS_PER_LONG - 1; + memnodemap =3D _memnodemap; + memnodemapsize =3D ARRAY_SIZE(_memnodemap); + + nodes_clear(node_online_map); + node_set_online(0); + for ( i =3D 0; i < nr_cpu_ids; i++ ) + numa_set_node(i, 0); + cpumask_copy(&node_to_cpumask[0], cpumask_of(0)); + setup_node_bootmem(0, (u64)start_pfn << PAGE_SHIFT, + (u64)end_pfn << PAGE_SHIFT); +} diff --git a/xen/include/asm-x86/numa.h b/xen/include/asm-x86/numa.h index e8a92ad9df..f8e4e15586 100644 --- a/xen/include/asm-x86/numa.h +++ b/xen/include/asm-x86/numa.h @@ -21,16 +21,11 @@ extern nodeid_t pxm_to_node(unsigned int pxm); =20 #define ZONE_ALIGN (1UL << (MAX_ORDER+PAGE_SHIFT)) =20 -extern void numa_init_array(void); -extern bool numa_off; - - extern int srat_disabled(void); extern void numa_set_node(int cpu, nodeid_t node); extern nodeid_t setup_node(unsigned int pxm); extern void srat_detect_node(int cpu); =20 -extern void setup_node_bootmem(nodeid_t nodeid, u64 start, u64 end); extern nodeid_t apicid_to_node[]; extern void init_cpu_to_node(void); =20 diff --git a/xen/include/asm-x86/setup.h b/xen/include/asm-x86/setup.h index 24be46115d..63838ba2d1 100644 --- a/xen/include/asm-x86/setup.h +++ b/xen/include/asm-x86/setup.h @@ -17,7 +17,6 @@ void early_time_init(void); =20 void set_nr_cpu_ids(unsigned int max_cpus); =20 -void numa_initmem_init(unsigned long start_pfn, unsigned long end_pfn); void arch_init_memory(void); void subarch_init_memory(void); =20 diff --git a/xen/include/xen/numa.h b/xen/include/xen/numa.h index 67b79a73a3..258a5cb3db 100644 --- a/xen/include/xen/numa.h +++ b/xen/include/xen/numa.h @@ -26,7 +26,6 @@ extern int memnode_shift; extern unsigned long memnodemapsize; extern u8 *memnodemap; -extern typeof(*memnodemap) _memnodemap[64]; =20 struct node_data { unsigned long node_start_pfn; @@ -69,6 +68,13 @@ extern int conflicting_memblks(u64 start, u64 end); extern void cutoff_node(int i, u64 start, u64 end); extern int valid_numa_range(u64 start, u64 end, nodeid_t node); =20 +extern void numa_init_array(void); +extern void numa_initmem_init(unsigned long start_pfn, unsigned long end_p= fn); +extern bool numa_off; +extern int numa_fake; + +extern void setup_node_bootmem(nodeid_t nodeid, u64 start, u64 end); + #endif /* CONFIG_NUMA */ =20 #endif /* _XEN_NUMA_H */ --=20 2.25.1 From nobody Sat May 4 03:49:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=2; a=rsa-sha256; t=1628677929; cv=pass; d=zohomail.com; s=zohoarc; b=bbLXPoXuPkER4yc6rOpt+DSS7KOywDLb5vIQy5LtD+XnUO6FnMmpLys76Oanxgnf76oShXjqsgx8B+HBFR7CE9RLx2tbAJC9sQyi0hDacElDWrqhH67dCuyyIRs5MvotXPDYGhLWvkzLl82omwtaocxpBPQmuchDB+b7ygex/vI= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628677929; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=NPe+D+dpN9Fb/d8ivHIUPCK4Pbt5qBhS048EZq+FnSY=; b=m8inuG7lmCNFDZEuXKLHAOqXrwRVt6QbUw9xePjmpSzH5X17x4FVr/gVaGPocDI67Q7ugOf7E64J+/AfSh8jTc/7rBhUQuMdhzdXbvxSeGvhHBmKVxp3tpQwcbliL44bd6zKKvZLTsN7AMO55+1H0SdfZz7vvzmUWkJD8AAaYtU= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1628677929758647.8826172162401; Wed, 11 Aug 2021 03:32:09 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.165788.303015 (Exim 4.92) (envelope-from ) id 1mDlWY-0003oJ-E6; Wed, 11 Aug 2021 10:31:50 +0000 Received: by outflank-mailman (output) from mailman id 165788.303015; Wed, 11 Aug 2021 10:31:50 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlWY-0003n0-29; Wed, 11 Aug 2021 10:31:50 +0000 Received: by outflank-mailman (input) for mailman id 165788; Wed, 11 Aug 2021 10:31:47 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlR2-0000BQ-Dm for xen-devel@lists.xenproject.org; Wed, 11 Aug 2021 10:26:08 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (unknown [40.107.21.75]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 2fea898c-6117-4051-a62f-be0923dfb5ab; Wed, 11 Aug 2021 10:25:31 +0000 (UTC) Received: from AM6P195CA0027.EURP195.PROD.OUTLOOK.COM (2603:10a6:209:81::40) by DB7PR08MB3660.eurprd08.prod.outlook.com (2603:10a6:10:46::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.17; Wed, 11 Aug 2021 10:25:29 +0000 Received: from VE1EUR03FT029.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:81:cafe::31) by AM6P195CA0027.outlook.office365.com (2603:10a6:209:81::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:25:29 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT029.mail.protection.outlook.com (10.152.18.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:25:29 +0000 Received: ("Tessian outbound 79bfeeb089c1:v101"); Wed, 11 Aug 2021 10:25:28 +0000 Received: from 37402230e43f.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 5143B55B-DD05-48B3-A03D-F514DDF2D533.1; Wed, 11 Aug 2021 10:25:22 +0000 Received: from EUR03-DB5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 37402230e43f.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 11 Aug 2021 10:25:22 +0000 Received: from DB9PR06CA0005.eurprd06.prod.outlook.com (2603:10a6:10:1db::10) by VE1PR08MB4800.eurprd08.prod.outlook.com (2603:10a6:802:a9::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.14; Wed, 11 Aug 2021 10:25:20 +0000 Received: from DB5EUR03FT012.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:1db:cafe::a0) by DB9PR06CA0005.outlook.office365.com (2603:10a6:10:1db::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.13 via Frontend Transport; Wed, 11 Aug 2021 10:25:20 +0000 Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT012.mail.protection.outlook.com (10.152.20.161) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:25:20 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) 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.2308.14; Wed, 11 Aug 2021 10:25:03 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Wed, 11 Aug 2021 10:25:01 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 2fea898c-6117-4051-a62f-be0923dfb5ab 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=NPe+D+dpN9Fb/d8ivHIUPCK4Pbt5qBhS048EZq+FnSY=; b=IdMIZQa27Ls3NUHN9xFQ8mw8ojSegJyxHrHwinmkNTTQ563Oqad2qKMt5/0BAsYLSYMjzkL1O3KDk5NKLyU0jcmw1GtzjXbJR5X+LSDILV/2QaGxgwDo3FuuswVt/OyvMZ2YthPqp+pvz4r17o3bhaagrqMp7CqZ7DzUjcAogW8= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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; X-CheckRecipientChecked: true X-CR-MTA-CID: 7657802012c66ae9 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EVnuvMI7InkTFqXmlEVZYqi3gbZjTuuyM/9/bMvkIhz/jWU4GMxezyWhFoik7vAlUwWmeiLgsjA4HIilMyiyrtBA4C/xwroNq8PapCFApbfB5MJoCyn1mkmZ3karvY03oArqkHRhrW8OKN3Arx0qT3WVMOIemaNfpk7CfPKawHu3zLS7exxy8WGAr/XdzqPgoHGfrxZ5rFyZRCO5mURlYdO6K+4YmlBoGT6xQfY1VIFMz05bEo954a/W/Sa4/X2rNbrkKHy45HIyh4Lp6Gb5sREtZ0dToIS+anAu4d29Sjqz0x3T1bxpYAbdty+NXbtrCcFO2h4LY0Emsjg4MFkemQ== 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-SenderADCheck; bh=NPe+D+dpN9Fb/d8ivHIUPCK4Pbt5qBhS048EZq+FnSY=; b=DTXPJbIk+kIU1FH71xak81YQlJtI7vaaYbi0MQa390i0C37ES+i/5kx1a9dC24NnO3RD0vR3/TRM4M4Cc0nVULMcE/ATJzkj8Ir2oxqrbgk4kQ9IlLvab3PWQ28gDbaQw9tywhZoeL+cOZTrYdtGG8G+0FKmLZUefezxvIjHdRTVovszcTc6ubyLE9eUWhrMaX/67So8hS1GxGlyoj6eSBGT8V22UYJY1JQTcFgscD0p2twN4IYBlHndFRgkqhOQ2On5frisaeiU5dPXACFqJrfKVs0m0wlwXDuX/HjKX6rhSek+49OpKz5dTPVQaFsEkEPQ1Yx+2dCY0K9MX8lEnA== 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=NPe+D+dpN9Fb/d8ivHIUPCK4Pbt5qBhS048EZq+FnSY=; b=IdMIZQa27Ls3NUHN9xFQ8mw8ojSegJyxHrHwinmkNTTQ563Oqad2qKMt5/0BAsYLSYMjzkL1O3KDk5NKLyU0jcmw1GtzjXbJR5X+LSDILV/2QaGxgwDo3FuuswVt/OyvMZ2YthPqp+pvz4r17o3bhaagrqMp7CqZ7DzUjcAogW8= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; 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; From: Wei Chen To: , , , , CC: Subject: [XEN RFC PATCH 13/40] xen/arm: introduce numa_set_node for Arm Date: Wed, 11 Aug 2021 18:23:56 +0800 Message-ID: <20210811102423.28908-14-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210811102423.28908-1-wei.chen@arm.com> References: <20210811102423.28908-1-wei.chen@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e081f2a6-e6f1-406c-9330-08d95cb25783 X-MS-TrafficTypeDiagnostic: VE1PR08MB4800:|DB7PR08MB3660: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:9508;OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: At26H3rHHA/MB594iKXFV8dz7Zu2Jy5WttOeGyO2vH8Ctv9kvCfwqQXP3cqjvNaw1R4z7MU9FAAiCGvXumKhEPxVxVOj7jhFjIn1joEDgw5/t7/tbm4lllIrs8qsp3QlyEKcy8mGPbOc51jiR7mK+D09oYDWUVKAMpByUZemM+D0/2ODEE2qDTDMvgWDZX6yFWWgJ0NelA29U8PVlh5SSIOn1s/DnW95l0IzdZYUiQZUrmV2Md4w7njxR44BlTps2U9wnRNdy3tpbWl72ysS4vBNz8KYRCg2eTQx/hH6AqWPR4KqNIZd8V9LlCMt3s6Wm66k8dZnHJLy8XJDnjrGpJ1djcWqq1n4k0Bta9JC8iip0g5waGnQYJbT/rMH/ymYZlbfkbJs7gEuaB3jhjsWeFvMMvuNKVhfT+C49QiFzPcFTVakKfqA/uIwDklF/5LVn0POZGGMdpfR0Ej+rewbENLldy1bR9YFaZDP1mRVhfIP2g25wOBbA/KBTwCJLfcm7D6cQoyAYi/lVp+O9H+jnXGMCvSbMpV1w2UMTeD72M+kS4BbblR208OD1XwuAEcMqXPJJ/l6B2M1s/HEVPUiM3mxvKba36EVpzrtDBX42rZqsaNrv06wjtj85CIcXxeFjET8Sducp2eZU5b70yaKzHQ4GQDNuY5Dg68aRl7MK6RbHcZxHaqx6A+0ept2aFmEZ9NMugIipc8uDjyxecbKPLUCbKbcrK9fVM8kCuL4loi6taCaesHzmQcga3VVb1ti/ZUC8CG93GgGTVvxRgh+EurijdClqNbjhXs4TtecmubuVOaxR23dDOyiraYC8HJZDakojjsj/agPa7s2zjUaAZemoKYwDhe9OBvP8pArJuC7Na1iavVNlq0h6xE6dklrSVNDjlbKEB3rEo3OKuM5JQ== 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:(4636009)(46966006)(36840700001)(34070700002)(7696005)(81166007)(83380400001)(70586007)(110136005)(2906002)(36756003)(316002)(47076005)(70206006)(86362001)(36860700001)(5660300002)(8936002)(186003)(1076003)(2616005)(26005)(44832011)(508600001)(4326008)(356005)(6666004)(82310400003)(336012)(426003)(8676002)(2004002)(36900700001)(2101003);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB4800 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT029.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 0fbeea89-92b7-4eb2-03d4-08d95cb25258 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0eUBLv3lfkNc/OS5fHHq7EJWprhTG5s0YAVWcBrPFGFW+cDNmWJcd08EpjXiB5DGm1u5nrn6FKd0nctLaoxonFKBszTahdW2ej3aguvp2XYiWLDgQaINwYllZmUX2HNMO/+dbhFljgM6tJPLbn/bA3XaQjxjgoxMNh2rwau5gdcwwPSCJUmaZUnO4YOANrjUJn9LXmtL7/oA6fUF+2B6alhkXXIparPhwNOXd/Kpswl3iMgtDu3B/Lg6hVRsjFrBR3Lfizgir0cE1oMsmPW/BKwaRjLeN09pSoh9Dkm3lO9sKrwNJ/qWOKPUbl4TS/5eqx0+wUyUWgxo1f5DgoBSTn7FeNiEJsrL5dooO6114hQVPoaro01dnFDHUPL9W5A1sFBEvDq4T4VCikr9DGjZfHG5VD6fmXI41NDihN39Xeg7ZFAnFbaV/zPUC19ER0GdeP/1eXgD0CE7k4/UuJI5AT+m9LJUkl4OLcLbl+Vf6TD4fxyNAvYE4FiaMBTqLuACQ188dPyXQ5mgaTBkjDbijfOSIMV9AwcNbkJApWjbUIyvTbh0lZowcX8Ysy2Ahh/Xi8MwqWyva0imW2BuAJil1B3zr5zRNRLTRUa+EESQzvXNRQhVZAmXD7QC8uIPFCGtzBVqGK+Fe7Y3kYkK5rk8r9VH1l7hq7m1NXBvIo6O/zaCRTWpVMJtCTEb5E9FIuoPalB4HTtjPee28Mf6cvQramjhs1T3heZj2Cdmq/TS+8HZUbv0SpUORDm9nFaCF/9kmZ5+Te7ENWWSHYm0sC7m3g/wLf7InJrL854P4ypAMgrsPyLDR8bPoEubWel3531etNAbofE/Tf7rJ5zvfnB9Yg== 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:(4636009)(36840700001)(46966006)(5660300002)(6666004)(82310400003)(44832011)(86362001)(36860700001)(70206006)(36756003)(47076005)(7696005)(4326008)(2616005)(426003)(81166007)(70586007)(26005)(2906002)(110136005)(336012)(316002)(1076003)(83380400001)(186003)(8676002)(8936002)(508600001)(2004002)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2021 10:25:29.0622 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e081f2a6-e6f1-406c-9330-08d95cb25783 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: VE1EUR03FT029.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB3660 X-ZohoMail-DKIM: pass (identity @armh.onmicrosoft.com) X-ZM-MESSAGEID: 1628677930787100003 Content-Type: text/plain; charset="utf-8" This API is used to set one CPU to a NUMA node. If the system configure NUMA off or system initialize NUMA failed, the online NUMA node would set to only node#0. This will be done in following patches. When NUMA turn off or init failed, node_online_map will be cleared and set node#0 online. So we use node_online_map to prevent to set a CPU to an offline node. Signed-off-by: Wei Chen --- xen/arch/arm/Makefile | 1 + xen/arch/arm/numa.c | 31 +++++++++++++++++++++++++++++++ xen/include/asm-arm/numa.h | 2 ++ xen/include/asm-x86/numa.h | 1 - xen/include/xen/numa.h | 1 + 5 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 xen/arch/arm/numa.c diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile index 3d3b97b5b4..6e3fb8033e 100644 --- a/xen/arch/arm/Makefile +++ b/xen/arch/arm/Makefile @@ -35,6 +35,7 @@ obj-$(CONFIG_LIVEPATCH) +=3D livepatch.o obj-y +=3D mem_access.o obj-y +=3D mm.o obj-y +=3D monitor.o +obj-$(CONFIG_NUMA) +=3D numa.o obj-y +=3D p2m.o obj-y +=3D percpu.o obj-y +=3D platform.o diff --git a/xen/arch/arm/numa.c b/xen/arch/arm/numa.c new file mode 100644 index 0000000000..1e30c5bb13 --- /dev/null +++ b/xen/arch/arm/numa.c @@ -0,0 +1,31 @@ +// 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 +#include + +void numa_set_node(int cpu, nodeid_t nid) +{ + if ( nid >=3D MAX_NUMNODES || + !nodemask_test(nid, &node_online_map) ) + nid =3D 0; + + cpu_to_node[cpu] =3D nid; +} diff --git a/xen/include/asm-arm/numa.h b/xen/include/asm-arm/numa.h index ab9c4a2448..1162c702df 100644 --- a/xen/include/asm-arm/numa.h +++ b/xen/include/asm-arm/numa.h @@ -27,6 +27,8 @@ extern mfn_t first_valid_mfn; #define node_start_pfn(nid) (mfn_x(first_valid_mfn)) #define __node_distance(a, b) (20) =20 +#define numa_set_node(x, y) do { } while (0) + #endif =20 #endif /* __ARCH_ARM_NUMA_H */ diff --git a/xen/include/asm-x86/numa.h b/xen/include/asm-x86/numa.h index f8e4e15586..69859b0a57 100644 --- a/xen/include/asm-x86/numa.h +++ b/xen/include/asm-x86/numa.h @@ -22,7 +22,6 @@ extern nodeid_t pxm_to_node(unsigned int pxm); #define ZONE_ALIGN (1UL << (MAX_ORDER+PAGE_SHIFT)) =20 extern int srat_disabled(void); -extern void numa_set_node(int cpu, nodeid_t node); extern nodeid_t setup_node(unsigned int pxm); extern void srat_detect_node(int cpu); =20 diff --git a/xen/include/xen/numa.h b/xen/include/xen/numa.h index 258a5cb3db..3972aa6b93 100644 --- a/xen/include/xen/numa.h +++ b/xen/include/xen/numa.h @@ -70,6 +70,7 @@ extern int valid_numa_range(u64 start, u64 end, nodeid_t = node); =20 extern void numa_init_array(void); extern void numa_initmem_init(unsigned long start_pfn, unsigned long end_p= fn); +extern void numa_set_node(int cpu, nodeid_t node); extern bool numa_off; extern int numa_fake; =20 --=20 2.25.1 From nobody Sat May 4 03:49:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=2; a=rsa-sha256; t=1628677556; cv=pass; d=zohomail.com; s=zohoarc; b=lZulxp3oFBE0zy4gDQHllRRPt0GOw8CyB21X0FsyNoSN9YtGackFo+Hc9dR7183aSlXrc3H6N1CHw9U0RCL5/qi39234WAxLwmRQ3ppV5VhGf/dn6/Fg0k8Rv8+mVyzAJ/t83n0KJwsqFPm1a/6tmF3f5T9qSAe/K19F52SBA6I= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628677556; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ADy+xgeVyGznBAi23oXEJ0cpv/hao8FwBoKS3LhfV94=; b=SFecDnDaw3YSpbQjLPlGGqNJJK2oyeLTnfyXubxjpsdTeq8fq6IAB8aMQNeaGH8LyDextLaA1prh9S2xhINP3YUB72lHzS7pNRZWAIW9jIx7YoR7m0UnkJXxacMjnDgf/Vp8FcMNeJH+3fGUxErOBwZFezb/6MusPEPJkNVLYEg= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1628677556499959.4821042282016; Wed, 11 Aug 2021 03:25:56 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.165656.302755 (Exim 4.92) (envelope-from ) id 1mDlQc-00066n-Ex; Wed, 11 Aug 2021 10:25:42 +0000 Received: by outflank-mailman (output) from mailman id 165656.302755; Wed, 11 Aug 2021 10:25:42 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlQc-00066a-Aw; Wed, 11 Aug 2021 10:25:42 +0000 Received: by outflank-mailman (input) for mailman id 165656; Wed, 11 Aug 2021 10:25:41 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlQb-0002Qj-F9 for xen-devel@lists.xenproject.org; Wed, 11 Aug 2021 10:25:41 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (unknown [40.107.8.81]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 75270a4c-fa8e-11eb-a052-12813bfff9fa; Wed, 11 Aug 2021 10:25:32 +0000 (UTC) Received: from DB6P192CA0004.EURP192.PROD.OUTLOOK.COM (2603:10a6:4:b8::14) by AM6PR08MB4785.eurprd08.prod.outlook.com (2603:10a6:20b:d2::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.19; Wed, 11 Aug 2021 10:25:26 +0000 Received: from DB5EUR03FT010.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:b8:cafe::8d) by DB6P192CA0004.outlook.office365.com (2603:10a6:4:b8::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:25:26 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT010.mail.protection.outlook.com (10.152.20.96) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.14 via Frontend Transport; Wed, 11 Aug 2021 10:25:26 +0000 Received: ("Tessian outbound ab45ca2b67bc:v101"); Wed, 11 Aug 2021 10:25:26 +0000 Received: from 7f71c6e7d59f.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 52B14470-63A4-42F3-8A67-DF6CC4B489BE.1; Wed, 11 Aug 2021 10:25:19 +0000 Received: from EUR01-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 7f71c6e7d59f.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 11 Aug 2021 10:25:19 +0000 Received: from DB6P18901CA0019.EURP189.PROD.OUTLOOK.COM (2603:10a6:4:16::29) by DB8PR08MB5018.eurprd08.prod.outlook.com (2603:10a6:10:e2::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.17; Wed, 11 Aug 2021 10:25:17 +0000 Received: from DB5EUR03FT038.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:16:cafe::57) by DB6P18901CA0019.outlook.office365.com (2603:10a6:4:16::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.15 via Frontend Transport; Wed, 11 Aug 2021 10:25:17 +0000 Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT038.mail.protection.outlook.com (10.152.21.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:25:17 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) 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.2308.14; Wed, 11 Aug 2021 10:25:05 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Wed, 11 Aug 2021 10:25:04 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 75270a4c-fa8e-11eb-a052-12813bfff9fa 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=ADy+xgeVyGznBAi23oXEJ0cpv/hao8FwBoKS3LhfV94=; b=mo0fZj35FtwR3/htoEDvlw2SrhHQ5zyZwhSDrLI9wzrfhyqTHOBnA3GuVJ/XMfOQ9x24PTPt6J6f7cWhhxFlzPJGcz547TYouJAXCA8FfOX9tzp5CQOZN7MYFpKlw9+l4ALcfjKlucrmw7BHqmZJkdeEvOGPx4gx7s6yRsMN7B4= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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; X-CheckRecipientChecked: true X-CR-MTA-CID: 36dbf6cfc345242e X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ItR46e+Tp3oAe3k6Ovqn+0ONCYcrgJvfjAqO9yb0N+sEADUQ3ZKx0OU1MKWhxRw5Lj6gqWdzSUbOPzzY3kB03Wkdl5gqAdFl2yzVtRmUkzPznF93W5dQKdOMY4RNNrR7oVpz9TFK3h/t1+AtW+O9RBDRoMMylUjH2kakzmMyUHecAQ6XVcNFtVPkswe9BdZqfLOclRQAWi62OW+yfBoWFgRTcnB5F6aU1PgJ9mPMPE/oIAugiDzpPgkaV2WBP0HgH37yTE3q2R+ndBivH8YooPbtKp4ZBiLCa5lJjvd6CjvYoGASwX99LyA6WVJU5cNSVl7/q3WULsblwWk3ZRS2vg== 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-SenderADCheck; bh=ADy+xgeVyGznBAi23oXEJ0cpv/hao8FwBoKS3LhfV94=; b=aQv45BfzL3yftAU1OyR5HS40OvD2yw55Qg38HLlWR4dphUMpCoMXnDKwxddIl8y6KaL5WKJ3eWfjLuUqBe1z2tBn5SqQHNKEg6zNZICdmE5WUy/Co6f1MdJyKcqBcr9C5YEdaW+h2xPZs1xxgZRTMCRu/9GkBjUzH3fdLpwRfpuHtLO0H6xdzBg/+7Tc3FaS2OdKLGSiwSS15L8IcOt5YkD+yNVh9eCwEh2BVWRtIthkBYS2iCjpH5TYz0gGb9X/l2jP7fENa9S8DIclPiYzUv6o1r2nld+xm/079tI8Qg3KbZZAka3aeNyY1Zw/zzuyZJ+DWIHdKUlrb5stcn//4Q== 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=ADy+xgeVyGznBAi23oXEJ0cpv/hao8FwBoKS3LhfV94=; b=mo0fZj35FtwR3/htoEDvlw2SrhHQ5zyZwhSDrLI9wzrfhyqTHOBnA3GuVJ/XMfOQ9x24PTPt6J6f7cWhhxFlzPJGcz547TYouJAXCA8FfOX9tzp5CQOZN7MYFpKlw9+l4ALcfjKlucrmw7BHqmZJkdeEvOGPx4gx7s6yRsMN7B4= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; 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; From: Wei Chen To: , , , , CC: Subject: [XEN RFC PATCH 14/40] xen/arm: set NUMA nodes max number to 64 by default Date: Wed, 11 Aug 2021 18:23:57 +0800 Message-ID: <20210811102423.28908-15-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210811102423.28908-1-wei.chen@arm.com> References: <20210811102423.28908-1-wei.chen@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8d07a97f-7976-4fdc-169a-08d95cb255e3 X-MS-TrafficTypeDiagnostic: DB8PR08MB5018:|AM6PR08MB4785: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:6108;OLM:6108; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: YRXEAQ/Lf0UimN46tOYD8IqThje9ugBnlMgdCmuaV01mqjAu6MwMEyrZkHIaIhPCYbGwbcqC2AHXREa+bV4MA1MxdEh8ehpSXwhZjRyoFwQGOEbUtwL81A1EjuiBBm+avsqOJFtgwUbaUwT5e8S44vkIC14Ck0FHPq1u1jPugyPEjSfGk9bEa3nljpjoK76hWQ6VyrI78o8tBoqvLTGL93Rervt892PQ34SokySm/uc91PBJQl0eOtDywUOQUDjKBwirjQoDOOFLF3u5wg2RezZu89vqE0nR2ZTTm8OykP0LWpbea71e0HLy6dtdeehjNyBJcUfiMxeUuRruNdoex8ZpncV6QN/UM5MhDSFYf+8flSu/9p69f7IEP2+6oT8LB8SixB2Hddyo5VK4jCUdlO/oEcFcJ5a7QFt4byNfSoYfJv8sfxRtoEFBCUMGXnC+S56s1ZxKiRBj2doL4lHdvv7YXnaI0kYMP/gH9wal74j4HMBDPj9qKAQtMauHFHbxpOPrHDcfS9B3cZs9JFKw9JGyf6/foRwgN9wSM4JjDSWHLomcka1r8iOUJQCmx+jjZ6+bafqmhHuxpLsJwfZcWLJx1kbIYMGhS8xT8esFA4FZTbpolmmYw02S1mExxoE570vOEOe9LUSPYu+7owPTjdGolDDmv+IG4imLxb+Lk0vR/vA9nnL4GJakSLJNjI439FIXTFBcdAuAPA0kM9w06sD1CIjdg/CfFkvCqVmLcW0za3c0wRV3puPUEPMKf1XKPINONEfuJYHzEzuMjhBZMwHVplrvW5iY3uwTaOrJRIE= 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:(4636009)(136003)(396003)(39860400002)(376002)(346002)(36840700001)(46966006)(26005)(186003)(1076003)(2906002)(70206006)(70586007)(356005)(7696005)(110136005)(5660300002)(4326008)(81166007)(83380400001)(478600001)(6666004)(82310400003)(316002)(8936002)(82740400003)(4744005)(36756003)(426003)(47076005)(36860700001)(86362001)(336012)(8676002)(44832011)(2616005)(34070700002)(36900700001)(2101003);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB5018 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT010.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 76f7e428-a6d0-4a74-14c0-08d95cb2509d X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cthx+Xdhu2tGj5nbPTFLYbxOe5FiejwLvd61QUYxkCB8XiuUDNiBFwum064tps9Mb396V13/A0GOrwpE9O+B7cXi095YsU+i7UJP/nWpq8Yv9qLc/XMIqO/BO/XzYppU3JBzFjLAbxehCaklNGdjAvsObxrB4ZYF2gav4XM7yXfeL29JSRM6fuZcY2gDq+hgq2nz4B7nCZ5YAYDwucmqTm+Qi8QcQssbBesymJOs7BITxhrQzH8SaK+dkYXAjTS1gLBqcLkC3qN4bCRJ8y86uAlGXdyny0aUauVwzmwhq+eSsqVmtmWdJ+S6Dgj+ir5nr2w8jbCSp7PAEVsewaGMMUb6BJRtbrV44CVCrOd/FTs3L6JIsACJtLl8IaMNLn5VhYAmZ9VLkAFkS4ZRZUiDJAhFZpMLuNZ4Q4IYoee4SSHec3vMj0kBgAUI+89qHmDPsiQaSvIU7BTwoCOPjE25aH5v7ORyBejDvq2NiVbes+POksiYppIn5IJwqmYYbBhykb7wrAeILpOHHysP8tPKqTSMhusKaBrpEbsgsm8jd09xph1u+srVTRq+QJ+NQcrCEMoxPvA3tWCouW3AGI7smaV6UufhRIBkhxPQOntZO0Uf3fYmhdKSzHSxRQ8e84Jj9Va8qBnLTsYHnwSy4Sc8YWQaXbFIt7Rlw/fPryzH6q5MtDIw+TXq9Z8ePpu82VsnA5fUBJeDhO416BeUMNZ2RY40d8yJUXJyOTlGuNSj9is= 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:(4636009)(376002)(136003)(39860400002)(346002)(396003)(36840700001)(46966006)(2616005)(316002)(4744005)(110136005)(6666004)(70586007)(1076003)(83380400001)(82310400003)(336012)(186003)(36860700001)(47076005)(4326008)(82740400003)(86362001)(81166007)(70206006)(7696005)(8676002)(8936002)(2906002)(36756003)(478600001)(5660300002)(44832011)(26005)(426003)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2021 10:25:26.4435 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8d07a97f-7976-4fdc-169a-08d95cb255e3 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: DB5EUR03FT010.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB4785 X-ZohoMail-DKIM: pass (identity @armh.onmicrosoft.com) X-ZM-MESSAGEID: 1628677558561100001 Content-Type: text/plain; charset="utf-8" Today's Arm64 systems can reach or exceed 16 NUMA nodes, so we set the number to 64 to match with x86. Signed-off-by: Wei Chen --- xen/include/asm-arm/numa.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/xen/include/asm-arm/numa.h b/xen/include/asm-arm/numa.h index 1162c702df..b2982f9053 100644 --- a/xen/include/asm-arm/numa.h +++ b/xen/include/asm-arm/numa.h @@ -5,7 +5,15 @@ =20 typedef u8 nodeid_t; =20 -#if !defined(CONFIG_NUMA) +#if defined(CONFIG_NUMA) + +/* + * Same as x86, we set the max number of NUMA nodes to 64 and + * set the number of NUMA memory block number to 128. + */ +#define NODES_SHIFT 6 + +#else =20 /* Fake one node for now. See also node_online_map. */ #define cpu_to_node(cpu) 0 --=20 2.25.1 From nobody Sat May 4 03:49:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=2; a=rsa-sha256; t=1628677926; cv=pass; d=zohomail.com; s=zohoarc; b=enIDQCrhbaaIRMGbfgpJMLO3juzSinjry5AoD3GgIcPF48Tmn6ZdI5chuImDwOazjL6KLYW94hg6tNhYZgMASDygJQob7ukmNEhmc6fCXXz8MaDAlrdAs61OIre4e6+AbTZqXulqNxRBPaAflTNJwWb680ud5bQ/ij+hCc6rxJY= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628677926; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=JGeH1SM1ROZ3KKy1kyx91+XnuUZdgjTfuLm34BheG1s=; b=hVlEIdKW8/Ci28wAoCeRlk0Ek5/1On+Tf9alRNwv0nLQ2YFZljSgkFbpVA4lEaDKoGIusOt6krBddxkaQawL1dGWZr4qWu6M+4Motk3wDSh2iodAOrO4XLlKJJo8oFLnPoMGJ0PtFIh5auCrqlmKrO6wJdZm0ojh/mKZ2cHpTfU= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1628677926831807.5020174944913; Wed, 11 Aug 2021 03:32:06 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.165791.303023 (Exim 4.92) (envelope-from ) id 1mDlWa-00043O-1K; Wed, 11 Aug 2021 10:31:52 +0000 Received: by outflank-mailman (output) from mailman id 165791.303023; Wed, 11 Aug 2021 10:31:51 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlWZ-00040K-7t; Wed, 11 Aug 2021 10:31:51 +0000 Received: by outflank-mailman (input) for mailman id 165791; Wed, 11 Aug 2021 10:31:48 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlRe-0002Qj-H9 for xen-devel@lists.xenproject.org; Wed, 11 Aug 2021 10:26:46 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (unknown [40.107.22.48]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 8a308062-fa8e-11eb-a052-12813bfff9fa; Wed, 11 Aug 2021 10:26:08 +0000 (UTC) Received: from AM6PR02CA0007.eurprd02.prod.outlook.com (2603:10a6:20b:6e::20) by PAXPR08MB6969.eurprd08.prod.outlook.com (2603:10a6:102:1d8::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.21; Wed, 11 Aug 2021 10:26:02 +0000 Received: from AM5EUR03FT019.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:6e:cafe::d2) by AM6PR02CA0007.outlook.office365.com (2603:10a6:20b:6e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.13 via Frontend Transport; Wed, 11 Aug 2021 10:26:02 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT019.mail.protection.outlook.com (10.152.16.104) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.14 via Frontend Transport; Wed, 11 Aug 2021 10:26:02 +0000 Received: ("Tessian outbound 8529ae990a93:v101"); Wed, 11 Aug 2021 10:26:01 +0000 Received: from b47833e060a2.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 486DFEB5-3FA9-44D3-ACBC-B81E404EA8F5.1; Wed, 11 Aug 2021 10:25:23 +0000 Received: from EUR01-DB5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id b47833e060a2.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 11 Aug 2021 10:25:23 +0000 Received: from DB9PR06CA0020.eurprd06.prod.outlook.com (2603:10a6:10:1db::25) by VI1PR08MB3901.eurprd08.prod.outlook.com (2603:10a6:803:c3::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.14; Wed, 11 Aug 2021 10:25:21 +0000 Received: from DB5EUR03FT012.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:1db:cafe::96) by DB9PR06CA0020.outlook.office365.com (2603:10a6:10:1db::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.13 via Frontend Transport; Wed, 11 Aug 2021 10:25:21 +0000 Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT012.mail.protection.outlook.com (10.152.20.161) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:25:21 +0000 Received: from AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2308.14; Wed, 11 Aug 2021 10:25:08 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Wed, 11 Aug 2021 10:25:09 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Wed, 11 Aug 2021 10:25:06 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 8a308062-fa8e-11eb-a052-12813bfff9fa 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=JGeH1SM1ROZ3KKy1kyx91+XnuUZdgjTfuLm34BheG1s=; b=xVtSh09tZM5DeaRSF76/ukS+CwJYT4O3RLztNDPoDsHAouDweOp7z61MfdeNIyhgKKUlq2iEryRQQfbhDW/KQuZCqxTfw90raH9fJZcSPv/Zzg7En6pcT/Vdpobw1CoRig0LD+QCRX12jv6eyLIR2uRBcbpYWwlUaOti+TtmVdw= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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; X-CheckRecipientChecked: true X-CR-MTA-CID: d6e8adb5d83350f2 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XJLFbiz0+2S4OvTIOXalxLNggoVsK524UZamCZGpTbMYU660dtmt+BbSDyegth+r/nVGFz/oFFMedLPtpbnyzRWn27IWGYyZQLe6BG/4t91VCpMGaUmCfDFXZSBSytxdvX5s9MEXsK0RbLsUjyvCgj5h+0Ov3jMI4OCPx9ETu1wZOb7KKl01hOB714LDn8gWrEe4l1fb8LpKmiGt1KqEQW5ko4j6Gj5K12ncqsvS+v56u1r7xY8pxjSF2GQykIXLssbmTWTerf9DJhb6KEUCkOLYXUL0I4qfksfXC/pFxeFkTgmk4CLSZ0rRtR7qdA6KNoJZmwbskFpzi5R3QMVZGw== 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-SenderADCheck; bh=JGeH1SM1ROZ3KKy1kyx91+XnuUZdgjTfuLm34BheG1s=; b=PsZKMbNDKOESPkIsfbNnXau+QFjUOgKAxdNSp+0HCBSl710NeWVVoakOgdX0r3/i5W52BKhK/rN79XaMy3Ss/Dm8F6Pr/0vptYTYXX0SU1bLWsFryhRGBqfB8/kfg2cqh+BV4fE4TN3yvUITS6t0Df/qWvOYGfGcwYdgjQIzodu44CwbyFhEneWZWXRYfaY95sFvY3d9MGEe8L+ZgZ059+KSu6vKHOfL3G/T7Cp5+FcTP95pvlkThoSgmRPKwVbRvp26d7PNBXcKofNTrpBvaFhPAlqB/MKCX1H9InRy1GZluDc6o3ROD3ZH6+KZKWk7cCN8gtzEudRx0E+saQAT+Q== 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=JGeH1SM1ROZ3KKy1kyx91+XnuUZdgjTfuLm34BheG1s=; b=xVtSh09tZM5DeaRSF76/ukS+CwJYT4O3RLztNDPoDsHAouDweOp7z61MfdeNIyhgKKUlq2iEryRQQfbhDW/KQuZCqxTfw90raH9fJZcSPv/Zzg7En6pcT/Vdpobw1CoRig0LD+QCRX12jv6eyLIR2uRBcbpYWwlUaOti+TtmVdw= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; 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; From: Wei Chen To: , , , , CC: Subject: [XEN RFC PATCH 15/40] xen/x86: move NUMA API from x86 header to common header Date: Wed, 11 Aug 2021 18:23:58 +0800 Message-ID: <20210811102423.28908-16-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210811102423.28908-1-wei.chen@arm.com> References: <20210811102423.28908-1-wei.chen@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d2f0d2cf-9192-4a18-45e6-08d95cb26b28 X-MS-TrafficTypeDiagnostic: VI1PR08MB3901:|PAXPR08MB6969: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:5797;OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: HiPW7Kbzdby7W47tWGyG4WhXOdKENTp0OMW3E9xVQlDTku94lkwiM+d5FY8a/WfXOtKYNF4ncRXjz2XlUDheiuZhQaB+gBD1U2H+2BYbuwjTOnod4Oh95rz1bs8Ui+ubdPzHd6yUKLUUZeysXveGqebHa2mRsPSdto221K1SpT17HOqzFZjbV1ybaFdjWzqzvpVu38wQxxi+2J7zh2lppiNsA2lgOHiMkP+KJvrWu4DDTCsbD7wsGF9hMVhdE6dGpXxX5IrUzT+9SvdYOymycVn4T7RObRU9xmvspH6JP1Mieub4Gy/crQ6VECpR2jGMB5pC46EVxQa194VEO7Kkk69tDo3OGQ9ZTHo11b5/jbID3cnx/z5tvNAs2qEc/VwHu53GT4oNlJ/1zll6ucZQNyM+0xWwnzHk9ffVYF9lcTSW60QUcLrDfiD3DbFu79+740J6UgCnE+XDeQvX0U0bCx9Dizix6A0a/psfhgOfb2VeXcY3fm0VYLjTMwAr++qNOQph0KWGSLUY/PPqQWn6gRiDAZ7PQDgp4MCoG5eLC7DR2MbsTPIOAMLnICOiEHMjAcm0yzaCzlU5NlS3YDJWfLeZO+XexqSwMRw6yUtoFKD6TLyxBeq9jvkuWzSMLLMIz6e80JE9T6GxUloATeUuWY21neE523Rl9NBpl7QBmZ0s3lot2gOVjGUm1j7Fu9imy4jM5SjQcfSXmnQ5cMIVHAmr1Z0x1YtFKBxle8cq+rhoRiA+cSjX2BZ7gUihmIOgpt2Q7BCClZFQ85nK1ARU9TEW2VA1HbA/8biScjw8E3g= 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:(4636009)(346002)(376002)(396003)(39850400004)(136003)(36840700001)(46966006)(110136005)(356005)(47076005)(44832011)(70206006)(7696005)(186003)(83380400001)(316002)(36756003)(2616005)(1076003)(70586007)(8676002)(86362001)(81166007)(82310400003)(2906002)(478600001)(4326008)(82740400003)(6666004)(26005)(8936002)(36860700001)(426003)(34070700002)(336012)(5660300002)(36900700001)(2101003);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB3901 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT019.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: e018031b-5ed4-4a7f-90ed-08d95cb2531e X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5xBQpIJmVi2pgyjabR2+4HCUYVJRt6jYMJWhkJ6ActgRQP3RicJ7CmoR16VTCLzWaV+LMT4Mv2CNuTBNkSuEkcO6XiZhPa7stGp4la/0w1AhEw040+pA3sQy7Zzda8mC69T7NYQGzjL7Jx3HKVUJNOMHC0eJlv4hqFxsuSokV2wX/e3f6hx/ozHGBp7w0yk6NwHcLbh2QLmmijbXSVCSPDykDGHgX9utL0JTf0ALVvYNcsobwbIEDTuq6a2/EsfBgLKIE/jW7NlT7AERj/F71rUbHj2DLe3WR5GcDKShnRPI23dccbaARguX1Bew6IM4ZYajDILzK+mW3Y8V1KrYlOMplqyuSrEmoBbYT7inSUtHTbhrjt4cRxp4iheEiQYN7ZNL4bGSZmHSRukFBPlJPMOh35Hc6UQDJHqEgKT1amNWPHdPRXtYy9HlkTM0VZ8fhAqCq0tcWIChjuygqisq1EUrho40M69sTuoYC5QiSPrU/v41NBXxtkarefxV5abf0i36dnf10oGESzuGBrrE7Hw9ZRABbArCrz8K1IST9MLdma0KuWTUHGvlSAhynOPNpHXusIqdM2eQMofW/+/qsR8w1KQPVg1jOrscG7WJ/zQwRBkYPoVv2beEwkeLXKbmf0xoFNlY8VykUouP4nZdtE9bJaO7l9Zkbvkvl2QlFf4qyy6SnRcOOvqZn5/Ue9v3Cr6wvVR2D5uufKPkveTl1WTfNvGEvqE+b7n/YXiXPBg= 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:(4636009)(376002)(396003)(39850400004)(346002)(136003)(46966006)(36840700001)(2616005)(316002)(426003)(44832011)(1076003)(82310400003)(36860700001)(110136005)(47076005)(5660300002)(2906002)(7696005)(478600001)(186003)(86362001)(336012)(81166007)(70206006)(4326008)(8676002)(83380400001)(70586007)(82740400003)(26005)(8936002)(36756003)(6666004)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2021 10:26:02.0841 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d2f0d2cf-9192-4a18-45e6-08d95cb26b28 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: AM5EUR03FT019.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB6969 X-ZohoMail-DKIM: pass (identity @armh.onmicrosoft.com) X-ZM-MESSAGEID: 1628677928349100001 Content-Type: text/plain; charset="utf-8" As all functions and macros that depends on these NUMA API, like clear_node_cpumask, have been moved to common header file. In this case, we can move NUMA API from x86 header file to common header file, and will not trigger the symbols not found error when functions in arch NUMA header file depends on the symbols in common NUMA header file. Signed-off-by: Wei Chen --- xen/include/asm-x86/numa.h | 13 ------------- xen/include/xen/numa.h | 13 +++++++++++++ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/xen/include/asm-x86/numa.h b/xen/include/asm-x86/numa.h index 69859b0a57..5a57a51e26 100644 --- a/xen/include/asm-x86/numa.h +++ b/xen/include/asm-x86/numa.h @@ -9,14 +9,6 @@ typedef u8 nodeid_t; =20 extern int srat_rev; =20 -extern nodeid_t cpu_to_node[NR_CPUS]; -extern cpumask_t node_to_cpumask[]; - -#define cpu_to_node(cpu) (cpu_to_node[cpu]) -#define parent_node(node) (node) -#define node_to_first_cpu(node) (__ffs(node_to_cpumask[node])) -#define node_to_cpumask(node) (node_to_cpumask[node]) - extern nodeid_t pxm_to_node(unsigned int pxm); =20 #define ZONE_ALIGN (1UL << (MAX_ORDER+PAGE_SHIFT)) @@ -28,11 +20,6 @@ extern void srat_detect_node(int cpu); extern nodeid_t apicid_to_node[]; extern void init_cpu_to_node(void); =20 -static inline void clear_node_cpumask(int cpu) -{ - cpumask_clear_cpu(cpu, &node_to_cpumask[cpu_to_node(cpu)]); -} - void srat_parse_regions(u64 addr); extern u8 __node_distance(nodeid_t a, nodeid_t b); unsigned int arch_get_dma_bitsize(void); diff --git a/xen/include/xen/numa.h b/xen/include/xen/numa.h index 3972aa6b93..cb08d2eca9 100644 --- a/xen/include/xen/numa.h +++ b/xen/include/xen/numa.h @@ -22,6 +22,14 @@ /* The following content can be used when NUMA feature is enabled */ #if defined(CONFIG_NUMA) =20 +extern nodeid_t cpu_to_node[NR_CPUS]; +extern cpumask_t node_to_cpumask[]; + +#define cpu_to_node(cpu) (cpu_to_node[cpu]) +#define parent_node(node) (node) +#define node_to_first_cpu(node) (__ffs(node_to_cpumask[node])) +#define node_to_cpumask(node) (node_to_cpumask[node]) + /* Simple perfect hash to map pdx to node numbers */ extern int memnode_shift; extern unsigned long memnodemapsize; @@ -76,6 +84,11 @@ extern int numa_fake; =20 extern void setup_node_bootmem(nodeid_t nodeid, u64 start, u64 end); =20 +static inline void clear_node_cpumask(int cpu) +{ + cpumask_clear_cpu(cpu, &node_to_cpumask[cpu_to_node(cpu)]); +} + #endif /* CONFIG_NUMA */ =20 #endif /* _XEN_NUMA_H */ --=20 2.25.1 From nobody Sat May 4 03:49:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=2; a=rsa-sha256; t=1628677887; cv=pass; d=zohomail.com; s=zohoarc; b=anKrlvNLJH699xUme3XV5hh0caat6OMKdWZlG/QleOY8cqxHvgYDHr5JGZ7RsGw6+FzJ8IMNckv0V5iUqSF2spbYWEcLLPy9XvukpMShUBQRof6JUZfzIVFmtR9wsiT00LydbGguOxFkGSgUsxqW7hXeUfAZkWhWpj64V68O0Jo= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628677887; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=q2kC8piroqCMG6BjsTu+cHiImjGbMH3XMGZi5wNR5AE=; b=GuQIF4qU4ues69gKQDrAv7secOrPFHhri7maSnyGzH6GvnzSm2gyBi1ANTOByWjTConIFSvVNn3F65qxCasq5GxeKGTabbj7tUO/XplvaWPoQfC19izcDPoUDOo+FthnPb7H1645SCQMFjCaA1RgBIbl0XvU3+O66yvCTZ5exCM= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1628677887222435.8053122130292; Wed, 11 Aug 2021 03:31:27 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.165703.302841 (Exim 4.92) (envelope-from ) id 1mDlVt-00037F-9u; Wed, 11 Aug 2021 10:31:09 +0000 Received: by outflank-mailman (output) from mailman id 165703.302841; Wed, 11 Aug 2021 10:31: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 1mDlVs-00034W-Lj; Wed, 11 Aug 2021 10:31:08 +0000 Received: by outflank-mailman (input) for mailman id 165703; Wed, 11 Aug 2021 10:31:07 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlR7-0000BQ-Dz for xen-devel@lists.xenproject.org; Wed, 11 Aug 2021 10:26:13 +0000 Received: from EUR03-AM5-obe.outbound.protection.outlook.com (unknown [40.107.3.42]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 5bd42a6d-93c6-42fe-8e7d-367cca279870; Wed, 11 Aug 2021 10:25:31 +0000 (UTC) Received: from DB6PR1001CA0028.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:4:55::14) by VI1PR0801MB1869.eurprd08.prod.outlook.com (2603:10a6:800:88::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.19; Wed, 11 Aug 2021 10:25:29 +0000 Received: from DB5EUR03FT005.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:55:cafe::ce) by DB6PR1001CA0028.outlook.office365.com (2603:10a6:4:55::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.15 via Frontend Transport; Wed, 11 Aug 2021 10:25:29 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT005.mail.protection.outlook.com (10.152.20.122) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:25:29 +0000 Received: ("Tessian outbound 7b804b1d9bbf:v101"); Wed, 11 Aug 2021 10:25:29 +0000 Received: from 62d2127e0534.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 203BACA2-52EE-4AFA-A944-1E75A2440C43.1; Wed, 11 Aug 2021 10:25:23 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 62d2127e0534.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 11 Aug 2021 10:25:23 +0000 Received: from DB8PR04CA0019.eurprd04.prod.outlook.com (2603:10a6:10:110::29) by AM0PR08MB5089.eurprd08.prod.outlook.com (2603:10a6:208:15b::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.13; Wed, 11 Aug 2021 10:25:21 +0000 Received: from DB5EUR03FT054.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:110:cafe::3b) by DB8PR04CA0019.outlook.office365.com (2603:10a6:10:110::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.17 via Frontend Transport; Wed, 11 Aug 2021 10:25:21 +0000 Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT054.mail.protection.outlook.com (10.152.20.248) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:25:21 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) 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.2308.14; Wed, 11 Aug 2021 10:25:10 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Wed, 11 Aug 2021 10:25:08 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 5bd42a6d-93c6-42fe-8e7d-367cca279870 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=q2kC8piroqCMG6BjsTu+cHiImjGbMH3XMGZi5wNR5AE=; b=nvCsyurQgJO7ZLRAmbbnhRz3fuGj+PKvAlcJ2qRtYUcR/v4vJfMIEFC04Iz9ZUf2gQWk6MLRn3XxBP5LgxfKgO2UgguVC5xXOLU4CmEOi0FPaA6nPz7iS69j+JnnniKUMIAm8eqvfV9DegadhsjB4WC8MA8dzv56CYxAQ6E2FCM= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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; X-CheckRecipientChecked: true X-CR-MTA-CID: d158891a400b4171 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=E2pFLTuOdbm9rqxgCbIbqjDsaJGGOmnzNC2LJXNOdsMzQisYS6skl0EyT/E+7GfaOVXPZQlb7rhbRPyMc+HUwyLpUJ6UhWvLtXapjYsWdelVTa67JHWcbAsFIZy3Gwm0/dW0W8/gw8anAX8zraHlXBnyTpKs0ilcURuR6VcB0yFFRe17DbGIyB5CJi/GDjULyamvSmPQFrjBn7g9CoCuz9p6SBEDhVZoA87TnyHGnVnlrFb+LoXwocsTwInE/YCPrnS9UGaoovQDnfSJHqyyHJf89vQPRuoHVuvU6cCVgNp8qhmLOB9Yza8dtqbxKZpGVPVSkyHyrZyUgOeXvpHAmw== 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-SenderADCheck; bh=q2kC8piroqCMG6BjsTu+cHiImjGbMH3XMGZi5wNR5AE=; b=hDJcUfCOISeGZKNCF2LVWPh/mvQl7f9eRhTt9ZmgapdtAd0LkEICbFXWBiyOD+AtNVqQ3Dr2wvb91qaFlckQy75ykk8vZtyfX5nOAMAxAk44KZKX8Nm1RkUIp7R9rMXUcSvlA71HpNCb+ADCz70z0/P8pb4DAz8E72BKf5JGLckD0mSnBUjCsIDLYLP1f0S1VWuf8ZexMPCsN3NciNezZoy4FJZxWPI+UcQaXGqiiHVqKATrKg/5ApegPHpJN+VbMWqWsknRX0YgQOrt65wU6vQ886K/Vi6J5EUf4zNZ6sK7NKSaamCx28HXc3knnZNQDgPaz4X3rxoUROUEWOalGA== 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=q2kC8piroqCMG6BjsTu+cHiImjGbMH3XMGZi5wNR5AE=; b=nvCsyurQgJO7ZLRAmbbnhRz3fuGj+PKvAlcJ2qRtYUcR/v4vJfMIEFC04Iz9ZUf2gQWk6MLRn3XxBP5LgxfKgO2UgguVC5xXOLU4CmEOi0FPaA6nPz7iS69j+JnnniKUMIAm8eqvfV9DegadhsjB4WC8MA8dzv56CYxAQ6E2FCM= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; 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; From: Wei Chen To: , , , , CC: Subject: [XEN RFC PATCH 16/40] xen/arm: Create a fake NUMA node to use common code Date: Wed, 11 Aug 2021 18:23:59 +0800 Message-ID: <20210811102423.28908-17-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210811102423.28908-1-wei.chen@arm.com> References: <20210811102423.28908-1-wei.chen@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 278ff1cc-1184-460b-c768-08d95cb25787 X-MS-TrafficTypeDiagnostic: AM0PR08MB5089:|VI1PR0801MB1869: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:1169;OLM:1169; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: yOBWMeB91wpoaksoiU82B2AXNrO2LGG6cpB/h42bAr5rWGZyNEWDI+ODJDBZUFTGOca+sU21eKjyEG1BTlcDuz6YWmdf+P9sInzzV19DftmqOUM77ze9GT0nYjw5iCuv9Q4aJz//KUR6mlehgUw+qCTbRnpcXGLFaiKZCv50zkWHnh+MHFjwUq38eAP+bTLILPD2vwoqMBOhcdbMDVbB+GN1LV37UtEGJhNXufJT6oBEV2+W9NJQ5ErRbbRw4fr8Reyz60Jy7sTFs5hkJKs80Vnw7SCp2AVjlkyjGy1DxHaAUHUChRlEvigHF+qGsVwwNvT1dqtN7AfimiF5AyYSBhnkBl6McOPDATIsLytwDT1ooPn4Qp2UPW1IMg6UkTDfHry3iql6HZXGVIAqIoxEzIAH2sg4GxqBYHnmo29IsCugKE1H7GOuhx63iIQecyossGLf9d/b1J48f9BTf+Jjv7mt3ocRz7xDK49X972ZTpefphdWcxaZUJGwz5INerZLKICxodAVqmXzD5LUAw0YPwbwQHSKvLEucRCy1Ot7sFaCCJ3QF06EYzuWZm1c0BlBXJ+wDGQNZCzEYwASEAleM0UtbnGa+ZWUtmgos/8J0KsKVn0KrWIckNhDDc6ej622wbWRp8KxZdwqvXh+P3DBCY2PwtcZwkHKCwqYwKst85RO3qFS6QC0KRkIddEXopDXaL3gA092OlBTFrlMR6E5JIRT2dMq7b1PRppygmHAqdV9LJ1KlS8bErfR92DjW2VuY35M5drb8zzNA0D4GR52XiBrtsKqEACVLd7z0zyRu84= 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:(4636009)(346002)(39860400002)(136003)(376002)(396003)(36840700001)(46966006)(26005)(478600001)(426003)(34070700002)(36756003)(86362001)(5660300002)(4326008)(6666004)(1076003)(82740400003)(316002)(81166007)(110136005)(2906002)(2616005)(36860700001)(186003)(44832011)(8676002)(70586007)(70206006)(8936002)(7696005)(82310400003)(356005)(336012)(83380400001)(47076005)(2101003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB5089 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT005.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 4d976adf-232e-44e0-0fcf-08d95cb252df X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Y5xQ5a+Cy1WpSp3DqvaVUJ9hdj2YZftzdHp7NMNbdpjPDgOPx3FTiuM4T1VEUpaGZJO7e+5icvPpW/tk8lUJLYlwPOayuO6hjaGSLP3gycjnJjvgGg9JUu14GOs5I2nzTkigysyjgn4Os7UVFIRtKVLseHArKJgb5pCYuhML8O2qW3Z+7ZQxY73H7MRZmaYGIXuCvtjxzgxUVOK8LJ/EtI1vlR/6Y12I8FExWdwIaO+/9DnBC6w7f5lDreXjtPsxXtZXVeOKxibC32vJSfWWsrFUrHQ19A6mo5DxizPZ4aM8p3r1+j0akw4Urahn61l0rG7Z/AmqopQcEeqPnsSDpL2ugRpefQrdkkbfIE1Em+RD4nLGnZggvVf4FpN8HyF+tnxTC2cPvHjA2JcGHS08zdJT6rawpJLIaWB7PtDBnfFbDnBMD1y3Nr3ZDIl9fchq593RmGTDbu7uJE47auHjAAEqwYaML6rWALVxZXC733iKhzqfzAoR4qLxHuW8p/p58dbYEnbH3M8k7BcY64nFppgx4pgUBCsd4BRcRq/9sZF9CD/fCUqimeCj5ENgmqw5Lj7cxgSua6rhPqKC2cE7aLoRPKPo/40nrwpq6GdFRsvWzuQ9wnDpOP7TRa4MZwBB2ElRs1ehwGG9qjBhm0krffRSPkQ6fcrWLi3CIrLTR9c2huknH8CKRKxC/hoTQxpATQiGDmYvomdADyWnMZ1MnTcKVEche7HdeDEbYZb2jzg= 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:(4636009)(39850400004)(396003)(376002)(346002)(136003)(46966006)(36840700001)(83380400001)(110136005)(2616005)(1076003)(47076005)(8936002)(426003)(44832011)(36756003)(2906002)(478600001)(86362001)(70206006)(7696005)(26005)(6666004)(81166007)(70586007)(36860700001)(186003)(336012)(82310400003)(4326008)(316002)(8676002)(5660300002)(82740400003)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2021 10:25:29.2016 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 278ff1cc-1184-460b-c768-08d95cb25787 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: DB5EUR03FT005.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0801MB1869 X-ZohoMail-DKIM: pass (identity @armh.onmicrosoft.com) X-ZM-MESSAGEID: 1628677888095100001 Content-Type: text/plain; charset="utf-8" When CONFIG_NUMA is enabled for Arm, Xen will switch to use common NUMA API instead of previous fake NUMA API. Before we parse NUMA information from device tree or ACPI SRAT table, we need to init the NUMA related variables, like cpu_to_node, as single node NUMA system. So in this patch, we introduce a numa_init function for to initialize these data structures as all resources belongs to node#0. This will make the new API returns the same values as the fake API has done. Signed-off-by: Wei Chen --- xen/arch/arm/numa.c | 53 ++++++++++++++++++++++++++++++++++++++ xen/arch/arm/setup.c | 8 ++++++ xen/include/asm-arm/numa.h | 11 ++++++++ 3 files changed, 72 insertions(+) diff --git a/xen/arch/arm/numa.c b/xen/arch/arm/numa.c index 1e30c5bb13..566ad1e52b 100644 --- a/xen/arch/arm/numa.c +++ b/xen/arch/arm/numa.c @@ -20,6 +20,8 @@ #include #include #include +#include +#include =20 void numa_set_node(int cpu, nodeid_t nid) { @@ -29,3 +31,54 @@ void numa_set_node(int cpu, nodeid_t nid) =20 cpu_to_node[cpu] =3D nid; } + +void __init numa_init(bool acpi_off) +{ + uint32_t idx; + paddr_t ram_start =3D ~0; + paddr_t ram_size =3D 0; + paddr_t ram_end =3D 0; + + printk(XENLOG_WARNING + "NUMA has not been supported yet, NUMA off!\n"); + /* Arm NUMA has not been implemented until this patch */ + numa_off =3D true; + + /* + * Set all cpu_to_node mapping to 0, this will make cpu_to_node + * function return 0 as previous fake cpu_to_node API. + */ + for ( idx =3D 0; idx < NR_CPUS; idx++ ) + cpu_to_node[idx] =3D 0; + + /* + * Make node_to_cpumask, node_spanned_pages and node_start_pfn + * return as previous fake APIs. + */ + for ( idx =3D 0; idx < MAX_NUMNODES; idx++ ) { + node_to_cpumask[idx] =3D cpu_online_map; + node_spanned_pages(idx) =3D (max_page - mfn_x(first_valid_mfn)); + node_start_pfn(idx) =3D (mfn_x(first_valid_mfn)); + } + + /* + * Find the minimal and maximum address of RAM, NUMA will + * build a memory to node mapping table for the whole range. + */ + ram_start =3D bootinfo.mem.bank[0].start; + ram_size =3D bootinfo.mem.bank[0].size; + ram_end =3D ram_start + ram_size; + for ( idx =3D 1 ; idx < bootinfo.mem.nr_banks; idx++ ) + { + paddr_t bank_start =3D bootinfo.mem.bank[idx].start; + paddr_t bank_size =3D bootinfo.mem.bank[idx].size; + paddr_t bank_end =3D bank_start + bank_size; + + ram_size =3D ram_size + bank_size; + ram_start =3D min(ram_start, bank_start); + ram_end =3D max(ram_end, bank_end); + } + + numa_initmem_init(PFN_UP(ram_start), PFN_DOWN(ram_end)); + return; +} diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c index 63a908e325..3c58d2d441 100644 --- a/xen/arch/arm/setup.c +++ b/xen/arch/arm/setup.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -874,6 +875,13 @@ void __init start_xen(unsigned long boot_phys_offset, /* Parse the ACPI tables for possible boot-time configuration */ acpi_boot_table_init(); =20 + /* + * Try to initialize NUMA system, if failed, the system will + * fallback to uniform system which means system has only 1 + * NUMA node. + */ + numa_init(acpi_disabled); + end_boot_allocator(); =20 /* diff --git a/xen/include/asm-arm/numa.h b/xen/include/asm-arm/numa.h index b2982f9053..bb495a24e1 100644 --- a/xen/include/asm-arm/numa.h +++ b/xen/include/asm-arm/numa.h @@ -13,6 +13,16 @@ typedef u8 nodeid_t; */ #define NODES_SHIFT 6 =20 +extern void numa_init(bool acpi_off); + +/* + * Temporary for fake NUMA node, when CPU, memory and distance + * matrix will be read from DTB or ACPI SRAT. The following + * symbols will be removed. + */ +extern mfn_t first_valid_mfn; +#define __node_distance(a, b) (20) + #else =20 /* Fake one node for now. See also node_online_map. */ @@ -35,6 +45,7 @@ extern mfn_t first_valid_mfn; #define node_start_pfn(nid) (mfn_x(first_valid_mfn)) #define __node_distance(a, b) (20) =20 +#define numa_init(x) do { } while (0) #define numa_set_node(x, y) do { } while (0) =20 #endif --=20 2.25.1 From nobody Sat May 4 03:49:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=2; a=rsa-sha256; t=1628677567; cv=pass; d=zohomail.com; s=zohoarc; b=Q0AxL6VLhcXHhfydi2Jpw1oLnCVS9PR+45dt8RzPUdAlBlj7cVCOKDnELHw7dJca/X9Tq/5V5Telt4SrCaqSzpxWnChe4ju4wJqVf7vTfwb0bp2/ZWQQr3pIJwH2IEh7s2Nz2QxnSIFGIz6C7IUG7XbGxMc1UaBp2u964Oubcuk= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628677567; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=7SbFnreLB3IizsJ3DjqNZm/eCO7EB4EsDPVZsBU4wsY=; b=ZpDZ6EB7BZkvdsUMylmaDwDX4iAbMdv0/1CRO9sDrfsJCPTFgVF9dGAE00xne2cS2SzIFEFxk9g60+fxGC9AjK0Tl9xSro6W+CDHcnClskzYUXG8geOLucmwJyTchs9PryhG89HouSmpxIWVuSY+lKv36Igst54+S4SMAhp6Mog= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1628677567010599.8514289218434; Wed, 11 Aug 2021 03:26:07 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.165667.302766 (Exim 4.92) (envelope-from ) id 1mDlQn-0007Hf-12; Wed, 11 Aug 2021 10:25:53 +0000 Received: by outflank-mailman (output) from mailman id 165667.302766; Wed, 11 Aug 2021 10:25:52 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlQm-0007HU-TY; Wed, 11 Aug 2021 10:25:52 +0000 Received: by outflank-mailman (input) for mailman id 165667; Wed, 11 Aug 2021 10:25:51 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlQl-0002Qj-FY for xen-devel@lists.xenproject.org; Wed, 11 Aug 2021 10:25:51 +0000 Received: from EUR02-HE1-obe.outbound.protection.outlook.com (unknown [40.107.1.61]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 761e8696-fa8e-11eb-a052-12813bfff9fa; Wed, 11 Aug 2021 10:25:34 +0000 (UTC) Received: from PR3P195CA0013.EURP195.PROD.OUTLOOK.COM (2603:10a6:102:b6::18) by AM5PR0802MB2417.eurprd08.prod.outlook.com (2603:10a6:203:9c::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.21; Wed, 11 Aug 2021 10:25:33 +0000 Received: from VE1EUR03FT054.eop-EUR03.prod.protection.outlook.com (2603:10a6:102:b6:cafe::b8) by PR3P195CA0013.outlook.office365.com (2603:10a6:102:b6::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.15 via Frontend Transport; Wed, 11 Aug 2021 10:25:32 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT054.mail.protection.outlook.com (10.152.19.64) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:25:32 +0000 Received: ("Tessian outbound d9f41274f41a:v101"); Wed, 11 Aug 2021 10:25:32 +0000 Received: from f06cc1c132ec.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 818B36B5-F871-4F84-A4B3-FA7113A418E4.1; Wed, 11 Aug 2021 10:25:26 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id f06cc1c132ec.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 11 Aug 2021 10:25:26 +0000 Received: from DB9PR06CA0026.eurprd06.prod.outlook.com (2603:10a6:10:1db::31) by VE1PR08MB4656.eurprd08.prod.outlook.com (2603:10a6:802:a8::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.14; Wed, 11 Aug 2021 10:25:23 +0000 Received: from DB5EUR03FT012.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:1db:cafe::66) by DB9PR06CA0026.outlook.office365.com (2603:10a6:10:1db::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.15 via Frontend Transport; Wed, 11 Aug 2021 10:25:23 +0000 Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT012.mail.protection.outlook.com (10.152.20.161) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:25:23 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) 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.2308.14; Wed, 11 Aug 2021 10:25:13 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Wed, 11 Aug 2021 10:25:11 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 761e8696-fa8e-11eb-a052-12813bfff9fa 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=7SbFnreLB3IizsJ3DjqNZm/eCO7EB4EsDPVZsBU4wsY=; b=YmvlLPcmkIyGG31nDBHMyKSwhBbeQwaqQBaG6SS8N9IGIewfTaLd0/RHLBeXdiQGO1TfoVZWU42x77dOy/lRgtnzCHfKH8XjXIZNgSq4uycFJZyZFKdmZxi2MgDigpuqdhClyhsQqM8nhkwpgkXe3LWst+XqcUX519W2/CuLBSU= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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; X-CheckRecipientChecked: true X-CR-MTA-CID: 5a0fe43bf5988e56 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RQ+RBwdFlSVVVPpbdZqHDCmKFycjWqM6DyzKsBZXTF/tagjQPs4zwMqzZO8/s94jgvKLSli7/qi2xwdmQMOScaIKStTl0FUKAMw+izz3YWH/RWkB4Uc7oUTU8yHcPZbXYx5CnXT2joxUhPbhauzrNVl9lp0xH5zrabI4jHEURqiMGURTo9Hhv8Ra9mjKejDGYQxc1opcAn0ph3dMf6MaKxcgHMa29zo+5rGdf8zSu3xvV4WnKjmcwMXabjrWwnIc5QXOogAi5DQ9ShXLvb2QODpgEt73nee+HlWLS4mJinEM9RjDHy+hl2N4duOA6OSq4IoAnL2ObyXKpwLfg8izcg== 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-SenderADCheck; bh=7SbFnreLB3IizsJ3DjqNZm/eCO7EB4EsDPVZsBU4wsY=; b=H3EfLvwR6tkPFcBj1XiqLTVOTG4YXFn+ErTmePLpuBi/ix9PEd1JGvyPC1ynOfi2omX0k73bp5/dvIaGdAs2wAe5X7CtTVKg32xBYQq6t066+H5KbuOTRfx1z9tedGAl/AzeZ5uq0gwkvUFY53CdJJz/aK0m06wNEccSqoI81d9AKIRp2jy0gtvEi/fiT0sm6MxX6WGMIJeHh14L/gbtbo2xD0Kj9DBg8abtzHiJ5D68cBJMmm8PpfkgE+FnHZb8EOtWGrvN1X+FTK1XSMSP3N8vA+fES+dQzByiNggdIwcUAM68FsTOmPk76588mL200iJ15Q1vEOHNQmXWA7MbFA== 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=7SbFnreLB3IizsJ3DjqNZm/eCO7EB4EsDPVZsBU4wsY=; b=YmvlLPcmkIyGG31nDBHMyKSwhBbeQwaqQBaG6SS8N9IGIewfTaLd0/RHLBeXdiQGO1TfoVZWU42x77dOy/lRgtnzCHfKH8XjXIZNgSq4uycFJZyZFKdmZxi2MgDigpuqdhClyhsQqM8nhkwpgkXe3LWst+XqcUX519W2/CuLBSU= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; 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; From: Wei Chen To: , , , , CC: Subject: [XEN RFC PATCH 17/40] xen/arm: Introduce DEVICE_TREE_NUMA Kconfig for arm64 Date: Wed, 11 Aug 2021 18:24:00 +0800 Message-ID: <20210811102423.28908-18-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210811102423.28908-1-wei.chen@arm.com> References: <20210811102423.28908-1-wei.chen@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1793903a-3972-476f-19f5-08d95cb259b3 X-MS-TrafficTypeDiagnostic: VE1PR08MB4656:|AM5PR0802MB2417: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:6790;OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: SGYAQWt69RrMhW52qM1XE2li1PgonbUUsOvDHGBWzwVSsOktKRHXEzY+3eTP92mRZVHJbAGsrC3JCo+NhQggm5E/RP8Igyx3drygBS4mixytqIR6qbqxmn06SyjLd7PgrXnnEth9WUNivPmkDC3kY0PU9mdjw9MG9VdWB50LC+Vf/srSgXxPo3OlWcV02k1TWfRKXnvod2vNhITyQQHoVflcDJWcwOPS5nVo3vFh+X9+LCjdRqayfzSdzaFrztDRJppR0JoC0eLulHrh7Po7pR80bCYdpwLCmGlOmcSITpfQSvndowLcshyORYemL9hkbOBvCgtBMmHIU9+vCXAELXy9J2d4RS6mwzt/LavSSm4eVNZlZZkZEzdCz/TT/mcx2LBZwPmlWu0bJIX5NOcptTSYp5QZ76Gk/TPxZQAOXjUu/bVWrCOnDG0JMF37zuXc3f1QBo8d5jivMlP8Lu5f81S7ko8WX8KpiyNCVytAR+0O1DXhT46jKL7Izm5XXwUmAQ1YdelTm+l5Z9c3Eun5WWT5O4rrS91yBBDAJhwNH7J5bqwId8UOpVX8DHu8TrJ3mZEym9uYK454PTy2G7ym3a+Q6cZ6cUvN+icWSlUZE3e/W3q57wpCuSyskvyCLcHa49wNDrk+8GybTZGFiJc71pEi5b+7fXr9i38W8lb6z89CkJYFR3SO+WwxjibXxKfjPMnXAYgcJHsOAjHrywoLDq/6AR5Wnz5RhlCFzDMXqgheNCZlZGt+sCpVqpZZ0u0+7bJ6kVM8g2udTBT0XA/Nldj/xvEVghgm2ZWTRPgZL3w= 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:(4636009)(39860400002)(396003)(136003)(376002)(346002)(46966006)(36840700001)(7696005)(8936002)(44832011)(8676002)(70586007)(70206006)(47076005)(336012)(82310400003)(83380400001)(356005)(6666004)(86362001)(34070700002)(186003)(316002)(36756003)(26005)(478600001)(81166007)(36860700001)(2906002)(2616005)(5660300002)(1076003)(4326008)(426003)(82740400003)(4744005)(110136005)(36900700001)(2101003);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB4656 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT054.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: ca383ecd-c552-4858-cbc6-08d95cb253de X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JApGZ+xvMc3gm3muVEsoVlySeRxwGdISNcB3i+8aIq3//dn8Qi/GAOhxo9hilyy+oYAr0fP6krRFbsOhgjbu2lkghXF91tiJetig/2H1Kb9/XGjNq7+gQMkngOXG6rxn4USZZbQOkpwDY9DXdPnxAKith0TrdULkKgC4ZbcvfVhe9yon005rcL/maLNcQJfH+TRF7yteYZrEZRnzPKMdO4muq9iXRSvdDoPl863t9Fr4lZYRwHo3bKJmpuU0EtOfEB//FynqNS4JkyiGxT69ByGC48DEAqxZreacLuYQwuJbSA7AmwppguWIpCa9REJyy+KshtJRoDDI/hf9bMGmwiB5jYAhpLr12+lKkfQM16jWLYtozlYgkiCpLRUuxCGpGhW08vGXNOixMfL+kHE3SnbLT2zW4hfIsmiRiOUybcZzSwESnWpkO1HLqBuDvpJAJGVX6u2jsJ/KEMFkH0AydB8FWd1MDAOPS6BPuFUXMZVR6tqJc8oAdKJdtiISCBs6H2QAIJSpes5vkyFXDbD9YuELcnVltkBng+T6nAwCEqn7lJL2Q8wzBgvAUUURy+KCHq0pdd2lz53ULUJGcFPqGuBVMw97a6JDpcIBmJKmIdslVeqSLaZpwlYpKyUJcdLTA8YqG7uT39HThik0cTivaBKeYUlK5KlO+Y93TOTizArX39S/4Qye72ec9+BVyn/5MB5etV8b84hNWPKbz6kuMQ1txBiZJsSHq/NH0vZVxk0= 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:(4636009)(346002)(396003)(136003)(39850400004)(376002)(46966006)(36840700001)(36860700001)(70206006)(47076005)(8676002)(336012)(70586007)(186003)(4326008)(2906002)(2616005)(478600001)(426003)(81166007)(6666004)(8936002)(44832011)(36756003)(86362001)(7696005)(83380400001)(5660300002)(1076003)(82310400003)(110136005)(4744005)(316002)(82740400003)(26005)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2021 10:25:32.6910 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1793903a-3972-476f-19f5-08d95cb259b3 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: VE1EUR03FT054.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0802MB2417 X-ZohoMail-DKIM: pass (identity @armh.onmicrosoft.com) X-ZM-MESSAGEID: 1628677567518100003 Content-Type: text/plain; charset="utf-8" We need a Kconfig option to distinguish with ACPI based NUMA. So we introduce the new Kconfig option: DEVICE_TREE_NUMA in this patch for Arm64. Signed-off-by: Wei Chen --- xen/arch/arm/Kconfig | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig index ecfa6822e4..678cc98ea3 100644 --- a/xen/arch/arm/Kconfig +++ b/xen/arch/arm/Kconfig @@ -33,6 +33,16 @@ config ACPI Advanced Configuration and Power Interface (ACPI) support for Xen is an alternative to device tree on ARM64. =20 +config DEVICE_TREE_NUMA + bool "NUMA (Non-Uniform Memory Access) Support (UNSUPPORTED)" if UNSUPPOR= TED + depends on ARM_64 + select NUMA + ---help--- + + Non-Uniform Memory Access (NUMA) is a computer memory design used in + multiprocessing, where the memory access time depends on the memory + location relative to the processor. + config GICV3 bool "GICv3 driver" depends on ARM_64 && !NEW_VGIC --=20 2.25.1 From nobody Sat May 4 03:49:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=2; a=rsa-sha256; t=1628677903; cv=pass; d=zohomail.com; s=zohoarc; b=kbGZkgWoz0NFeob1iJ2Dm9W4aO7si9WCrloZJJMWhhC/BusO+zeZpepgS6KfW60ey1yJBgZ2A1dpDeJVAGf38mJb+iLKOEnMvPdifLNThrhH4VzLc/87si+ICbGh4guW+0kO+eZ2wle3VWHnRP8k7vd1QaxYaQJG67p7vieMrSU= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628677903; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=aAb73wtz3fWrvny7PX7rdYo85rQ3rmJfUdReR1U9JWY=; b=Ur7Feh1/Uk8gvfxUMjtDhJ6ytxf/UKltelz+lXnPZ93W6WiypAYkCBaya7h/rQYWsP4l20GXtip7eGTnteaEGSoDw3uxv9mhhjzTontF0jc3WW+PP2/jYgRNS/5pIrzfntxbpnrRaoROl1p5ltkf24O9rYThFh4jO/m+7z3lZ60= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1628677903178572.2541781078953; Wed, 11 Aug 2021 03:31:43 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.165718.302906 (Exim 4.92) (envelope-from ) id 1mDlW6-0005qe-Si; Wed, 11 Aug 2021 10:31:22 +0000 Received: by outflank-mailman (output) from mailman id 165718.302906; Wed, 11 Aug 2021 10:31: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 1mDlW5-0005nL-SE; Wed, 11 Aug 2021 10:31:21 +0000 Received: by outflank-mailman (input) for mailman id 165718; Wed, 11 Aug 2021 10:31:20 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlRH-0000BQ-EJ for xen-devel@lists.xenproject.org; Wed, 11 Aug 2021 10:26:23 +0000 Received: from EUR02-HE1-obe.outbound.protection.outlook.com (unknown [2a01:111:f400:fe05::606]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id dbbcb941-dcc2-4247-9607-19b0fc439438; Wed, 11 Aug 2021 10:25:34 +0000 (UTC) Received: from DB8PR04CA0018.eurprd04.prod.outlook.com (2603:10a6:10:110::28) by DB9PR08MB6428.eurprd08.prod.outlook.com (2603:10a6:10:263::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.19; Wed, 11 Aug 2021 10:25:32 +0000 Received: from DB5EUR03FT030.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:110:cafe::7d) by DB8PR04CA0018.outlook.office365.com (2603:10a6:10:110::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.17 via Frontend Transport; Wed, 11 Aug 2021 10:25:32 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT030.mail.protection.outlook.com (10.152.20.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:25:32 +0000 Received: ("Tessian outbound ab45ca2b67bc:v101"); Wed, 11 Aug 2021 10:25:32 +0000 Received: from bb46b63f0042.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id E2D62C8C-EABD-41FC-A6A5-68C19FF45019.1; Wed, 11 Aug 2021 10:25:26 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id bb46b63f0042.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 11 Aug 2021 10:25:26 +0000 Received: from DB7PR02CA0014.eurprd02.prod.outlook.com (2603:10a6:10:52::27) by AM6PR08MB3880.eurprd08.prod.outlook.com (2603:10a6:20b:86::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.19; Wed, 11 Aug 2021 10:25:24 +0000 Received: from DB5EUR03FT027.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:52:cafe::61) by DB7PR02CA0014.outlook.office365.com (2603:10a6:10:52::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.13 via Frontend Transport; Wed, 11 Aug 2021 10:25:23 +0000 Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT027.mail.protection.outlook.com (10.152.20.121) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:25:23 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) 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.2308.14; Wed, 11 Aug 2021 10:25:15 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Wed, 11 Aug 2021 10:25:13 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: dbbcb941-dcc2-4247-9607-19b0fc439438 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=aAb73wtz3fWrvny7PX7rdYo85rQ3rmJfUdReR1U9JWY=; b=6/EeWRBO73ccZ2Hv4Rg3kfSaniReks//hRt4UXxGO5+E15NMaJpNM7qlH+e06gsyKrhBXuvVCyVo0aQ0JAy4VtaUFAJUvm7/RvtHQaGDX548tByoDnDPqKS4nqarZZq9kIIX5YYHhg6jKLJkZMgARMCRmTuvg93Z/kknvonIbmk= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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; X-CheckRecipientChecked: true X-CR-MTA-CID: 54924720137e9eb1 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eGPLVYQUDH+2tN0FDsW1j/wO9jIUte8wpubDFfHTFgDB6WPw0W30oZdw3yjS7AEXg0i/ZAlbazkEtFhOuf6lYZ3pfemHOgOBL+y5xzIU+FGpT2W7tpISwl8Zo2dZU5ct0FLCY1U2RXm96SVAUKik9uFlCOhb+CMfkPDC8esmGYV6YSxXP/H/0CW3e3zaZ6XRwNtJVe6EUDBVLTJOXFgYMi/qBYDNPbfDcDgJ1/hdB0y/Lv5w1XeTu4K0jPIhWyOrcw01DGEgDyjj61uLgebuuSULRbQIp3hfzy4PJpcR2kovP1reUbCPvV9ca+QC0IcDslI0CyJymEBgapa2ggilnA== 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-SenderADCheck; bh=aAb73wtz3fWrvny7PX7rdYo85rQ3rmJfUdReR1U9JWY=; b=Eswy+Tl9go+3cdhJbjLznjzrt1N8WHdT6lI9jTJao2hVEJI2dQHrJS3OQVT0RkSOey3ZH2yJs8lbfRkPG1C19xyhABqW7kV3OXnpyCO9oQZdSS/gsLDkGWUnq6DVohl3DrJOP3+YpTvP8ww4LiDRg8878tq0ljrkH0f+x2wXZubJiGnMZr8KVYVoVbIWqJW7+29q0dGTqVWk0XBYKkEoXR5d0uhsGdd348v1DZ23J/gft3v60vFXZjbJEK4tB7uOe2WR9Y/sxga/VvcVkn7i6kBm2sc04zU7Riwv03+qV78tjANNBWZBfvfURFF5+4wKyjOzuExadxUIm6IPXG354Q== 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=aAb73wtz3fWrvny7PX7rdYo85rQ3rmJfUdReR1U9JWY=; b=6/EeWRBO73ccZ2Hv4Rg3kfSaniReks//hRt4UXxGO5+E15NMaJpNM7qlH+e06gsyKrhBXuvVCyVo0aQ0JAy4VtaUFAJUvm7/RvtHQaGDX548tByoDnDPqKS4nqarZZq9kIIX5YYHhg6jKLJkZMgARMCRmTuvg93Z/kknvonIbmk= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; 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; From: Wei Chen To: , , , , CC: Subject: [XEN RFC PATCH 18/40] xen/arm: Keep memory nodes in dtb for NUMA when boot from EFI Date: Wed, 11 Aug 2021 18:24:01 +0800 Message-ID: <20210811102423.28908-19-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210811102423.28908-1-wei.chen@arm.com> References: <20210811102423.28908-1-wei.chen@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8cb10df8-21c5-4b73-9be1-08d95cb259a2 X-MS-TrafficTypeDiagnostic: AM6PR08MB3880:|DB9PR08MB6428: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:8273;OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: oHj/b4lCy8+f6amO8ACyg847P754dbVpNG9IC7PlmrNI2PE19cqL4mClEqioiqxxbA0oO4s/Bp0OV4+BROK1soQXiCX29vf6RktQUm65amepk3U1NeN3J8bBtB9axg5xDDVpATR/7YeCDUrYULFBr7tIWHgbyGq8yqQDaUJwK1E25JW1eDHlX2wlz/hiA1lc5ixiMu/Qjp5rvTUf+7M73M8atf9WPuO1yFfI6adppARb1vSxZw9TJC1PC40PjbbtSxoehr4+C/hDWT5MC3z5p4w/FghKmNurwC2kqfvzducCeKP5CemoQ1fDt0Z9KLY18jpe2lxhf7J9oi5qglMZ49eExtN0gPDa66frg8Eu55ibrBHZcDNZu4OErcfSjHZNqJtvpNSdm7/YVytrip9GHUaGfdZn9N2XLhkUA19E0lGJKV296C27S6Wj6aBJftY1vWfB5AbgQaq8nIp75hbAaz+8CeHzZP47W06ACUXk/qAqruF9PyL63DKD1KYoS3yN88cd1Jz/vWfT4tfBFOTIZWb91bE7Cz2oEmsQC/ZqCLkKf6ykX3OGx0gKniNoKADXEZarshDbQTFqvfBDFu8Z/3xTYCGgihWwk5a4K2ADc2LClM3YO1hz8hgXGCUueudWgnThl2kSIY8XT/zop0glOS4xKsFcToBcPPJqcUwdDsaIy6aLw/W9qiBBDZi/mBqSJfr0RUHJCHR+4E+ePJYqG8nZxCQm0/wxvZFm07AxLBsV3nnA8S1o4jdxdVjnMYM+jArwlw+5Ta5rnNkqArSn/Kt6yIyPzxW18CS67g6ByOE= 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:(4636009)(396003)(346002)(136003)(376002)(39860400002)(46966006)(36840700001)(8936002)(5660300002)(356005)(8676002)(110136005)(47076005)(34070700002)(6666004)(316002)(36756003)(81166007)(36860700001)(86362001)(70586007)(426003)(83380400001)(2906002)(478600001)(82310400003)(7696005)(26005)(82740400003)(1076003)(44832011)(186003)(2616005)(70206006)(336012)(4326008)(2101003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3880 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT030.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 7fdace4b-3074-4875-041d-08d95cb2545c X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mquuhGLu44v6Kbc0+QdgAOwjJ9ihYI0myf2WCdNxs9iWWfeEMc0OZTeq0oLK/veSEJU6to3PlgRd8LV3jyOT+tDOZ2EXGhFrbTFUzj0tzu+Bg0cz48GvpepnZf2KsMgMVtoIG915tPhnq+VN27MkUSBYonT+HTubt7syLYTtrcSCUDoskvrf+M19zGA/G3a82nmgO2OxkpROKoAZHHDIZE2hQXHFpNwwGEcUxYyro2YpnsynyU53d344ZZMV3ZpVDXj1136byQk1CkIXdBB6qKcAYI7KKDDdRRxOLEHrh+js1Q33bhE/pxji6J8QPCWe073gwXXgreCtz1izQgkC3VQ7nepXFddo3eLzTaT/o1o0QUBoy7T4tWdUbcgY5YpM9/KhINgXD7Ul0qmA9bxiEidul+gHQqZDmD3atKPzQCXdA8v9SP9lnbgf1UJ3XS/FAU0gcvvsoTN+BclCifPLIgDoHeJS5chjqoufUPdwBJhuBiwZiQa4RcdfxyLdJKsiJd6g/yfZ26m2sU+JIt0fzxTb7HBTejWF+LWzJK2vLMenf7WpYPcWZbsisSXyNdAzvhV4kH+JV4/vsZBHWUvtpmNuYBgzsyPaRVwb8Lev5WlFPBJd0ZBi8nowX260ss6nDnARG5yhnwqaXzEILLaML8O1NkdOoSU3bOnwfyhLfTCdcPlyEJhZWaz+ggJxiWJhiWMUGdR67h6FzDvhvnK5SoOMm67cKYXFjyhNoizll/g= 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:(4636009)(396003)(39850400004)(376002)(346002)(136003)(36840700001)(46966006)(110136005)(426003)(86362001)(7696005)(36756003)(316002)(2906002)(4326008)(44832011)(82310400003)(336012)(2616005)(8676002)(1076003)(36860700001)(8936002)(83380400001)(82740400003)(70586007)(5660300002)(70206006)(478600001)(81166007)(6666004)(186003)(26005)(47076005)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2021 10:25:32.7328 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8cb10df8-21c5-4b73-9be1-08d95cb259a2 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: DB5EUR03FT030.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB6428 X-ZohoMail-DKIM: pass (identity @armh.onmicrosoft.com) X-ZM-MESSAGEID: 1628677903901100001 Content-Type: text/plain; charset="utf-8" EFI can get memory map from EFI system table. But EFI system table doesn't contain memory NUMA information, EFI depends on ACPI SRAT or device tree memory node to parse memory blocks' NUMA mapping. But in current code, when Xen is booting from EFI, it will delete all memory nodes in device tree. So in UEFI + DTB boot, we don't have numa-node-id for memory blocks any more. So in this patch, we will keep memory nodes in device tree for NUMA code to parse memory numa-node-id later. As a side effect, if we still parse boot memory information in early_scan_node, bootmem.info will calculate memory ranges in memory nodes twice. So we have to prvent early_scan_node to parse memory nodes in EFI boot. As EFI APIs only can be used in Arm64, so we introduced a wrapper in header file to prevent #ifdef CONFIG_ARM_64/32 in code block. Signed-off-by: Wei Chen --- xen/arch/arm/bootfdt.c | 8 +++++++- xen/arch/arm/efi/efi-boot.h | 25 ------------------------- xen/include/asm-arm/setup.h | 6 ++++++ 3 files changed, 13 insertions(+), 26 deletions(-) diff --git a/xen/arch/arm/bootfdt.c b/xen/arch/arm/bootfdt.c index 476e32e0f5..7df149dbca 100644 --- a/xen/arch/arm/bootfdt.c +++ b/xen/arch/arm/bootfdt.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -335,7 +336,12 @@ static int __init early_scan_node(const void *fdt, { int rc =3D 0; =20 - if ( device_tree_node_matches(fdt, node, "memory") ) + /* + * If system boot from EFI, bootinfo.mem has been set by EFI, + * so we don't need to parse memory node from DTB. + */ + if ( device_tree_node_matches(fdt, node, "memory") && + !arch_efi_enabled(EFI_BOOT) ) rc =3D process_memory_node(fdt, node, name, depth, address_cells, size_cells, &bootinfo.mem); else if ( depth =3D=3D 1 && !dt_node_cmp(name, "reserved-memory") ) diff --git a/xen/arch/arm/efi/efi-boot.h b/xen/arch/arm/efi/efi-boot.h index cf9c37153f..d0a9987fa4 100644 --- a/xen/arch/arm/efi/efi-boot.h +++ b/xen/arch/arm/efi/efi-boot.h @@ -197,33 +197,8 @@ EFI_STATUS __init fdt_add_uefi_nodes(EFI_SYSTEM_TABLE = *sys_table, int status; u32 fdt_val32; u64 fdt_val64; - int prev; int num_rsv; =20 - /* - * Delete any memory nodes present. The EFI memory map is the only - * memory description provided to Xen. - */ - prev =3D 0; - for (;;) - { - const char *type; - int len; - - node =3D fdt_next_node(fdt, prev, NULL); - if ( node < 0 ) - break; - - type =3D fdt_getprop(fdt, node, "device_type", &len); - if ( type && strncmp(type, "memory", len) =3D=3D 0 ) - { - fdt_del_node(fdt, node); - continue; - } - - prev =3D node; - } - /* * Delete all memory reserve map entries. When booting via UEFI, * kernel will use the UEFI memory map to find reserved regions. diff --git a/xen/include/asm-arm/setup.h b/xen/include/asm-arm/setup.h index c4b6af6029..e4fb5f0d49 100644 --- a/xen/include/asm-arm/setup.h +++ b/xen/include/asm-arm/setup.h @@ -123,6 +123,12 @@ void device_tree_get_reg(const __be32 **cell, u32 addr= ess_cells, u32 device_tree_get_u32(const void *fdt, int node, const char *prop_name, u32 dflt); =20 +#if defined(CONFIG_ARM_64) +#define arch_efi_enabled(x) efi_enabled(x) +#else +#define arch_efi_enabled(x) (0) +#endif + #endif /* * Local variables: --=20 2.25.1 From nobody Sat May 4 03:49:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=2; a=rsa-sha256; t=1628677912; cv=pass; d=zohomail.com; s=zohoarc; b=WsDM6tqrTvHTh3k5CbN1Yj5Vuvddco3LOnpSMtdSh9uPA/W+HSlizhKk+ucRzdlMP9ijpOBfqXfDJ/xLRXv9F6QuXVhFVLfv6HEZTJXj1DW8nzOSmB9Mu38vP/+1uxhJ65HbudqEAMtA91LCCukBhS5KQa9Ee0uUAGLThRMQXHY= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628677912; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=odN0lHZAsbsVRMXgR2b8ZeF2f7UGOUcwvUmC6yeEvE4=; b=GtNJh9OmlWH3e6NAYI7oOaisy/LIbDZcBp1SLnAYOSObktI64WXcenCTCRB0qq3p9tcpFCqzwofj3tdZwY6sIIHXtZ/5vfmkqba6mgLko2a3dYNY/1X7TI8Hs8Kxa9Rix0ReY1NvDLkELOJr2XwpGcWfJiMLeZsuKa52o4rcM1A= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1628677912963755.5352863216176; Wed, 11 Aug 2021 03:31:52 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.165753.302964 (Exim 4.92) (envelope-from ) id 1mDlWL-0000j6-B5; Wed, 11 Aug 2021 10:31:37 +0000 Received: by outflank-mailman (output) from mailman id 165753.302964; Wed, 11 Aug 2021 10:31:37 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlWK-0000eq-NT; Wed, 11 Aug 2021 10:31:36 +0000 Received: by outflank-mailman (input) for mailman id 165753; Wed, 11 Aug 2021 10:31:33 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlR5-0002Qj-GD for xen-devel@lists.xenproject.org; Wed, 11 Aug 2021 10:26:11 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (unknown [40.107.22.41]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 7a1ddb68-fa8e-11eb-a052-12813bfff9fa; Wed, 11 Aug 2021 10:25:41 +0000 (UTC) Received: from DB9PR02CA0019.eurprd02.prod.outlook.com (2603:10a6:10:1d9::24) by DB9PR08MB7097.eurprd08.prod.outlook.com (2603:10a6:10:2c2::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.15; Wed, 11 Aug 2021 10:25:39 +0000 Received: from DB5EUR03FT049.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:1d9:cafe::64) by DB9PR02CA0019.outlook.office365.com (2603:10a6:10:1d9::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.17 via Frontend Transport; Wed, 11 Aug 2021 10:25:39 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT049.mail.protection.outlook.com (10.152.20.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:25:39 +0000 Received: ("Tessian outbound ab45ca2b67bc:v101"); Wed, 11 Aug 2021 10:25:39 +0000 Received: from dfd3347eb500.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 22735298-353D-4C27-9057-2E4937A724BF.1; Wed, 11 Aug 2021 10:25:33 +0000 Received: from EUR03-AM5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id dfd3347eb500.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 11 Aug 2021 10:25:33 +0000 Received: from DB7PR02CA0004.eurprd02.prod.outlook.com (2603:10a6:10:52::17) by DB7PR08MB3723.eurprd08.prod.outlook.com (2603:10a6:10:7b::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.15; Wed, 11 Aug 2021 10:25:26 +0000 Received: from DB5EUR03FT027.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:52:cafe::9a) by DB7PR02CA0004.outlook.office365.com (2603:10a6:10:52::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:25:26 +0000 Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT027.mail.protection.outlook.com (10.152.20.121) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:25:26 +0000 Received: from AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2308.14; Wed, 11 Aug 2021 10:25:18 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Wed, 11 Aug 2021 10:25:18 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Wed, 11 Aug 2021 10:25:16 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 7a1ddb68-fa8e-11eb-a052-12813bfff9fa 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=odN0lHZAsbsVRMXgR2b8ZeF2f7UGOUcwvUmC6yeEvE4=; b=6caHZsM8dl0fYrGEkXxCuR/NxH88PHAEWUJnYT+ZOlRi55rWMQYDuqNscdtNySFnum62J+L0QIvTG1S9aEtujZOJMp+lw9Lixz3+STGKDvErX+5GbY0ywp7wovMXAGsQM8IzGW815RL/IXkih3waBcBHs6tCZhSrDFUVrRrACvA= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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; X-CheckRecipientChecked: true X-CR-MTA-CID: c2c8e51570f7c19c X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Daizj4Q/2uR2wt2v6T5yYeW8wZNh53EQj9oHSwk5dEDu+9uL2E9XJzDCopF7lbYcaK8WyFUExF0WjNFQrY0nw/3GdmKCbts+pTu6l++VmvjlmLBl7GlPWaDStdtZ/LeHmZ7qp3Gr13I35SMMeYN+RnUbs0Iu4pYKoDURVA5jl85mBl5aM2NJQWr31wFcmlQU+oFAHOSIriPtTEGxYDd4+k3DmHmCQ0fFaDaBuTKYfE6Sr6Kfw6U68FtD5Zbd6gtYQK4bJZo/I/TAyFZtkNeXHLpIgZPU5HgQkue/k6KLQn48B1UJfgsfnSNGS6IIZ69sEzDE6N7pijgJ34jlPGrEew== 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-SenderADCheck; bh=odN0lHZAsbsVRMXgR2b8ZeF2f7UGOUcwvUmC6yeEvE4=; b=is5MiMPxrb9RZuFR7mTGsa/PVLhRuxTwc8gdJ45Ss+7PfQQj7RvMOGDFEyw/8Xc0ckVWelMu48AbJKmfz7j2vSoxNYurz7EZZ08vfRd75sZsSnByXPgUXabFVud7csH3qEbAkBfacLRrTbDVqKDEHrtnMGn+euZOYsBKzNLde98OumMuuFZXJfhK5KhETRJLtXsL5BmQf9eBr5kleM2qdjHX2ItzDmYA3hauXOBeEkUlu5fuUtF9ObWzCKz6RfTWdB5dWDo1e+HPS1EU/NC7Nj3pYO107I4uLYJkQ7JuQUV8GyDALxNH+r0T1RF33mG+snbsPrkkT+vqE1n7RKRVUQ== 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=odN0lHZAsbsVRMXgR2b8ZeF2f7UGOUcwvUmC6yeEvE4=; b=6caHZsM8dl0fYrGEkXxCuR/NxH88PHAEWUJnYT+ZOlRi55rWMQYDuqNscdtNySFnum62J+L0QIvTG1S9aEtujZOJMp+lw9Lixz3+STGKDvErX+5GbY0ywp7wovMXAGsQM8IzGW815RL/IXkih3waBcBHs6tCZhSrDFUVrRrACvA= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; 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; From: Wei Chen To: , , , , CC: Subject: [XEN RFC PATCH 19/40] xen: fdt: Introduce a helper to check fdt node type Date: Wed, 11 Aug 2021 18:24:02 +0800 Message-ID: <20210811102423.28908-20-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210811102423.28908-1-wei.chen@arm.com> References: <20210811102423.28908-1-wei.chen@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b70631d2-6414-45de-1775-08d95cb25ddf X-MS-TrafficTypeDiagnostic: DB7PR08MB3723:|DB9PR08MB7097: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:9508;OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 1KO5nXSYrpAx0UcAhvulIaLhpBurXeXLojtp9FQJR2gDA4+LT3abMGIModWEzul+Y09boyTwAGmHuDUM7ykitAAHrMWF2HBmtgSTvUrE5htJoOhyhfTT8bJv2uR7+6V8n93Ga3TwEHtRnJOtYq+0/rKkomYjS2lQDDKA3pE0yrXsAJEETBz0JnkK98Y6U2wDIzI3V97eco6ppvmCP6gyuCaHTPsUaDs2wW+LuOPpoICjo41wZlaU/a1n1v3DVLahcQZccoCzemQFEUidz0FqOOloMO3XpP7NrL2S40BnsaQt4EdYn9jQ8iRwgqJJBWODtFRaAIl/DHnvdlh1Ja+Hya7GjDXMl4G8yE1DAgFBAuZE7BNI6f68zbIUKFieos3j1cB6E0atj4OIQ3fRBtcEJ9lp6Ea0xqcI+jMx2G11hfIR3IGzHvAo984nICuE7dW8BMAouVjOLlujwRCB5eVqIPe+MY9+B3A+KV44uEjG+ndtR3vAhqAADaICWXiEwNiDZKfI0y/Lnji5sVHhBaDbnTTuNTLYFw1+NUHF5PS5oGeRQLtPVtirEY5BWOLlN5GeCuelBkOnZSz1QFT1FVGSLxcJfLnJWxLxnJ/yiw88kXK+Dw0VldHzwuJQEo4g9uV39Xg4jtg3JiCejbaHKsSAQEZ1EgXgvt0Ol2BDl34t/tIDcUnFwsEcnzjbGw6lu47DogjpskPIGiHoZakzd3X+a4kX8ZKjn1Agtt6N7SXU9aARehKzfJ6TjnV4H2S4jUQoozjzVUi/d26JIuo15WMIgdxHOJ90h96i5AsSxvQ8/4c= 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:(4636009)(36840700001)(46966006)(2616005)(336012)(86362001)(2906002)(186003)(36860700001)(1076003)(47076005)(5660300002)(7696005)(36756003)(82310400003)(4326008)(70586007)(70206006)(356005)(44832011)(8936002)(8676002)(26005)(426003)(34070700002)(508600001)(81166007)(316002)(110136005)(6666004)(36900700001)(2101003);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB3723 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT049.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 15f0bff1-bb77-4f6e-3f2e-08d95cb255a2 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RoIUMMmpKDtBrNFzT0L6HqQ6Glr5bL0Fi/Zc/5YL7oMiitid2/ISmxq3M98Q+2/JXFU+lPCk6fVrWjaxFFVut7eV2NZXjeEJKBiLNV+mHk0l5aPrwTQ89eNh/UuBwz+dNqEfWlBdtkNZPBD4aBcVJRmY2Cxdmg0Ie7slulAbQ74xNkaKpnCLT3WfN1XdHk8YLkU+JFdD1Use6mfkOp9h0g3g7GLycfCTV1rV7A0+ETx6QydYLOqQYocw2LKzh+0eRSU55WmX/7il35mPO0Prv8IIc+5jUZuW2SBTonB2ATZk06igPqRDfUFBqEKcJVDSCVeBFF+hydIgriLKQnpuVLC1Cg2DBkFb2Bi+tkpB5do9JYSKmEti12jm6Ho0tgSDw7XJhE47KOD76vJcdWbMxrmJkPymD9nhOfqoGVcYH8MlorfMQoSL3fqexPnvnT+envXrldcyX6SR88KQzmzSjI+isFF/6noqOIFqQD8Lba8wlSaJcHP+nviopyQcvgdFgLB6fb52TBLeRnbyinyGwWYmxNq4kxqD51WLb24rUccpsk4uTRtTjg3uiBSugWOJOeczR/dpagPInP1P3HcH5qJhPcRpskMnXb9aEuRyA+Gh6wiZxPaK1Pwrc39SyWerii3yz4337b8oa6k99Xb4XMB39EL4RC9RR5mkVY+WVIGphFYAdBA6KC6X/ltmMBMqnR/lKAHtfy8oR7YRH6q4YtYAq/hlxsczDcydyMjEL4c= 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:(4636009)(396003)(39860400002)(346002)(376002)(136003)(46966006)(36840700001)(110136005)(186003)(426003)(8936002)(82740400003)(36860700001)(26005)(8676002)(478600001)(7696005)(44832011)(316002)(86362001)(47076005)(1076003)(2616005)(6666004)(336012)(70206006)(2906002)(5660300002)(82310400003)(36756003)(81166007)(70586007)(4326008)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2021 10:25:39.8401 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b70631d2-6414-45de-1775-08d95cb25ddf 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: DB5EUR03FT049.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB7097 X-ZohoMail-DKIM: pass (identity @armh.onmicrosoft.com) X-ZM-MESSAGEID: 1628677914953100007 Content-Type: text/plain; charset="utf-8" In later patches, we will parse CPU and memory NUMA information from device tree. FDT is using device type property to indicate CPU nodes and memory nodes. So we introduce fdt_node_check_type in this patch to avoid redundant code in subsequent patches. Signed-off-by: Wei Chen --- xen/common/libfdt/fdt_ro.c | 15 +++++++++++++++ xen/include/xen/libfdt/libfdt.h | 25 +++++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/xen/common/libfdt/fdt_ro.c b/xen/common/libfdt/fdt_ro.c index 36f9b480d1..ae7794d870 100644 --- a/xen/common/libfdt/fdt_ro.c +++ b/xen/common/libfdt/fdt_ro.c @@ -545,6 +545,21 @@ int fdt_node_check_compatible(const void *fdt, int nod= eoffset, return 1; } =20 +int fdt_node_check_type(const void *fdt, int nodeoffset, + const char *type) +{ + const void *prop; + int len; + + prop =3D fdt_getprop(fdt, nodeoffset, "device_type", &len); + if (!prop) + return len; + if (fdt_stringlist_contains(prop, len, type)) + return 0; + else + return 1; +} + int fdt_node_offset_by_compatible(const void *fdt, int startoffset, const char *compatible) { diff --git a/xen/include/xen/libfdt/libfdt.h b/xen/include/xen/libfdt/libfd= t.h index 7c75688a39..7e4930dbcd 100644 --- a/xen/include/xen/libfdt/libfdt.h +++ b/xen/include/xen/libfdt/libfdt.h @@ -799,6 +799,31 @@ int fdt_node_offset_by_phandle(const void *fdt, uint32= _t phandle); int fdt_node_check_compatible(const void *fdt, int nodeoffset, const char *compatible); =20 +/** + * fdt_node_check_type: check a node's device_type property + * @fdt: pointer to the device tree blob + * @nodeoffset: offset of a tree node + * @type: string to match against + * + * + * fdt_node_check_type() returns 0 if the given node contains a 'device_ty= pe' + * property with the given string as one of its elements, it returns non-z= ero + * otherwise, or on error. + * + * returns: + * 0, if the node has a 'device_type' property listing the given string + * 1, if the node has a 'device_type' property, but it does not list + * the given string + * -FDT_ERR_NOTFOUND, if the given node has no 'device_type' property + * -FDT_ERR_BADOFFSET, if nodeoffset does not refer to a BEGIN_NODE tag + * -FDT_ERR_BADMAGIC, + * -FDT_ERR_BADVERSION, + * -FDT_ERR_BADSTATE, + * -FDT_ERR_BADSTRUCTURE, standard meanings + */ +int fdt_node_check_type(const void *fdt, int nodeoffset, + const char *type); + /** * fdt_node_offset_by_compatible - find nodes with a given 'compatible' va= lue * @fdt: pointer to the device tree blob --=20 2.25.1 From nobody Sat May 4 03:49:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=2; a=rsa-sha256; t=1628677882; cv=pass; d=zohomail.com; s=zohoarc; b=CHlT/FYJBE9i+XW86pFn4ZWRWdhSLPDr/JK6sZVaqAscbIUJ/zX/6LjoeEqrroifhUfHyl9dZVNKM7zdh/BhHl845wn3TGFUWU2viXq50fdnugm4PkT7FWsFIgfFBb/bXLD4S7Tw2KnzSlrNV+5I09ElvAkMHLqaA5oaW6ZmBDI= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628677882; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=vNLCmK6o/BFFBB7IYOhSAdZku5C++eyuzlH2uW7CLH0=; b=AjgMQxf0mNPLcbfcrV5nDoeb6sn9G2fcdTrmxjNQZFaFsRodR1AqZeNEu3WJF+S8X/Nz80ieqhXN3qtiwrspAfdEcihljlIgMo2Y17hyUdKtkBXNMNbWFXilaAsY+TJZL2I6o7hFlMmxF0hfJB6g60MvZdDO5aw8tYKKouHQ0Os= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1628677882988184.10604342725878; Wed, 11 Aug 2021 03:31:22 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.165698.302811 (Exim 4.92) (envelope-from ) id 1mDlVq-0002Lv-An; Wed, 11 Aug 2021 10:31:06 +0000 Received: by outflank-mailman (output) from mailman id 165698.302811; Wed, 11 Aug 2021 10:31:06 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlVq-0002Jy-0h; Wed, 11 Aug 2021 10:31:06 +0000 Received: by outflank-mailman (input) for mailman id 165698; Wed, 11 Aug 2021 10:31:04 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlRM-0000BQ-EM for xen-devel@lists.xenproject.org; Wed, 11 Aug 2021 10:26:28 +0000 Received: from EUR02-VE1-obe.outbound.protection.outlook.com (unknown [40.107.2.76]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 3146180f-42be-47ce-92a2-96b78428a5a2; Wed, 11 Aug 2021 10:25:36 +0000 (UTC) Received: from DU2PR04CA0045.eurprd04.prod.outlook.com (2603:10a6:10:234::20) by PAXPR08MB7188.eurprd08.prod.outlook.com (2603:10a6:102:20a::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.14; Wed, 11 Aug 2021 10:25:34 +0000 Received: from DB5EUR03FT052.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:234:cafe::b5) by DU2PR04CA0045.outlook.office365.com (2603:10a6:10:234::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.13 via Frontend Transport; Wed, 11 Aug 2021 10:25:34 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT052.mail.protection.outlook.com (10.152.21.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.14 via Frontend Transport; Wed, 11 Aug 2021 10:25:34 +0000 Received: ("Tessian outbound 312d863716bf:v101"); Wed, 11 Aug 2021 10:25:34 +0000 Received: from 6ed41c1450f4.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 9C0FF7C0-2993-441C-83FA-181B6A9C0AC6.1; Wed, 11 Aug 2021 10:25:28 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 6ed41c1450f4.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 11 Aug 2021 10:25:28 +0000 Received: from DB7PR02CA0009.eurprd02.prod.outlook.com (2603:10a6:10:52::22) by AM8PR08MB6371.eurprd08.prod.outlook.com (2603:10a6:20b:363::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.21; Wed, 11 Aug 2021 10:25:27 +0000 Received: from DB5EUR03FT027.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:52:cafe::4d) by DB7PR02CA0009.outlook.office365.com (2603:10a6:10:52::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.15 via Frontend Transport; Wed, 11 Aug 2021 10:25:27 +0000 Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT027.mail.protection.outlook.com (10.152.20.121) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:25:27 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) 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.2308.14; Wed, 11 Aug 2021 10:25:20 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Wed, 11 Aug 2021 10:25:18 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 3146180f-42be-47ce-92a2-96b78428a5a2 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=vNLCmK6o/BFFBB7IYOhSAdZku5C++eyuzlH2uW7CLH0=; b=aeCJXtoif4BhD+J4YNFBM/IUmssP/oAVlVwTxKjVuzApBrF/KZHt+SesE7jv/XNnIbml+2Z1GrdqTJv39zW5yJHw4gF5lgG+RoP8Nxr0OQiCfagg1/TU26wJaCwsuoK5KwwSk0YdPUlQVOI/dZ0dy3hJ3Zco+2xmc8lmu8Xp8hY= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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; X-CheckRecipientChecked: true X-CR-MTA-CID: fe3c316242becbc4 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e3RYLdBH2XihTuLxNA/1NhEFa6pWijjibavw4gXxUozq4Gf9ejzy96yiVLV051y/Z5M56bWDq/Z3ksQFGOhe5jQMSnk3049mlZTEvsoZ78ssT0L9LlXUxWZKB1eGO4AP8CSTNkfcdm+YXWY1/6A5Kb9w+Kc8XAR2HCv13VGxZLsCmTiW7mWQwmknTLa+b8GoqEdEMd9Evjy6O+puU45L5X6Wm9CRAn4Eyv4ITQVidRDuldGQTPkyIoxF86j2k3zBEVustot+mbJPkPbKBrvKkKCVsH+Fcu88X/gSw6CWawYwgb0in4mv1839qypvmOBktP6EOuBPrA+GBuqE1JccSA== 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-SenderADCheck; bh=vNLCmK6o/BFFBB7IYOhSAdZku5C++eyuzlH2uW7CLH0=; b=nYedcGbvefpwtmW3iafVXHd9qREg97v+SKJDDnyWIEupjPRRsEa8I1aZFa6eZ8l3ST6ZGy3lgHfj/KaIBdIs3q7kc0A3Nwq8OBZyCN/GHoNMLctw6ijPGib/RMtJqR8FQ+RbZzI02C3BBPaLkas6UMyvTn68z8cuy75NfTO1VUTenFVMuAediAm7m/P36B2FF0sjJKzSoYxJDWDgjJxg97qKIKEofGaj3O/oqKKXaIlywXbE735Nwbbi9TeGGVSU13hU0gV/uBfdSjEdiRXLEVLqkRxwgspyVDh7Kk6xlTxjr8kPA52alpv5IBoAveQ1YpQZAlXdEvv7U5Rxq9oUQQ== 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=vNLCmK6o/BFFBB7IYOhSAdZku5C++eyuzlH2uW7CLH0=; b=aeCJXtoif4BhD+J4YNFBM/IUmssP/oAVlVwTxKjVuzApBrF/KZHt+SesE7jv/XNnIbml+2Z1GrdqTJv39zW5yJHw4gF5lgG+RoP8Nxr0OQiCfagg1/TU26wJaCwsuoK5KwwSk0YdPUlQVOI/dZ0dy3hJ3Zco+2xmc8lmu8Xp8hY= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; 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; From: Wei Chen To: , , , , CC: Subject: [XEN RFC PATCH 20/40] xen/arm: implement node distance helpers for Arm64 Date: Wed, 11 Aug 2021 18:24:03 +0800 Message-ID: <20210811102423.28908-21-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210811102423.28908-1-wei.chen@arm.com> References: <20210811102423.28908-1-wei.chen@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9173b6a8-9437-4cb3-4920-08d95cb25ad3 X-MS-TrafficTypeDiagnostic: AM8PR08MB6371:|PAXPR08MB7188: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:2449;OLM:2449; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: CNVNHijh+W6JKMq1eh1rG5Ca9MlwhxDgONSTYQ5v8WFdu2iiC1HCT9auBVf4YAok5U57NfbMR2NOewtLRM7NY/ubtMOCH2IMkCiGE/8TlPU6ePshjf4mGCzFn8ELAB/X6tjNtjWSUtXayxtHCRF7jr4dXlyglO8BJRMiI45NxxugvlmTa5m1c5ICW1kAJ5EMaqfHT7wOCrcPM4PFMvBp4eK7/yjojFxZ2uatECSTRGIS2E91o5eD/yBbrzgp8dYVHkHjSH3V9zzTPk1Lls5Jn+LqmBI3ulmLznkorudZj6DTu1miObucHi+z7eozO9fq5ITTNNRHva1Gtw+cCyXfJ2ekmje3nTDgahP69oQzT1/gOwlfnhfyjWpoUFApIf2KLpsHOjC3Z27MhEJPowmVPW3JNJArNglYoVBYaqrM4invtiuIH+/eP9hSD1R2hq5IplsV5JV0LmWrjysN3AU/fz04IO3EgINeC4U0JZuFwJv4dBZkUghnewmZH89UMxQ3zfktjOgTL+dNA0USEDTdFDBxPEmK0yh1bcQpsupbcUH+Wr426Xg3sMBSwcSVUbo706UVDBMO/IAIf9oZYtpV0SMARoipITU4CYJGEE94DeM+kwCgMIuLz+S3JgxNQM3TM3J1DdN5vrmgAxXsxU1N+R+LZYTYecCJfpG9DC2qB/vY5ibKS8bWXsScsLqhjr9tWdvPVZ/ZT2/Ouho8DDoN4RaTc5hLK6s4T/dm1YPFrSgUCaXwg3ZFdRSl5WTsYUVUKTkY/i6e4+eZz+9n4JJ+kQcThyvRxWZy8pTDh3ZzC3k= 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:(4636009)(346002)(396003)(39860400002)(376002)(136003)(46966006)(36840700001)(186003)(2616005)(336012)(356005)(44832011)(81166007)(2906002)(83380400001)(426003)(82740400003)(8676002)(1076003)(86362001)(8936002)(47076005)(36860700001)(5660300002)(82310400003)(36756003)(34070700002)(478600001)(6666004)(70586007)(70206006)(4326008)(7696005)(316002)(110136005)(26005)(2101003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR08MB6371 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT052.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 646cedfa-6495-4223-9542-08d95cb25672 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DsZmDzEGkesL6DQNt6wmLe9ROt5I/Fdaz5LaUAvEKdku/3XJcFoC12mHvEZBH83+R3rQ+wTPl/P+rMiIy9QmBPuHAB6QL+Qq8amgds7nJxctCijy/LrkasZdKv1H8EaBSkzb0zCq2KakxlQTR9fC6L31nSlHFwHGwt0ngfgZAHvbsUXxVQlweXTGmMtQHb+Ia32lYe9S/RW1IV1yRBbzpcfmBuMAWs7MPj9uKMw4DobJ11vYGH1DFW1nXDetMwHKaxfwkbx/5SjSWFzJlju5tTiwcoWZulXgaVi44j1+9kyp4oEiK5X1XviHI1P8jX1kbfDTxXnCeMLqg2C263uqHrbukTVLCSp+3GTuUxt/uW0me7ry7WdJc031zxMHHv65S3i9i0MhRVQpVViZJnNfbdTCuEbc+LdH3kOecH7Xt0jgbyDMSLtmR3n9dzEOAilRNTQGjZp1Hf2rmjoQuBMGaJre6vwgq+35Uk+5Wg9SJ9Aj41btPGbFw8NPEFMU+qtiLN6RwGs+Lhc9ntb3xYS/UY+LgjfT+GCaofiS86umPfFliwddULR7E3GjSO9a1GVqjy6N6LSfVb1F5qk1BTIaGfRYCkFLAR8wII8efLdDmgpR7mZ6iNZPUgJGq/aBG3E/cwKs3aVCunGAoxArPenleHkV3ZaYucD5PiPvAMul/5vdHCA1DmAp750hYuPuM9NWsAU/an4H+KyXinLyKhYOP2ZLfWhfX9l26m78B1g1AjM= 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:(4636009)(136003)(376002)(396003)(346002)(39860400002)(46966006)(36840700001)(8676002)(7696005)(82740400003)(83380400001)(6666004)(70586007)(316002)(70206006)(110136005)(26005)(5660300002)(186003)(4326008)(8936002)(47076005)(82310400003)(1076003)(478600001)(86362001)(336012)(36756003)(81166007)(44832011)(2616005)(2906002)(426003)(36860700001)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2021 10:25:34.7286 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9173b6a8-9437-4cb3-4920-08d95cb25ad3 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: DB5EUR03FT052.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB7188 X-ZohoMail-DKIM: pass (identity @armh.onmicrosoft.com) X-ZM-MESSAGEID: 1628677883643100006 Content-Type: text/plain; charset="utf-8" In current Xen code, __node_distance is a fake API, it always returns NUMA_REMOTE_DISTANCE(20). Now we use a matrix to record the distance between any two nodes. Accordingly, we provide a set_node_distance API to set the distance for any two nodes in this patch. Signed-off-by: Wei Chen --- xen/arch/arm/numa.c | 44 ++++++++++++++++++++++++++++++++++++++ xen/include/asm-arm/numa.h | 12 ++++++++++- xen/include/asm-x86/numa.h | 1 - xen/include/xen/numa.h | 2 +- 4 files changed, 56 insertions(+), 3 deletions(-) diff --git a/xen/arch/arm/numa.c b/xen/arch/arm/numa.c index 566ad1e52b..f61a8df645 100644 --- a/xen/arch/arm/numa.c +++ b/xen/arch/arm/numa.c @@ -23,6 +23,11 @@ #include #include =20 +static uint8_t __read_mostly +node_distance_map[MAX_NUMNODES][MAX_NUMNODES] =3D { + { NUMA_REMOTE_DISTANCE } +}; + void numa_set_node(int cpu, nodeid_t nid) { if ( nid >=3D MAX_NUMNODES || @@ -32,6 +37,45 @@ void numa_set_node(int cpu, nodeid_t nid) cpu_to_node[cpu] =3D nid; } =20 +void __init numa_set_distance(nodeid_t from, nodeid_t to, uint32_t distanc= e) +{ + if ( from >=3D MAX_NUMNODES || to >=3D MAX_NUMNODES ) + { + printk(KERN_WARNING + "NUMA nodes are out of matrix, from=3D%u to=3D%u distance=3D%u= \n", + from, to, distance); + return; + } + + /* NUMA defines 0xff as an unreachable node and 0-9 are undefined */ + if ( distance >=3D NUMA_NO_DISTANCE || + (distance >=3D NUMA_DISTANCE_UDF_MIN && + distance <=3D NUMA_DISTANCE_UDF_MAX) || + (from =3D=3D to && distance !=3D NUMA_LOCAL_DISTANCE) ) + { + printk(KERN_WARNING + "Invalid NUMA node distance, from:%d to:%d distance=3D%d\n", + from, to, distance); + return; + } + + node_distance_map[from][to] =3D distance; +} + +uint8_t __node_distance(nodeid_t from, nodeid_t to) +{ + /* + * 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 >=3D MAX_NUMNODES || to >=3D MAX_NUMNODES ) + return from =3D=3D to ? NUMA_LOCAL_DISTANCE : NUMA_NO_DISTANCE; + + return node_distance_map[from][to]; +} +EXPORT_SYMBOL(__node_distance); + void __init numa_init(bool acpi_off) { uint32_t idx; diff --git a/xen/include/asm-arm/numa.h b/xen/include/asm-arm/numa.h index bb495a24e1..559b028a01 100644 --- a/xen/include/asm-arm/numa.h +++ b/xen/include/asm-arm/numa.h @@ -12,8 +12,19 @@ typedef u8 nodeid_t; * set the number of NUMA memory block number to 128. */ #define NODES_SHIFT 6 +/* + * 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 =20 extern void numa_init(bool acpi_off); +extern void numa_set_distance(nodeid_t from, nodeid_t to, uint32_t distanc= e); =20 /* * Temporary for fake NUMA node, when CPU, memory and distance @@ -21,7 +32,6 @@ extern void numa_init(bool acpi_off); * symbols will be removed. */ extern mfn_t first_valid_mfn; -#define __node_distance(a, b) (20) =20 #else =20 diff --git a/xen/include/asm-x86/numa.h b/xen/include/asm-x86/numa.h index 5a57a51e26..e0253c20b7 100644 --- a/xen/include/asm-x86/numa.h +++ b/xen/include/asm-x86/numa.h @@ -21,7 +21,6 @@ extern nodeid_t apicid_to_node[]; extern void init_cpu_to_node(void); =20 void srat_parse_regions(u64 addr); -extern u8 __node_distance(nodeid_t a, nodeid_t b); unsigned int arch_get_dma_bitsize(void); =20 #endif diff --git a/xen/include/xen/numa.h b/xen/include/xen/numa.h index cb08d2eca9..0475823b13 100644 --- a/xen/include/xen/numa.h +++ b/xen/include/xen/numa.h @@ -58,7 +58,7 @@ static inline __attribute__((pure)) nodeid_t phys_to_nid(= paddr_t addr) #define node_spanned_pages(nid) (NODE_DATA(nid)->node_spanned_pages) #define node_end_pfn(nid) (NODE_DATA(nid)->node_start_pfn + \ NODE_DATA(nid)->node_spanned_pages) - +extern u8 __node_distance(nodeid_t a, nodeid_t b); extern void numa_add_cpu(int cpu); =20 struct node { --=20 2.25.1 From nobody Sat May 4 03:49:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=2; a=rsa-sha256; t=1628677907; cv=pass; d=zohomail.com; s=zohoarc; b=LQSrXhdEXMxZJoYYLZDhRPsE3RS8S+d+TXopbhMXFaX/GE1BbgksvJLdG7kGRfTJPVmity43fjZNUzgEsLMHfd7ido6Bb6iQuyredoCvMwBZYffM6l66BzqVkiJ2ZSwSxNoRtOtGK97tZ3IurcMm3rrOK8BWC/EqLwZvkBxgA1E= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628677907; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=C7gc62amk+AdDN6sirEJxKpJ++i0p773bONvwikpyjY=; b=D8pMhF+iQRfvlqzitvMwKaCUDgMhKF0aLG6zcMLB+bzKS8nWS0aVBBgFz/o9RkNjGYMD8qpwdTku/GOFcfZSj0GhKxxaS3u35/Fsun8vjUp+Y6Z1v7l1OZQRba+M3IKRtOHI+suJ5H8Ej+g54GhkTjPW03Gk3Ctdb+0ZUpjHi6M= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1628677907452479.3843685976682; Wed, 11 Aug 2021 03:31:47 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.165726.302929 (Exim 4.92) (envelope-from ) id 1mDlWD-0007IX-73; Wed, 11 Aug 2021 10:31:29 +0000 Received: by outflank-mailman (output) from mailman id 165726.302929; Wed, 11 Aug 2021 10:31:29 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlWC-00079t-F0; Wed, 11 Aug 2021 10:31:28 +0000 Received: by outflank-mailman (input) for mailman id 165726; Wed, 11 Aug 2021 10:31:23 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlRR-0000BQ-EW for xen-devel@lists.xenproject.org; Wed, 11 Aug 2021 10:26:33 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (unknown [2a01:111:f400:7e1a::629]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 2afdca48-3fe6-451f-b879-b76fa520a6ca; Wed, 11 Aug 2021 10:25:38 +0000 (UTC) Received: from DB6PR07CA0157.eurprd07.prod.outlook.com (2603:10a6:6:43::11) by DB7PR08MB3433.eurprd08.prod.outlook.com (2603:10a6:10:48::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.13; Wed, 11 Aug 2021 10:25:36 +0000 Received: from DB5EUR03FT025.eop-EUR03.prod.protection.outlook.com (2603:10a6:6:43:cafe::a8) by DB6PR07CA0157.outlook.office365.com (2603:10a6:6:43::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.6 via Frontend Transport; Wed, 11 Aug 2021 10:25:36 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT025.mail.protection.outlook.com (10.152.20.104) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:25:36 +0000 Received: ("Tessian outbound 077ab11054bf:v101"); Wed, 11 Aug 2021 10:25:36 +0000 Received: from 7cac37810ffc.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 86FF1607-A9F0-4732-AFC9-5B2442877FEE.1; Wed, 11 Aug 2021 10:25:29 +0000 Received: from EUR03-AM5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 7cac37810ffc.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 11 Aug 2021 10:25:29 +0000 Received: from DB9PR06CA0028.eurprd06.prod.outlook.com (2603:10a6:10:1db::33) by AM6PR08MB5175.eurprd08.prod.outlook.com (2603:10a6:20b:ef::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.19; Wed, 11 Aug 2021 10:25:25 +0000 Received: from DB5EUR03FT012.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:1db:cafe::11) by DB9PR06CA0028.outlook.office365.com (2603:10a6:10:1db::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:25:25 +0000 Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT012.mail.protection.outlook.com (10.152.20.161) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:25:25 +0000 Received: from AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2308.14; Wed, 11 Aug 2021 10:25:23 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Wed, 11 Aug 2021 10:25:23 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Wed, 11 Aug 2021 10:25:20 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 2afdca48-3fe6-451f-b879-b76fa520a6ca 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=C7gc62amk+AdDN6sirEJxKpJ++i0p773bONvwikpyjY=; b=V9yCHIbjtNZjW50ukC6RQwdNrPTniVVOg24brU7RF3K5JfjvUPoCA7Ln+YfaEl4yQMit6OHHFXcsAxzOZ6o4m8RwAZctqTVLsl7T8nhRo6n9jw4tlLpT2s7FaCwq/a5yuUR5XyT+mvlOILEkCD+MuouUWolJv436cPD3CAfv+44= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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; X-CheckRecipientChecked: true X-CR-MTA-CID: 02b7615fedc72c2e X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TqLFEiskTVOKDvjS+Tmi08Qn97Vx2tQv3bZkcd2BJn3YJzL1QWMjyvIO+zJ4e8e6W73vMFzUdxvxFRTzJWI1eZPMANwZUTTsrT4XpTzQTsGHWTFdYxYjUdmh5eMW9ULPZkHCmF+/2C6RZu5l9NlIu9tT4EtIYHvDBYUlkS1JgeXC6Exr3aoeuGhQhli4QCdB3Yk0ZaFWQZglKufX9uBqjtinyjF7F3nGKD7Ig3Q+vwkXaEgOXz44919JVC0Ag6LVG/544wDsvO9Rtgfxe3whLgcMSYqm2MPWgnhX56LWV1fG95eXMkWO9WHyqaKjRjEooJ9KAr+GOPBa7TGyICFykQ== 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-SenderADCheck; bh=C7gc62amk+AdDN6sirEJxKpJ++i0p773bONvwikpyjY=; b=BNMxZtmhrMlNsgYDtcFAvgHl2i7SAytbzm7cpXvTj4DvPBw99qON4QrgAFk5jUzNLw9VMsirXyaGGmdN2cF/zqI6OGkQJwLEEL2hUdQEXXBF88FPEc1Lf7zNIPpLotg8KIRRQhaOyrtU8PawATfHEcO/rX/oqOqTZZWc80/2hTyIE3zFxsmAXhffWiIaCwVFTYZ2DnYdMEyBmWqx3nAKzyWzYHpi/LZzZ8WAA6ESHy13te9jxf3at4ixoI80ULWtKlK26zJHcPbgyoEOFNB5O2GjVQzp+OufCLfaNZs5wCRz1Qk68ilYNrPeTqC2bsvGMxl9DirYtwVKShewcXYn0A== 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=C7gc62amk+AdDN6sirEJxKpJ++i0p773bONvwikpyjY=; b=V9yCHIbjtNZjW50ukC6RQwdNrPTniVVOg24brU7RF3K5JfjvUPoCA7Ln+YfaEl4yQMit6OHHFXcsAxzOZ6o4m8RwAZctqTVLsl7T8nhRo6n9jw4tlLpT2s7FaCwq/a5yuUR5XyT+mvlOILEkCD+MuouUWolJv436cPD3CAfv+44= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; 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; From: Wei Chen To: , , , , CC: Subject: [XEN RFC PATCH 21/40] xen/arm: introduce device_tree_numa as a switch for device tree NUMA Date: Wed, 11 Aug 2021 18:24:04 +0800 Message-ID: <20210811102423.28908-22-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210811102423.28908-1-wei.chen@arm.com> References: <20210811102423.28908-1-wei.chen@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4be59d33-8c33-4edc-d3ea-08d95cb25bf6 X-MS-TrafficTypeDiagnostic: AM6PR08MB5175:|DB7PR08MB3433: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:9508;OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 09ob8oqXRgcKeOSA9bnr4c6OdqnODOm+bqSHMazmPZL5B1a6o8MHYLARrETK9MwCzwdGzypZvb2kDArr+5BYuuZbd/xsrL+hF8wnsONakXxZAPS9/CWeb4WTZOcTYxavjt1oGNT5IG5WbiltbAlTH0xFdCZdG2++YDO3mFy/48BcSgw5qUhFZ4fkqqFwGcQfBcjub0q4dUG3Vq1mji28ZHvPUrZ8ihyrpVKuy77NPum5ofFkl3HNz4mpOw+RjtFMuf+Aol9ugEgG97UekP1G8U3k6y7/eZaa4kNSPltiBd3bWZtQrT+3ljY34ZcQ2eL72DIsZuWJZD2CuXxtM8Ud6N4kLf4UohAWNGOSMU9wwiCHnvguCNDBYKVpDGuzGXG4qi1qbNTONfDcWivgyUn0G/RhEyfeGKCkp+Fr0f6VOixZpT3qeEHWnZyKw554c9Ph6ypxESyZ6Di8UV9K2V7v//opWkNEhEWPF4/BKl0J/qlK4h5qgkDmt/DbmBrgHzntHIMPs13wd16Ybg5MwU+4YdfqOUV2nEW8492rPzX/WrNnkhRa6njtIlFkV0/rv2tRHzmahhaleMmciZkn/VkkLiddzFeNWtOdWcLSefM9pR8VjcltlyfV8HYlTthQT5Oa/yjW5bkIf9bwR9ck3Pw89DpKycLUt+NSCoZkuNDBAB5I5B9BjQ66eA5v5rRPtRtdVKVrWBiNAvH5odB0x9F9sHnBAIWWZ1X4CjIqueHKgiVJjca0CreTSZ5JNJSxysl1jZdHwfXVtwdruH1Wr5oJoqg5AkSkCuyO8LIjZOUH2mc0JqLVgbNK+adV3p8yOyScgOVqmUiP1LtuUlcfVgwACXvnM+LhzkcPeRDtfdZhxJpRyn9kC7Rph+WL7EpwyLBCpbb2RRGErxT5DMAddJ06Hw== 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:(4636009)(346002)(376002)(396003)(39860400002)(136003)(36840700001)(46966006)(426003)(2906002)(82310400003)(47076005)(1076003)(6666004)(36860700001)(8936002)(26005)(336012)(36756003)(8676002)(4326008)(34070700002)(478600001)(82740400003)(2616005)(83380400001)(44832011)(356005)(86362001)(70206006)(7696005)(110136005)(5660300002)(316002)(186003)(81166007)(70586007)(2004002)(2101003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB5175 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT025.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 216fdec2-55a0-4d92-3ae4-08d95cb25588 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rqTMCj9DPWghZYgbzBJuNoHc0BxUP15bvEB1uUGB/g50Oslka9w95egGqLpUuKnH1koiMR5I9cEbwFUp8UF0nDC8Udr2BThD0d/i+S60YhNuSuaf+Zoz5f/o0ozvvVjMejbkCgYbwZMa71Z06VverqkbXFKTwErSbGVvLhysthXPsfiPylDKR5HqdcUii87qAvT9G2QetCuoj9kYXdGrI6UCuuyRgNm7QjfPqQjdcUBPj2gbA0ZwI7slxgv35ekHwXZA7ESYHOzATMOaS8YmzdXYXwIpmDByWSlJkAjlZlbAHDyZNzIwRoYqmQ1ZnMgpnMyBJId/HdVI4Rv5HnUW4J5y28C9rBZeLyv+RmlJhpyh3hEfEFXe2FJpMPYkS4/OLGT1wAWaQZpjE5kz7en9V/f5F2lji4HYqLr18897VUv5yGeLeqVsSVrTXPIx6Rsk+fLP9zU9fq6o7kDAD/mZ9AbRK+bf6NXt3NjRZ5ZeJ7QLvVnUw+3rSsR/tsIRtRp508//Ms0bDN9SwWfcvNA8Ktu7iy/nQNq+8MusBR5SvVQemT++/DLrifvKGk+IvqxClK2xhj4Cz+zsTtxnBtUNlhjb06bgL/h0apVcfyQq7MStzipsiBweE8Zj6zXkD357KUHZkzjYaAFLPW21NwriV9ej3FSR9MB+q7XC09WTlk4gKVDEiK33fOAFZVSqGFqHop2cohexnkie9Nt2x1Jmz/ChVzvZUT9ArxCg4nyuO4C6eJxqqa4zOArfI2WNJ0/ixY3Byg6KJCDiPt/J54Fcc0qpmeAVaNTLjby3rV991ktJsHTecool9dQv1nkiToOMAEQn8um4+IqowhcILnH1nA== 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:(4636009)(39850400004)(396003)(376002)(136003)(346002)(46966006)(36840700001)(7696005)(8936002)(44832011)(8676002)(70586007)(70206006)(336012)(82310400003)(47076005)(83380400001)(4326008)(186003)(36756003)(26005)(478600001)(316002)(86362001)(81166007)(110136005)(5660300002)(2906002)(2616005)(6666004)(426003)(82740400003)(1076003)(36860700001)(2004002)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2021 10:25:36.6402 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4be59d33-8c33-4edc-d3ea-08d95cb25bf6 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: DB5EUR03FT025.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB3433 X-ZohoMail-DKIM: pass (identity @armh.onmicrosoft.com) X-ZM-MESSAGEID: 1628677908349100001 Content-Type: text/plain; charset="utf-8" Like acpi_numa in x86 as a switch for ACPI based NUMA, we introduce device_tree_numa as a switch for Arm device tree based NUMA. When NUMA information in device tree is invalid, this switch will be set to -1, then NUMA support for Arm will be disabled, even if user set numa_off=3D0. Keep using bad_srat and srat_disabled functions name, because we will reuse node_covers_memory and acpi_scan_nodes code for Arm. These functions are using these two API names. And, as device tree can be treated as one kind of static resource table. So we keep these two function names. Signed-off-by: Wei Chen --- xen/arch/arm/Makefile | 1 + xen/arch/arm/numa_device_tree.c | 35 +++++++++++++++++++++++++++++++++ xen/include/asm-arm/numa.h | 2 ++ 3 files changed, 38 insertions(+) create mode 100644 xen/arch/arm/numa_device_tree.c diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile index 6e3fb8033e..13e1549be0 100644 --- a/xen/arch/arm/Makefile +++ b/xen/arch/arm/Makefile @@ -36,6 +36,7 @@ obj-y +=3D mem_access.o obj-y +=3D mm.o obj-y +=3D monitor.o obj-$(CONFIG_NUMA) +=3D numa.o +obj-$(CONFIG_DEVICE_TREE_NUMA) +=3D numa_device_tree.o obj-y +=3D p2m.o obj-y +=3D percpu.o obj-y +=3D platform.o diff --git a/xen/arch/arm/numa_device_tree.c b/xen/arch/arm/numa_device_tre= e.c new file mode 100644 index 0000000000..1c74ad135d --- /dev/null +++ b/xen/arch/arm/numa_device_tree.c @@ -0,0 +1,35 @@ +// 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 +#include + +s8 device_tree_numa =3D 0; + +int srat_disabled(void) +{ + return numa_off || device_tree_numa < 0; +} + +void __init bad_srat(void) +{ + printk(KERN_ERR "DT: NUMA information is not used.\n"); + device_tree_numa =3D -1; +} diff --git a/xen/include/asm-arm/numa.h b/xen/include/asm-arm/numa.h index 559b028a01..756ad82d07 100644 --- a/xen/include/asm-arm/numa.h +++ b/xen/include/asm-arm/numa.h @@ -23,6 +23,8 @@ typedef u8 nodeid_t; #define NUMA_LOCAL_DISTANCE 10 #define NUMA_REMOTE_DISTANCE 20 =20 +extern s8 device_tree_numa; + extern void numa_init(bool acpi_off); extern void numa_set_distance(nodeid_t from, nodeid_t to, uint32_t distanc= e); =20 --=20 2.25.1 From nobody Sat May 4 03:49:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=2; a=rsa-sha256; t=1628677920; cv=pass; d=zohomail.com; s=zohoarc; b=TAGrWjDnSa4nO588CjRmn4gwYago7BJT9WyHD08i3Nqe2kOfSVIK2vUXFFlVwlickPSzBodATAZJbbi90a1XP2UGHeQAQ/zSiip7YU50iFku0YmfvhiOb2YzMmsH6wOqRkbM118DoIw13ByfIv1I16GNK4EOTTl9W87BxtaBiL0= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628677920; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=tJdqw/WESrBdaASbDcLiFFaHTeYsE5uHyM9TMKEbuAg=; b=G2fqZfHvi4jCIZ0sTLtqOfm9I2OeSWxIBO5x+uSTYESF/dvdm7gCut14EWzWmRaCGEOAenVHDbhZeR1ftUI20r81fueyZ3IlnXDOMmZGp/fxvMvGfa1cl5ZHpAkEoz4nZ3LaMqUhawW+Qq43pQ3M/XsDsmtIwA+mDUEitqi/SWk= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1628677920230163.0406905258526; Wed, 11 Aug 2021 03:32:00 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.165772.302994 (Exim 4.92) (envelope-from ) id 1mDlWS-0002HA-QV; Wed, 11 Aug 2021 10:31:44 +0000 Received: by outflank-mailman (output) from mailman id 165772.302994; Wed, 11 Aug 2021 10:31:44 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlWR-00029H-RL; Wed, 11 Aug 2021 10:31:43 +0000 Received: by outflank-mailman (input) for mailman id 165772; Wed, 11 Aug 2021 10:31:40 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlRg-0000BQ-Eg for xen-devel@lists.xenproject.org; Wed, 11 Aug 2021 10:26:48 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (unknown [40.107.22.81]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id ca0173c4-c714-4ae9-8de7-ede4a1f1d539; Wed, 11 Aug 2021 10:25:42 +0000 (UTC) Received: from DBBPR09CA0031.eurprd09.prod.outlook.com (2603:10a6:10:d4::19) by VI1PR08MB4541.eurprd08.prod.outlook.com (2603:10a6:803:f9::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.19; Wed, 11 Aug 2021 10:25:39 +0000 Received: from DB5EUR03FT035.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:d4:cafe::61) by DBBPR09CA0031.outlook.office365.com (2603:10a6:10:d4::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.15 via Frontend Transport; Wed, 11 Aug 2021 10:25:39 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT035.mail.protection.outlook.com (10.152.20.65) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.14 via Frontend Transport; Wed, 11 Aug 2021 10:25:39 +0000 Received: ("Tessian outbound 7b804b1d9bbf:v101"); Wed, 11 Aug 2021 10:25:39 +0000 Received: from 6e46e89ab710.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 646000BB-06E3-49E7-BA0F-AA52E0AA75C3.1; Wed, 11 Aug 2021 10:25:32 +0000 Received: from EUR01-VE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 6e46e89ab710.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 11 Aug 2021 10:25:32 +0000 Received: from DU2PR04CA0230.eurprd04.prod.outlook.com (2603:10a6:10:2b1::25) by AM7PR08MB5415.eurprd08.prod.outlook.com (2603:10a6:20b:10d::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.21; Wed, 11 Aug 2021 10:25:31 +0000 Received: from DB5EUR03FT028.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:2b1:cafe::d6) by DU2PR04CA0230.outlook.office365.com (2603:10a6:10:2b1::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.13 via Frontend Transport; Wed, 11 Aug 2021 10:25:31 +0000 Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT028.mail.protection.outlook.com (10.152.20.99) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4415.14 via Frontend Transport; Wed, 11 Aug 2021 10:25:31 +0000 Received: from AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2308.14; Wed, 11 Aug 2021 10:25:25 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Wed, 11 Aug 2021 10:25:26 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Wed, 11 Aug 2021 10:25:23 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: ca0173c4-c714-4ae9-8de7-ede4a1f1d539 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=tJdqw/WESrBdaASbDcLiFFaHTeYsE5uHyM9TMKEbuAg=; b=xM06aacso6FJmHHGd+8YXh50A9tLYqAAT5U3JzJFQfr8vLzNuxT/fVLpWwDe1fCaLZK2Bje54b50RwM7WhsdKJoOfdWZL7yY0Ce03g1rnR5p4E2bfSBCshF0lSF26bE5SHqVdsf5T2KIPkbt69XJTzILcYMVtdxEe+kqCDi05EE= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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; X-CheckRecipientChecked: true X-CR-MTA-CID: 5e180c4a8c8508b1 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UuefLb6Wknlk6Zb1WxqaNj/Oww2DOpwbfPl7I//aK9nSaT93xH2XhTpzOp8CcZq5/UnubsTyq3f1/Q7E5gtBUL7tI5kg/iFTqc7fC6CGBp0MpOWuN2/d0MUwj92jx8vN4v7JUwGxO9tnKtQHEsv1Tw8NBupGZ6VGBterW/nBAOnIrK5/9U10gEtuPMXoVM1AFptIn0IwmRKnEqEkilObUt7yuzf0QSEYZmb/4dJ6I8y6lWZuNcCpDefgr9lQ75IbMJyr/tk4+vQ06voFZehyc2eTUn4RQAwEXHZoHxp4fUSEN5RyKmoUn0jrs6YpE97hYo19A3NgjuItOiS+GlmbCw== 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-SenderADCheck; bh=tJdqw/WESrBdaASbDcLiFFaHTeYsE5uHyM9TMKEbuAg=; b=bgOs3lYnePVKnu4FtcWUB60z70oFi1CBDTMqXitHMmcrSjrxCvUg1bxlTBTv/20D1jhtEGJ4jzwz/GfeJO7NCuLvyfMyJEcWwAVJYaMJriY2b3sCTnvwqReGHyf/LASzY1y85PQ2DFGZvhqfFLdLk9xP5ub/dak0tbBnlKh7M8qwasFNet275VokjVassZ5JG6emhU3Ezu5aFFA7JIxS9s/ohx+ZXymRC72YaBWaaLKcKPow4pZelGSM7UL25+NDLa+NrjkYfxloTaVfKXhOQJdxj+tWutzdORYDb8AkBVv7FxjKPTNtjKAmWF+GjBsQ3lCrHQ2zD7Fc5j16MzCcCw== 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=tJdqw/WESrBdaASbDcLiFFaHTeYsE5uHyM9TMKEbuAg=; b=xM06aacso6FJmHHGd+8YXh50A9tLYqAAT5U3JzJFQfr8vLzNuxT/fVLpWwDe1fCaLZK2Bje54b50RwM7WhsdKJoOfdWZL7yY0Ce03g1rnR5p4E2bfSBCshF0lSF26bE5SHqVdsf5T2KIPkbt69XJTzILcYMVtdxEe+kqCDi05EE= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; 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; From: Wei Chen To: , , , , CC: Subject: [XEN RFC PATCH 22/40] xen/arm: introduce a helper to parse device tree processor node Date: Wed, 11 Aug 2021 18:24:05 +0800 Message-ID: <20210811102423.28908-23-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210811102423.28908-1-wei.chen@arm.com> References: <20210811102423.28908-1-wei.chen@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a4962245-712c-433c-6ed8-08d95cb25da9 X-MS-TrafficTypeDiagnostic: AM7PR08MB5415:|VI1PR08MB4541: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:9508;OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 7ZJeEoHDM/jCTyjusdBToazj8npPidTTW9b50HnBa0x2GaPHZlGe+Yes09GOIKq3rDkTegC7GT+7iy32PJIdjdfzpL9O2nN5zgSnJtcVBFwhQ0tcgoSc+52Sm+LDLhGpqR3NkXxVPFaJSdfICQu1zZzKoajw8hUGcf2+fKoqCvI7vJoEY+TBBSrLLg5R0srXysrKuylilE93AGUC4AzGl0nSN39TRiw5+T2iCLd/iTbQS9gKCEpDrcjyFnqOgkAyEOHAelvfDeWDrAxxmtZ/Vb8vdeESKgwFOoxqGJgbQuaZTnA2x9VFMKjI+IGwLLjaM5S0zjtWp3oXD/sKGcLTxqQOzUl4RjEYE1gxeMf7EStgyuZwbr6kpfAbEK1Er095UnfyjaA2fNO5JittXBFw2GoH9WKWo7caVjueQHpTF6wNSa1fwkaEiQUWhg7idkOA2e4doTcywb6vmEwE8Y+g7TuStK6f35zp1sMYeDP9+o9FyBczMn5amYcIrlTjiCTWyqBTAE/ofwmm8BFvC0bHaHFqR20RqZBroBQUM6An3jUkGr5rVGukxhDN+VmMuxHzIlrAoccVFp53Nkq6NV9qcsjmIjPoNFBgIZel4gzbaDKntZ/Xd8UMsHc2wxlBGyhKkAVjpwBSaDUZ9xXRONThcdhmo/vp8h7IHAbL+M/KFBs7LPkgK73cRwihNpWhQMOL51BfWelRIc0NY9tcirYULn8C3rvgQmVVrUemHzCYt4pRs1RM8IcP950Q2zQ3hecfogQcZhO1pb0DtnyGO/beA+n60xRNtNhpdPTDDLL6Bng= 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:(4636009)(346002)(39850400004)(376002)(396003)(136003)(46966006)(36840700001)(316002)(110136005)(356005)(4326008)(2616005)(478600001)(44832011)(47076005)(81166007)(36860700001)(70586007)(86362001)(82740400003)(336012)(426003)(7696005)(70206006)(82310400003)(8936002)(2906002)(8676002)(1076003)(26005)(36756003)(6666004)(34070700002)(5660300002)(83380400001)(186003)(2101003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR08MB5415 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT035.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 67fd6f5b-cb5b-48b3-e9dd-08d95cb258ae X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Bqkz9zJytwuUtozJWDbiVnWJ0Ej4CzGzQ1swrAq5LU/g9RNrMZ9PNGg0fJ1xhBd94g623AaYSI2EVXa07Ne1qPkmmpWV9mKEAbVLBfR9abM4LNfdtCIdV2l6o8bzANaWhNIq67YfS5Nr1s+ECJ2LQPuGonw7Pkb8ZZt73yQrjnIBhK41S+l9xfvOoTMt9HFZbDkxvllxzk7xQ8x/f6DPnQ+DGsE03QcUXyzVMKGQVaztJG1O4M+pXTYTSwS8j2uHgE941vWQNcg5LAxRRZN0cJ433eNLdtlNA6Ovw59kMbNNYbydlPqIsmElDAfY7yw7ig2pGvlBIZJC++pgimdFrSinw8lWb/c1W/Iv3youfbWMc2SwGeCAd4+tOT4RwWWqi5vvRyqI7KulcPDJ63brxAtyFoudIp/Y2PIwe2+IkxEYB6r0Opmhy5igOkLZZvKIwN3SL99OkPN7zh+HMSwkashrb0WYaYGohdtiME/3OrZ6Mhc5iZqltaFqPjSxGh2Ephit/Z0SuaTmu5Rk+VztkmJ7s9WtjWLxyYLDbijKbJrIHnZJc7OWLV5rUCPn1mihayAoxMm9IL0IOsPfvghyaQWMFdl+puBteO+9kjmm8POwO1j29oZrXOeI39cmuv0r4hrTb9LlbDchOv9HNIjBie+LYATwxCwCbO5xmK/BKnJj5rm6Cp6Jw/ami5l4NUlFObqCGSky1TkWL8LAZBWF0xpjBWn7ZRdAf2xTvg87cuU= 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:(4636009)(136003)(376002)(346002)(396003)(39860400002)(36840700001)(46966006)(36860700001)(26005)(70586007)(2616005)(86362001)(6666004)(2906002)(186003)(70206006)(44832011)(82310400003)(426003)(478600001)(110136005)(316002)(8936002)(7696005)(4326008)(82740400003)(1076003)(36756003)(8676002)(5660300002)(81166007)(83380400001)(47076005)(336012)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2021 10:25:39.4885 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a4962245-712c-433c-6ed8-08d95cb25da9 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: DB5EUR03FT035.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB4541 X-ZohoMail-DKIM: pass (identity @armh.onmicrosoft.com) X-ZM-MESSAGEID: 1628677921709100001 Content-Type: text/plain; charset="utf-8" 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 --- xen/arch/arm/numa_device_tree.c | 41 +++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/xen/arch/arm/numa_device_tree.c b/xen/arch/arm/numa_device_tre= e.c index 1c74ad135d..37cc56acf3 100644 --- a/xen/arch/arm/numa_device_tree.c +++ b/xen/arch/arm/numa_device_tree.c @@ -20,16 +20,53 @@ #include #include #include +#include +#include =20 s8 device_tree_numa =3D 0; +static nodemask_t processor_nodes_parsed __initdata; =20 -int srat_disabled(void) +static int srat_disabled(void) { return numa_off || device_tree_numa < 0; } =20 -void __init bad_srat(void) +static __init void bad_srat(void) { printk(KERN_ERR "DT: NUMA information is not used.\n"); device_tree_numa =3D -1; } + +/* Callback for device tree processor affinity */ +static int __init dtb_numa_processor_affinity_init(nodeid_t node) +{ + if ( srat_disabled() ) + return -EINVAL; + else if ( node =3D=3D NUMA_NO_NODE || node >=3D MAX_NUMNODES ) { + bad_srat(); + return -EINVAL; + } + + node_set(node, processor_nodes_parsed); + + device_tree_numa =3D 1; + printk(KERN_INFO "DT: NUMA node %u processor parsed\n", node); + + return 0; +} + +/* Parse CPU NUMA node info */ +int __init device_tree_parse_numa_cpu_node(const void *fdt, int node) +{ + uint32_t nid; + + nid =3D device_tree_get_u32(fdt, node, "numa-node-id", MAX_NUMNODES); + printk(XENLOG_WARNING "CPU on NUMA node:%u\n", nid); + if ( nid >=3D MAX_NUMNODES ) + { + printk(XENLOG_WARNING "Node id %u exceeds maximum value\n", nid); + return -EINVAL; + } + + return dtb_numa_processor_affinity_init(nid); +} --=20 2.25.1 From nobody Sat May 4 03:49:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=2; a=rsa-sha256; t=1628677904; cv=pass; d=zohomail.com; s=zohoarc; b=F+TiOeNpo33bdzkQ93/2xrsWMwAwLGFjXk99uos4jpweIX/ZhmX+fYWOG1Al4/Aic8afUs4OdPQYEAlNfLcJfxK2WCBka4X3QjpVUOt62L/37LLO3bCCOStma51ZU4DUCh6j0xQqOVDon+HKh+SInJTgl8Y4uQeCQQlFfnG6cFA= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628677904; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=iOH05sifhuQzcpRT3Qs8FnL8mDtMKXH8DTapkC3LA0o=; b=OeQlM/WLJlyMQr2RN7KtnTt1KT5EY46dok/m819yYFRt5kMbgItNQeC5dKxFSGQLioAKDB9g6mJmLLEWqA9Id5PotJZ2+vB/E2PTMTJtUG5RQ/GDkgQQ1IMv54dB2jxcf36IpDg+YxH3xHgSWsO+6H3ljWvqk2I/uwaqbkqRtEI= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1628677904017104.29131884094443; Wed, 11 Aug 2021 03:31:44 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.165724.302920 (Exim 4.92) (envelope-from ) id 1mDlWB-0006xH-IK; Wed, 11 Aug 2021 10:31:27 +0000 Received: by outflank-mailman (output) from mailman id 165724.302920; Wed, 11 Aug 2021 10:31:27 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlWA-0006tL-V2; Wed, 11 Aug 2021 10:31:26 +0000 Received: by outflank-mailman (input) for mailman id 165724; Wed, 11 Aug 2021 10:31:22 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlSU-0000BQ-G8 for xen-devel@lists.xenproject.org; Wed, 11 Aug 2021 10:27:38 +0000 Received: from EUR02-HE1-obe.outbound.protection.outlook.com (unknown [40.107.1.54]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id b0d107f6-ed81-4e24-8ce5-e2f934523559; Wed, 11 Aug 2021 10:25:58 +0000 (UTC) Received: from AM5PR0701CA0022.eurprd07.prod.outlook.com (2603:10a6:203:51::32) by DBBPR08MB4314.eurprd08.prod.outlook.com (2603:10a6:10:ce::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.17; Wed, 11 Aug 2021 10:25:56 +0000 Received: from AM5EUR03FT016.eop-EUR03.prod.protection.outlook.com (2603:10a6:203:51:cafe::9c) by AM5PR0701CA0022.outlook.office365.com (2603:10a6:203:51::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.4 via Frontend Transport; Wed, 11 Aug 2021 10:25:56 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT016.mail.protection.outlook.com (10.152.16.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.14 via Frontend Transport; Wed, 11 Aug 2021 10:25:56 +0000 Received: ("Tessian outbound ab45ca2b67bc:v101"); Wed, 11 Aug 2021 10:25:56 +0000 Received: from 8eeff61bb6e1.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 76596E82-7C72-4D3F-B57F-77F15178233B.1; Wed, 11 Aug 2021 10:25:34 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 8eeff61bb6e1.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 11 Aug 2021 10:25:34 +0000 Received: from DB7PR05CA0045.eurprd05.prod.outlook.com (2603:10a6:10:2e::22) by AM5PR0802MB2451.eurprd08.prod.outlook.com (2603:10a6:203:9d::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.21; Wed, 11 Aug 2021 10:25:33 +0000 Received: from DB5EUR03FT024.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:2e:cafe::ad) by DB7PR05CA0045.outlook.office365.com (2603:10a6:10:2e::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.14 via Frontend Transport; Wed, 11 Aug 2021 10:25:33 +0000 Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT024.mail.protection.outlook.com (10.152.20.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:25:33 +0000 Received: from AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2308.14; Wed, 11 Aug 2021 10:25:28 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Wed, 11 Aug 2021 10:25:28 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Wed, 11 Aug 2021 10:25:25 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: b0d107f6-ed81-4e24-8ce5-e2f934523559 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=iOH05sifhuQzcpRT3Qs8FnL8mDtMKXH8DTapkC3LA0o=; b=h7k8kV4sHOqLuCE1j1SJpw/E7leLYZjBAzxBKy5J4YFNrmUFqSrQXa3If964hrSFsCRJ4dffGcNJx1BjSilMjlFd0nZJhaVKLRMdSXt1vdskRtJtl3QLIrMAy/76Fx/Qytppj2/0b4YmvyrDSfINFNc5mIYQKIw43ejwWqRakZM= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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; X-CheckRecipientChecked: true X-CR-MTA-CID: 0cfbb24433a938be X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SKVsYL2yubwMsE98Gky6IJU/Xe1n6vL2iDeKxH+o5lrEOTnE7ipCXHkinNNw2tjVXoLuDF0f4mn3rvYQcdrzLclG6SadHbnszdX81v6z3ccHtb0POB35csYhNokV2A88G+APeDlaef0WsjraYgIDB60Csf8IZ+Jezbb6f9It0ZsfJUGAV6UQIYIOopgz7aiaQNS8fpm8XMUNEeu3GRiS2r990Lx2ribm75Piu2z0FBvdrMUH/8d2LAA/4veYcGxGmdqvcDJCBkozDlEHNN7z2XVHVcsvnjUon0VGCIklfNPO5xVf88z40NT7ql/AZL6HRLeu17WZCly6AdOoFQDFBg== 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-SenderADCheck; bh=iOH05sifhuQzcpRT3Qs8FnL8mDtMKXH8DTapkC3LA0o=; b=IrfvEmmHoM3h66+KSk7hZERgqwhdx6avDL4WpQHouyzhb6oQGi4Sbc/9zmk33lixvd8T4EcYRGM/XssuwUtbpuHLQFLjiDMofb/sH/TI0wogR6kXsOpCo6VK3mptNXAnTrDj/F3HoRW+CPTybqZwzYPgrDV8IBo97okX2IeW+rEKkBavHAHbn/P21VJn4cc6HFcXBpntMFDd+/VLsbhj//Iwo3XxjZUZtQJDr2ZhK5PY9Pnp/31drCvw8kwkSugYpmXdLbM31YggJLoPztXdj2bGNyPZBODwJjh+AdODPOfBlU+rTtQnw8SOklr1qd0h0J8nlY3LpvzFfyJlj7u12Q== 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=iOH05sifhuQzcpRT3Qs8FnL8mDtMKXH8DTapkC3LA0o=; b=h7k8kV4sHOqLuCE1j1SJpw/E7leLYZjBAzxBKy5J4YFNrmUFqSrQXa3If964hrSFsCRJ4dffGcNJx1BjSilMjlFd0nZJhaVKLRMdSXt1vdskRtJtl3QLIrMAy/76Fx/Qytppj2/0b4YmvyrDSfINFNc5mIYQKIw43ejwWqRakZM= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; 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; From: Wei Chen To: , , , , CC: Subject: [XEN RFC PATCH 23/40] xen/arm: introduce a helper to parse device tree memory node Date: Wed, 11 Aug 2021 18:24:06 +0800 Message-ID: <20210811102423.28908-24-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210811102423.28908-1-wei.chen@arm.com> References: <20210811102423.28908-1-wei.chen@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6239f186-01bd-4779-7866-08d95cb267b9 X-MS-TrafficTypeDiagnostic: AM5PR0802MB2451:|DBBPR08MB4314: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:8882;OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 3ojiCzWck34GgIl326ga518rTAcUOG2C1VbmrEoevtZSfmmzt4MqDvnbVcw4OWMybOIATiPcqcTQlr0o5mNsyv7iGTwt/RXmYrcf1zK9ca7k7Y36gOjn4mL8bsAglRiRgetxpWGGCxnReuFAGG9NfkHyYlABdPRNJ1OFZgphqv4ahXR2kRtq+12nYdFc1WPtyY/v3gMPHzgo1P3gni5nOc0WzTEDSWMY2NGGBzUqNMBvpAXYNXqc4ohKRyLP0A5Kt8UIwmf2z0RJqVeB6yz2xNJLIx48qnAi1+EHTbSQRyeLXAwOVJuVgmIbDuCqxGOBZGCL5BPVpxqtJhUm/tlYNP8myWCweSGBlXBBGFZXt8+bV9th+Tpp7jgMOwnleBrzgqjES56hKpjfVNuCxnzrPXAmoR+FnnyoVKJFsLRZr1+V15L1X6/69gmOtpZqc4z56V0FNaK0nfwPsQOwSt2+59x95R2OmfyEo0Lkg4KXhwgaxi+enU7t00mLh1WiLcps5TIn4kVuWT/jALdBJ6YzfI7S1wd0LeOy4+OT1d6VzUnet4DlTe9r0a5HEofzwat/Nky97X445M0+Plp1fudh9dogRnKyfZmh+UieuWKuK4w3Rh6v4UNNXvW3DCjHNoAt39Rp/geh+RETPHYLPyRSW/mUM2La2C7A8NAjOw4WvZSaKVrjvebX1D0Zx06WMovS7WElb0hAPO/cLriU7mD/hhKQZ2Uf/v98MuesFpAAZLrrRnpha41aCn9t7ucTafy3qZ3mVSPuuFHW3lD013Lg0e5G0uVTJcRka2NI2amUSSA= 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:(4636009)(46966006)(36840700001)(186003)(70206006)(83380400001)(2906002)(8676002)(81166007)(336012)(70586007)(4326008)(8936002)(47076005)(36756003)(508600001)(356005)(7696005)(82310400003)(26005)(36860700001)(2616005)(1076003)(5660300002)(316002)(34070700002)(110136005)(86362001)(6666004)(44832011)(426003)(36900700001)(2101003);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0802MB2451 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT016.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: b39eca59-d21f-4aca-5433-08d95cb259db X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QL92bXEy9IPsxUrun4i5hHHk09CkZKH0pJYm2vn9owbHanq8BRP8M9dWAwNZBKXvz5LdxZo5rsVfo+pVv17DSoBkdR4GvrekgwtZc31CS6l8BxA/BbEQQOxss+HKcM5FujcNiqPCK3yWIhchYuuGxTLSIYE/lJTLFX7tTLsJg3a773iesjp219hFNtekMUBKvSkeHOL4sKIXUs0dobYDeGAG8Qjnyjd81PcLahQLxvta49ev/FXKWffbxejk+OOBVnK+PN0s28SUl9ecpQofntyvs98sNyHWR8QFH444VJY/Gt/UCfkZm00ziovWWrag9RAkbGm5xZblM/HAk2C79NgX11NmHVmvHUiigxTR+AoiK1adpV0mAO3z/HepyeCNJg2+YMKlkVnt+6t6Ro6sGRhFu0qqUKrkHw0X25dU5JwJh7K+Pg6++a+5/ar0aaqQV3+OyYWNtGoWVEtyIAwGhIJv0JDqevXYnzfqtP6N46HWF/LhY66TZg3xjg0wvHAtDKOFyAfptp5GYyB1+Gh2kROGrHgl70S1wJOACTwF9DHpFRDC3LV9+vcherSXqMRodKZEKuziakiRcwh8671yYzMO7kFmcC+tXEaAKd8Kb4zs1+tQoDOGF30loElEhO/i9Ii1v5fHb1GJrOkrLjulfUpMdPPBV3XmoK8D/r0FdOKK44nS9qnt/A12K/PFNDFYlfz6nnBM5KKBIDgzIsb65BfxSC/RAibnAxHv0RBjMNA= 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:(4636009)(39860400002)(376002)(396003)(346002)(136003)(36840700001)(46966006)(82310400003)(426003)(26005)(83380400001)(70586007)(4326008)(336012)(1076003)(478600001)(7696005)(2616005)(47076005)(5660300002)(70206006)(86362001)(8936002)(36860700001)(2906002)(8676002)(316002)(44832011)(6666004)(110136005)(82740400003)(186003)(81166007)(36756003)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2021 10:25:56.3158 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6239f186-01bd-4779-7866-08d95cb267b9 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: AM5EUR03FT016.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB4314 X-ZohoMail-DKIM: pass (identity @armh.onmicrosoft.com) X-ZM-MESSAGEID: 1628677906005100003 Content-Type: text/plain; charset="utf-8" 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. In order to support memory affinity in later use, the valid memory ranges and NUMA ID will be saved to tables. Signed-off-by: Wei Chen --- xen/arch/arm/numa_device_tree.c | 130 ++++++++++++++++++++++++++++++++ 1 file changed, 130 insertions(+) diff --git a/xen/arch/arm/numa_device_tree.c b/xen/arch/arm/numa_device_tre= e.c index 37cc56acf3..bbe081dcd1 100644 --- a/xen/arch/arm/numa_device_tree.c +++ b/xen/arch/arm/numa_device_tree.c @@ -20,11 +20,13 @@ #include #include #include +#include #include #include =20 s8 device_tree_numa =3D 0; static nodemask_t processor_nodes_parsed __initdata; +static nodemask_t memory_nodes_parsed __initdata; =20 static int srat_disabled(void) { @@ -55,6 +57,79 @@ static int __init dtb_numa_processor_affinity_init(nodei= d_t node) return 0; } =20 +/* Callback for parsing of the memory regions affinity */ +static int __init dtb_numa_memory_affinity_init(nodeid_t node, + paddr_t start, paddr_t size) +{ + struct node *nd; + paddr_t end; + int i; + + if ( srat_disabled() ) + return -EINVAL; + + end =3D start + size; + if ( num_node_memblks >=3D NR_NODE_MEMBLKS ) + { + dprintk(XENLOG_WARNING, + "Too many numa entry, try bigger NR_NODE_MEMBLKS \n"); + bad_srat(); + return -EINVAL; + } + + /* It is fine to add this area to the nodes data it will be used later= */ + i =3D conflicting_memblks(start, end); + /* No conflicting memory block, we can save it for later usage */; + if ( i < 0 ) + goto save_memblk; + + if ( memblk_nodeid[i] =3D=3D node ) { + /* + * Overlaps with other memblk in the same node, warning here. + * This memblk will be merged with conflicted memblk later. + */ + printk(XENLOG_WARNING + "DT: NUMA NODE %u (%"PRIx64 + "-%"PRIx64") overlaps with itself (%"PRIx64"-%"PRIx64")\n", + node, start, end, + node_memblk_range[i].start, node_memblk_range[i].end); + } else { + /* + * Conflict with memblk in other node, this is an error. + * The NUMA information is invalid, NUMA will be turn off. + */ + printk(XENLOG_ERR + "DT: NUMA NODE %u (%"PRIx64"-%" + PRIx64") overlaps with NODE %u (%"PRIx64"-%"PRIx64")\n", + node, start, end, memblk_nodeid[i], + node_memblk_range[i].start, node_memblk_range[i].end); + bad_srat(); + return -EINVAL; + } + +save_memblk: + nd =3D &nodes[node]; + if ( !node_test_and_set(node, memory_nodes_parsed) ) { + nd->start =3D start; + nd->end =3D end; + } else { + if ( start < nd->start ) + nd->start =3D start; + if ( nd->end < end ) + nd->end =3D end; + } + + printk(XENLOG_INFO "DT: NUMA node %u %"PRIx64"-%"PRIx64"\n", + node, start, end); + + node_memblk_range[num_node_memblks].start =3D start; + node_memblk_range[num_node_memblks].end =3D end; + memblk_nodeid[num_node_memblks] =3D node; + num_node_memblks++; + + return 0; +} + /* Parse CPU NUMA node info */ int __init device_tree_parse_numa_cpu_node(const void *fdt, int node) { @@ -70,3 +145,58 @@ int __init device_tree_parse_numa_cpu_node(const void *= fdt, int node) =20 return dtb_numa_processor_affinity_init(nid); } + +/* Parse memory node NUMA info */ +int __init +device_tree_parse_numa_memory_node(const void *fdt, int node, + const char *name, uint32_t addr_cells, uint32_t size_cells) +{ + uint32_t nid; + int ret =3D 0, len; + paddr_t addr, size; + const struct fdt_property *prop; + uint32_t idx, ranges; + const __be32 *addresses; + + nid =3D device_tree_get_u32(fdt, node, "numa-node-id", MAX_NUMNODES); + if ( nid >=3D MAX_NUMNODES ) + { + printk(XENLOG_WARNING "Node id %u exceeds maximum value\n", nid); + return -EINVAL; + } + + prop =3D fdt_get_property(fdt, node, "reg", &len); + if ( !prop ) + { + printk(XENLOG_WARNING + "fdt: node `%s': missing `reg' property\n", name); + return -EINVAL; + } + + addresses =3D (const __be32 *)prop->data; + ranges =3D len / (sizeof(__be32)* (addr_cells + size_cells)); + for ( idx =3D 0; idx < ranges; idx++ ) + { + device_tree_get_reg(&addresses, addr_cells, size_cells, &addr, &si= ze); + /* Skip zero size ranges */ + if ( !size ) + continue; + + ret =3D dtb_numa_memory_affinity_init(nid, addr, size); + if ( ret ) { + printk(XENLOG_WARNING + "NUMA: process range#%d addr =3D %lx size=3D%lx failed!= \n", + idx, addr, size); + return -EINVAL; + } + } + + if ( idx =3D=3D 0 ) + { + printk(XENLOG_ERR + "bad property in memory node, idx=3D%d ret=3D%d\n", idx, re= t); + return -EINVAL; + } + + return 0; +} --=20 2.25.1 From nobody Sat May 4 03:49:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=2; a=rsa-sha256; t=1628677901; cv=pass; d=zohomail.com; s=zohoarc; b=K5fXmx9JCH89xcIsuVwyb+twe2PBrBT9IN5c+U/d4ClMx9pYVIAASEv+bTCaYvCco+w7jZkGIrhDKqIWPaQpQDPlapdLhQmIVXj64in34HcRLTd2rOU3lhCoJvO/Kkyfz1Atie+XHMSeCPpDzi1F/EMq1qY6CEJZS1+3QpkpLFc= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628677901; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=EeFam+v6ajvMkhzqL2mzgwF/d0QSwcJY+2wQP0aX944=; b=WsKT8otFDkJBuIIu6MwMCXZ1gwlqtaowz2KUgXfI0OHo/BuGUinbfERjgSIqWpOHJRWC6/bbfYroltCOal1t07RO/XqDCfIxGuLSVFY50FcehTi21pftcCSRJu8cuQRho+VxQu0sAXp1gyMzIXm9feUTg1OU2L1mj2MEEEX3sHQ= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 162867790105670.4917173286002; Wed, 11 Aug 2021 03:31:41 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.165720.302916 (Exim 4.92) (envelope-from ) id 1mDlWA-0006cX-1z; Wed, 11 Aug 2021 10:31:26 +0000 Received: by outflank-mailman (output) from mailman id 165720.302916; Wed, 11 Aug 2021 10:31: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 1mDlW9-0006a8-Fp; Wed, 11 Aug 2021 10:31:25 +0000 Received: by outflank-mailman (input) for mailman id 165720; Wed, 11 Aug 2021 10:31:21 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlRK-0002Qj-Gg for xen-devel@lists.xenproject.org; Wed, 11 Aug 2021 10:26:26 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (unknown [40.107.6.45]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 7d735e58-fa8e-11eb-a052-12813bfff9fa; Wed, 11 Aug 2021 10:25:46 +0000 (UTC) Received: from FR3P281CA0038.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:4a::14) by AM0PR08MB3857.eurprd08.prod.outlook.com (2603:10a6:208:104::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.21; Wed, 11 Aug 2021 10:25:44 +0000 Received: from VE1EUR03FT047.eop-EUR03.prod.protection.outlook.com (2603:10a6:d10:4a:cafe::66) by FR3P281CA0038.outlook.office365.com (2603:10a6:d10:4a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.8 via Frontend Transport; Wed, 11 Aug 2021 10:25:44 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT047.mail.protection.outlook.com (10.152.19.218) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:25:44 +0000 Received: ("Tessian outbound 312d863716bf:v101"); Wed, 11 Aug 2021 10:25:43 +0000 Received: from ae3ebfe48086.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id E4103E1B-28E2-42BA-9599-D597A9794027.1; Wed, 11 Aug 2021 10:25:37 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id ae3ebfe48086.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 11 Aug 2021 10:25:37 +0000 Received: from DB7PR05CA0037.eurprd05.prod.outlook.com (2603:10a6:10:2e::14) by DB6PR0801MB1637.eurprd08.prod.outlook.com (2603:10a6:4:3a::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.19; Wed, 11 Aug 2021 10:25:35 +0000 Received: from DB5EUR03FT024.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:2e:cafe::66) by DB7PR05CA0037.outlook.office365.com (2603:10a6:10:2e::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.13 via Frontend Transport; Wed, 11 Aug 2021 10:25:35 +0000 Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT024.mail.protection.outlook.com (10.152.20.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:25:35 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) 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.2308.14; Wed, 11 Aug 2021 10:25:30 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Wed, 11 Aug 2021 10:25:28 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 7d735e58-fa8e-11eb-a052-12813bfff9fa 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=EeFam+v6ajvMkhzqL2mzgwF/d0QSwcJY+2wQP0aX944=; b=WwhjurqVbqaCK6FSBbiEdvy9S08a0uEw1kf2OT6EtI/gGgxlGZYEIje+rcUYIRFSEQu/aK9Btfk+/sSj33fUVq1M+nLJfFb8k4Eq1QM2dHd243G3WzCvkYOGOS7oikW7f9Vj1LaVVKUg4UI9Rn9Isb7UIyhNBkwT122KJJhV17M= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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; X-CheckRecipientChecked: true X-CR-MTA-CID: 2dae50ff4c724ac6 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Me3ZN3wUJZdH+hGDLk9MJEuH+NB7/lh3TDzFeu9gCJ9083G/fZ8MSAZE+q5Wbiove8QCocwZc3mY9W2iqkZoaI3MBSCk5yhZDUYUMlfKi4VpOoFGiw3MEklCq3SaHAqsovsS/cBQtsjc7MA4GiGE19+paKX+H/6rBsiLnqVu5PyItK8zwrz+kRh73klyZKkrLFcbkN+nSRMjqTsNVhsQMqQJc7XgV/cUNqlcCalgUs9GN5KadxcZEKwDYQCaKMygiOTc/ITCTbCiDFwVHtCyPocuOFT9vyv0gUr1G+XkS7ULjoD/dgj05tqxREffbUd/j1R45/Na7nRHr0k4RHK8lg== 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-SenderADCheck; bh=EeFam+v6ajvMkhzqL2mzgwF/d0QSwcJY+2wQP0aX944=; b=hibgSyTZ/I/xQErSKBffncWN+KnkxLgh89zsSZD7M4oMeL0emQltkZe3feRrWEx7pAask3mvPygHBRY/pFNz4t3nJsKwmri0mJ/5iJrCvzbiTyA/7Q3JJpgq1Qlmk5VwErx8qgYcgsAMUzKKjIne0pppJcXoEScW0J8V6BFJwDM7LsGmFzRXh5yhkwFpjW4daGZe19WamkcDBAqHR2X7QwC30j05oVyg5hq6CHooRCiVn7RcRluPuMeN7oWzyKgIyYbDoPi5POAD3Eb+hgs4rxofzM+7qYK9lovqLHHGt4fhBkfzGQVTH4VLwLCqfA+dAR+FnPY6P68bxWzVzFTnzQ== 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=EeFam+v6ajvMkhzqL2mzgwF/d0QSwcJY+2wQP0aX944=; b=WwhjurqVbqaCK6FSBbiEdvy9S08a0uEw1kf2OT6EtI/gGgxlGZYEIje+rcUYIRFSEQu/aK9Btfk+/sSj33fUVq1M+nLJfFb8k4Eq1QM2dHd243G3WzCvkYOGOS7oikW7f9Vj1LaVVKUg4UI9Rn9Isb7UIyhNBkwT122KJJhV17M= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; 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; From: Wei Chen To: , , , , CC: Subject: [XEN RFC PATCH 24/40] xen/arm: introduce a helper to parse device tree NUMA distance map Date: Wed, 11 Aug 2021 18:24:07 +0800 Message-ID: <20210811102423.28908-25-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210811102423.28908-1-wei.chen@arm.com> References: <20210811102423.28908-1-wei.chen@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f3fc3f31-6bc4-4723-30a6-08d95cb26085 X-MS-TrafficTypeDiagnostic: DB6PR0801MB1637:|AM0PR08MB3857: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:7219;OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: eHhSsoYwZqvxlAMNAvGj7S3LGzH6zAc638L7Cnqejv/rxxKGMuhg2toy7n8OlYE+dAA/dDjMuo4RjBS1ZHd2N+2HQy6R9S9h0X0hoeGi+H6/64TjAe/TH++jhtSXzqgonK/2xRmR7vaaTnb3aWKvwYTzm3zOyCOSx9BixRZMw5xliMzS/CR3gjnWbCpYHDk39UwttNcThyPiTcDWJ1Trw0vZWV17oq8gdunjNPMFyYeB41IwcCZzyGW//s2bdCahz+zneWjqSvKh/jSQPpvc6pQTxZTBEUn2PU05cknM9qk1OXYFPtF84TYfejWZQvpVBlqMZ62nhIA5eTRUjRbOSppEr2TVWyVqe6D5XAH9uuEZUw07r9l76Ud3kgt0chwwqpHk07vvTZWLcaPxnDNYDpICzrv+gaJONfgozlbqvW1oBdljhWn5yrkmRiDeBpj9C00jrStrJC+9h81sFrXSudtr94+NGB2cXwjTfRCXrTJBNKrSFe//LY473Hg4z+quDD6Ugt0KK5M9hdAiIkrdAc/8u2ziyDCmFHLFHoqNc9f8Q7OpzKrDoxu82byVxkj8z/8egZRLPwjmUhcGe4fiZiOR/RLpbS5PPQC0qgU8sHLRHxIZNIYWqxo4dcrGlbnklPtShtVY1NTZdU1V19Z0Sd5M00xG8DbXkMj8MI4LMojzkYZsCh2mspVVVhJWHcWcQQBRiGshKS3r6KpvfPOoDm0qAJ7C6MG6QsOeK41NHn25Tj9FzTPrYt+pBB0OZYO8FkWKsAhqxqnov1pXhvZsJAK9c+46jKcc+zUf4r9Wjsw= 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:(4636009)(376002)(396003)(39850400004)(136003)(346002)(46966006)(36840700001)(47076005)(70206006)(70586007)(7696005)(2616005)(8936002)(34070700002)(426003)(44832011)(110136005)(4326008)(86362001)(5660300002)(81166007)(8676002)(6666004)(186003)(356005)(2906002)(36756003)(478600001)(82740400003)(1076003)(83380400001)(82310400003)(26005)(316002)(36860700001)(336012)(36900700001)(2101003);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0801MB1637 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT047.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 5f4fbaee-efb4-4af9-bac7-08d95cb25b55 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Nokllosg8HiW03KDgHDlI/F77T8AJ/WDwwoXsJA1KkUiCrRDipNUdzZOhxwfrJt2coT/0V8mMjxkchdmb32eg5ejJ7r6GtiIlH0RpWASIZW6HPqTr8m9aoFO8BamEIkZX0J/epvpJ0hD0rs7c1T1aCSXVQlgB6M7lSz1rHikAeAWsANE9TFYPSd8ohcCd46KFJohMxZK/vnQt+OzYJw9ofo9oHH8euLhDl4s19oC/s0UVpYTMk+ElzterJpBVFoGlDPhJTCdp3ZzqijfWMJirMP6mDM51pJOdgs2PBUr2BVfmkdyEXl/bnoJe/Bu3064xh4RgauCpPdWtd8oJIbU/xpIwk6MfMzoP1ubAx4LcYxIntzcNucWW/3oeKbrfaz8nyjKzO+dnUuvBlNzdRCxBT6+UueZROcvF8CE/zLkKnIy8hSy+IVIrh99Iao/bLMxSONp9aAsrJ4sUwF06dfFEjFO2hwEhluaEpBrytUqEdRS6Yf2i9nK2i1yi2ecwPpH1cW93gC9+v/TO5V4hQOd2dFP3g4Lc30Gk5itXHOutPrI7BQGkJLk0UyQPxxNB1sQwXqq8sApU+9dFM645PKcueDyT2R47ONl5ce+W3MdHZYHcDqlZFsU52pPl2jlFq/LBtdXtWq0xoolQ9pKO90wh20rp+yPfToqEc5qPRapxU7F+F3Kke4yDb0lX65qA63M3Gl2QaT+3CsNrUsc9iNmtWWY6ArNxYizNuOV3q6STIs= 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:(4636009)(396003)(39860400002)(376002)(136003)(346002)(46966006)(36840700001)(4326008)(8676002)(2906002)(316002)(86362001)(336012)(110136005)(7696005)(6666004)(478600001)(70206006)(1076003)(70586007)(47076005)(26005)(82740400003)(5660300002)(426003)(82310400003)(2616005)(44832011)(8936002)(83380400001)(186003)(36860700001)(81166007)(36756003)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2021 10:25:44.1721 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f3fc3f31-6bc4-4723-30a6-08d95cb26085 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: VE1EUR03FT047.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB3857 X-ZohoMail-DKIM: pass (identity @armh.onmicrosoft.com) X-ZM-MESSAGEID: 1628677901636100001 Content-Type: text/plain; charset="utf-8" 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 --- xen/arch/arm/numa_device_tree.c | 67 +++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/xen/arch/arm/numa_device_tree.c b/xen/arch/arm/numa_device_tre= e.c index bbe081dcd1..6e0d1d3d9f 100644 --- a/xen/arch/arm/numa_device_tree.c +++ b/xen/arch/arm/numa_device_tree.c @@ -200,3 +200,70 @@ device_tree_parse_numa_memory_node(const void *fdt, in= t node, =20 return 0; } + +/* Parse NUMA distance map v1 */ +int __init +device_tree_parse_numa_distance_map_v1(const void *fdt, int node) +{ + const struct fdt_property *prop; + const __be32 *matrix; + int entry_count, len, i; + + printk(XENLOG_INFO "NUMA: parsing numa-distance-map\n"); + + prop =3D fdt_get_property(fdt, node, "distance-matrix", &len); + if ( !prop ) + { + printk(XENLOG_WARNING + "NUMA: No distance-matrix property in distance-map\n"); + + return -EINVAL; + } + + if ( len % sizeof(uint32_t) !=3D 0 ) + { + printk(XENLOG_WARNING + "distance-matrix in node is not a multiple of u32\n"); + return -EINVAL; + } + + entry_count =3D len / sizeof(uint32_t); + if ( entry_count <=3D 0 ) + { + printk(XENLOG_WARNING "NUMA: Invalid distance-matrix\n"); + + return -EINVAL; + } + + matrix =3D (const __be32 *)prop->data; + for ( i =3D 0; i + 2 < entry_count; i +=3D 3 ) + { + uint32_t from, to, distance; + + from =3D dt_read_number(matrix, 1); + matrix++; + to =3D dt_read_number(matrix, 1); + matrix++; + distance =3D dt_read_number(matrix, 1); + matrix++; + + if ( (from =3D=3D to && distance !=3D NUMA_LOCAL_DISTANCE) || + (from !=3D to && distance <=3D NUMA_LOCAL_DISTANCE) ) + { + printk(XENLOG_WARNING + "Invalid nodes' distance from node#%d to node#%d =3D %d= \n", + from, to, distance); + return -EINVAL; + } + + printk(XENLOG_INFO "NUMA: distance from node#%d to node#%d =3D %d\= n", + from, to, distance); + numa_set_distance(from, to, distance); + + /* Set default distance of node B->A same as A->B */ + if (to > from) + numa_set_distance(to, from, distance); + } + + return 0; +} --=20 2.25.1 From nobody Sat May 4 03:49:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=2; a=rsa-sha256; t=1628677884; cv=pass; d=zohomail.com; s=zohoarc; b=lZDb4D68J3EA3HJMExFLy1sRh1njDDOphzUgJsdcVj0LMQkHM+clwpyxPfe/I+/hXG10eNjXwzcKjQaJ0FnaaOp9BwSsg6kNJIUdVQHpMRMVzf/59FLCrIL6nWWE9xCaMpc/S8Om1DyLlqR7E6oBmbjQ8zyeXoXbRBseLWaOKAo= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628677884; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=mV9BMQM6jBgOu/GpZfRnWjx48k73m+HxXIGWUQtTgGA=; b=XmSP6gdAETZrtZSEkwINfTxgKH+QzrZspGIHQTyAytngBgEWQzVrMlNYZOrRdDvtBgr4zzGFPkOoYEYvRZWOUNMBp5k88pmJKcEDcBrqqLB/SXXIsGUYOMWlIgsWGHueukknFNHsNg/RVj+P2w1phwvy61lB7DW4JDWJgfrEqHc= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1628677884128583.770320566124; Wed, 11 Aug 2021 03:31:24 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.165700.302827 (Exim 4.92) (envelope-from ) id 1mDlVr-0002ob-Qb; Wed, 11 Aug 2021 10:31:07 +0000 Received: by outflank-mailman (output) from mailman id 165700.302827; Wed, 11 Aug 2021 10:31:07 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlVr-0002lo-IC; Wed, 11 Aug 2021 10:31:07 +0000 Received: by outflank-mailman (input) for mailman id 165700; Wed, 11 Aug 2021 10:31:04 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlSP-0000BQ-G1 for xen-devel@lists.xenproject.org; Wed, 11 Aug 2021 10:27:33 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (unknown [40.107.6.51]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id eeacf4f9-42c6-4494-8f8a-07b54b30723f; Wed, 11 Aug 2021 10:25:58 +0000 (UTC) Received: from AM6P191CA0108.EURP191.PROD.OUTLOOK.COM (2603:10a6:209:8a::49) by PA4PR08MB6014.eurprd08.prod.outlook.com (2603:10a6:102:ee::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.14; Wed, 11 Aug 2021 10:25:48 +0000 Received: from VE1EUR03FT015.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:8a:cafe::22) by AM6P191CA0108.outlook.office365.com (2603:10a6:209:8a::49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.15 via Frontend Transport; Wed, 11 Aug 2021 10:25:48 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT015.mail.protection.outlook.com (10.152.18.176) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:25:48 +0000 Received: ("Tessian outbound ab45ca2b67bc:v101"); Wed, 11 Aug 2021 10:25:48 +0000 Received: from ca4836320fdc.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 53EFEF69-6DE1-4D6A-A5C6-ED460416405A.1; Wed, 11 Aug 2021 10:25:42 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id ca4836320fdc.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 11 Aug 2021 10:25:42 +0000 Received: from DU2PR04CA0060.eurprd04.prod.outlook.com (2603:10a6:10:234::35) by DB9PR08MB6875.eurprd08.prod.outlook.com (2603:10a6:10:2aa::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.15; Wed, 11 Aug 2021 10:25:38 +0000 Received: from DB5EUR03FT052.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:234:cafe::96) by DU2PR04CA0060.outlook.office365.com (2603:10a6:10:234::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:25:38 +0000 Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT052.mail.protection.outlook.com (10.152.21.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4415.14 via Frontend Transport; Wed, 11 Aug 2021 10:25:38 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) 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.2308.14; Wed, 11 Aug 2021 10:25:32 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Wed, 11 Aug 2021 10:25:30 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: eeacf4f9-42c6-4494-8f8a-07b54b30723f 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=mV9BMQM6jBgOu/GpZfRnWjx48k73m+HxXIGWUQtTgGA=; b=rfU/w3FC4h+c2JHSWmjEeCj2tWYArDc1ucexFfoz2uXTDGpTKiy/uFXKTA8vXa8mDBK5nparKIhYujS2CWcMPXK/XINdJ3dfzNXI+tl1LAxrnqW/gdK5HLXabvDh4KHmRFhXFUx9Ox0LkF9i+zz9A6Oc3TH0ZUjn8aLQRXtr6mU= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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; X-CheckRecipientChecked: true X-CR-MTA-CID: 57b47ae374b91047 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CdmcxWMgVcDZ2Kq1VYadjPEeHePOsXwr70osTNjId9KKwbG6W4xfQEr4FhWTptrLXmRuT0iYJjKXOyZwcIuRIsdU8zsi7OqMsBxDlo3V+bLbIQq240sjNWHe3bYJjctqGM2bZtbPRxID2gdg+qZUZQysX+yhlRkDL2PM98R2bxvSngKEzSt6OEKLpRdAtp7A0fUXvXGu+JvKw7JOTLLMIGROsgTlY9HVCU/DZjiQHYCUd/kuQzcr3cZr+qGgr4eVNwagMn1sxtedtkenPtcMrRDg6MRfgFXJaNKCWD8u/H45Ilp4oIMgsgM5V43lS3etmvRC78+gPadTXiK+YUdRVg== 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-SenderADCheck; bh=mV9BMQM6jBgOu/GpZfRnWjx48k73m+HxXIGWUQtTgGA=; b=g9Np371fJbeXX8zwgTdBWx1SqE7F8Fwd7QOczF4EZXI3QlA4ZGrYCWhK5DHQow+Skk1TvJrDHYtY/SXm5W4DhToatgF7a5NCPDLn7Vew/AHDEyA97jOjOipc7nRDBQzkVbCHj2Qz/LSvB3FbEpFMjTJZKPbK1nooRg1rN1YTxZPi7lK4sD5OknLzM7ifhTHzyXeRjuTQR0S+972/L5WjHGPjRpQvw7E3brWDZr5EeB4ggGCGRQoIa93g6RwEKgIPcIn/OLY12cCc3Q+PX9cQqje0iISLDNzLQEvI1kFEfgdMq+xXfBjrbwP7+9WOG+K3yvPf//uUu7X8VGqR35YyxA== 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=mV9BMQM6jBgOu/GpZfRnWjx48k73m+HxXIGWUQtTgGA=; b=rfU/w3FC4h+c2JHSWmjEeCj2tWYArDc1ucexFfoz2uXTDGpTKiy/uFXKTA8vXa8mDBK5nparKIhYujS2CWcMPXK/XINdJ3dfzNXI+tl1LAxrnqW/gdK5HLXabvDh4KHmRFhXFUx9Ox0LkF9i+zz9A6Oc3TH0ZUjn8aLQRXtr6mU= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; 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; From: Wei Chen To: , , , , CC: Subject: [XEN RFC PATCH 25/40] xen/arm: unified entry to parse all NUMA data from device tree Date: Wed, 11 Aug 2021 18:24:08 +0800 Message-ID: <20210811102423.28908-26-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210811102423.28908-1-wei.chen@arm.com> References: <20210811102423.28908-1-wei.chen@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: dfd8cd3c-959c-4a1b-6b66-08d95cb2630b X-MS-TrafficTypeDiagnostic: DB9PR08MB6875:|PA4PR08MB6014: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:4502;OLM:4502; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 65NLayJa2Eg0Naw+roDr1MpisV0vjwrFSWA9O1Q1ZzokcaCdCVV//YQ0hY0Bkt/ejdycNMTicYDDkWGudYlGdJQ0BGN+/fy96t4SozOzve8i5bHgLEJcXATi9GqNEoIPMmVQwhdNht8yhQYNTKC27MgbAfv0lqrhhaebNJfAUGGW8hzABjNVLo7FC2jtbUQFF5uuId9HGwJu+/JmDew40JZV7CB+XMogahl6MN/JC7i0lRlcwcf0VjduljXLBqnZc/YfnzsSTSV4/GNHU8HRvuJXMH9VOYYraNsA9LNrhanfCOwfEljRw4TWJFU7WalAnNm02ctHAaX8ORjMtEYJ4u3YL+vAtS8GFTm2toO5BEDaNy3rIyhmLWmBPlQlPCxJmJW1yY2m8KQGBSz14WtYCm9FivqF+9BmAzY+zSsOjo2GQhjprybE8HjvBcqtKAfdcH2AGnUOBQyf+jEZcqztMoivbscqEPHSPXXwMppIJGU0Huh2RxBiVwHi7CTHvWApDDDy2NDMO2MpiK+Kev84oR6QxhK24acbB7JPQqvAmFD2xzM7xmLhzHbbvz2FxlQV3Mn4lqYd8MBZZrUY9j5wAKZGWCbfquIIIOcwdO2PGYS4MMQ+NfgwpdjDIIsSoNOEDRvUqNv5IapDLEN9MlyCVSy4/Zk/cvkGUSeclv+toFXlSIQEASXMOeFhP26iILWM6PakqclCJ7DxKatj69jPJ6/Ftrq2narzou2I8U4wsS+h47eBXq/iKXjQHBy9KpCV22HwHSiQgoDADm/SeIs/r+1c0hy4mPqLwmSqiYz9LFc= 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:(4636009)(346002)(136003)(39850400004)(396003)(376002)(46966006)(36840700001)(426003)(82310400003)(4326008)(34070700002)(7696005)(86362001)(47076005)(186003)(36860700001)(8936002)(336012)(316002)(44832011)(8676002)(36756003)(110136005)(1076003)(83380400001)(26005)(82740400003)(2616005)(5660300002)(81166007)(2906002)(478600001)(70206006)(70586007)(6666004)(356005)(2101003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB6875 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT015.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: b273a102-d832-4b0f-b764-08d95cb25d3f X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sttQUmo36zHtm4rA96fDVALQ4mHQqQxTENZ2mzYo/Jn23Wi0F3DTPKPkJBbyHuuqZrrGuCxXxizZcXe/jFkImW4Lf7Vcfu6gjzTpGQQ8otaSiOgoczMLTCQKavqAkq9XZuKbFWc6vgE7YCKujpgwkafrBeB2jM2zumBEbZo3iwHxkGECgmsVpJkXd4r0p2vDtMdQkn5gE8nFqZbDH4UJK8P9P58LNpocGFRjvWTbWy/So6zpw+Bf3cKIe/53dvCyharrHCUIjQ4GcxgfRDqV8Ir/J9OsduNU1atT/I177oBOVFLHgPJRj8WZ3RXeUDtRiDe3NgvcwjsIf5dUkpQi2Ikjy539qMqu5MVi3a376nHM6lcFAu3JTUAZEHU99i8pYFNkD41bl/JsH3c5CdUOhFpZ3sZHEMyblPK6zAVZlc+xf2z8OoRYO8CM3lSg5OqVWFxlseQAxmA99r2Ycv4yJYnsrNSULubfAbvnyaRaE+YvWTttCf4DF1de7Kvj9yMgjtltM1d0Sqja35CJoH8GEvcix8+0HliP6q/otx4WQqjHCyd3X8tYRjdpBqRi5XU/EwTChtclaYrqCa36gJkuhTT0zTMDnh/Pl0glT6y3nwI0ndK3zwwz1D/lUW/QZEOaG0BboVHQsYdxQavbtMNWWqMU1CRG6W8SabxAEwLxsKqWSfoRLto/krCbc5+HD73J4ce8GJuEmNrARTRp/A8PjmC6ZNEUDKyvRF53PFJMk0I= 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:(4636009)(136003)(376002)(396003)(39850400004)(346002)(46966006)(36840700001)(6666004)(186003)(82740400003)(426003)(47076005)(316002)(2906002)(36756003)(70206006)(5660300002)(70586007)(478600001)(81166007)(82310400003)(7696005)(336012)(83380400001)(86362001)(36860700001)(110136005)(8676002)(8936002)(26005)(44832011)(4326008)(2616005)(1076003)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2021 10:25:48.4083 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dfd8cd3c-959c-4a1b-6b66-08d95cb2630b 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: VE1EUR03FT015.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB6014 X-ZohoMail-DKIM: pass (identity @armh.onmicrosoft.com) X-ZM-MESSAGEID: 1628677885794100001 Content-Type: text/plain; charset="utf-8" In this API, we scan whole device tree to parse CPU node id, memory node id and distance-map. Though early_scan_node will invoke has a handler to process memory nodes. If we want to parse memory node id in this handler, we have to embeded NUMA parse code in this 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 API too. Another benefit is that we have a unique entry for device tree NUMA data parse. Signed-off-by: Wei Chen --- xen/arch/arm/numa_device_tree.c | 31 ++++++++++++++++++++++++++++--- xen/include/asm-arm/numa.h | 1 + 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/xen/arch/arm/numa_device_tree.c b/xen/arch/arm/numa_device_tre= e.c index 6e0d1d3d9f..27ffb72f7b 100644 --- a/xen/arch/arm/numa_device_tree.c +++ b/xen/arch/arm/numa_device_tree.c @@ -131,7 +131,8 @@ save_memblk: } =20 /* Parse CPU NUMA node info */ -int __init device_tree_parse_numa_cpu_node(const void *fdt, int node) +static int __init +device_tree_parse_numa_cpu_node(const void *fdt, int node) { uint32_t nid; =20 @@ -147,7 +148,7 @@ int __init device_tree_parse_numa_cpu_node(const void *= fdt, int node) } =20 /* Parse memory node NUMA info */ -int __init +static int __init device_tree_parse_numa_memory_node(const void *fdt, int node, const char *name, uint32_t addr_cells, uint32_t size_cells) { @@ -202,7 +203,7 @@ device_tree_parse_numa_memory_node(const void *fdt, int= node, } =20 /* Parse NUMA distance map v1 */ -int __init +static int __init device_tree_parse_numa_distance_map_v1(const void *fdt, int node) { const struct fdt_property *prop; @@ -267,3 +268,27 @@ device_tree_parse_numa_distance_map_v1(const void *fdt= , int node) =20 return 0; } + +static int __init fdt_scan_numa_nodes(const void *fdt, + int node, const char *uname, int depth, + u32 address_cells, u32 size_cells, void *data) +{ + int ret =3D 0; + + if ( fdt_node_check_type(fdt, node, "cpu") =3D=3D 0 ) + ret =3D device_tree_parse_numa_cpu_node(fdt, node); + else if ( fdt_node_check_type(fdt, node, "memory") =3D=3D 0 ) + ret =3D device_tree_parse_numa_memory_node(fdt, node, uname, + address_cells, size_cells); + else if ( fdt_node_check_compatible(fdt, node, + "numa-distance-map-v1") =3D=3D 0 ) + ret =3D device_tree_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); +} diff --git a/xen/include/asm-arm/numa.h b/xen/include/asm-arm/numa.h index 756ad82d07..7a3588ac7f 100644 --- a/xen/include/asm-arm/numa.h +++ b/xen/include/asm-arm/numa.h @@ -26,6 +26,7 @@ typedef u8 nodeid_t; extern s8 device_tree_numa; =20 extern void numa_init(bool acpi_off); +extern int numa_device_tree_init(const void *fdt); extern void numa_set_distance(nodeid_t from, nodeid_t to, uint32_t distanc= e); =20 /* --=20 2.25.1 From nobody Sat May 4 03:49:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=2; a=rsa-sha256; t=1628677934; cv=pass; d=zohomail.com; s=zohoarc; b=SmGPSMylJ+glpyCEkS7Mp83CGJlLQzgOII0AJWLRS6n6VBv5Gs044oN1TMK9A+V2YMhs9yHaoPNbqaOWoTCPGsOQVjW68Icm+JORcaTLvE7g32EmbA8gB/oFiNzdbRMogiaVd7gYpW8pCg32HEK7BO1kNcOzivfQskhIJKDMGmo= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628677934; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=FMHvog/ZeUKCEsfAn5HVuMBBiWdgn9MS9BQ8ztuD3iQ=; b=dzIRocP5mTDjcopZxJXBAZ1smtAyZHWk4+TSVPl63TfxHPM88pT60cwvrrNf/Xq2EBaCAvAlpCkzym5561fzCU5/+/6Uh3tu52N6BgicJSDMIpwE8Gii1i36tF+hOL86GBtPQjD9hABWao+0yf7tbWPKF0v3YGo4wxxrLPlFJnI= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1628677934296750.021864560886; Wed, 11 Aug 2021 03:32:14 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.165816.303061 (Exim 4.92) (envelope-from ) id 1mDlWi-00060Y-JM; Wed, 11 Aug 2021 10:32:00 +0000 Received: by outflank-mailman (output) from mailman id 165816.303061; Wed, 11 Aug 2021 10:32:00 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlWh-0005uu-UZ; Wed, 11 Aug 2021 10:31:59 +0000 Received: by outflank-mailman (input) for mailman id 165816; Wed, 11 Aug 2021 10:31:57 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlRv-0000BQ-F1 for xen-devel@lists.xenproject.org; Wed, 11 Aug 2021 10:27:03 +0000 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (unknown [40.107.13.78]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 0fea5d40-7657-4aec-8f5c-ffb7632b9478; Wed, 11 Aug 2021 10:25:52 +0000 (UTC) Received: from AM6P192CA0102.EURP192.PROD.OUTLOOK.COM (2603:10a6:209:8d::43) by AM6PR08MB5046.eurprd08.prod.outlook.com (2603:10a6:20b:eb::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.16; Wed, 11 Aug 2021 10:25:50 +0000 Received: from AM5EUR03FT014.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:8d:cafe::71) by AM6P192CA0102.outlook.office365.com (2603:10a6:209:8d::43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.14 via Frontend Transport; Wed, 11 Aug 2021 10:25:50 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT014.mail.protection.outlook.com (10.152.16.130) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:25:50 +0000 Received: ("Tessian outbound 312d863716bf:v101"); Wed, 11 Aug 2021 10:25:50 +0000 Received: from 465b7ff04c5b.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id BAA518C6-6EBF-4698-9CF6-13D0D50D338E.1; Wed, 11 Aug 2021 10:25:43 +0000 Received: from EUR03-VE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 465b7ff04c5b.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 11 Aug 2021 10:25:43 +0000 Received: from DB9PR05CA0026.eurprd05.prod.outlook.com (2603:10a6:10:1da::31) by PR3PR08MB5658.eurprd08.prod.outlook.com (2603:10a6:102:88::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.15; Wed, 11 Aug 2021 10:25:41 +0000 Received: from DB5EUR03FT006.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:1da:cafe::b3) by DB9PR05CA0026.outlook.office365.com (2603:10a6:10:1da::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.15 via Frontend Transport; Wed, 11 Aug 2021 10:25:41 +0000 Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT006.mail.protection.outlook.com (10.152.20.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:25:41 +0000 Received: from AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2308.14; Wed, 11 Aug 2021 10:25:35 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Wed, 11 Aug 2021 10:25:35 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Wed, 11 Aug 2021 10:25:33 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 0fea5d40-7657-4aec-8f5c-ffb7632b9478 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=FMHvog/ZeUKCEsfAn5HVuMBBiWdgn9MS9BQ8ztuD3iQ=; b=hjpsSJdYXTyYvwAda35U8lLSSOYRA5wC72SodZJ3KMuQ031Xplmm88P1pONwayRi0dYBzjzODJgmFKYswsMnmv5QxBNEMk6K3+SGbEUr0ekZ/NDmgPKlxpeonuVaz5sCNQ2KiFchNIdTshhEJuHS00VzZddK+1DIZapcmfBC4Hc= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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; X-CheckRecipientChecked: true X-CR-MTA-CID: 3f86eb01c36ee976 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FHlK1AIPyRH2hEE2cha/yLkFByH8Qe5yGzvIc9p0M3kNcFwXt7l2QDKeKgytLOaXZAdZgbMuOVZ3sBW9yrqC8c1Ad3SYoNv9ia9U7Vziu2HGtad33QsX2fj3tvLv8fe4eDpY6dm6e4k3w0vqpmqjX4WyLFhesKRn5KgxKrqg+mJxRXGSM6mhTkU7OJVI62QoUB3nD6OfNjzN/R+NZb3ay8WHk+G1AiIYTMwiOtNyGaeB9Lxzcms52oG9UQJrMB+yj7KFv6gXbFYYWjoO/xIvi+2BK2lJKSITNQjz5jkNau7Ok21GocSHrDFiFEoiHTd9PG04fPIIGDWC4RumCBPOiQ== 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-SenderADCheck; bh=FMHvog/ZeUKCEsfAn5HVuMBBiWdgn9MS9BQ8ztuD3iQ=; b=dQN82trnFkr4OiOHT/NEOdi5zdAjMPIzLXzEOgCVNLAoiatt0U+aT1YuYLBHau1wUN2w6Ui9r8IMvFhC2bEHJvAZJYdoLz7gAjmZhBuHQB8ITwVxwLrxhFx54oTggoM79SXVIDt3Nvk2aaXJX+wDwrTESL1bz8r9pYl8eLq1mDtyA+wTfkT795RIGo1IMV31d6F/mt+avocDHtwYUNuoTLqJCwdVsxf0GgVW1a90P9rV++a3WxF5r3CEJwGgNVB2s8C7nBgo/YEEJmCX0o01diw2x3KjFvMbfNz+kK7uDUmRC+KHQeURo5KgkeMUYyZx4+ZjlzNcDSMBZCHGa2YOUg== 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=FMHvog/ZeUKCEsfAn5HVuMBBiWdgn9MS9BQ8ztuD3iQ=; b=hjpsSJdYXTyYvwAda35U8lLSSOYRA5wC72SodZJ3KMuQ031Xplmm88P1pONwayRi0dYBzjzODJgmFKYswsMnmv5QxBNEMk6K3+SGbEUr0ekZ/NDmgPKlxpeonuVaz5sCNQ2KiFchNIdTshhEJuHS00VzZddK+1DIZapcmfBC4Hc= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; 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; From: Wei Chen To: , , , , CC: Subject: [XEN RFC PATCH 26/40] xen/arm: Add boot and secondary CPU to NUMA system Date: Wed, 11 Aug 2021 18:24:09 +0800 Message-ID: <20210811102423.28908-27-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210811102423.28908-1-wei.chen@arm.com> References: <20210811102423.28908-1-wei.chen@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6d6a7eab-8080-4cd5-8c4b-08d95cb263fb X-MS-TrafficTypeDiagnostic: PR3PR08MB5658:|AM6PR08MB5046: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:8882;OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: elBIOAUClpZo3bL4M3MJ/kpiTp6ZDVLrJLu2qHUSOf2CeqivQURWOjbMb9h6GPVgNXL/1BwC2+VEP2kGTmB9b3jyhyWF/scT4FUHNepi/igAPMIkpWA29hNEz5eBxmLYliFIEebtfbgpRNqQetSQLvZ8cGDCNxG7iMNWZCFlDL89pUPFbEGAucsTmsG0EQ5Wa3UYWFSVOMICAQimmk9df9NGYtbq0tUr0SjD206c7C5HTsyNmUWMPNazOje1RJ8/VCvl2HyuwIkK8WJl6iMheSQOhRX8BzAozkbywfIm6e+MZ98Phyaz1faJLunWneiFql/pvYCeBFzJG4jnc5ZILHou2ww2Tez841lVweBYMLrOQZlLGMSMN1LErMnCKEVMvyear7aME4aKCSgQd+GNNz3de3YKIocrUDqSXX93SadNLIPcS45n4bMUd8re/egT2dATgnW2cxZULYbLwW8LeuTmKh4GNAQHX+juPbst8cev9EmowRpUnfqoWKYj5WrzHCM32M02/suL2PZe8iJKuDjic+ndNR5BiqnxHOafv9t3xy9NHP3LRY1ZdR6usubqf14P5EJkyJzGwrZPET7bNdgs2ZIx3pbrmH1j5nF5VeK0xzfx+BDOmZ1GV6x13/D7uh0jsVQwPdVc8XTCfOE10cBZR1m5lF+uS0N6KP0jyYelbPgqCR4la2YUREtDK9zr4G8QLZ1+tL+GaldvUzUcaJO6L2GKhVlsGbDDP2QC6PadIa9ukh0LX+MrUm4WLJYXO1gIoR3elWYIrhvDjvo3yiZ9HowcHkA5OL/vnAS5Jmk= 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:(4636009)(136003)(346002)(376002)(39850400004)(396003)(46966006)(36840700001)(186003)(36860700001)(44832011)(316002)(478600001)(336012)(7696005)(8676002)(82740400003)(26005)(36756003)(6666004)(1076003)(34070700002)(47076005)(4326008)(110136005)(426003)(86362001)(8936002)(81166007)(356005)(2906002)(83380400001)(2616005)(82310400003)(70586007)(70206006)(5660300002)(36900700001)(2101003);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR08MB5658 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT014.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 4e55ccab-78ec-4386-1401-08d95cb25ea0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4heZEKkNvOguc2am60KsCOkyKghgL71Z0PGGV+r+ThxXRnSyBFZRXl5zgX1ZzKFVpYouRmVVJtc72f9zy8NW89zQT8VDuR118FzalQ0qbBNs2XGBv3yMeguA8bONwxsPhumZTm+qiNPyvgJQLf01c+wZYb3bblBdAFnMi3wo3q7TSbf4rj+GSwfC27GKL6oxP0DE0hanx2ix7AE0RsQoRpXDw+ZSOLLMBiJjnCgOGSqjj3/6DPDMf1TZ3cv+RmUv9TjUXjJuUltpt5I43glfSdRbp3n0LInlHiwatnBJGoOh3B7rFmOzA2VthbMm2RisMHmffZsSAsgziG0IirfhrRhW/e5bCEK3ARLdFH8dsca7pM2twItoFfLa/2wpVVY96GWG9w0Bkm+vCR5OL52MvwfQu5heS7MpWTRwvR1LkE7VIOv664yA2aboW3NWZowLAd/udoQQYxt7uOPHByUputR4Kme5KD5Ejg/BU/NRp2K98Mpallsb4CvHdv2RtmNBQqUtbMJ8CPqKohr+q1hkwymqgkMkEeP79RarH7Z0xI3ohg67HIM1KL7OWmkJ5QOL81p1UDDGirlSVwKZ0B2RRznzFdAFulDYfVVVmcJAm07aJWDbTHlzoy7tvNv8GHG+f99+DSV7ePD0q+tWBgjhufc59hJd/HYxgrhTJwg55hhTwrDhSn2y13IA92PxDr79tMpp8Q+HBBhmZ9VSgbBitN5GxvCGkotyuQ0iLWt2Gh4= 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:(4636009)(36840700001)(46966006)(1076003)(6666004)(26005)(5660300002)(8676002)(81166007)(47076005)(186003)(316002)(8936002)(83380400001)(86362001)(7696005)(36756003)(110136005)(426003)(70586007)(82310400003)(36860700001)(2906002)(70206006)(336012)(508600001)(4326008)(2616005)(44832011)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2021 10:25:50.0420 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6d6a7eab-8080-4cd5-8c4b-08d95cb263fb 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: AM5EUR03FT014.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB5046 X-ZohoMail-DKIM: pass (identity @armh.onmicrosoft.com) X-ZM-MESSAGEID: 1628677935351100004 Content-Type: text/plain; charset="utf-8" When cpu boot up, we have add them to NUMA system. In current stage, we have not parsed the NUMA data, but we have created a fake NUMA node. So, in this patch, all CPU will be added to NUMA node#0. After the NUMA data has been parsed from device tree, the CPU will be added to correct NUMA node as the NUMA data described. Signed-off-by: Wei Chen --- xen/arch/arm/setup.c | 6 ++++++ xen/arch/arm/smpboot.c | 6 ++++++ xen/include/asm-arm/numa.h | 1 + 3 files changed, 13 insertions(+) diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c index 3c58d2d441..7531989f21 100644 --- a/xen/arch/arm/setup.c +++ b/xen/arch/arm/setup.c @@ -918,6 +918,12 @@ void __init start_xen(unsigned long boot_phys_offset, =20 processor_id(); =20 + /* + * If Xen is running on a NUMA off system, there will + * be a node#0 at least. + */ + numa_add_cpu(0); + smp_init_cpus(); cpus =3D smp_get_max_cpus(); printk(XENLOG_INFO "SMP: Allowing %u CPUs\n", cpus); diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c index a1ee3146ef..aa78958c07 100644 --- a/xen/arch/arm/smpboot.c +++ b/xen/arch/arm/smpboot.c @@ -358,6 +358,12 @@ void start_secondary(void) */ smp_wmb(); =20 + /* + * If Xen is running on a NUMA off system, there will + * be a node#0 at least. + */ + numa_add_cpu(cpuid); + /* Now report this CPU is up */ cpumask_set_cpu(cpuid, &cpu_online_map); =20 diff --git a/xen/include/asm-arm/numa.h b/xen/include/asm-arm/numa.h index 7a3588ac7f..dd31324b0b 100644 --- a/xen/include/asm-arm/numa.h +++ b/xen/include/asm-arm/numa.h @@ -59,6 +59,7 @@ extern mfn_t first_valid_mfn; #define __node_distance(a, b) (20) =20 #define numa_init(x) do { } while (0) +#define numa_add_cpu(x) do { } while (0) #define numa_set_node(x, y) do { } while (0) =20 #endif --=20 2.25.1 From nobody Sat May 4 03:49:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=2; a=rsa-sha256; t=1628677918; cv=pass; d=zohomail.com; s=zohoarc; b=oG5pzfQ+JoUQOFIPz4dxDQP9lDSOGIt3TJYYNIsc6ZmpOl7okrdgjtaqe5pLjkI5SzRjNm+cnbDxEiADkaGI0wf56byfr/50haIyC3fW9/v+xWD8Zqz+kvhXW9MRUGrZ/N1J7T8Crc+heUmgK0xT/t2UiZLOssaqtZSb3A7A+9o= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628677918; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=UBGY6GfvOKpF4SmINSG8yp2SYCx1tlbM/Wi58rWpnME=; b=lREyLYZmzGao5i5Tds3Gzo9IDD1xlZU3s7IE3Ud6SyS9cZ1SwgMScWM9fGzeEGhvAdB91NN2Ee1+tw/+VhvNriWnYaS1W52vuyekabo2Ed/kxShy4NmCjPZRM09bRxT1OsXCq6ED4z0qZPMA3XN34JDW9XmK9dlxGEZbMSFYSxo= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1628677918627248.73753542412726; Wed, 11 Aug 2021 03:31:58 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.165768.302984 (Exim 4.92) (envelope-from ) id 1mDlWQ-0001g8-Cs; Wed, 11 Aug 2021 10:31:42 +0000 Received: by outflank-mailman (output) from mailman id 165768.302984; Wed, 11 Aug 2021 10:31:41 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlWP-0001cV-45; Wed, 11 Aug 2021 10:31:41 +0000 Received: by outflank-mailman (input) for mailman id 165768; Wed, 11 Aug 2021 10:31:39 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlSK-0000BQ-Fp for xen-devel@lists.xenproject.org; Wed, 11 Aug 2021 10:27:28 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (unknown [2a01:111:f400:7e1a::631]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 88972533-0b90-4f21-b6e0-6bc2197160db; Wed, 11 Aug 2021 10:25:57 +0000 (UTC) Received: from AM5PR04CA0034.eurprd04.prod.outlook.com (2603:10a6:206:1::47) by AM5PR0801MB1730.eurprd08.prod.outlook.com (2603:10a6:203:38::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.16; Wed, 11 Aug 2021 10:25:55 +0000 Received: from AM5EUR03FT040.eop-EUR03.prod.protection.outlook.com (2603:10a6:206:1:cafe::f7) by AM5PR04CA0034.outlook.office365.com (2603:10a6:206:1::47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.15 via Frontend Transport; Wed, 11 Aug 2021 10:25:55 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT040.mail.protection.outlook.com (10.152.17.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.14 via Frontend Transport; Wed, 11 Aug 2021 10:25:55 +0000 Received: ("Tessian outbound 7b804b1d9bbf:v101"); Wed, 11 Aug 2021 10:25:55 +0000 Received: from eda043fa79b9.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 55E5BB24-0A5A-4D05-8DD1-5B4E48F96E9C.1; Wed, 11 Aug 2021 10:25:49 +0000 Received: from EUR01-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id eda043fa79b9.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 11 Aug 2021 10:25:49 +0000 Received: from DB9PR05CA0024.eurprd05.prod.outlook.com (2603:10a6:10:1da::29) by AM6PR08MB4167.eurprd08.prod.outlook.com (2603:10a6:20b:ad::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.15; Wed, 11 Aug 2021 10:25:46 +0000 Received: from DB5EUR03FT006.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:1da:cafe::df) by DB9PR05CA0024.outlook.office365.com (2603:10a6:10:1da::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.14 via Frontend Transport; Wed, 11 Aug 2021 10:25:45 +0000 Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT006.mail.protection.outlook.com (10.152.20.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:25:45 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) 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.2308.14; Wed, 11 Aug 2021 10:25:37 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Wed, 11 Aug 2021 10:25:35 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 88972533-0b90-4f21-b6e0-6bc2197160db 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=UBGY6GfvOKpF4SmINSG8yp2SYCx1tlbM/Wi58rWpnME=; b=jEhHCyd2obaX3ip/lUDjS5wjnlrpRbxqhE8M7OaTTlu/EHeZR5RdGCriRB1fAVs8NSy+4Vj5XrqZPlwlbLxH+ps9JbH0NlF0JSuwBedUS5bnAJMMrwSfWSNy2m/ciesGM+iLeyd1U6UeXlRkb/ePAMr0rWjZzENpjQXxQNjnjbs= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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; X-CheckRecipientChecked: true X-CR-MTA-CID: 088b7758af486d10 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fWsmxw14xGEGX9bmdlN9/IiB4SeDhmH9of7ZXlCmUyTH2iC0zLysBAwzeyvFlH1usbwV1eNwmAEAfz2J90F5y+Zz9Y7uu5x8xKGPsj3BcCwJl6rT3b0zA0E1CWGzGVBPTwiSddWBn62+Fx2IO22IHksVIbWzEecnn/yT8yn/jnqmK5ENO/EYUtBJVU+Lf9O5tqo8spxrZ1kb5sFivP/8GWHvX87YlTJP4xg96szAbGfIjbjheXGW7oXSpjYVWbasax3ZkhuYdknAJ8vpGpQuNOGcVjyS57y7wYpDhcoOduul0WYruABnQj907tPhTGQXRKUOlVAqIFnZXnNXvDaONg== 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-SenderADCheck; bh=UBGY6GfvOKpF4SmINSG8yp2SYCx1tlbM/Wi58rWpnME=; b=TNCN6Dz4152CWug8enbj2mqdlJCPc07aURosEJOPKaSGUge3KAPtv87cNoYPfKN7dJP/FvVV+dE1zwarzRv8tbMKgmslkAlxANtUylDlWM35APevMXDZ1Er3zVS4uH2cQtmnDLQs/uYQOfDcyHYDBKCI+d0o3a0gqZx7jEs+3SO2LJFq0RosjfNdNdDhunGXUlMq6IA1AMg0fSTEBwGvp3Kn2n9LjJeY+zlBjn8d4VfpvKSH/U2Dd5MOR6VFwB9x+okpR8iFLBs3PRbcs8s4kJzZrd2rBunWmNkGltI190PgUtlFOcFV2NuI5khge7k2rHJUIhNSG6xnrRzHCtWHNA== 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=UBGY6GfvOKpF4SmINSG8yp2SYCx1tlbM/Wi58rWpnME=; b=jEhHCyd2obaX3ip/lUDjS5wjnlrpRbxqhE8M7OaTTlu/EHeZR5RdGCriRB1fAVs8NSy+4Vj5XrqZPlwlbLxH+ps9JbH0NlF0JSuwBedUS5bnAJMMrwSfWSNy2m/ciesGM+iLeyd1U6UeXlRkb/ePAMr0rWjZzENpjQXxQNjnjbs= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; 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; From: Wei Chen To: , , , , CC: Subject: [XEN RFC PATCH 27/40] xen/arm: build CPU NUMA node map while creating cpu_logical_map Date: Wed, 11 Aug 2021 18:24:10 +0800 Message-ID: <20210811102423.28908-28-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210811102423.28908-1-wei.chen@arm.com> References: <20210811102423.28908-1-wei.chen@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 26edcac0-0236-43ad-b3c1-08d95cb26763 X-MS-TrafficTypeDiagnostic: AM6PR08MB4167:|AM5PR0801MB1730: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:7691;OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: bbV6pQLYMaQMoXB4LA7CsB8gbR6psS+Vh3S6NFBlQ7Q5JpYeQCIypUdcghyesgeHvGftvAyE0RQqAiLPx/xFOQiE9kR6Bbp/2ESVd+ZPn1Ye7OH3Q3B0KvUO0sQ71yrT1FyWzIk3RToAeJnh++Z7PZWFUWqarCjlSP0arCXDkmmJAB//X20Xxeb2K9PvTkykPaeH2aytOr/GiOzUVahlEM3S0G57zmArUfmuRmMjHsz+f80l5BFUSIq2t0NKhDvEvsZ14NxbJvjl+SRZGkifHSGQmPAeIHIBjykfl7j/tn1IgZ1AkgsXPGQ8XOaOiCohVBuRfV2AIKnLSNR1B8eBt1ntgT+RDcFt0/CmSu7OsK4CS3vNJlQRazZ/QeLSaMK4mfjdFPHvp5MHbKcK1jQFmOjN10ndyPiEuFzgMRYe4RyCA1XwGmp4az05JLokKcIrGm5rWJp4OS7OaDIBQ3Z8Fy1mJaKnJVHGa/ZbjphWS+hJsTbCJjvCqtUUfQw21k9CW3nCK9cteiwePEi8Z3GVoB4YmuVqPZQnB0I5Zd24jXTjHixGHV2qUP/fAdG3KJ8oYzTNQ+H5/K5/Rk1rMxUKqewz+4J99qEC2egEU0mILMVjo5gbQskEdMsgpUIXU8Xrljnl+WFhutAYyPENuyiuBhT0v02zHFH2tQDLkPaFhogfShgKWgtehmwbqlH15HvC44tFaSErMzt2RJLJTh+m8MXq2z03s1kjrJSihueiUOevErMaewTAzdw+aBa4pMg4o91TNVGxpBL8vaSzY4rhUxvU+668NP09BtYIcao41zs= 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:(4636009)(136003)(376002)(346002)(396003)(39860400002)(36840700001)(46966006)(36860700001)(34070700002)(110136005)(316002)(86362001)(47076005)(36756003)(8676002)(1076003)(478600001)(8936002)(44832011)(2616005)(7696005)(70586007)(26005)(6666004)(2906002)(82740400003)(83380400001)(70206006)(5660300002)(356005)(81166007)(186003)(82310400003)(426003)(336012)(4326008)(2101003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB4167 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT040.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 80f41c7a-42c6-496d-a68f-08d95cb26188 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VW8i/e8pNCL7eGrVUPQJ/n50EclPGW1qrsv9T2cGxjRbxYj7XWrnxr+ln6cfJzgTFbWKWy/ivN24+PjIKJsTnzzp7ahGOos4mPuQnh/cPw2vLPsVyHBOjYNMKjeW7I/kmfVc6tGFm5gmhzH4mRz8HNjcxCdYTlsDE3Jukvb4YnhueIWOuM8QSSmBDWi+cwoJ6sgQE1nt4Sc2o8RTaTRRmFc9kZg90tIXXOr269bhcy5HzSEDnrVPy3taEkHgxE2+MnW3mK7qlo+BNi9ck30WrBB4f3pMVm4I9GGlZ8bF6Uy/cXCi8Clqw3OgIPwsQhfsiY1VqLhE6xe7vpzDqRtHmGlOj6MQtPTSbNpuB/egYgdVk+QzZ4VM6mZRqirCjBrMSTLDMB6IM5Gr6TCCazRl5iqNn0cceLXGyUCjlcx7dvH+X95PNwDsPoango45Dj+0P3i83I9Tk3WlSxaf6UgQwBSvhOm7PpO4at2JCFM4RX1VG35awuQ/qbHYaziUkU7amLGymvygPRglhDMF5YyEy/gtpae0lVZaNoR3T5FF90rvfORWBNbsT0G76/xTFhNW97SNW+Z9nHEYZTJ9uvJiclGb5tTx4HDLxs8v5nM9p8p7lN1uXi9/7iubOx0JI2WzOWJdfeBqAFBJRaxB4p45IeLIiXdP2ZFb70oChWLu4gPorguU8zNJ3cGsjA8JVcVQ23cf10YEJePkFV3HV5/gaUVCEHYT6FmUkXId59qv0Fc= 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:(4636009)(36840700001)(46966006)(5660300002)(44832011)(426003)(1076003)(70206006)(70586007)(4326008)(2616005)(6666004)(47076005)(7696005)(110136005)(83380400001)(8936002)(508600001)(82310400003)(81166007)(36756003)(8676002)(316002)(26005)(2906002)(186003)(86362001)(336012)(36860700001)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2021 10:25:55.7567 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 26edcac0-0236-43ad-b3c1-08d95cb26763 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: AM5EUR03FT040.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0801MB1730 X-ZohoMail-DKIM: pass (identity @armh.onmicrosoft.com) X-ZM-MESSAGEID: 1628677919550100001 Content-Type: text/plain; charset="utf-8" Sometimes, CPU logical ID maybe different with physical CPU ID. Xen is using CPU logial ID for runtime usage, so we should use CPU logical ID to create map between NUMA node and CPU. Signed-off-by: Wei Chen --- xen/arch/arm/smpboot.c | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c index aa78958c07..dd5a45bffc 100644 --- a/xen/arch/arm/smpboot.c +++ b/xen/arch/arm/smpboot.c @@ -121,7 +121,12 @@ static void __init dt_smp_init_cpus(void) { [0 ... NR_CPUS - 1] =3D MPIDR_INVALID }; + static nodeid_t node_map[NR_CPUS] __initdata =3D + { + [0 ... NR_CPUS - 1] =3D NUMA_NO_NODE + }; bool bootcpu_valid =3D false; + uint32_t nid =3D 0; int rc; =20 mpidr =3D boot_cpu_data.mpidr.bits & MPIDR_HWID_MASK; @@ -172,6 +177,26 @@ static void __init dt_smp_init_cpus(void) continue; } =20 +#ifdef CONFIG_DEVICE_TREE_NUMA + /* + * When CONFIG_DEVICE_TREE_NUMA is set, try to fetch numa infomat= ion + * 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 infomation!\n", + cpuidx, dt_node_full_name(cpu)); + /* + * The 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 =3D 0; + } +#endif + /* * 8 MSBs must be set to 0 in the DT since the reg property * defines the MPIDR[23:0] @@ -231,9 +256,12 @@ static void __init dt_smp_init_cpus(void) { printk("cpu%d init failed (hwid %"PRIregister"): %d\n", i, hwi= d, rc); tmp_map[i] =3D MPIDR_INVALID; + node_map[i] =3D NUMA_NO_NODE; } - else + else { tmp_map[i] =3D hwid; + node_map[i] =3D nid; + } } =20 if ( !bootcpu_valid ) @@ -249,6 +277,7 @@ static void __init dt_smp_init_cpus(void) continue; cpumask_set_cpu(i, &cpu_possible_map); cpu_logical_map(i) =3D tmp_map[i]; + numa_set_node(i, node_map[i]); } } =20 --=20 2.25.1 From nobody Sat May 4 03:49:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=2; a=rsa-sha256; t=1628677915; cv=pass; d=zohomail.com; s=zohoarc; b=ZeU77mcXqHqHtxhWzViojzAoqhV1MB8W6Jxw8PkoyEfm4f687q31XZARMjuOdTAfjraPGwbKoh7wRwZ4hpr8Mu5l7h5sFPDNDP2mYc7QdBdfNUPYdAkqgY9NgStLAsCMpYGqdQhskAQbZbCtLtpKd/euWpzgpO75Y7vzAC6Ud+Y= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628677915; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=xkva09jfasVoqqDl8pVZ4uwtTmz6YH26qMVoCVfWrk0=; b=WOT/QNggbNYCfSKIDn1zqqW210NZpg8IbRUw3bc33AEe9+pcmB5buctvI1OHd7Y6gJV892kWwsNR05atF239wkvPh6iNF01Yj3f8GGH6tjgzcNc7fNsRXZE7n1/JpiORMV2xVhptSEFQmqZ4AHY9D6bOxKJJF/0JeiqrljlJQDM= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1628677915630243.30530464274455; Wed, 11 Aug 2021 03:31:55 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.165751.302950 (Exim 4.92) (envelope-from ) id 1mDlWI-00007k-D2; Wed, 11 Aug 2021 10:31:34 +0000 Received: by outflank-mailman (output) from mailman id 165751.302950; Wed, 11 Aug 2021 10:31:34 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlWH-0008Tf-Ry; Wed, 11 Aug 2021 10:31:33 +0000 Received: by outflank-mailman (input) for mailman id 165751; Wed, 11 Aug 2021 10:31:32 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlSj-0000BQ-Gs for xen-devel@lists.xenproject.org; Wed, 11 Aug 2021 10:27:53 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (unknown [40.107.6.59]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id c37d5588-c6f8-481f-b70e-563582809505; Wed, 11 Aug 2021 10:25:59 +0000 (UTC) Received: from DU2PR04CA0015.eurprd04.prod.outlook.com (2603:10a6:10:3b::20) by AM5PR0801MB2116.eurprd08.prod.outlook.com (2603:10a6:203:31::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.17; Wed, 11 Aug 2021 10:25:57 +0000 Received: from DB5EUR03FT050.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:3b:cafe::ac) by DU2PR04CA0015.outlook.office365.com (2603:10a6:10:3b::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.15 via Frontend Transport; Wed, 11 Aug 2021 10:25:57 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT050.mail.protection.outlook.com (10.152.21.128) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:25:57 +0000 Received: ("Tessian outbound d9f41274f41a:v101"); Wed, 11 Aug 2021 10:25:57 +0000 Received: from 1713049aedfc.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 7B0767EE-A0DF-450A-B4F1-3D2F12245A70.1; Wed, 11 Aug 2021 10:25:50 +0000 Received: from EUR03-AM5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 1713049aedfc.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 11 Aug 2021 10:25:50 +0000 Received: from DB6PR0301CA0077.eurprd03.prod.outlook.com (2603:10a6:6:30::24) by AM6PR08MB3751.eurprd08.prod.outlook.com (2603:10a6:20b:84::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.19; Wed, 11 Aug 2021 10:25:49 +0000 Received: from DB5EUR03FT058.eop-EUR03.prod.protection.outlook.com (2603:10a6:6:30:cafe::75) by DB6PR0301CA0077.outlook.office365.com (2603:10a6:6:30::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.13 via Frontend Transport; Wed, 11 Aug 2021 10:25:49 +0000 Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT058.mail.protection.outlook.com (10.152.20.255) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4415.14 via Frontend Transport; Wed, 11 Aug 2021 10:25:49 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) 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.2308.14; Wed, 11 Aug 2021 10:25:40 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Wed, 11 Aug 2021 10:25:38 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: c37d5588-c6f8-481f-b70e-563582809505 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=xkva09jfasVoqqDl8pVZ4uwtTmz6YH26qMVoCVfWrk0=; b=tdqaV23KQSxe/JMubWYsa3nvkdzZipu4natVed9xYrdEocnQJVwrLBEaxvQInyCx461YC9Oc/CesPTWgu0n4LaftClNpvtSXPhCwxkfgWCdkJPLLKdIholrLscxo5wRmB0i265u3FqxcEeHBiGLurieiE0Usie+iudYEbCZVnpE= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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; X-CheckRecipientChecked: true X-CR-MTA-CID: b17d4125fc988081 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QbGOcVPnF+p6Uth0yJ7plyUqlnwMBWCfvFlHmhvCVwEbTxDlgL5EE2BFe2RdEKyrtw6mnhDMAEFW/fYPl9m3tiXxQkHYpKWlcS3nrepJBJLj7B9EdGm1uRgGGxibKIwROgiLR/t37hFJdKL6kQ0dYVPICfmjxsQAtimd3ESQTsX1V30wQHQstB2QaUWIe+7ZoGbs6svZ9ftmIIU8fCaoGXsKu3ygZ6HYHLo7Z98EQB/2IUqsLGYr1HNXfMWJtw27xb7+gNJEePpgaOfXdPDzL9DzRN3SFzJRJpu1M7TI5PTVSKaFVaWCbVKEgCJFCUfBl/EUy74tVrIZEsSfyTahDA== 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-SenderADCheck; bh=xkva09jfasVoqqDl8pVZ4uwtTmz6YH26qMVoCVfWrk0=; b=jmIYUOI3YD7pthEC+ZCIvzr07CC0IDdpjDqvkVBXqgU/jlVNWB3FN9/5awedRM3JKczYflI7fjTtRJwOZrhg/0rNrZD5VcLrPqzsrKf74AoecUSaD6KF5K6eHpcLFV9BxY7I0v+FwRHi/brptY/rbUDCcfsblrG4Wes5SLsiAiSQcppmeVNW6X0kj/dqRJKNIHzgWy/XzaCWz+2iUy1jSuRBzUJE/vy+zmNT0Co2/Iymrhz4aWQQfHxKtCV40LA5xtrwEklsq56aWbZKmKxLfSyN5XnqNVbMLdRTY9Eh5+YPwcxnVH/V6emt+6NK5AScqK0Nw+HP4XYB4aihHcrFLQ== 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=xkva09jfasVoqqDl8pVZ4uwtTmz6YH26qMVoCVfWrk0=; b=tdqaV23KQSxe/JMubWYsa3nvkdzZipu4natVed9xYrdEocnQJVwrLBEaxvQInyCx461YC9Oc/CesPTWgu0n4LaftClNpvtSXPhCwxkfgWCdkJPLLKdIholrLscxo5wRmB0i265u3FqxcEeHBiGLurieiE0Usie+iudYEbCZVnpE= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; 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; From: Wei Chen To: , , , , CC: Subject: [XEN RFC PATCH 28/40] xen/x86: decouple nodes_cover_memory with E820 map Date: Wed, 11 Aug 2021 18:24:11 +0800 Message-ID: <20210811102423.28908-29-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210811102423.28908-1-wei.chen@arm.com> References: <20210811102423.28908-1-wei.chen@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 99ae0171-5dd0-4bae-3ee5-08d95cb2687b X-MS-TrafficTypeDiagnostic: AM6PR08MB3751:|AM5PR0801MB2116: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:1923;OLM:1923; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: +w49qkgSUHnWqNAfPmd/96ZFwkAS6o0285jLGpTX4lX4Wv/5ckhjJLwDc9904a6JAfPZb14sxAS/SrwBesPaTtqcHnHXtrdSa/FJXa9GVKtgtENx7l6YSu9/PifXFP4Iu1Jjv/5/gblYGhngqevWrzVUhfqBznKhBkARZoI7PvkuUj6lXFEScNNvbeQkK73qt6YqiF7zQvZ8OVAkdziLzCpJwIBPCd13DqxHtbt/UnIdNs6Z6SV6AORdqTk/PhdDGEyruhF8BC0HmoosCSeaE+97mD3sQl9WNNtvk+uo9R9DwvTG9hvp22YLZ9JWoZz0vigQ3r1OP/uA7TZRo3ohiQYwKnZ6nzeXAXl/O09nM9P5ofL74FFWiRrGaPorcLQGuFCCGfTn7+bvto1dCPP+vEB6QWNZwPHuXWd3wAVze/xeiBK1n35e1dwHYjZOm9Sl5VFMV4h91K9qEUHbbP72AVJCXrs5lVrNvnZYB9q5MoN9QMxa+9ryr5b4Zdbcc6wffy7t0ON3d7mvYXqvxAhuTtiWzVXfeVohigyHidr8u23cBlFZYpLSGTy1ZQxuOvv2X5BZYshQSM2S0vZ2A4Jm7pggnA7R8NCDL3h00+MLRX1rkJ2pTeONPfRMgyCfq/YNkxOXIXfbvnwvzYHna26UW10DAnTxSRCSvJRtEItDGZ6A3WjgiyJZ/VGDTaWEGFjpuczIKW5qofRTXQ0bk0Uqo0Zor9yKG8L9lXq+tHti9s72ptUI6FA1ri2/NGnn6p/9Er9mhifMBJZgDbhQFii9wEfDIlF9PDEusA6HBybRB+U= 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:(4636009)(46966006)(36840700001)(36860700001)(6666004)(70206006)(70586007)(316002)(2906002)(110136005)(336012)(36756003)(81166007)(82310400003)(83380400001)(47076005)(4326008)(426003)(508600001)(8676002)(34070700002)(186003)(86362001)(44832011)(5660300002)(26005)(2616005)(8936002)(356005)(7696005)(1076003)(36900700001)(2101003);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3751 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT050.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 02280acd-b8b1-4893-e707-08d95cb26388 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ay8DxX/HOL5qk1wwEN5dnLZLCpM1fmd9xIoWN9XCYIu3ws94O8zv5cpKO1HDl5eM3BYDxpuJ53ws3gfHbx39LSj5NqYrnKmGWAIx+zd839u087JSBEfIlo2W2JqaRnE1ESlxQxXQ9nrd6mHWwuHQtDuBtqbeSbvIGG21TRsd6DibCWEGQzqTMii0i/PboNWuHA6pImk58p246mfvoFo+b8c57+pXhzrcEYf+B0MjxxhhIpiFG/lKFNYiHGuZ1Z9JerXyhd+Vk/+v5xEZK3PBwa7bpfZZl+/QDoToCAXhCEXfuvaouNfInfOB002n52nnluD8C3ERKUBq2QP9poo21IUG18XD2OhBjNe6Hypg+NQRmt8+mpal3sPnWzTjnE5MYpH8Jw7X0QE2sPaF09FW/MwxBht+uPuahSHGu/VOXg0Z6+ICZ5q52UWl1vkmjxN6ddE22F1Pk70tWvRpDHCSbYetzqRs8ycQGsIg+/+yHSsD/LJErT73F7jyL9ko3bN19TufJZaS6UQY1Q5eJbbK8UVnM9num2kGXjFOLbuk8wZ/p/dNxIc9Ou057B7S33ZwDBUEiSqeuhz6af/vanVwePTggYxthb8Gp6/FUp4MPN28hVaaV+x6C/a6Q9ZZpPxOwTOOBbTVfPKB1dwS8NkmeDwFHvKH9UxIhklfnnMM0OHEuZXKUnvLOeGWk2+c+bzdIfd6ExykvtLaPD6cTAqnixZH8rdCurLF7ENPboJGj6Q= 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:(4636009)(376002)(396003)(346002)(39850400004)(136003)(46966006)(36840700001)(86362001)(36860700001)(2616005)(47076005)(36756003)(8676002)(44832011)(426003)(336012)(186003)(4326008)(2906002)(1076003)(7696005)(26005)(70206006)(70586007)(478600001)(82740400003)(8936002)(82310400003)(81166007)(6666004)(110136005)(5660300002)(83380400001)(316002)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2021 10:25:57.6407 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 99ae0171-5dd0-4bae-3ee5-08d95cb2687b 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: DB5EUR03FT050.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0801MB2116 X-ZohoMail-DKIM: pass (identity @armh.onmicrosoft.com) X-ZM-MESSAGEID: 1628677917307100001 Content-Type: text/plain; charset="utf-8" We will reuse nodes_cover_memory for Arm to check its bootmem info. So we introduce two arch helpers to get memory map's entry number and specified entry's range: arch_get_memory_bank_number arch_get_memory_bank_range Depends above two helpers, we make nodes_cover_memory become architecture independent. Signed-off-by: Wei Chen --- xen/arch/x86/numa.c | 18 ++++++++++++++++++ xen/arch/x86/srat.c | 8 +++----- xen/include/xen/numa.h | 4 ++++ 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/xen/arch/x86/numa.c b/xen/arch/x86/numa.c index 6908738305..8b43be4aa7 100644 --- a/xen/arch/x86/numa.c +++ b/xen/arch/x86/numa.c @@ -128,6 +128,24 @@ unsigned int __init arch_get_dma_bitsize(void) + PAGE_SHIFT, 32); } =20 +uint32_t __init arch_meminfo_get_nr_bank(void) +{ + return e820.nr_map; +} + +int __init arch_meminfo_get_ram_bank_range(int bank, + unsigned long long *start, unsigned long long *end) +{ + if (e820.map[bank].type !=3D E820_RAM || !start || !end) { + return -1; + } + + *start =3D e820.map[bank].addr; + *end =3D e820.map[bank].addr + e820.map[bank].size; + + return 0; +} + static void dump_numa(unsigned char key) { s_time_t now =3D NOW(); diff --git a/xen/arch/x86/srat.c b/xen/arch/x86/srat.c index 6d68b8a614..2298353846 100644 --- a/xen/arch/x86/srat.c +++ b/xen/arch/x86/srat.c @@ -316,18 +316,16 @@ acpi_numa_memory_affinity_init(const struct acpi_srat= _mem_affinity *ma) static int __init nodes_cover_memory(void) { int i; + uint32_t nr_banks =3D arch_meminfo_get_nr_bank(); =20 - for (i =3D 0; i < e820.nr_map; i++) { + for (i =3D 0; i < nr_banks; i++) { int j, found; unsigned long long start, end; =20 - if (e820.map[i].type !=3D E820_RAM) { + if (arch_meminfo_get_ram_bank_range(i, &start, &end)) { continue; } =20 - start =3D e820.map[i].addr; - end =3D e820.map[i].addr + e820.map[i].size; - do { found =3D 0; for_each_node_mask(j, memory_nodes_parsed) diff --git a/xen/include/xen/numa.h b/xen/include/xen/numa.h index 0475823b13..6d18059bcd 100644 --- a/xen/include/xen/numa.h +++ b/xen/include/xen/numa.h @@ -89,6 +89,10 @@ static inline void clear_node_cpumask(int cpu) cpumask_clear_cpu(cpu, &node_to_cpumask[cpu_to_node(cpu)]); } =20 +extern uint32_t arch_meminfo_get_nr_bank(void); +extern int arch_meminfo_get_ram_bank_range(int bank, + unsigned long long *start, unsigned long long *end); + #endif /* CONFIG_NUMA */ =20 #endif /* _XEN_NUMA_H */ --=20 2.25.1 From nobody Sat May 4 03:49:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=2; a=rsa-sha256; t=1628677894; cv=pass; d=zohomail.com; s=zohoarc; b=lvsSQ9nqSZmigtU0LajEorAMCt4Kws4fDs1p8wakJOsUxNcdO4wY+b4QBh353q0KQAjFxllp8zy/i+3k/YZWKZDLHcyf455/oWhPAfqHMj7vxnc+wYrB+oM+tXPorUYAnDS9CH6kKRtcgbhj2E6uk2kJ/H8uInitslWOUz6sHzc= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628677894; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=IuwOyUAAWxazKiZukmts/nvTo8jdjdFUnue+r03ghW0=; b=dh3Qhp6L2JSEp1Er7rlBXmYno1QhEKHpYGQoHNQVUtxOJc2uGOBP2FPaf7rcO8zEz0zcuLMSmyA00Y5u0C81YMsPRZ0w4Tov9oxLysyPFqXRuJCMrMnUJuZnkVsdcK34usicRnkODMinJFQl2DCURuySi9NbtZUqD6KzKMI3kb4= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1628677894015778.290460648006; Wed, 11 Aug 2021 03:31:34 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.165706.302872 (Exim 4.92) (envelope-from ) id 1mDlVx-000477-EE; Wed, 11 Aug 2021 10:31:13 +0000 Received: by outflank-mailman (output) from mailman id 165706.302872; Wed, 11 Aug 2021 10:31:13 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlVw-000419-Ng; Wed, 11 Aug 2021 10:31:12 +0000 Received: by outflank-mailman (input) for mailman id 165706; Wed, 11 Aug 2021 10:31:09 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlTc-0000BQ-JN for xen-devel@lists.xenproject.org; Wed, 11 Aug 2021 10:28:48 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (unknown [40.107.20.72]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 658d4b88-1517-46cd-a6ad-d99637b41d30; Wed, 11 Aug 2021 10:26:11 +0000 (UTC) Received: from DB6P192CA0009.EURP192.PROD.OUTLOOK.COM (2603:10a6:4:b8::19) by VI1PR0802MB2605.eurprd08.prod.outlook.com (2603:10a6:800:b0::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.21; Wed, 11 Aug 2021 10:26:04 +0000 Received: from DB5EUR03FT010.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:b8:cafe::24) by DB6P192CA0009.outlook.office365.com (2603:10a6:4:b8::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.17 via Frontend Transport; Wed, 11 Aug 2021 10:26:03 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT010.mail.protection.outlook.com (10.152.20.96) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.14 via Frontend Transport; Wed, 11 Aug 2021 10:26:03 +0000 Received: ("Tessian outbound efa8a7456a86:v101"); Wed, 11 Aug 2021 10:26:03 +0000 Received: from a56e96869bed.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id BF6DD913-B5AD-4DAA-A8DD-F819D57CC6B8.1; Wed, 11 Aug 2021 10:25:57 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id a56e96869bed.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 11 Aug 2021 10:25:57 +0000 Received: from DB6PR0301CA0073.eurprd03.prod.outlook.com (2603:10a6:6:30::20) by DBBPR08MB4489.eurprd08.prod.outlook.com (2603:10a6:10:cf::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.17; Wed, 11 Aug 2021 10:25:53 +0000 Received: from DB5EUR03FT058.eop-EUR03.prod.protection.outlook.com (2603:10a6:6:30:cafe::a7) by DB6PR0301CA0073.outlook.office365.com (2603:10a6:6:30::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.14 via Frontend Transport; Wed, 11 Aug 2021 10:25:53 +0000 Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT058.mail.protection.outlook.com (10.152.20.255) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4415.14 via Frontend Transport; Wed, 11 Aug 2021 10:25:53 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) 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.2308.14; Wed, 11 Aug 2021 10:25:42 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Wed, 11 Aug 2021 10:25:40 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 658d4b88-1517-46cd-a6ad-d99637b41d30 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=IuwOyUAAWxazKiZukmts/nvTo8jdjdFUnue+r03ghW0=; b=WNQkYnDitYguyNwSUDkR8e/riYJEGzGBQSHPjqpZFGcZOBBDa+EDnv7l9wENaMDFO2ke09n7v8NKOdKont+gpSrd++PDzNw5eM8B3TmO5D+Nlw3TBh088zYwE8ET+Pgzj7skEan+DLCMONkeNKyEemfjwbgc+o7mEjpq+VZwFU0= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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; X-CheckRecipientChecked: true X-CR-MTA-CID: 5ade92c257371a15 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nWz7lD1N9MQ+vVh0silXrGdk4dkzb+sv/sKRZi/Oc8ActucMqYVNJuY8SsylyG7I6CqTNwYksyo0WJ4FvTx9vudi1JfRYrYXwogCYsVunAg7ucsREZm3co+Ievb++H/0DIcSgv3YAJCi2VFd9AzOELH3gANF/2qcHp3M0ST/C0YOBqpkmdj8T8McknI7dasI1BspiBuxWiqDCVgBaN1gfhIdLMrYEQnzHETxsh5JKqjvXNeWl6sK0rx0/lRYMIt+uV9SYtGYErObHfi6hYAm/g4joG3fu3IGiv/Vz3Y4+X/TfQvpCiB6RKn4/oU3sgl4l/nHKR90UnorCr4kMi8pUA== 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-SenderADCheck; bh=IuwOyUAAWxazKiZukmts/nvTo8jdjdFUnue+r03ghW0=; b=CGeSRkQuzWPv7F/djCsVS5t4UmEY/gXGpiieNVb5QApommbSef1GK6PKpM0jeRAkW4D0lOGxM3TkOH+WbBDARBa1J9Nf0MK7/To/kMBK3JoQr8rrdWFIl7Loj9UACSpwFQwmBuk+ZyEe9U+zx6zcQm5PmP9kd/mrsQaLe2nbp0T8aGJNEy4HPiF9NTCPRtGIqNcPPRuI+wsj2P/daz7ZLBRVrqKuIIo8w3ScDlUDEYUhV4mZvp+VZFNExkco8SKgQCMq4hbwV5JPz/VrTA9TPyhS1q6m7prLLshbzYfT9T8EIW2B9kz2PC77qyvkYN16QlRh/qVGfSYgLCkYxw944Q== 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=IuwOyUAAWxazKiZukmts/nvTo8jdjdFUnue+r03ghW0=; b=WNQkYnDitYguyNwSUDkR8e/riYJEGzGBQSHPjqpZFGcZOBBDa+EDnv7l9wENaMDFO2ke09n7v8NKOdKont+gpSrd++PDzNw5eM8B3TmO5D+Nlw3TBh088zYwE8ET+Pgzj7skEan+DLCMONkeNKyEemfjwbgc+o7mEjpq+VZwFU0= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; 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; From: Wei Chen To: , , , , CC: Subject: [XEN RFC PATCH 29/40] xen/arm: implement Arm arch helpers Arm to get memory map info Date: Wed, 11 Aug 2021 18:24:12 +0800 Message-ID: <20210811102423.28908-30-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210811102423.28908-1-wei.chen@arm.com> References: <20210811102423.28908-1-wei.chen@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3143298d-8e71-4901-e29d-08d95cb26c3f X-MS-TrafficTypeDiagnostic: DBBPR08MB4489:|VI1PR0802MB2605: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:82;OLM:82; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: BlK9ImNVQoWJUeHxG+MREZIj4864o+A8iVQP0q4pN85VY6TEeh/DsD09p3zwz3IVO2DDgg93DcFEsuMIN0XJ/5JkA43qjCr0XSPZMcSm2fX648zMmFJ4PNyqbw72NWP43UgO67k+L0uQweLhY4WeZjHI+wzQfYkL+FsKcy7f88a2j94FPlqmnLDhI3SQAbEyy76IsK3ApRJxsHgRwX7xir6W1aODv2HsOg+bxqLsvHklfwAAcSwTwF+KoxFs5CzeH4gfoRybcjid1uxzsOrCkvyo82JkEs3RmvA6rnc8nptXQ1VZTBSCMBXDBpEdLXm3dMmonprfawaMpUnY1GyOOJ50Y1tBKbUq9dwwchCa7YOZa3Bp3DCPGbtOZRu25INVVeIHZauDcfVbvI5Kcmb5FCgVvx0dFULdZHAyMVSyDz/5tu+S9mc6vhq5VGlfAkBbl0DTlPOpgRyQK4Sr9Fq0qurRglQpI6DrQl9gbjKpIYPEFwL3SnpoQUtGeBvrj0woOBH7bazHQ/Se1tYL70r5FXybEIWBphksNB8QGCcYIZJaRn6M6Hk4RxPLpq4Y/SIQnHMoz8UyPcO3evvGVpR2SS6GDRZi5sEo2P0/M2NsLaenKDBl13hVqxkJo5Y2efBG4BZOLgJq/36zWadEqiA73rhzl2fr+ukJxHoPoH907eODWildMJf2B3nlW2KDUdaHW4LUR86BHh1CDBY08G2QB/Jmz0CFuQNAbdRezmx7fGeeJj/HeAEIeuAUZGDALQuZ49OHuYOzxlpKb9OvKrJyr+gZhCprmv+kv+w3/eYR4PQ= 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:(4636009)(376002)(346002)(136003)(396003)(39860400002)(36840700001)(46966006)(2906002)(82310400003)(36756003)(81166007)(356005)(70206006)(2616005)(8676002)(44832011)(70586007)(82740400003)(86362001)(8936002)(83380400001)(5660300002)(7696005)(336012)(47076005)(1076003)(110136005)(4744005)(316002)(36860700001)(6666004)(26005)(186003)(4326008)(34070700002)(426003)(478600001)(2101003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB4489 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT010.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: ec689fee-a26e-4c3a-6524-08d95cb2661a X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TVOnSUFiAQ+vvvJSOd2PTqquSYIKvJ5OzGZU7rykaBQL5VBZztowL7f5HfM/8UfHcTlMQqlXENgw2Farpw9bBV7mTvPx9nuhRtx0Sj9Jt5vcUXAiiz5M+8dbThGlhvK1v0ph0oLFsoMat3g4sa23/Xu1gRLd4uIHk6Fs1Fx7TwQfWYEe9uzM1OP504Gl70H2acZ7RaEWsufjZKNbUFjGqO+0b5rhmSqFdvzi9E1xR6LCxhnM0PX1TLP86J+2GyxHs3RqMyLSAOmPWL2lV8PtPQVnYsqF44WEwm1jahStk1AhMPyXqb/M/9G2Z+FAPEiUInNs9tHqaVXOeGmdQgBYJBLwfZJaRj8TlOfFAaZKb8BVmDZPOkkaJ9uG+0BCB/mhvdh61S3WOXdOEuAuJ92TISa1U6her1E/o1XPHtxHU9rZTJtUswrfNPXUWITRnwSJtZnlUD0iWzpvSZaXKV3hBFrBKqERPZaHT4j+5VAqYlWepf4faJW3O5I2gfZ/0+SX1gD69g3N0VksXdqlrd+R+lfd9cCgclYjOGl2HsGhu5OVFr6fucdLJbrPGeacAjzlpltOh+xfA5sQ3vyg6K7QYukmWUGgRTem80b4BP7hU7Fgn9SOCoJaMbnqE3OgbS0x8H7NuMQ2xrzAHwRLa7Q7i/bpeM9vPvk2EpiOK08NtV5dSqzYjV/DQ+ErTMEDYeSwaoBjmxZg/ALhpro8LnQuOLHk1t/86r+SaRU4wR2324Y= 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:(4636009)(376002)(396003)(136003)(39850400004)(346002)(36840700001)(46966006)(2616005)(426003)(36860700001)(44832011)(336012)(47076005)(82740400003)(70206006)(5660300002)(316002)(83380400001)(70586007)(186003)(81166007)(2906002)(1076003)(4744005)(110136005)(4326008)(82310400003)(6666004)(26005)(478600001)(86362001)(7696005)(8676002)(36756003)(8936002)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2021 10:26:03.9596 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3143298d-8e71-4901-e29d-08d95cb26c3f 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: DB5EUR03FT010.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0802MB2605 X-ZohoMail-DKIM: pass (identity @armh.onmicrosoft.com) X-ZM-MESSAGEID: 1628677894769100001 Content-Type: text/plain; charset="utf-8" These two helpers are architecture APIs that are required by nodes_cover_memory. Signed-off-by: Wei Chen --- xen/arch/arm/numa.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/xen/arch/arm/numa.c b/xen/arch/arm/numa.c index f61a8df645..6eebf8e8bc 100644 --- a/xen/arch/arm/numa.c +++ b/xen/arch/arm/numa.c @@ -126,3 +126,17 @@ void __init numa_init(bool acpi_off) numa_initmem_init(PFN_UP(ram_start), PFN_DOWN(ram_end)); return; } + +uint32_t __init arch_meminfo_get_nr_bank(void) +{ + return bootinfo.mem.nr_banks; +} + +int __init arch_meminfo_get_ram_bank_range(int bank, + unsigned long long *start, unsigned long long *end) +{ + *start =3D bootinfo.mem.bank[bank].start; + *end =3D bootinfo.mem.bank[bank].start + bootinfo.mem.bank[bank].size; + + return 0; +} --=20 2.25.1 From nobody Sat May 4 03:49:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=2; a=rsa-sha256; t=1628677884; cv=pass; d=zohomail.com; s=zohoarc; b=mygKV4ig/ZtZvxG8iKP0d2iKsVzkfV0T6KDTGB4Sf3exsavDoiE18oSeppSO/5IJ0itv7btf0/TFZEZOD9WKMXrFQkLhJ1iJCNEkKLHB7g9aYAWmT/jBFhe9irb2rvCQa5dfQVS4SJBMtB9aySTQgIOhtrQ3myhqldbPqvGlV/M= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628677884; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=kAd68KnXsqd+C2bIAP1n0fHZQ7iABbF7AodWabl+rLs=; b=HUZd9WW8haYi90rzpX7WwaAd4pm/rgM6gP9xxd2kdKS0zqzit/0r8CjvpgYT0sFVvkbvC3YIA185ot2X00jf0ScpsM+Ne6PN2ANRI3vHP2xaNoE/+/KOlnH/OOUZd5cdMj3Ys877e7QHxlktZhnUlYbZhXQHLb5KxARcPP+u7Yo= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 162867788480025.080864550335036; Wed, 11 Aug 2021 03:31:24 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.165704.302846 (Exim 4.92) (envelope-from ) id 1mDlVt-0003Gt-T4; Wed, 11 Aug 2021 10:31:09 +0000 Received: by outflank-mailman (output) from mailman id 165704.302846; Wed, 11 Aug 2021 10:31: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 1mDlVt-0003EA-CK; Wed, 11 Aug 2021 10:31:09 +0000 Received: by outflank-mailman (input) for mailman id 165704; Wed, 11 Aug 2021 10:31:07 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlRt-0002Qj-Hd for xen-devel@lists.xenproject.org; Wed, 11 Aug 2021 10:27:01 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (unknown [40.107.21.54]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 8e31e048-fa8e-11eb-a052-12813bfff9fa; Wed, 11 Aug 2021 10:26:14 +0000 (UTC) Received: from AM6P193CA0073.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:88::14) 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.4394.21; Wed, 11 Aug 2021 10:26:09 +0000 Received: from VE1EUR03FT063.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:88:cafe::8) by AM6P193CA0073.outlook.office365.com (2603:10a6:209:88::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.14 via Frontend Transport; Wed, 11 Aug 2021 10:26:09 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT063.mail.protection.outlook.com (10.152.18.236) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:26:08 +0000 Received: ("Tessian outbound 79bfeeb089c1:v101"); Wed, 11 Aug 2021 10:26:08 +0000 Received: from 841568cdc80d.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 5E7B3703-1965-488A-879D-3374F72C818D.1; Wed, 11 Aug 2021 10:26:01 +0000 Received: from EUR02-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 841568cdc80d.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 11 Aug 2021 10:26:01 +0000 Received: from DB6PR0201CA0012.eurprd02.prod.outlook.com (2603:10a6:4:3f::22) by AM5PR0802MB2547.eurprd08.prod.outlook.com (2603:10a6:203:a0::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.22; Wed, 11 Aug 2021 10:25:57 +0000 Received: from DB5EUR03FT036.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:3f:cafe::30) by DB6PR0201CA0012.outlook.office365.com (2603:10a6:4:3f::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.14 via Frontend Transport; Wed, 11 Aug 2021 10:25:57 +0000 Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT036.mail.protection.outlook.com (10.152.20.185) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:25:57 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) 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.2308.14; Wed, 11 Aug 2021 10:25:44 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Wed, 11 Aug 2021 10:25:43 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 8e31e048-fa8e-11eb-a052-12813bfff9fa 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=kAd68KnXsqd+C2bIAP1n0fHZQ7iABbF7AodWabl+rLs=; b=NN7SNcQ/0ftHViax+fgQ4xFeXDVMAMUqM/UOiBUCPtcvKY7Qqj4J1ubpLbC9A+7aBsjxWDB6T2Nd3ymW+kf7LuooZuK5ly121gaw9LTkEOMVpX3iPWzEb2DIKkYUFaN1doFXutCPhnPEFyTFE71B3RWgnk5a2ZH9GqMoOAa+ex4= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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; X-CheckRecipientChecked: true X-CR-MTA-CID: 815451cf1eaab556 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Kkj1y8eDd3DDs0xSTi4okAKXQyi+0jFKfvIsS/swjVS27HhKUYkQEbQVD+7XWwfbkEH5Q68+dFc3zKI9ouFl+MnFftPrIOa+vqKNUktd4M/SgoFPlsa0IBjSTA/G8SwwkC76SXgftOFl1eTva2kmXYNlEWQqv7tE/5Wbz0V4hWN/OknCSvc8Mm258WCVnSRJQk9CDQk/SJ2Xn8ouubq1qq++owBOTEeRtuOqs6hMLCwtSIiwOGXEklseIZytUk44OdohuX71MRanmhAoyQpbI0SIERDtkWjmbSPjZ94s1tOpvq5kspHGJWqoD0TBIBEwEkEBd0mcvaTKqSwfnJL9TQ== 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-SenderADCheck; bh=kAd68KnXsqd+C2bIAP1n0fHZQ7iABbF7AodWabl+rLs=; b=D3BEQnoT9yVmoXKY7Nou5+sjJzrq7rL9U5CLBk07ebjqRErWVIpdFbmZz3d00fSqxF8TjqnVZbeMtWUDQmkQqJPZFYXTDH3RjFxLFQfRXZgPySVtYF4NwNXVZEsv9Bw72gusvNGWLgxitJBTFePQYCP5pB+V72oyiXMSvZCelYxeYJqpg6Sl1H/YoQy8SrmhxR7XD4rqp8co9w/5xM50uxZdz3pb3TF0N9o4PrQXL7j7/bHpcfBRZlzkojhwbZUVQso/Hm9/PItbb2URW3geQn9okUHiKHLw3P9UgubNlQ7KRUXlv15htp8gk6ud5A9RepXxN0j/gqh+sn4tzK/DUw== 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=kAd68KnXsqd+C2bIAP1n0fHZQ7iABbF7AodWabl+rLs=; b=NN7SNcQ/0ftHViax+fgQ4xFeXDVMAMUqM/UOiBUCPtcvKY7Qqj4J1ubpLbC9A+7aBsjxWDB6T2Nd3ymW+kf7LuooZuK5ly121gaw9LTkEOMVpX3iPWzEb2DIKkYUFaN1doFXutCPhnPEFyTFE71B3RWgnk5a2ZH9GqMoOAa+ex4= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; 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; From: Wei Chen To: , , , , CC: Subject: [XEN RFC PATCH 30/40] xen: move NUMA memory and CPU parsed nodemasks to common Date: Wed, 11 Aug 2021 18:24:13 +0800 Message-ID: <20210811102423.28908-31-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210811102423.28908-1-wei.chen@arm.com> References: <20210811102423.28908-1-wei.chen@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 87e20043-0a15-49ac-3f8f-08d95cb26f30 X-MS-TrafficTypeDiagnostic: AM5PR0802MB2547:|DBAPR08MB5671: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:198;OLM:198; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: M3+bHq77CXZOa0tvzZI8sTsVYtx+e37qqvEpqa+1y/03HKea4cDavKtzEOPatFE8zYIf8YLnDrPJulY8dndRyKshhOs7MmJ2nLpAbKCDe/zicwD8PAI2swVjfwNpxxU09KUB/CBKb9PuIqWPuPTsz4m+IRO5fnaQ0XBXfMloq9314+4lhOLHLURSSZZzjHsmT7RFDOCg6wnflqywcZQNN40+QFNp+7C1nPcp8zyJKN0aD3Ma6IS4/dEabKO/mkPagBa9p8ruLO2VCFIlcGHcX1HG5XefK9hApWiVuQciMCZ+LGCpWfEPTfr7M5ipchdJPNBlrzpIedG+s6iL3xKoAEzc1RrTi13TnKoWMW3p8EG6SS+Fxr4LVSFPxqgVvU/NIQmkzfOlxWssUL8Ky6Dr2dtgqKeavOBJd0RGMJWOmN10pkLCKiWJ9JXmUoPpGof5sKVGYU0vdwG0bG5z026nrDkBmd4/NDnZ8Nh9FA7INqDy1tXBf054SW3XYtuJLnaUKxuhZanxtcFMyYNsL7V6XQyjOLMzdeiAD6YWtzIHRbHtgZIfynszftam98qREOcHU/ZECyOZWC5TXBhEM+rQYaAPRfRS8DUcOybg8GUFxgOyTk5HsvOKOwjRSV50qrGFyGjlegQbdBwem48WcfP7Icsm0E89ylG+vnv1P9iPLzo5zbuH2hoFJcRc81EVRjS3zMaUAJnfkS+hbnSbtYaVZcy44PRKqrwf8o/UjQINR49znDiT8+7296m1iT7OCI3L5YouURRo/pP1u8O/7iWH+e4rnsrco7rnb7x5w1z77aE= 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:(4636009)(46966006)(36840700001)(6666004)(8676002)(508600001)(82310400003)(426003)(83380400001)(336012)(2616005)(110136005)(186003)(36860700001)(34070700002)(1076003)(7696005)(5660300002)(86362001)(316002)(8936002)(81166007)(4326008)(36756003)(70586007)(47076005)(44832011)(356005)(70206006)(26005)(2906002)(2101003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0802MB2547 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT063.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: d16a6a5d-02f9-4fc1-79da-08d95cb2686d X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tXxAPvp3I+QKKNblGzJxYwxqJAH8hWiTxw2HHrssR+T4fM+69BGk3rUxm0nplvG8m9ZQsAOqT650h/lPzk31n/aBWmQcp+mQm9jiZvFRGMvY8aBkxyzIzeifzQmC9469qYiYPFT7ZiahtjvkELxNC/JssOC+ypjvkawJ3K+MwHWOsqzv+yGFGaB0QEkvWQ2Q0yzVtdkzzKupRAy63pqH0/TqmvUlJPj42N1fnEbJEBy4pE/S48pRiVqg4qyTcmp6mH0xXGu8KrJPdwlloY7SUTwcOHGaSFHbCN1fgiU6DwzHvwbrcr6tETiTxg+bN+tP98Bxk+zpJZhGXgrOB7wNsFSB+Q/ZVszBdM6jFa1P+RwUBm/ADydTvAbMVB9iBlF9amr25PU0KRviXDC7T04p0/gHK7WhQxOpWtfmMcztdUPjJOKRuDm/1emy53uo3t5XonIRz0RlbGLj3QBHEliQoZEdnoTIdsp/Q/W1kgiZSmMocfDXBn/EmPHEtK9HlOgFRU0GCuiOtxofx51i4E2iraR0aNBgO+3KdcqF+qBRyQHT+ywcZMAoIV3JlkXsu0cehF4yJuLiMPO9aVEjK2A0ekAoh+oHROAJxMcVrUTa2xnv4TrWUqJGMRmyEMd9rkAFWzqmknUXVcpvZhR80LizW4tWZQLRd4UHeQnSxnwiWpdjsBBGsdWFWo63E6I35GSyQlp+U/eWcSpKrETTe2IIVjemed79RIhyigtEYgK5dk4= 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:(4636009)(46966006)(36840700001)(81166007)(1076003)(5660300002)(47076005)(336012)(110136005)(86362001)(6666004)(508600001)(8936002)(83380400001)(4326008)(8676002)(7696005)(316002)(36756003)(44832011)(70206006)(26005)(186003)(70586007)(2616005)(36860700001)(2906002)(82310400003)(426003)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2021 10:26:08.7803 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 87e20043-0a15-49ac-3f8f-08d95cb26f30 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: VE1EUR03FT063.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR08MB5671 X-ZohoMail-DKIM: pass (identity @armh.onmicrosoft.com) X-ZM-MESSAGEID: 1628677885991100003 Content-Type: text/plain; charset="utf-8" Both memory_nodes_parsed and processor_nodes_parsed are using for Arm and x86 to record parded NUMA memory and CPU. So we move them to common. Signed-off-by: Wei Chen --- xen/arch/arm/numa_device_tree.c | 2 -- xen/arch/x86/srat.c | 3 --- xen/common/numa.c | 3 +++ xen/include/xen/nodemask.h | 2 ++ 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/xen/arch/arm/numa_device_tree.c b/xen/arch/arm/numa_device_tre= e.c index 27ffb72f7b..f74b7f6427 100644 --- a/xen/arch/arm/numa_device_tree.c +++ b/xen/arch/arm/numa_device_tree.c @@ -25,8 +25,6 @@ #include =20 s8 device_tree_numa =3D 0; -static nodemask_t processor_nodes_parsed __initdata; -static nodemask_t memory_nodes_parsed __initdata; =20 static int srat_disabled(void) { diff --git a/xen/arch/x86/srat.c b/xen/arch/x86/srat.c index 2298353846..dd3aa30843 100644 --- a/xen/arch/x86/srat.c +++ b/xen/arch/x86/srat.c @@ -24,9 +24,6 @@ =20 static struct acpi_table_slit *__read_mostly acpi_slit; =20 -static nodemask_t memory_nodes_parsed __initdata; -static nodemask_t processor_nodes_parsed __initdata; - struct pxm2node { unsigned pxm; nodeid_t node; diff --git a/xen/common/numa.c b/xen/common/numa.c index 26c0006d04..79ab250543 100644 --- a/xen/common/numa.c +++ b/xen/common/numa.c @@ -35,6 +35,9 @@ int num_node_memblks; struct node node_memblk_range[NR_NODE_MEMBLKS]; nodeid_t memblk_nodeid[NR_NODE_MEMBLKS]; =20 +nodemask_t memory_nodes_parsed __initdata; +nodemask_t processor_nodes_parsed __initdata; + bool numa_off; =20 /* diff --git a/xen/include/xen/nodemask.h b/xen/include/xen/nodemask.h index 1dd6c7458e..29ce5e28e7 100644 --- a/xen/include/xen/nodemask.h +++ b/xen/include/xen/nodemask.h @@ -276,6 +276,8 @@ static inline int __cycle_node(int n, const nodemask_t = *maskp, int nbits) */ =20 extern nodemask_t node_online_map; +extern nodemask_t memory_nodes_parsed; +extern nodemask_t processor_nodes_parsed; =20 #if MAX_NUMNODES > 1 #define num_online_nodes() nodes_weight(node_online_map) --=20 2.25.1 From nobody Sat May 4 03:49:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=2; a=rsa-sha256; t=1628677911; cv=pass; d=zohomail.com; s=zohoarc; b=iECsmZQ8Tqx/+ret6aWptuCIbs5rYhTgx/g8SfHHS/Wn+kEqNWY3PdEB9bT27utLjtHsdSKhBQWSdowk/XUz6kqzTh4qKXic79urPzDytv1a/GdnDL0gH4SxtTJFyy6K55bNVFARD/OiLs9e8FsS/XBU2RDSUWufy2/JozDQi5g= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628677911; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=HWJHCCjl1hbGXNltzp/ISaOFhGhC8ThEvX0V7WgmkKA=; b=VObtkQE8at/OJLTnSdMtxTePSOW8u5KFVckBMuwBwvjUCO+VgRlEFDgxIoz7sK8mWbiS8tWnr9DOZrG0hE0zoGH0TpIsJsvvVXlmyd93QDqNDBmZ3JFOmx1KwJoHBc6e/bBm+GGpAeYhfpgx15KC8/2tFDoA9ufWoaZDpDrtDYM= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1628677911272199.70304828681537; Wed, 11 Aug 2021 03:31:51 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.165752.302957 (Exim 4.92) (envelope-from ) id 1mDlWJ-0000Mk-NF; Wed, 11 Aug 2021 10:31:35 +0000 Received: by outflank-mailman (output) from mailman id 165752.302957; Wed, 11 Aug 2021 10:31:35 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlWI-0000Fm-Tp; Wed, 11 Aug 2021 10:31:34 +0000 Received: by outflank-mailman (input) for mailman id 165752; Wed, 11 Aug 2021 10:31:32 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlU1-0000BQ-Ju for xen-devel@lists.xenproject.org; Wed, 11 Aug 2021 10:29:13 +0000 Received: from EUR03-AM5-obe.outbound.protection.outlook.com (unknown [40.107.3.50]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 6b0b17b2-90a2-4543-b23e-a562baaa68e8; Wed, 11 Aug 2021 10:26:15 +0000 (UTC) Received: from AS8PR04CA0171.eurprd04.prod.outlook.com (2603:10a6:20b:331::26) by AM9PR08MB6835.eurprd08.prod.outlook.com (2603:10a6:20b:2ff::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16; Wed, 11 Aug 2021 10:26:14 +0000 Received: from VE1EUR03FT045.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:331:cafe::15) by AS8PR04CA0171.outlook.office365.com (2603:10a6:20b:331::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.13 via Frontend Transport; Wed, 11 Aug 2021 10:26:14 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT045.mail.protection.outlook.com (10.152.19.51) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:26:13 +0000 Received: ("Tessian outbound 312d863716bf:v101"); Wed, 11 Aug 2021 10:26:13 +0000 Received: from 6d23c3fb136b.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 23203EB5-D2B6-47A7-AA98-9D8360B2AACA.1; Wed, 11 Aug 2021 10:26:07 +0000 Received: from EUR03-AM5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 6d23c3fb136b.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 11 Aug 2021 10:26:07 +0000 Received: from DB6PR0201CA0022.eurprd02.prod.outlook.com (2603:10a6:4:3f::32) by AM9PR08MB7215.eurprd08.prod.outlook.com (2603:10a6:20b:3de::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.14; Wed, 11 Aug 2021 10:26:00 +0000 Received: from DB5EUR03FT036.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:3f:cafe::70) by DB6PR0201CA0022.outlook.office365.com (2603:10a6:4:3f::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:26:00 +0000 Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT036.mail.protection.outlook.com (10.152.20.185) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:26:00 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) 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.2308.14; Wed, 11 Aug 2021 10:25:47 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Wed, 11 Aug 2021 10:25:45 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 6b0b17b2-90a2-4543-b23e-a562baaa68e8 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=HWJHCCjl1hbGXNltzp/ISaOFhGhC8ThEvX0V7WgmkKA=; b=2hBEneRsLkoAF0k0FYTM2mRHx+jE+wvJMXyxSNwUT/J+0MH1rpFjZxjbPxjZ3xlOn2RYexxToB1Sdp/18jvKgu7xPxD9KGpi1IPhxTkSsJ+Sq8mz5rtCRdueKMobLBASwXDw1zYgR+U4pWeQnoFJs1zqbM2m8jCD6LSfqic0Nwg= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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; X-CheckRecipientChecked: true X-CR-MTA-CID: 9edb159b5d36f640 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jAs/WPMFYm763HR2sLlC88pr3/kT/1QLjwlLsg1eW8SxjQPoVu5EJSWmb0lK6dO9opO7ZiD51Bf6foOAiNzQ4VtSjePXh+Q/x/loGzK52J8VKpwo0nJGFpkv9aS0i+0/XftvicTmJ7U1xC/UoeTLA0WNT9dNC+KLmVj5fd9lCzEowfoPXFjsMuQiyw0ILWjgRTp1MRENSc0X4sdeHV8doQLGbvII6HgxtR6OVOJ4ESc6nWXtoPVckODHKoq7zsouwfwlTOVBWjWKQVno6BswYguyVJNX/1nrwTNXx61AFY7M6rG37YdaQa+PgdxSF9LWweYQq+PTjzlxi5nwRkFk1A== 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-SenderADCheck; bh=HWJHCCjl1hbGXNltzp/ISaOFhGhC8ThEvX0V7WgmkKA=; b=aalgA2npBGO6S+2cC0FQL4tEY4uS537fMUU3IJAcyqizi3+b+YQOuEG/iY7vZnO/ntGfyQtO4HRyBjwGhN52oBW4I+Yo5W2UuLMSxXsErSlyTxvnXhOXjA+j0BVridPx4sBGIb0NG/FhjWA9ofYk1f/KXWKax3N8dNskjpWUuE53ZP5AThsJSiqLRHybMewGICu7bxtGujI6i+Os2RiRBGe412IUVFoX2rwfUUd3//ikZvx7yR7drfzfcnkXNZoTVnbr2hgfKiW+6UWbx4YbLEuyDoIX1l+1Erh8U8jEmGeMVc5gYBTkfT6hdyhcW+yxc903ihso6+NhDiGiymbdzQ== 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=HWJHCCjl1hbGXNltzp/ISaOFhGhC8ThEvX0V7WgmkKA=; b=2hBEneRsLkoAF0k0FYTM2mRHx+jE+wvJMXyxSNwUT/J+0MH1rpFjZxjbPxjZ3xlOn2RYexxToB1Sdp/18jvKgu7xPxD9KGpi1IPhxTkSsJ+Sq8mz5rtCRdueKMobLBASwXDw1zYgR+U4pWeQnoFJs1zqbM2m8jCD6LSfqic0Nwg= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; 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; From: Wei Chen To: , , , , CC: Subject: [XEN RFC PATCH 31/40] xen/x86: move nodes_cover_memory to common Date: Wed, 11 Aug 2021 18:24:14 +0800 Message-ID: <20210811102423.28908-32-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210811102423.28908-1-wei.chen@arm.com> References: <20210811102423.28908-1-wei.chen@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7d2c7625-58b4-4a55-7df5-08d95cb27233 X-MS-TrafficTypeDiagnostic: AM9PR08MB7215:|AM9PR08MB6835: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:6790;OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: uAgP5LOZT5isIlo7JvnvliKkkQvb7BGpvvrVIr8FCrNQsBV5tzxjCyRn8Ur1pw2bW2xxl/92v7TxIv7jitljIX3vMWOwDTID2yWYjwS6xkmTG/XYgxFu10omOVFN6v6SgHZkQpTnkvDDSihPmFozGgLPJitcrS2Ox+zoM+LwJWwbdyouf1Yu+yKiXhQpMuF/3dPvps9NtKhTiODzkO0jQUr9BvVLeb1lJGmDxap43GISejAzoMI9/UnHaq1tBffk05tjHdNagKSZOs7J7IQYl1NcWPB9/So4Gy+V7jGbiYl7cIgK+GBLCeRHOLfnBYk/EUj/HM78W4WTKGA48P0SZMhUyDS5GyHiObA3RkNioZmteS4LgCoWqQIGewBn4BX0aOpju3YwRfLtl3DESczB5o7UCnA0sXkYs4Rz2aB226J1qzFSDx8ahh1qghLPKJpl8t0PQYyJ3uzD6PUKTfJNKmeeDG37qvwWDbHiFSkqbpQWEBDuzfWM3moiHmFaJ1BhOzJrVGCMF5ODlb/qwflUYsTSpXuUw40Gaj/0U9hC8HCNsfzoGFfVsY0SvQqMApQRm0B5gGF1UbZF4UvsidVibrE/fREZncm9ZmSa2AG/GztKmFUbN6rmJnJBhNuvr/NjOOSSK51uAI7IQ3K1bar34SocuG/E799XqMt0sZSmW32SgbwraFCxW3c8RX1cq+lB4ZKRjsADRIjDYQNKfIOosRpQMzHEk6yAu+8ti/PnWM2Pj5+YfJUkZCibNILIJkR5mt14wilDqvFFPTS42r4ATzwwZGDAoF30asrRC+5d350= 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:(4636009)(39860400002)(376002)(346002)(396003)(136003)(36840700001)(46966006)(4326008)(5660300002)(36756003)(36860700001)(8676002)(47076005)(70586007)(1076003)(336012)(70206006)(82310400003)(81166007)(426003)(110136005)(356005)(83380400001)(26005)(316002)(7696005)(82740400003)(2906002)(34070700002)(86362001)(6666004)(44832011)(8936002)(2616005)(186003)(478600001)(36900700001)(2101003);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR08MB7215 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT045.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: be89c955-fd0a-48d0-6838-08d95cb269e7 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uvT0E9oq4yz57du8k+s2LsCNOT/SDQEp88q5dF+PnOShUr06yLRuQgfzBq2d9wo5G6UWhmtQvHCQW1VrSt3m7VHgGHapTooBgkAO376lMotwAAFTJ8RUS3ijrj5/rdJQreBPfxG0MTzuqCJlIOzx2+NWTlfM26HHYa2+udt74QiAShw8LjOgE152PNMVSyHvngY26nLNG1CqARGj8ORc7U6ubtzThTZHOk83Hide14J1x66tBriuUYEzSwGHkpV93IYcwxURipJT8cG15UrmJj9+rlbmoPXQCWx36BpzNSj1v8y7HfNFDnqlLOwLeshXUtR1/1pNtPVsT8zOMfnKu+OQIm1aCCjdWGm3FNNjPt0tZNCQ/EpA1GCSOg62h0q09oNowWjtr0Z4QuhHxm9N4Huh+SBY1OyM79euJ1Ru+GM21RCZteY4tXwtkldM0rub+txefGPU2F6NI+/mIyKd33OERoujQjtyph8WFxzaSATfwsDEq5VDgykOKz1Cedx+j07alPFriH1nBr3RhnIz9O6Pa2yasvD93IMfyq/kL6y1nYZSs0DeyMoUUgOGUyrMCyrnzR6/nHEiWcdAgn0RaiETSceOvjGDNJDTsqMQ5msgD7okJ3MkdHCMMWNpTdUIC6J7SPKjSohv3aMSI9CvGgGMIpcsV2r2b1ei1dPw5eNf6Ep14Sq9hLB/VNt2pxKVI5qzw6CiFbdbY5+0CXFbtdxJMc66oCw4v+cPrOYqNQY= 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:(4636009)(396003)(376002)(136003)(346002)(39850400004)(36840700001)(46966006)(86362001)(2906002)(7696005)(82740400003)(47076005)(5660300002)(316002)(4326008)(36860700001)(81166007)(83380400001)(70206006)(70586007)(26005)(2616005)(82310400003)(478600001)(1076003)(8676002)(6666004)(8936002)(44832011)(110136005)(336012)(186003)(426003)(36756003)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2021 10:26:13.8027 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7d2c7625-58b4-4a55-7df5-08d95cb27233 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: VE1EUR03FT045.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR08MB6835 X-ZohoMail-DKIM: pass (identity @armh.onmicrosoft.com) X-ZM-MESSAGEID: 1628677912806100003 Content-Type: text/plain; charset="utf-8" Not only ACPU NUMA, but also Arm device tree based NUMA will use nodes_cover_memory to do sanity check. So we move this function from arch/x86 to common. Signed-off-by: Wei Chen --- xen/arch/x86/srat.c | 40 ---------------------------------------- xen/common/numa.c | 40 ++++++++++++++++++++++++++++++++++++++++ xen/include/xen/numa.h | 1 + 3 files changed, 41 insertions(+), 40 deletions(-) diff --git a/xen/arch/x86/srat.c b/xen/arch/x86/srat.c index dd3aa30843..dcebc7adec 100644 --- a/xen/arch/x86/srat.c +++ b/xen/arch/x86/srat.c @@ -308,46 +308,6 @@ acpi_numa_memory_affinity_init(const struct acpi_srat_= mem_affinity *ma) num_node_memblks++; } =20 -/* Sanity check to catch more bad SRATs (they are amazingly common). - Make sure the PXMs cover all memory. */ -static int __init nodes_cover_memory(void) -{ - int i; - uint32_t nr_banks =3D arch_meminfo_get_nr_bank(); - - for (i =3D 0; i < nr_banks; i++) { - int j, found; - unsigned long long start, end; - - if (arch_meminfo_get_ram_bank_range(i, &start, &end)) { - continue; - } - - do { - found =3D 0; - for_each_node_mask(j, memory_nodes_parsed) - if (start < nodes[j].end - && end > nodes[j].start) { - if (start >=3D nodes[j].start) { - start =3D nodes[j].end; - found =3D 1; - } - if (end <=3D nodes[j].end) { - end =3D nodes[j].start; - found =3D 1; - } - } - } while (found && start < end); - - if (start < end) { - printk(KERN_ERR "SRAT: No PXM for e820 range: " - "%016Lx - %016Lx\n", start, end); - return 0; - } - } - return 1; -} - void __init acpi_numa_arch_fixup(void) {} =20 static uint64_t __initdata srat_region_mask; diff --git a/xen/common/numa.c b/xen/common/numa.c index 79ab250543..74960885a6 100644 --- a/xen/common/numa.c +++ b/xen/common/numa.c @@ -193,6 +193,46 @@ void __init cutoff_node(int i, u64 start, u64 end) } } =20 +/* Sanity check to catch more bad SRATs (they are amazingly common). + Make sure the PXMs cover all memory. */ +int __init nodes_cover_memory(void) +{ + int i; + uint32_t nr_banks =3D arch_meminfo_get_nr_bank(); + + for (i =3D 0; i < nr_banks; i++) { + int j, found; + unsigned long long start, end; + + if (arch_meminfo_get_ram_bank_range(i, &start, &end)) { + continue; + } + + do { + found =3D 0; + for_each_node_mask(j, memory_nodes_parsed) + if (start < nodes[j].end + && end > nodes[j].start) { + if (start >=3D nodes[j].start) { + start =3D nodes[j].end; + found =3D 1; + } + if (end <=3D nodes[j].end) { + end =3D nodes[j].start; + found =3D 1; + } + } + } while (found && start < end); + + if (start < end) { + printk(KERN_ERR "SRAT: No PXM for e820 range: " + "%016Lx - %016Lx\n", start, end); + return 0; + } + } + return 1; +} + void numa_add_cpu(int cpu) { cpumask_set_cpu(cpu, &node_to_cpumask[cpu_to_node(cpu)]); diff --git a/xen/include/xen/numa.h b/xen/include/xen/numa.h index 6d18059bcd..094ab904c9 100644 --- a/xen/include/xen/numa.h +++ b/xen/include/xen/numa.h @@ -92,6 +92,7 @@ static inline void clear_node_cpumask(int cpu) extern uint32_t arch_meminfo_get_nr_bank(void); extern int arch_meminfo_get_ram_bank_range(int bank, unsigned long long *start, unsigned long long *end); +extern int nodes_cover_memory(void); =20 #endif /* CONFIG_NUMA */ =20 --=20 2.25.1 From nobody Sat May 4 03:49:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=2; a=rsa-sha256; t=1628677928; cv=pass; d=zohomail.com; s=zohoarc; b=SJRVrJUwlWwohpl8Js2bXkBIhLyRl/spDjS+g1eJwJ1j2sF9y/a8AGbU1u6XFBU6VdIuF+PyvmcKGWmDlDsYc30JAuFtyOw7L8bMho00QX+YCePiif8upd8lBaKtlMvlpzvCZgPaqz43dqVtvpt/5A6AkrIlf43+NmL5DFwrnEs= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628677928; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=t/9Z30yQrnVeDNYbOYgNSbsnu664JdEj5BAT/JnizSg=; b=UcZj38cjsJfgbvcRgTvw45V8suWVXCGwhP0PiAh6CgXKqyLELacO8ehKEe5NuWF9mor5xpeijebX4PBfN3IhF2OrhXvTSivznsLEYxyXsQf0neuDQNv5VRvsfXoiCdd9nYhWB0UY4R8P6Eq71tIZJZ49uie/KNBuOgc5+krLVnA= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1628677928458279.1563850575087; Wed, 11 Aug 2021 03:32:08 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.165795.303028 (Exim 4.92) (envelope-from ) id 1mDlWb-0004Kd-5u; Wed, 11 Aug 2021 10:31:53 +0000 Received: by outflank-mailman (output) from mailman id 165795.303028; Wed, 11 Aug 2021 10:31:53 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlWa-0004Fr-LB; Wed, 11 Aug 2021 10:31:52 +0000 Received: by outflank-mailman (input) for mailman id 165795; Wed, 11 Aug 2021 10:31:49 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlTX-0000BQ-J8 for xen-devel@lists.xenproject.org; Wed, 11 Aug 2021 10:28:43 +0000 Received: from EUR02-AM5-obe.outbound.protection.outlook.com (unknown [2a01:111:f400:fe07::61c]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 825788ea-0dba-443e-a549-6d2f87a3c23a; Wed, 11 Aug 2021 10:26:11 +0000 (UTC) Received: from PR0P264CA0104.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:19::20) by PAXPR08MB6640.eurprd08.prod.outlook.com (2603:10a6:102:dd::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.22; Wed, 11 Aug 2021 10:26:09 +0000 Received: from VE1EUR03FT008.eop-EUR03.prod.protection.outlook.com (2603:10a6:100:19:cafe::dc) by PR0P264CA0104.outlook.office365.com (2603:10a6:100:19::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.15 via Frontend Transport; Wed, 11 Aug 2021 10:26:09 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT008.mail.protection.outlook.com (10.152.18.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:26:09 +0000 Received: ("Tessian outbound efa8a7456a86:v101"); Wed, 11 Aug 2021 10:26:09 +0000 Received: from e85922422c5e.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 5B43F670-27D9-44B6-A926-FC01CB34D019.1; Wed, 11 Aug 2021 10:26:02 +0000 Received: from EUR02-VE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id e85922422c5e.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 11 Aug 2021 10:26:02 +0000 Received: from DB6PR0201CA0010.eurprd02.prod.outlook.com (2603:10a6:4:3f::20) by AM9PR08MB6916.eurprd08.prod.outlook.com (2603:10a6:20b:30c::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.17; Wed, 11 Aug 2021 10:26:00 +0000 Received: from DB5EUR03FT036.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:3f:cafe::27) by DB6PR0201CA0010.outlook.office365.com (2603:10a6:4:3f::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:26:00 +0000 Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT036.mail.protection.outlook.com (10.152.20.185) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:26:00 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) 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.2308.14; Wed, 11 Aug 2021 10:25:49 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Wed, 11 Aug 2021 10:25:47 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 825788ea-0dba-443e-a549-6d2f87a3c23a 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=t/9Z30yQrnVeDNYbOYgNSbsnu664JdEj5BAT/JnizSg=; b=ykOvZIoDqxAN0bc6pw6EJ7FpcpVMLTGSnP5PVosztTjah2on64MPUXb7nlDcKOGYFf+d4R3cJ7e7Mmmrp0Hrq/9L/ysGKq8JNe+impg6r7QP23O5qTGgQkDwm+NljRrqRsvaV4OBRL2W84dEBVmLs/auoPs+o0lgACZ8uwSCibg= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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; X-CheckRecipientChecked: true X-CR-MTA-CID: c04fb077d407ff8b X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LqDxmdIlMlNad36wj/HNgeinp+CO3m6DbBmuXYgprQx/PSQpJBN2GOhx0fDrL2s7u6tjfwQ3a8NpFMffmF6PsHECbA+bTMMsjoeZM0OrNJC2Os/Ggj0Y5aF2/ELrPZwgPmphHLJWfRBbuc6J+Jh8jld025yGvJJ1dNOS4Nk2j11fLkmxXVqnKY+MUNskllCcN2HazVzL9ufn5lJtAlIJ3B3A0GNrey72l5GvUGn6SibbbZ63PDB61gdaThPGSQ4LwDQDzWlusPCP7pQWvu0rMw1LSYDqGM1iSoj2jEo8HgNGpotTjN1qYIzNBsv860nw0LuFX+Di8l4dtNYj2kvKwg== 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-SenderADCheck; bh=t/9Z30yQrnVeDNYbOYgNSbsnu664JdEj5BAT/JnizSg=; b=hC2yRKQJJivU4vTsYUSI6HE7lPs5dqosAyDlV4q1ZiqYk03cvkcWZS3wICpozplTFu+/Jt/Vs0fnCwjh2Bj00sbM0tiiA36ZARcVgCysEYLtBptd8rrvDasgVf6hvcjJIROcPB+7gHDump4hNcgyt9eEp5CeKDk8FdQfrZgiswVJ3onnyJEU2ppD7CU3+X63rlToxdt1cXywrag+lSJhy4UT7URVNDmrCTLm5qLZau9akv2JCNk14zSJ/ftL/3bkIVVpeShkkRRIi1Pj2+xzv7EV6NHKUWi0jf3OOfViFcwfq7KwzCBQccDoRElfFbBIK0ti9KIEITgr9lECNKpQ8w== 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=t/9Z30yQrnVeDNYbOYgNSbsnu664JdEj5BAT/JnizSg=; b=ykOvZIoDqxAN0bc6pw6EJ7FpcpVMLTGSnP5PVosztTjah2on64MPUXb7nlDcKOGYFf+d4R3cJ7e7Mmmrp0Hrq/9L/ysGKq8JNe+impg6r7QP23O5qTGgQkDwm+NljRrqRsvaV4OBRL2W84dEBVmLs/auoPs+o0lgACZ8uwSCibg= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; 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; From: Wei Chen To: , , , , CC: Subject: [XEN RFC PATCH 32/40] xen/x86: make acpi_scan_nodes to be neutral Date: Wed, 11 Aug 2021 18:24:15 +0800 Message-ID: <20210811102423.28908-33-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210811102423.28908-1-wei.chen@arm.com> References: <20210811102423.28908-1-wei.chen@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6cf62339-b5ee-4533-7fc2-08d95cb26f97 X-MS-TrafficTypeDiagnostic: AM9PR08MB6916:|PAXPR08MB6640: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:6790;OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: q86xrus2iSBNVRhC6K/hxmWwNhjT9LWm6Z5G/1ALFPuM+PmOyCjgLDSv05i33DZQhY8yV+kxmxWQOdga/MEI+Ncz1uA+7WDX/uKUASvZiP8DuWAVe+TKHbnpk1Tj09oKNYT17rn/5c4TVMM4Zgj/XHq1TBLp1FeJVHC33UmtqD0xdM7e2lAdXMTs4CBRK2PvfjGFFbVY9jnTEWxhICv9BBNZFBWc+h/TS/Ztm4kQi9HbItAkwdqPbUj1nX3G1CGkWlcnGRDIrmvY659SYWl9rTQUBJvaIV1fTeTmfPu3XCbVODQIWFniANIQTcxdrobL9ROUAGtkfFwnZdCBbS3zEV4kccr/E+ldWegF3etIdt6CXtS5S7IwVgn7uStCnyRtzttwX0j8vo8XNtsbVu9ABnP3pavwXFkTB/HjlTPeX3VZVzzdWt8O/slIz0W0+2GTb0zH4B0c7buWFgai1Ow4c+YqbHNFKJslR12DPjjoQ4gdRhnEaJxZOJQEb8OCVMmh0yH9Cur6Z6hwnJQZGoDbw7nTk8dsN4zVFieZSBKfm9UNgnQAVeVoFvBeor+Th1rsKSJTHqzztX9RMJuUtHi3X1HA54cHFZ0cUwEnTGXFPLh5728nUejWohXtQcBtLflXhcWxnghbgc+zCcIEiZwJwMsHF7BIcYxCzdZixizhPIX9JshrwzMmnuWc6DOs1rU92TEm1HO0zzwROKpyHTT4Vn5luAv/Qjk1EWQjKrC14796HJhgQUtTq1wbEP86zl5kTy6K4Ba5NPgbTlh4uu+K/SE6TrN01vy4MbyvDtVCdAI= 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:(4636009)(376002)(136003)(396003)(39860400002)(346002)(36840700001)(46966006)(81166007)(1076003)(82740400003)(110136005)(426003)(47076005)(70206006)(7696005)(70586007)(36860700001)(5660300002)(2616005)(82310400003)(44832011)(356005)(4326008)(86362001)(316002)(336012)(36756003)(83380400001)(26005)(186003)(2906002)(8936002)(34070700002)(6666004)(8676002)(478600001)(2101003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR08MB6916 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT008.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 7ab51a75-7a37-4b3d-416b-08d95cb26a3f X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OEs5lv2+kLKykGB7qbXSZHyJcuw9vJ04A7CijnXMzwJThXPso4Y3cTp4VIslijG8Tz6O4QABAXg12aQ/ln/IHeeS+ddqgHShhLBhClbatV7l7DygXX2S0TQr7subuSAJePGYLtkN30h+3g+fQEoCz/zz1LJfyp8Yy5ZuzxhCwtvzGTYQuwRDv7/XCZf6yxBtVDuLcgDjXWIG8+nJ0yVcw4pSkVPkpSGqIZ9ClpRFQEJXLEW4/i9KuMaAsNFq2GJOFc0NE4OuelYs+pqJuEDhGPs686nnOXnXVPBE410Epo4xZVugc199Z0vn58vIb2uD19sZA6syjKRYW64Btu6U066//ppuLgb/70mY1tKMOmQ6VvlOxdRpyG7IdiS9tZqJmZuqjtag6cVOzlB2xUp5FUeZmBBREoR7UiZrdA7wW+u2ReBaNxyNuql3c1NoynquGF0NrE4DTNv1UT8cwBtFKxOOTiv93R9gT3CdHS/cyhcjlQXTOjJP7t2Vg0WNyreu8v4Rn4KaM5kyGKfQ9hQUg2OJ8xYMQvbj+L5BsFvplQGsbPJtRLgGDt0GBRFsyXmcrXudN8dECE7hCq97r4FQAk9nCrl5mhULW8gBDQJdeTvl3MgE79fg0YyqOb+uZiXv+MUAo6FXcg4N3Z/3ybd+yWFUkTUlkACT8TZsjo6FkFZizBNq34Ehn751bx//I6ndv4fjIoh7WYNfYxeoa96wWuIfXp0q+Mz7GKIrMcN1ikw= 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:(4636009)(46966006)(36840700001)(8936002)(426003)(70586007)(8676002)(82310400003)(6666004)(70206006)(26005)(508600001)(186003)(47076005)(1076003)(316002)(44832011)(4326008)(2616005)(83380400001)(36860700001)(36756003)(86362001)(2906002)(81166007)(7696005)(5660300002)(110136005)(336012)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2021 10:26:09.4570 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6cf62339-b5ee-4533-7fc2-08d95cb26f97 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: VE1EUR03FT008.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB6640 X-ZohoMail-DKIM: pass (identity @armh.onmicrosoft.com) X-ZM-MESSAGEID: 1628677930447100001 Content-Type: text/plain; charset="utf-8" The code in acpi_scan_nodes can be reused for device tree based NUMA. So we rename acpi_scan_nodes to numa_scan_nodes for a neutral function name. As acpi_numa variable is available in ACPU based NUMA system only, we use CONFIG_ACPI_NUMA to protect it. Signed-off-by: Wei Chen --- xen/arch/x86/srat.c | 4 +++- xen/common/numa.c | 2 +- xen/include/asm-x86/acpi.h | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/xen/arch/x86/srat.c b/xen/arch/x86/srat.c index dcebc7adec..3d4d90a622 100644 --- a/xen/arch/x86/srat.c +++ b/xen/arch/x86/srat.c @@ -362,7 +362,7 @@ void __init srat_parse_regions(u64 addr) } =20 /* Use the information discovered above to actually set up the nodes. */ -int __init acpi_scan_nodes(u64 start, u64 end) +int __init numa_scan_nodes(u64 start, u64 end) { int i; nodemask_t all_nodes_parsed; @@ -371,8 +371,10 @@ int __init acpi_scan_nodes(u64 start, u64 end) for (i =3D 0; i < MAX_NUMNODES; i++) cutoff_node(i, start, end); =20 +#ifdef CONFIG_ACPI_NUMA if (acpi_numa <=3D 0) return -1; +#endif =20 if (!nodes_cover_memory()) { bad_srat(); diff --git a/xen/common/numa.c b/xen/common/numa.c index 74960885a6..4152bbe83b 100644 --- a/xen/common/numa.c +++ b/xen/common/numa.c @@ -330,7 +330,7 @@ void __init numa_initmem_init(unsigned long start_pfn, = unsigned long end_pfn) #endif =20 #ifdef CONFIG_ACPI_NUMA - if ( !numa_off && !acpi_scan_nodes((u64)start_pfn << PAGE_SHIFT, + if ( !numa_off && !numa_scan_nodes((u64)start_pfn << PAGE_SHIFT, (u64)end_pfn << PAGE_SHIFT) ) return; #endif diff --git a/xen/include/asm-x86/acpi.h b/xen/include/asm-x86/acpi.h index d347500a3c..33b71dfb3b 100644 --- a/xen/include/asm-x86/acpi.h +++ b/xen/include/asm-x86/acpi.h @@ -102,7 +102,7 @@ extern unsigned long acpi_wakeup_address; #define ARCH_HAS_POWER_INIT 1 =20 extern s8 acpi_numa; -extern int acpi_scan_nodes(u64 start, u64 end); +extern int numa_scan_nodes(u64 start, u64 end); =20 extern struct acpi_sleep_info acpi_sinfo; #define acpi_video_flags bootsym(video_flags) --=20 2.25.1 From nobody Sat May 4 03:49:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=2; a=rsa-sha256; t=1628677895; cv=pass; d=zohomail.com; s=zohoarc; b=Cw3Q5uBH72XuxuevQtyzVzoPkoBcf6nZeKnVx68T2yaWW7EdYwtmsRJo1WyrBqRcV7baKtTAjgIArWP+hXio/Ytq7BfDxy+z44XNh2zZ9YTrnFzgDUW06dSeOOJr2ZffX+YnfFPeYBJkNX4q+2NKDgpeUsENUGZNTdjDmMrSGDI= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628677895; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=EmBrAhy7WLonyjAWWI83mwWLyuxAd98SyWeYC4/1lnY=; b=Yo9Pv4VFpH0X0hv0K+pBVX88EXtNjr0gwn8bqY/HzqXxMw2olpxY9RcUOJWjejtg0T9NhOm6YBfFum7huXhbNlWZ2tABT1q2pl91b29bm/Fk5TwnANHW3C5TEpvREdrCIn5lPYh+5BomctfHn7he0OtiX+jlSNDjD6fWcqS5e6g= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1628677895556800.1313578624281; Wed, 11 Aug 2021 03:31:35 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.165714.302898 (Exim 4.92) (envelope-from ) id 1mDlW4-0005Ta-Dw; Wed, 11 Aug 2021 10:31:20 +0000 Received: by outflank-mailman (output) from mailman id 165714.302898; Wed, 11 Aug 2021 10:31: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 1mDlW3-0005Rv-T8; Wed, 11 Aug 2021 10:31:19 +0000 Received: by outflank-mailman (input) for mailman id 165714; Wed, 11 Aug 2021 10:31:18 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlTr-0000BQ-Jj for xen-devel@lists.xenproject.org; Wed, 11 Aug 2021 10:29:03 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (unknown [40.107.20.77]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id f69d0d80-9815-4f0f-b344-10710924f086; Wed, 11 Aug 2021 10:26:13 +0000 (UTC) Received: from PR0P264CA0151.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1b::19) by DBBPR08MB4508.eurprd08.prod.outlook.com (2603:10a6:10:c6::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.17; Wed, 11 Aug 2021 10:26:10 +0000 Received: from VE1EUR03FT040.eop-EUR03.prod.protection.outlook.com (2603:10a6:100:1b:cafe::16) by PR0P264CA0151.outlook.office365.com (2603:10a6:100:1b::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:26:10 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT040.mail.protection.outlook.com (10.152.18.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:26:10 +0000 Received: ("Tessian outbound 79bfeeb089c1:v101"); Wed, 11 Aug 2021 10:26:09 +0000 Received: from de6e02881e24.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 84F16701-ED76-4209-BDE7-67B91679EADA.1; Wed, 11 Aug 2021 10:26:03 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id de6e02881e24.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 11 Aug 2021 10:26:03 +0000 Received: from DB6PR0201CA0011.eurprd02.prod.outlook.com (2603:10a6:4:3f::21) by DB9PR08MB6796.eurprd08.prod.outlook.com (2603:10a6:10:2ad::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.21; Wed, 11 Aug 2021 10:26:01 +0000 Received: from DB5EUR03FT036.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:3f:cafe::48) by DB6PR0201CA0011.outlook.office365.com (2603:10a6:4:3f::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.15 via Frontend Transport; Wed, 11 Aug 2021 10:26:01 +0000 Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT036.mail.protection.outlook.com (10.152.20.185) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:26:01 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) 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.2308.14; Wed, 11 Aug 2021 10:25:52 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Wed, 11 Aug 2021 10:25:50 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: f69d0d80-9815-4f0f-b344-10710924f086 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=EmBrAhy7WLonyjAWWI83mwWLyuxAd98SyWeYC4/1lnY=; b=0SuPGx4kP3ePgyyE3YPlv04R6Rfsw+iRcDwt780/laCKSANY3t+7T63Me1Mg7Sloi2simzZKfecILY7v5xVQ3Ti0Fq4I3zHMXEsKH3I3MdKAk83q2e4C7FZv/RUnHvQxcduPNDRFOvFUYasWCAid0/g2I5D4uSwDz26FIWvsIf0= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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; X-CheckRecipientChecked: true X-CR-MTA-CID: 77d86dbcfb6f5e2c X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=np8irdwm+BAGgGfXMO42iTRJdK0LJMMvkJCAghFCAkQOI2VBW8rvcVZVfdKQN+62VAoIVW8GeDz55bSxvTZ95j9wxFMOjGOeKLqTMDFwnjFXc/0fkEmD3G6ojKzlHM7VQF33G8ZvG33K3dJQsXPLDjOSArQ5m5DmTOEhiALiDOdZ3Tcu7Th6j5V2MJsAk7USMwQSWnwk8F6O8GZUGiwxDwfSlS+r08xSwDGRjx2nYImbeFCSxtWXsplx1DzHz8woeJQlGidrK0+NqgV/sOAcPdskX4LIMsOsYkUxHQmEQWVLgDS1KALbsnaBfhTotaaxfFAWtcYsGx+tHLw8R8Fyqg== 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-SenderADCheck; bh=EmBrAhy7WLonyjAWWI83mwWLyuxAd98SyWeYC4/1lnY=; b=mxkt+GiwNUH2ldxebRUoWZWnTfGoh0iKyP+JjOAixBA4KApmrXucGbrOXkhc2nadjDz2NVHM84yJMiizMjX7y/QBFM94FUouHU1/mPRRnOWcn6lSlUUXV1Wbuwf839uyex6AeTWhUEUnctI1Gylz27efxG61uLy8DFoxE1dR31KuZ2CGjM28wEL+VUAlOPmIDDWMcNEgrpghE0SG66b+TactjejK+6aK+qAYDtjAMSc8enpETH4qXVIAGs3f3b18e0acBZ5Ss02Z4y75mzJ1ZgdRaxF4eeKhkettD0OjtECDBkh4ubQ5EXm/RXAwfePryLlCqkh5YJwiDEyB1AVErw== 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=EmBrAhy7WLonyjAWWI83mwWLyuxAd98SyWeYC4/1lnY=; b=0SuPGx4kP3ePgyyE3YPlv04R6Rfsw+iRcDwt780/laCKSANY3t+7T63Me1Mg7Sloi2simzZKfecILY7v5xVQ3Ti0Fq4I3zHMXEsKH3I3MdKAk83q2e4C7FZv/RUnHvQxcduPNDRFOvFUYasWCAid0/g2I5D4uSwDz26FIWvsIf0= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; 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; From: Wei Chen To: , , , , CC: Subject: [XEN RFC PATCH 33/40] xen: export bad_srat and srat_disabled to extern Date: Wed, 11 Aug 2021 18:24:16 +0800 Message-ID: <20210811102423.28908-34-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210811102423.28908-1-wei.chen@arm.com> References: <20210811102423.28908-1-wei.chen@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 120cf18a-1854-477b-b679-08d95cb27018 X-MS-TrafficTypeDiagnostic: DB9PR08MB6796:|DBBPR08MB4508: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:530;OLM:530; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 3HMucFgcMqqWdO0mD2yewyB4A+fBXURZEqBt47uItVUY1ZqZx3mZkOYJse8fe9lL8Ya6RPKnBmHQtvhI5ZvW1C5nz7zwOzcjKc532VfXpYmTWqR3NaHtbQKqAtEbTUGNnkA/q4HsmsNSVBLjel//gdbgAP51s3WZjP9uOt/+WgKPgTALsqsEz3utnswqUonIjvEx0BHYJmgcjVaBX7BDGpFOLqzWnLM7xtQ6SzMP4JDagW2xGAgW2kmDXhDhq5jhl21Xs4OE43BlgXvKYfJ88E7HnIB5WpovOpB23Q5Jxg1ajgjX1AW50FaUgJjzhSCQCYXVjxFZpJRVRCH2/DVBCKXXziZGJKsTHfurfNhkPmeDf7Oea0cSsfHs6GwmGJ6tn0VhmlJEnu/UnoUBjldHS8uO4BZZ47Z576Bzyodztz4Z2K55RqYpRuF3CqrNTiD2CXQqtkW4fzHxpKp16CucJ1+O60Ex6fJaEKO0iizx0E14UuB8Yk38X2rn4FAxfht+rCkZodVGh6cyHbJIKuJPt2+WwERavIb9R2TEKoFemUAnKs1mtBtQxM6CjTX9eZORw/XKmys9ltt4FZrkphcnT6Dvts8dqBZ9++tR93Y2L8LF87vjfPj3WIdmCS2gh79oS3qFkj4eRYLWcyQ8GFJ/I+5sjLm20WQ5fAhVx3EMeOoZus7aUzwK3NJarZ36d31GD2SwJaWXonpStNUjLZj+ePnlwQ/puC87/XDpobS2QDQ8oZtT4t3R73+5rfKfQmsC/2vbbcu4py8MYpR8MFbkvsvvXY1O4Tu3kF8fl0BqSmI= 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:(4636009)(346002)(136003)(39860400002)(396003)(376002)(46966006)(36840700001)(2906002)(186003)(70206006)(8676002)(81166007)(4326008)(336012)(83380400001)(70586007)(82740400003)(8936002)(478600001)(36756003)(47076005)(110136005)(82310400003)(356005)(7696005)(26005)(1076003)(36860700001)(2616005)(316002)(34070700002)(5660300002)(6666004)(86362001)(44832011)(426003)(36900700001)(2101003);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB6796 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT040.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 0538a474-f12f-418d-7303-08d95cb26ad0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qiTE+s8meOUL4M8YUBDqWb6KYBlwNCj8rGuGRu2Fd708qzNQgC45iXFFLYiyVj0r/Eivzk8t8BodM8LdVcouih9J5iSsqJph22MKs6E9NWP+HAw+4ed08SmGlyjvmncB2WbD4or93aErRb0VbGPnKTNNWYBsiMJGJKMYF/bwQjuzYGqZ8sY0RBRL26v0nW/7Q7n2vPgx8Q5xH+bESOUd72r3ULE8K+iI6tc37aPniwbXuibQHs1xOj22LxwaHYyUEPa+P5dnBNCDkvLNBw5AzMXHgPYKHND4Z5fcXmxd4E8M5V9wJ+EWdExIOKXc4TUx26YuI0P2OPIbG07jlV3cgEPI8FW/46DGHNf6mD9pobp808ZrhWJvitvoz+BRQz17NHwAbSvxuOhWswW4E/GpN2UaWWHCNGS+cIcY6psgdhRhD6boYNvAf7t1pHEbuAxhlVCSkO7zJ52Uw63qOAgVcu9F/5yZbpu3vQnDSPNWpGvaW6tuZqmvZ7PE5qW5WnKwbE/oPsYlW+phd7a1D85hSGvMIPKo0R/HbnKAGaxng3Zv2jivLJh+ortD/nGFzSUjA3qjoAqbmj9Xm7gLEGdLvttOQcfy4+IYO/tF1QWIoGmHG1xr9wDvXbRbFDGoEhuvW6I6pYTYg0fG3MjoHYHFoZbXgLTce5T0KXHCu/EWiQHbv1bKNSvWM3pBzgmHukxtrmcFrUt87OHf6cVYzCJCfV2jGgqOJ65UZHPZ+X8v+NA= 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:(4636009)(376002)(346002)(39860400002)(136003)(396003)(36840700001)(46966006)(26005)(70586007)(1076003)(83380400001)(186003)(70206006)(110136005)(4326008)(5660300002)(47076005)(7696005)(36860700001)(316002)(44832011)(2906002)(82740400003)(81166007)(2616005)(426003)(336012)(8936002)(8676002)(478600001)(36756003)(6666004)(82310400003)(86362001)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2021 10:26:10.3088 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 120cf18a-1854-477b-b679-08d95cb27018 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: VE1EUR03FT040.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB4508 X-ZohoMail-DKIM: pass (identity @armh.onmicrosoft.com) X-ZM-MESSAGEID: 1628677896945100001 Content-Type: text/plain; charset="utf-8" These two functions are architecture implementation. But common code out of arch will invoke them, so we export them to extern. Signed-off-by: Wei Chen --- xen/arch/arm/numa_device_tree.c | 4 ++-- xen/arch/x86/srat.c | 2 +- xen/include/asm-x86/numa.h | 1 - xen/include/xen/numa.h | 2 ++ 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/xen/arch/arm/numa_device_tree.c b/xen/arch/arm/numa_device_tre= e.c index f74b7f6427..f7f2eeebc3 100644 --- a/xen/arch/arm/numa_device_tree.c +++ b/xen/arch/arm/numa_device_tree.c @@ -26,12 +26,12 @@ =20 s8 device_tree_numa =3D 0; =20 -static int srat_disabled(void) +int srat_disabled(void) { return numa_off || device_tree_numa < 0; } =20 -static __init void bad_srat(void) +__init void bad_srat(void) { printk(KERN_ERR "DT: NUMA information is not used.\n"); device_tree_numa =3D -1; diff --git a/xen/arch/x86/srat.c b/xen/arch/x86/srat.c index 3d4d90a622..c979939fdd 100644 --- a/xen/arch/x86/srat.c +++ b/xen/arch/x86/srat.c @@ -97,7 +97,7 @@ nodeid_t setup_node(unsigned pxm) return node; } =20 -static __init void bad_srat(void) +__init void bad_srat(void) { int i; printk(KERN_ERR "SRAT: SRAT not used.\n"); diff --git a/xen/include/asm-x86/numa.h b/xen/include/asm-x86/numa.h index e0253c20b7..e63869135c 100644 --- a/xen/include/asm-x86/numa.h +++ b/xen/include/asm-x86/numa.h @@ -13,7 +13,6 @@ extern nodeid_t pxm_to_node(unsigned int pxm); =20 #define ZONE_ALIGN (1UL << (MAX_ORDER+PAGE_SHIFT)) =20 -extern int srat_disabled(void); extern nodeid_t setup_node(unsigned int pxm); extern void srat_detect_node(int cpu); =20 diff --git a/xen/include/xen/numa.h b/xen/include/xen/numa.h index 094ab904c9..490381bd13 100644 --- a/xen/include/xen/numa.h +++ b/xen/include/xen/numa.h @@ -75,6 +75,8 @@ extern int compute_hash_shift(struct node *nodes, int num= nodes, extern int conflicting_memblks(u64 start, u64 end); extern void cutoff_node(int i, u64 start, u64 end); extern int valid_numa_range(u64 start, u64 end, nodeid_t node); +extern int srat_disabled(void); +extern void bad_srat(void); =20 extern void numa_init_array(void); extern void numa_initmem_init(unsigned long start_pfn, unsigned long end_p= fn); --=20 2.25.1 From nobody Sat May 4 03:49:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=2; a=rsa-sha256; t=1628677882; cv=pass; d=zohomail.com; s=zohoarc; b=oEo6a7JovWRr6l9EpHKnkiL0YptTvQj3Xy1laAoPrJYm6UgheCzKXzxB5RVGUkOuZll+9kdXLjWCbgzEpLTFovbIWJAtB6t24YpqCKsM4slwhbK13CLQ1D1bXyUCW1EWv6HbQzcvNvPn0l1n+33NOf7RtgsYrRqyFJzukoYe7Gg= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628677882; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=6/ECE2NT3/W7SlQs3jvLDkVaHn4CW/xBcD06c9TPz4k=; b=jiCcct48UHXMq98+TtQDiMr8Fh9Ur/1ZpOXcBDSLJOL73rqNqRk0x0/iaqYNXna0loAXiCU3ePpCJCFj3AG9WWeMm3Fg1fEcObx0AgsCA79CHkwTRBbmy7LQpaJMxZqS/UBFOUNkrOLFAcb7hT0L5pEGClJ7D+7UFbrYYTq7U10= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 16286778820939.510833893420227; Wed, 11 Aug 2021 03:31:22 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.165699.302819 (Exim 4.92) (envelope-from ) id 1mDlVr-0002fx-6U; Wed, 11 Aug 2021 10:31:07 +0000 Received: by outflank-mailman (output) from mailman id 165699.302819; Wed, 11 Aug 2021 10:31:07 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlVr-0002af-16; Wed, 11 Aug 2021 10:31:07 +0000 Received: by outflank-mailman (input) for mailman id 165699; Wed, 11 Aug 2021 10:31:04 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlRo-0002Qj-HN for xen-devel@lists.xenproject.org; Wed, 11 Aug 2021 10:26:56 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (unknown [40.107.22.62]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 8e08efd0-fa8e-11eb-a052-12813bfff9fa; Wed, 11 Aug 2021 10:26:14 +0000 (UTC) Received: from AM6PR10CA0007.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:209:89::20) by HE1PR08MB2841.eurprd08.prod.outlook.com (2603:10a6:7:35::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.21; Wed, 11 Aug 2021 10:26:11 +0000 Received: from AM5EUR03FT062.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:89:cafe::14) by AM6PR10CA0007.outlook.office365.com (2603:10a6:209:89::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.15 via Frontend Transport; Wed, 11 Aug 2021 10:26:11 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT062.mail.protection.outlook.com (10.152.17.120) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.16 via Frontend Transport; Wed, 11 Aug 2021 10:26:10 +0000 Received: ("Tessian outbound 79bfeeb089c1:v101"); Wed, 11 Aug 2021 10:26:10 +0000 Received: from 82a657d6e15e.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 9E282BA0-67A4-406D-86BF-90752968C6BB.1; Wed, 11 Aug 2021 10:26:04 +0000 Received: from EUR01-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 82a657d6e15e.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 11 Aug 2021 10:26:04 +0000 Received: from DB6PR0201CA0024.eurprd02.prod.outlook.com (2603:10a6:4:3f::34) by DB7PR08MB3017.eurprd08.prod.outlook.com (2603:10a6:5:1f::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.13; Wed, 11 Aug 2021 10:26:02 +0000 Received: from DB5EUR03FT036.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:3f:cafe::13) by DB6PR0201CA0024.outlook.office365.com (2603:10a6:4:3f::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.13 via Frontend Transport; Wed, 11 Aug 2021 10:26:02 +0000 Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT036.mail.protection.outlook.com (10.152.20.185) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:26:01 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) 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.2308.14; Wed, 11 Aug 2021 10:25:54 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Wed, 11 Aug 2021 10:25:52 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 8e08efd0-fa8e-11eb-a052-12813bfff9fa 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=6/ECE2NT3/W7SlQs3jvLDkVaHn4CW/xBcD06c9TPz4k=; b=UKPu+5QRDqqqeNBt76a0Fb94OLpU2gpgQiXW0INoRHhQBeWX5pSYHlSdPKmJgLTw4Vj/p6E/s/5J2cPOOaJRlN19VInwm+bMrEHz0oiGDuIt14Sl4z7kzotBYQ1r+2w/f17VzrLInwMwuCLDNHT3iZyX3EL71VFJ4gnV7OZwAlE= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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; X-CheckRecipientChecked: true X-CR-MTA-CID: 4126685f348a2717 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=T7EO4JwNCvMHm3Zu6GYgi/r02kzZf7NpIIzwaVzZNmxepTVDDngCdWNStgxLKq3INWGALdZmg5LKTsIgJzoXUtYYOO/c7OGl0EtwGJRN3rnzq43P4VuDlNUcQ/7AyIvfRpZhPNYDBZYWssvkfT5sBd/IKawyYADFm7lUHKid1fTgjbZPQ8J6uJ9qALaVCFFFu3fEtPH1IEtGy9IHwjMMWvj5L20fODJwePj/QmoejPalI/niU6hi9YQJQiYvfbYcZUN8MiMhjFDiSI6vr4gcyHe1T1RRPH1SEz0HROeJsP46LlKno98Mc1fzlxoxp1p8EWytTfdh4vMVJzIED5cVdg== 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-SenderADCheck; bh=6/ECE2NT3/W7SlQs3jvLDkVaHn4CW/xBcD06c9TPz4k=; b=WLYW65VYpF2lLbEBSK6+5a4XcQqLWxC+Ny64GhjQfAioWBPntVh8SYRin/0CEF9VDF9zw/raTxlwO0/oxFf+DyDj4/V8G2ob3d7fHZGWSrfmPpMbTPwvNw0ne8wb46DzvH8fp4CwYDwqrQpndYIuIiGLuZ1IJNXSWiac6W/eLjvIXs+r749wPXYK5+mfiRj4rOYne4fsL5lB3hkRjO+xymcUsN+jHgDx1xP6FwVkbx0Ul5I/Dd4s25mNAh0gqq35R3vq+71CbEgyr5XhqzKw/jEEU+vqz+ls/oSfejbg9cNKiujRvIl22lU1H1pQP06186ocln2VW+iwTYqkLA1ggg== 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=6/ECE2NT3/W7SlQs3jvLDkVaHn4CW/xBcD06c9TPz4k=; b=UKPu+5QRDqqqeNBt76a0Fb94OLpU2gpgQiXW0INoRHhQBeWX5pSYHlSdPKmJgLTw4Vj/p6E/s/5J2cPOOaJRlN19VInwm+bMrEHz0oiGDuIt14Sl4z7kzotBYQ1r+2w/f17VzrLInwMwuCLDNHT3iZyX3EL71VFJ4gnV7OZwAlE= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; 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; From: Wei Chen To: , , , , CC: Subject: [XEN RFC PATCH 34/40] xen: move numa_scan_nodes from x86 to common Date: Wed, 11 Aug 2021 18:24:17 +0800 Message-ID: <20210811102423.28908-35-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210811102423.28908-1-wei.chen@arm.com> References: <20210811102423.28908-1-wei.chen@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ca887c00-64f1-44db-20fb-08d95cb2703e X-MS-TrafficTypeDiagnostic: DB7PR08MB3017:|HE1PR08MB2841: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:1360;OLM:1360; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: i9gsGn94WEJQSwxMutINQSdy20MM2TjbDHpdMk6ZmJ3mBIaYdk99y8vEO5iU0Yufhz4lTsDo3NXtj+lhFTdkku6SVqI+DLY33RnPoEPCrJAj2AGrvEvWjIj/F/uYnFvdTMGJIdPucDdq2Pk4G1ZalYrDvXB0pw1BV7n1FmKpU7x/OTbmtoCSKkaCIGGPpBR+YRx0JkwRWA5hn4UbH3EyY23WORLuJO9w56TBFwV7p9FWgkX+pGTrLCdrlmIlvBxmQeSuoAUyB68y1ZaTCoZMxyukbkAl+h4RpPxrWWG2WX1lI6pz5uezbGQzTiGur7D8JLCvkHRnyWiSWtkQws536BbqvmWE5Vj8hg/GPZ9zsdl9T8avR48d+X1o/M9PxRkOLXWrA/aQwtKwdNz/S+XjjYBsFD4YYOi1X87+trMHPsR28LjywF6VqI+5mz251psBJ/ZhP0/138TbwUkCDKzmh6R/JE4qNGrcDfCQLykYAmhCsDi4w5R1dwy8ISI/3mfT68t53MvyU9z157Ki4WKCk8dG4xbU2RmUWvToJzieIan4Ps1ou2L6wcx3C1AtUShlp2LkAhyeGzKAVCln6LOe9x+3VAw9ov5V8yoVcYTyzseiJewlxmr8sr/ZlMRXyXuSOjp9uZPkUO7/sbWAcOVJNeqEOgvoiyWwV4FK6mgOJLhveXAXtnzm25MP+jw0ysBHSPGgJVxKro+031KNa0iNOsaPymtO1K3kg9ngCZzM5otg4FBMt8GK5QRJg29/VPXYiRV6Wse3aEezwwMv/KeMf6DsKCZi1GoCmpEVI9gsszg= 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:(4636009)(36840700001)(46966006)(83380400001)(5660300002)(508600001)(2616005)(44832011)(7696005)(36756003)(1076003)(336012)(34070700002)(356005)(81166007)(82310400003)(70586007)(70206006)(6666004)(8936002)(86362001)(186003)(8676002)(36860700001)(47076005)(2906002)(110136005)(316002)(4326008)(26005)(426003)(2101003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB3017 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT062.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 9f0b1209-d713-4618-192a-08d95cb26b13 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kns4oty07p6maIH0Ss47TfwTWSGoVzrjkHBOsGEGTq0UZbX1+vGeauQBsO893+CNNQI6EwvjUoXpCkPSrh4asEhFlSbSnaMMUhx/thn9rbPqApmgLSZDuPfhxArmuPXnSU/c1kinq0j0Kbjq4Adei0qqC8crLZsMuUmFEhDHC2k9jhgIm8pgWW3Eg+2tATI8KvbToJKfWV47Fy1sr8tFONiyeuLbpVi/7BT3vsqRbKLBYFBPK7v413eHBj8zbzD4SJQHi3znDNmA6DyZmqZjSCi93u8KAXwKeAaR6tlg6geL90UbVt9gDpd5Zp2WfuYkRbDEN4eBYrao0whLZh6IZuwc9JB8OgbJaid5HismfhiihU0y27CCBx1yI1ZoPEZLn/QP8sJHg4synSToOKxBd2RyzABaLFJb8/DBwGnNOMrNSGSEkNXl8QTg0bXiTzYC1LaKJSLImQzH1VmvE/rVcGvEP6xy9+w+4c1FLs15D31w4omFYwV4eBlGYzfJx5xJwGGL8V1GHfcYevVQdNmlhJOIbBLpcniKqU7Xf4IAy2QHO0RRIjivL+rULwVcS7jVWOEeFJX3vlGJ1ePDkjN35UdTWwybjYJHCC81UEzQ2PLUjVR8qxwmAoCsv7rMT/cLIFU8CbOhpU0h8JT17GEX12ml05pLz1mUTSDaTmpRYZMBOkkARuIif5+/Rg9F3FyHj39EkEXtcMWXEPl9I1nS5wgdIoJny2u4t9qQJKU4dHg= 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:(4636009)(346002)(39850400004)(376002)(396003)(136003)(46966006)(36840700001)(70586007)(82740400003)(82310400003)(36860700001)(478600001)(26005)(36756003)(7696005)(83380400001)(70206006)(6666004)(336012)(86362001)(1076003)(110136005)(2616005)(5660300002)(4326008)(44832011)(316002)(186003)(47076005)(426003)(8936002)(2906002)(8676002)(81166007)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2021 10:26:10.6130 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ca887c00-64f1-44db-20fb-08d95cb2703e 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: AM5EUR03FT062.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR08MB2841 X-ZohoMail-DKIM: pass (identity @armh.onmicrosoft.com) X-ZM-MESSAGEID: 1628677883564100005 Content-Type: text/plain; charset="utf-8" After the previous patches preparations, numa_scan_nodes can be used by Arm and x86. So we move this function from x86 to common. As node_cover_memory will not be used cross files, we restore its static attribute in this patch. Signed-off-by: Wei Chen --- xen/arch/x86/srat.c | 52 ------------------------------------ xen/common/numa.c | 54 +++++++++++++++++++++++++++++++++++++- xen/include/asm-x86/acpi.h | 3 --- xen/include/xen/numa.h | 3 ++- 4 files changed, 55 insertions(+), 57 deletions(-) diff --git a/xen/arch/x86/srat.c b/xen/arch/x86/srat.c index c979939fdd..c9f019c307 100644 --- a/xen/arch/x86/srat.c +++ b/xen/arch/x86/srat.c @@ -361,58 +361,6 @@ void __init srat_parse_regions(u64 addr) pfn_pdx_hole_setup(mask >> PAGE_SHIFT); } =20 -/* Use the information discovered above to actually set up the nodes. */ -int __init numa_scan_nodes(u64 start, u64 end) -{ - int i; - nodemask_t all_nodes_parsed; - - /* First clean up the node list */ - for (i =3D 0; i < MAX_NUMNODES; i++) - cutoff_node(i, start, end); - -#ifdef CONFIG_ACPI_NUMA - if (acpi_numa <=3D 0) - return -1; -#endif - - if (!nodes_cover_memory()) { - bad_srat(); - return -1; - } - - memnode_shift =3D compute_hash_shift(node_memblk_range, num_node_memblks, - memblk_nodeid); - - if (memnode_shift < 0) { - printk(KERN_ERR - "SRAT: No NUMA node hash function found. Contact maintainer\n"); - bad_srat(); - return -1; - } - - nodes_or(all_nodes_parsed, memory_nodes_parsed, processor_nodes_parsed); - - /* Finally register nodes */ - for_each_node_mask(i, all_nodes_parsed) - { - u64 size =3D nodes[i].end - nodes[i].start; - if ( size =3D=3D 0 ) - printk(KERN_WARNING "SRAT: Node %u has no memory. " - "BIOS Bug or mis-configured hardware?\n", i); - - setup_node_bootmem(i, nodes[i].start, nodes[i].end); - } - for (i =3D 0; i < nr_cpu_ids; i++) { - if (cpu_to_node[i] =3D=3D NUMA_NO_NODE) - continue; - if (!nodemask_test(cpu_to_node[i], &processor_nodes_parsed)) - numa_set_node(i, NUMA_NO_NODE); - } - numa_init_array(); - return 0; -} - static unsigned node_to_pxm(nodeid_t n) { unsigned i; diff --git a/xen/common/numa.c b/xen/common/numa.c index 4152bbe83b..8ca13e27d1 100644 --- a/xen/common/numa.c +++ b/xen/common/numa.c @@ -195,7 +195,7 @@ void __init cutoff_node(int i, u64 start, u64 end) =20 /* Sanity check to catch more bad SRATs (they are amazingly common). Make sure the PXMs cover all memory. */ -int __init nodes_cover_memory(void) +static int __init nodes_cover_memory(void) { int i; uint32_t nr_banks =3D arch_meminfo_get_nr_bank(); @@ -271,6 +271,58 @@ void __init numa_init_array(void) } } =20 +/* Use the information discovered above to actually set up the nodes. */ +int __init numa_scan_nodes(u64 start, u64 end) +{ + int i; + nodemask_t all_nodes_parsed; + + /* First clean up the node list */ + for (i =3D 0; i < MAX_NUMNODES; i++) + cutoff_node(i, start, end); + +#ifdef CONFIG_ACPI_NUMA + if (acpi_numa <=3D 0) + return -1; +#endif + + if (!nodes_cover_memory()) { + bad_srat(); + return -1; + } + + memnode_shift =3D compute_hash_shift(node_memblk_range, num_node_memblks, + memblk_nodeid); + + if (memnode_shift < 0) { + printk(KERN_ERR + "SRAT: No NUMA node hash function found. Contact maintainer\n"); + bad_srat(); + return -1; + } + + nodes_or(all_nodes_parsed, memory_nodes_parsed, processor_nodes_parsed); + + /* Finally register nodes */ + for_each_node_mask(i, all_nodes_parsed) + { + u64 size =3D nodes[i].end - nodes[i].start; + if ( size =3D=3D 0 ) + printk(KERN_WARNING "SRAT: Node %u has no memory. " + "BIOS Bug or mis-configured hardware?\n", i); + + setup_node_bootmem(i, nodes[i].start, nodes[i].end); + } + for (i =3D 0; i < nr_cpu_ids; i++) { + if (cpu_to_node[i] =3D=3D NUMA_NO_NODE) + continue; + if (!nodemask_test(cpu_to_node[i], &processor_nodes_parsed)) + numa_set_node(i, NUMA_NO_NODE); + } + numa_init_array(); + return 0; +} + #ifdef CONFIG_NUMA_EMU int numa_fake __initdata =3D 0; =20 diff --git a/xen/include/asm-x86/acpi.h b/xen/include/asm-x86/acpi.h index 33b71dfb3b..2140461ff3 100644 --- a/xen/include/asm-x86/acpi.h +++ b/xen/include/asm-x86/acpi.h @@ -101,9 +101,6 @@ extern unsigned long acpi_wakeup_address; =20 #define ARCH_HAS_POWER_INIT 1 =20 -extern s8 acpi_numa; -extern int numa_scan_nodes(u64 start, u64 end); - extern struct acpi_sleep_info acpi_sinfo; #define acpi_video_flags bootsym(video_flags) struct xenpf_enter_acpi_sleep; diff --git a/xen/include/xen/numa.h b/xen/include/xen/numa.h index 490381bd13..b9b5d1ad88 100644 --- a/xen/include/xen/numa.h +++ b/xen/include/xen/numa.h @@ -81,8 +81,10 @@ extern void bad_srat(void); extern void numa_init_array(void); extern void numa_initmem_init(unsigned long start_pfn, unsigned long end_p= fn); extern void numa_set_node(int cpu, nodeid_t node); +extern int numa_scan_nodes(u64 start, u64 end); extern bool numa_off; extern int numa_fake; +extern s8 acpi_numa; =20 extern void setup_node_bootmem(nodeid_t nodeid, u64 start, u64 end); =20 @@ -94,7 +96,6 @@ static inline void clear_node_cpumask(int cpu) extern uint32_t arch_meminfo_get_nr_bank(void); extern int arch_meminfo_get_ram_bank_range(int bank, unsigned long long *start, unsigned long long *end); -extern int nodes_cover_memory(void); =20 #endif /* CONFIG_NUMA */ =20 --=20 2.25.1 From nobody Sat May 4 03:49:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=2; a=rsa-sha256; t=1628677879; cv=pass; d=zohomail.com; s=zohoarc; b=S7b+EmGmkR7hXQPC1FDpUk2dPr62KP8fIDoGafCMg6rUykAhrd8K9lz7yUYFBL4UzTovfN4A/LKydpo5ENr7nbkbzPM2gMayaLGB7CQqlJM2/bkUmclK1WPceNNcoao8QVSKrFrYR8Jxns1eSJ/nwf7hGuHEQt7dlk96WNSxWTQ= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628677879; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=HsD8ki2XzqZKPjUHzaCAttl8RBCBnbgfYIT2FllWBxQ=; b=bo6Ci1ndPO6cPRuRxV+su0p7wQOKHSrEeRIdX8abkBDHYrPcrqPVevedoH5A8uQxo64jNgljlOkHHcyuwqnfR4ZDHimcaSYC/e7QXP/hi1NnDN3Mysg28KEcw0QyDj8o0PE6iS5UIy7WFo5S2J8rXofPTUMQqvv2IEV6+lpD0Rc= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 162867787926330.76546715557481; Wed, 11 Aug 2021 03:31:19 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.165692.302788 (Exim 4.92) (envelope-from ) id 1mDlVo-0001tH-0Q; Wed, 11 Aug 2021 10:31:04 +0000 Received: by outflank-mailman (output) from mailman id 165692.302788; Wed, 11 Aug 2021 10:31:03 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlVn-0001t3-SV; Wed, 11 Aug 2021 10:31:03 +0000 Received: by outflank-mailman (input) for mailman id 165692; Wed, 11 Aug 2021 10:31:02 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlTh-0000BQ-JR for xen-devel@lists.xenproject.org; Wed, 11 Aug 2021 10:28:53 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (unknown [40.107.21.71]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 6f7f1dd3-f948-4aab-9215-dcab0ed4280c; Wed, 11 Aug 2021 10:26:13 +0000 (UTC) Received: from AM6PR08CA0018.eurprd08.prod.outlook.com (2603:10a6:20b:b2::30) by HE1PR08MB2874.eurprd08.prod.outlook.com (2603:10a6:7:36::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.21; Wed, 11 Aug 2021 10:26:10 +0000 Received: from AM5EUR03FT020.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:b2:cafe::18) by AM6PR08CA0018.outlook.office365.com (2603:10a6:20b:b2::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.15 via Frontend Transport; Wed, 11 Aug 2021 10:26:10 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT020.mail.protection.outlook.com (10.152.16.116) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.14 via Frontend Transport; Wed, 11 Aug 2021 10:26:10 +0000 Received: ("Tessian outbound efa8a7456a86:v101"); Wed, 11 Aug 2021 10:26:10 +0000 Received: from b869a803357d.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id CA0683DC-BB73-42FC-A830-F03369FC18CB.1; Wed, 11 Aug 2021 10:26:03 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id b869a803357d.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 11 Aug 2021 10:26:03 +0000 Received: from DB8P191CA0011.EURP191.PROD.OUTLOOK.COM (2603:10a6:10:130::21) by AM6PR08MB3413.eurprd08.prod.outlook.com (2603:10a6:20b:44::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.21; Wed, 11 Aug 2021 10:26:02 +0000 Received: from DB5EUR03FT031.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:130:cafe::a) by DB8P191CA0011.outlook.office365.com (2603:10a6:10:130::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.13 via Frontend Transport; Wed, 11 Aug 2021 10:26:02 +0000 Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT031.mail.protection.outlook.com (10.152.20.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:26:02 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) 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.2308.14; Wed, 11 Aug 2021 10:25:57 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Wed, 11 Aug 2021 10:25:55 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 6f7f1dd3-f948-4aab-9215-dcab0ed4280c 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=HsD8ki2XzqZKPjUHzaCAttl8RBCBnbgfYIT2FllWBxQ=; b=6xBOv5P7c26RZjZnOVjJh8G/WQGaAOToUfrRfSlKC3NUKluW5NTvs7zO17ZbS0hFnsbrAoztAHYA9VDcrd0+e8P+0LVVYQvJ8XT9MPNTeyqUtzS8ydOsir5bdWGAAu9VhisGxsp0lWrSXhl/rK8HIGjPjZE0DIuhqO+1HAF2fHM= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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; X-CheckRecipientChecked: true X-CR-MTA-CID: a7ec1e1a1eaf4736 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PcCoEePVsYUaGz/l08i3/Nzuh7kWAzVuGIzXwakiD3igD6i2pvFu3iUOFntkFpfGJLISUvgGQ45CMFR749SGmxHTf+Vi0YdyLDpjW+6R8MXaXplLcGwXj7nQaKKRzX9m/EIJR7Z3lha4GTGj1iyVZrCo4UpTDlHdWb2NN5q5J/x9tOMncQKaVyCHYyhT5oejYENE2dNdnia29uqoTXfmSk/V3Qw+W8Gu0e08Qwmr+ORzT+rv2gAweLlx8wGKD5By73k8nXTjOZ5X8ZldhdR4B1O59TDnxaYoM2zNi94vHpFYy57mvZZZJqjwEEIPC7u1dxqnY00e0SIF+zK1/Xs8iQ== 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-SenderADCheck; bh=HsD8ki2XzqZKPjUHzaCAttl8RBCBnbgfYIT2FllWBxQ=; b=Fpxl0fz3UPjutlk9A0pugHhvaOgUH8ZJyJH3e14cyvyk71PoLXQ2AjfMOL8GdXD8pjL1izK2ucbL6SbDgto5lqlfVxoKzJfuPGfqnGvo1I9e9JXVVCSvFXNEOahVQvf0Q+J46z3WV98+QtWl7rsdjXCPtLEwv89qftZIHPi69pzl6Nj9+qtpLAR8M/XG8dtJVYvZp1EssmD5AziBjW98naEELUL1omuGBPCIXljzmqRkkILmMEP+Q1LR75oPi0eHUcrHagvJlKkPfJ9PHlxkTjYifscQ1Wipdg6pwevaOUoE/E5NLzWfX9MfQI/Robc/Z0EsR/uRpAPGHwWFIfO/xw== 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=HsD8ki2XzqZKPjUHzaCAttl8RBCBnbgfYIT2FllWBxQ=; b=6xBOv5P7c26RZjZnOVjJh8G/WQGaAOToUfrRfSlKC3NUKluW5NTvs7zO17ZbS0hFnsbrAoztAHYA9VDcrd0+e8P+0LVVYQvJ8XT9MPNTeyqUtzS8ydOsir5bdWGAAu9VhisGxsp0lWrSXhl/rK8HIGjPjZE0DIuhqO+1HAF2fHM= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; 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; From: Wei Chen To: , , , , CC: Subject: [XEN RFC PATCH 35/40] xen: enable numa_scan_nodes for device tree based NUMA Date: Wed, 11 Aug 2021 18:24:18 +0800 Message-ID: <20210811102423.28908-36-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210811102423.28908-1-wei.chen@arm.com> References: <20210811102423.28908-1-wei.chen@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2a7d66aa-b870-4415-8397-08d95cb26ffb X-MS-TrafficTypeDiagnostic: AM6PR08MB3413:|HE1PR08MB2874: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:4714;OLM:4714; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: gD1Ytvzy07flHX46qnGws9AeMGIvh7TUnA9nQtnpYCAG/vATRwMRQ7NCe3ScMMLZJRR31f1ttRnqDae460uKVI+NdIFyKRk1NkhkdZ1XUQQIthVbnv7LQ1rDF/UdZ0gs7YrmWd1sVQEAI9JckBfKihfzOvFdZmsr+tXnnf77L7GeDzphVdwOo4i1v5h7acke2AJczZCaxiQO26Ywba4Yd8MWCkE7vav4iQeKBXrOjGpoe4hVyPCZw3zrUbOCJd5f5FNBV2EsaebvBSk6DXIGbzgTImVFF8aEV8yNx++6LbkAmB4ZWld9M+bftlr6Y2bM3+mpdri4Pn06qsSgh/1kFyUfs4gFWNIgUeOCuLCdyRgPtjAYJslaZ6VhhF4vFWvA+GfUc8fCUioIMNoDtJYGy8C4i0dl4XNTuyGOZ030lE4aW19K5YLUASUfzaddh1zI5dXjE5wHXv7+GKUR74SPpEwDBXVGiCVqfaO7EWNvVUfNIgXkr9V1IK2saFBTH5MpIke4J4p/BRmARCCEVntoZ82awBdm5nNQG1bqOyLAc6ygpCqr6vwHhk1WoIZxeQ3VfrQx88nNVRG937iUBkXwVJLKOHeh4zPnAqhkfpkAbZ58T7WQt6sb4ivUPXOP0pggx4NXppuEN42DJtG8Yt7V4VMrdOmixK+RISUYlkXaYYnCZUBrAnVJRiUTM9msQkH6RtYq7jPefUW1eHy35k+daZ5hBLAenOjaQ1khEWwpZv8w93fP9Pg2BF0DP5uY51SWijN/4hPQWqWqXz7SeATRQ39AIWhiysCJ9MFDQKtIWZU= 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:(4636009)(136003)(346002)(376002)(396003)(39860400002)(46966006)(36840700001)(2616005)(26005)(186003)(5660300002)(36860700001)(8676002)(6666004)(478600001)(426003)(83380400001)(4744005)(34070700002)(70206006)(86362001)(70586007)(8936002)(316002)(110136005)(47076005)(82740400003)(4326008)(44832011)(356005)(36756003)(82310400003)(7696005)(336012)(1076003)(2906002)(81166007)(2101003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3413 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT020.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: e0dd6e07-cfb2-4a98-5238-08d95cb26b6e X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2DvGk5faxWDCBR3GCL+GePvhmWOLRgPlyWQXM9MO9W+knNnbGPZ5UsWmrpicEdlg86iRi8xxOqX8deT0QEnVSkDjgqQsa1XTaV4mDR6ykPtdldnuc4d6iBFflTj/bz5iQcLDmeFd219ybFrFz6PeArONI6ymca/C1lTNDO3T0kEL+QG3mmEDtRKFgjMaeUq6gOe+8J4rg0K0o75eS6GI12YRIEH4hUoIxEFb4hykmibr3k2rsNUrqsTb1V9jPTyOJYGAF999mXG4w/ASN8PkvQFSp+NgCJhZtrrYqMyqCNA5TvDriRIEz0IgUe2wMVna8NMlzlv1ArKXEJStV62jwJsEHDx6khjUVBewRc/GmUU6FPaVlgNu63Z+LCBCcSNKH3mmzY++HU59ecj9bU2EFzMI9MEv2H5AsQPSCvYIY2OUluSs2AWZVo+zEbTVbbkEujXcymIwVLaY3eHYLwHSiC1flBCOQV4Oj/D/XjYhBnMLEy+y9gI2mBr7GASkYgtJ33k6CvFUv8gMiUJuOCvEfqfDVVrSGZBU0wZp/ySwdTtLcBjsDFShMpUUqC/orBbzSB/I06vE7DoMX3gss99Gb3nWA8hKF3zh2h1L7mT0uaLXflwqv8N8ErxbTJSap9GA3p+zW75HU9emfgdwnhiySSXFMRl7h7+h3Tw/FNvIrKqKwOdz/mUOf+bEcPfVI1dtJ2oL/KLod+BemUQbXEhlqUDCu7P2N0XEfyYissnWPT8= 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:(4636009)(36840700001)(46966006)(4744005)(1076003)(70586007)(70206006)(86362001)(44832011)(36756003)(508600001)(4326008)(6666004)(2616005)(83380400001)(110136005)(82310400003)(316002)(186003)(81166007)(7696005)(47076005)(8936002)(426003)(336012)(26005)(2906002)(8676002)(5660300002)(36860700001)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2021 10:26:10.1734 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2a7d66aa-b870-4415-8397-08d95cb26ffb 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: AM5EUR03FT020.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR08MB2874 X-ZohoMail-DKIM: pass (identity @armh.onmicrosoft.com) X-ZM-MESSAGEID: 1628677882319100001 Content-Type: text/plain; charset="utf-8" Now, we can use the same function for ACPI and device tree based NUMA to scan memory nodes. Signed-off-by: Wei Chen --- xen/common/numa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/common/numa.c b/xen/common/numa.c index 8ca13e27d1..d15c2fc311 100644 --- a/xen/common/numa.c +++ b/xen/common/numa.c @@ -381,7 +381,7 @@ void __init numa_initmem_init(unsigned long start_pfn, = unsigned long end_pfn) return; #endif =20 -#ifdef CONFIG_ACPI_NUMA +#if defined(CONFIG_ACPI_NUMA) || defined(CONFIG_DEVICE_TREE_NUMA) if ( !numa_off && !numa_scan_nodes((u64)start_pfn << PAGE_SHIFT, (u64)end_pfn << PAGE_SHIFT) ) return; --=20 2.25.1 From nobody Sat May 4 03:49:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=2; a=rsa-sha256; t=1628677934; cv=pass; d=zohomail.com; s=zohoarc; b=Oa9eeeNip3sgRPD40/lwLqLR7svK66vsD+HIuRAcOATuw2hb3H9HcJAXpG9CaloEIyCUjkVJvnwpeSxlvhhgsgCo52SCuVNQ6PMHDaKN1AbWl6SRg9HbaYnrC2HoCEH+ngsbPraV+gYeTwi3ei0jh4CJCvPhkKWnI6xknkW09Is= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628677934; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=1jK2PW/1OK3X6TWEry7lKAeMTQlsnddWZt6g/VQHny0=; b=Or4d+zc9N85wX6Sm6svtr/JFiYHFlb1XHQzJdz5T7OzarBh0EMluCZ8R/PI8isFPxcvrMzEqy8g1/fUY3V8uHlPE9JIXceVVI+KTuP/YvttuCizjuQAWvKb9w+5CSaH1qMuN87LRrw6w+GxDQvDz4PQJkVTLACpqXd+r7df7U+U= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1628677934170427.27341688113336; Wed, 11 Aug 2021 03:32:14 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.165810.303054 (Exim 4.92) (envelope-from ) id 1mDlWh-0005fE-2L; Wed, 11 Aug 2021 10:31:59 +0000 Received: by outflank-mailman (output) from mailman id 165810.303054; Wed, 11 Aug 2021 10:31:58 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlWg-0005aU-2b; Wed, 11 Aug 2021 10:31:58 +0000 Received: by outflank-mailman (input) for mailman id 165810; Wed, 11 Aug 2021 10:31:55 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlTm-0000BQ-Ji for xen-devel@lists.xenproject.org; Wed, 11 Aug 2021 10:28:58 +0000 Received: from EUR02-VE1-obe.outbound.protection.outlook.com (unknown [40.107.2.54]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id b19cbc6f-9eee-46cb-b1be-8ae1a1c5ce56; Wed, 11 Aug 2021 10:26:13 +0000 (UTC) Received: from AM6PR04CA0018.eurprd04.prod.outlook.com (2603:10a6:20b:92::31) by DB9PR08MB6348.eurprd08.prod.outlook.com (2603:10a6:10:263::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.17; Wed, 11 Aug 2021 10:26:11 +0000 Received: from AM5EUR03FT027.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:92:cafe::b6) by AM6PR04CA0018.outlook.office365.com (2603:10a6:20b:92::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.13 via Frontend Transport; Wed, 11 Aug 2021 10:26:11 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT027.mail.protection.outlook.com (10.152.16.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:26:11 +0000 Received: ("Tessian outbound 077ab11054bf:v101"); Wed, 11 Aug 2021 10:26:11 +0000 Received: from db816a265a1c.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 27D4D6AE-CC55-44EF-B201-B565A8CD2269.1; Wed, 11 Aug 2021 10:26:04 +0000 Received: from EUR02-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id db816a265a1c.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 11 Aug 2021 10:26:04 +0000 Received: from DU2P251CA0015.EURP251.PROD.OUTLOOK.COM (2603:10a6:10:230::19) by VE1PR08MB5133.eurprd08.prod.outlook.com (2603:10a6:803:109::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.17; Wed, 11 Aug 2021 10:26:01 +0000 Received: from DB5EUR03FT055.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:230:cafe::2) by DU2P251CA0015.outlook.office365.com (2603:10a6:10:230::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:26:01 +0000 Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT055.mail.protection.outlook.com (10.152.21.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:26:01 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) 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.2308.14; Wed, 11 Aug 2021 10:25:59 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Wed, 11 Aug 2021 10:25:57 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: b19cbc6f-9eee-46cb-b1be-8ae1a1c5ce56 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=1jK2PW/1OK3X6TWEry7lKAeMTQlsnddWZt6g/VQHny0=; b=sg0C3ioq+ACGGnKELxsgmh+BHHbvmmIkaWxkwrySzNc7kbFgtVgVPI0hBqCpkOMPaebfOCu5NkemitRGJKtOs/JsuWqYq9NfuY1JRWylQhZ+nuGlgSD/JshYw7gvDGw7eEgrWygGMM9jrFnP0uLDyKrJSpwX+CyDXsJxqfPBNDU= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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; X-CheckRecipientChecked: true X-CR-MTA-CID: 37e791966c4b9bcc X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QxNHX8MZx05gJtyo6+lS4jeWRHM/30o7f75fCHVbfpUV9cUSmsESI53/8rkBhpxbJ7vsCOvTg2wjxzvRNEMtifD/B22w/KO/JU8QqamoWfzAqPicnXz9U71r8ziE0bPxO4DrS4EOXL8H7e1ODxU9d6OBcgNdgmj5ZyJz2Yeg3Xpvx30aOBai2Z8htACrsKIT95KdbTjuim1dYdDqvAe8Z77depqZ9Ag07wZVbf+p2XpoxcVDBtVBGrTjGUIRAqlOm9dpTcn9Z61pkLE8FXpJHvkVbNv0alLdD64JNzH31V0RF3rSUv0Z94xbz6xE7DdCAnc+L8VbQa/9us+87TzXEQ== 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-SenderADCheck; bh=1jK2PW/1OK3X6TWEry7lKAeMTQlsnddWZt6g/VQHny0=; b=fgStff7yY+L1mkSihxdKn7+QWkhKFeUrDuJFMxutfBvJmeT6nlBdn1+mJnBKlGM3nqBqRvFYhfdyrekkQajRnF3inC/HHLckOo8Zc1nyyAQpQc7nGGTqz1BnFjXm5nfBqQIA50pj4jlchmMtYNmjozKGEIvbxFqJtHJETQ86kGjSaFY9uyh8P43ceQ99Hs/JOtIfYYpleioAFS5llBjiUw+GFYVoGK6E9eVck7j6IGanna++mBzFdoFwIEc9RthLKqtdDgAxK+bTV+DZLNeISOrLhTsLUZLykCyLyYWBB29rCLuigPpzC/k2M7Bu7WAm5lbJyKoBCnVgEHZFm/1D3g== 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=1jK2PW/1OK3X6TWEry7lKAeMTQlsnddWZt6g/VQHny0=; b=sg0C3ioq+ACGGnKELxsgmh+BHHbvmmIkaWxkwrySzNc7kbFgtVgVPI0hBqCpkOMPaebfOCu5NkemitRGJKtOs/JsuWqYq9NfuY1JRWylQhZ+nuGlgSD/JshYw7gvDGw7eEgrWygGMM9jrFnP0uLDyKrJSpwX+CyDXsJxqfPBNDU= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; 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; From: Wei Chen To: , , , , CC: Subject: [XEN RFC PATCH 36/40] xen/arm: keep guest still be NUMA unware Date: Wed, 11 Aug 2021 18:24:19 +0800 Message-ID: <20210811102423.28908-37-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210811102423.28908-1-wei.chen@arm.com> References: <20210811102423.28908-1-wei.chen@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 424edb30-3815-4983-ade0-08d95cb270aa X-MS-TrafficTypeDiagnostic: VE1PR08MB5133:|DB9PR08MB6348: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:6790;OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: pgmEJHhkc+S7yCR7TsJ9+YUM/gvDwc1dysiaIrrVckk2Eqe/LosQP41kHNOf85LcjRFC2i2ldhYXo9JZkEEmklhur8j/cYPpQRFgxWBu5p7p+G+RNn/gjn4LAinC3JjEECNbUAP5uQAG0rZpuLLS32RQNfxP6Wc3ffKmsgEQwawZZynEX7mWkeCb/QDXG/p1mYYJQkypBXzGI6m7cUsTbtkP48vJRUoJCsgR7uvguPZUxq6FNK4RD1Dxht2VE5KKg9BIAu/1kxBS/Pqe1JYdsqbQA9rDeYHNG8YHI0BvD/YJIndC1b170wDpIhXzUX/u4zWK2nZYdKun8xiXGeC6FZL0pwX1lM/hzU0BqnMrg1F3kUkBIfZ1Ts8QILRlRpDWKVKCtzlMnAsdmRYMXmOSGpURYy5hXEexKidnzujZGJMnBNpxZEuPi9BCXsIdbavCyRdgA4QfU8s0a72JBjn6eNqS+BgmcedeegV86Z4pj6TX2sj1n4bb9PHylb7I45VYdzyz/CjOEKzYncb8w2J5xWAetOEMd22Y2Sz78GJ+/PwqunsOH9drRRZhZlcQXqVu4fzYPyg+fR0C+i0Ty/1Io9Ib3DgoKRHnZUP52djp4RVw9jxb5WXaEWgLBHyui0mNGbWnTn7rlKYuXv/P9M6Kpw3k05ZDEs4hLFpj3pwpR9X1nHE1nqh6lnVWBU9tkOnvAmbsCrfDLVSoZXrA5dfgCZnmxX8ipCV2aUg6fsrsenCVO0NyrkMRhc+2Gt1hCDP8DnJdHLGcH4hMUeomgWjZFP/OsGHfRfDkAlob8MqeHIc= 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:(4636009)(39860400002)(376002)(346002)(396003)(136003)(36840700001)(46966006)(82310400003)(356005)(426003)(26005)(4326008)(70586007)(336012)(36860700001)(1076003)(478600001)(2616005)(86362001)(5660300002)(47076005)(8936002)(7696005)(70206006)(2906002)(186003)(110136005)(8676002)(316002)(36756003)(82740400003)(44832011)(81166007)(34070700002)(6666004)(36900700001)(2101003);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB5133 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT027.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 54d64f97-3fd4-435b-e325-08d95cb26ada X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4QdhahvlHORyZ3sIo8iXC4gWRagCHwh0F00y7nMk0iOAP33vS0MYSPUzVX6hH4EB1CPd+U/zhGOkQcA6EICIjyXL/73hCAJU1qZENjJDnYQVgjZa3Hc70tTquIAF8FmOjnmo8XwZGf+qu9H7nUMkHGMGI6xc4eg0Q6/bsmXrNAArGMi9zIzIWtAMgj4RK8BCD8H6cXlO5u4u4FzsCVQUBvCEhCqnezqV7ZoBarZdzD8JehHaz+VCnwoa9fUEgmOvNgGZ+KFqG2v3mHD1O7nvxbjwL5QVBVcNCh5JfJlnmYbyrKpmRSxHhFuudOBPPwUs0w5HPYMDi/6XVDRd7p8/eGa5Gkyh5Smt2p0hRt/3rexUMyBlGnerQX9jiOu8Gx1/qenz2hD7YtXaW9HWG0F+wSMzSt36VDFW50JtEP8psSMeQnBUei3pnW1NgBIIdQiBKIuidaVr4yPT/BlFL9F5B72XkTrOPJn0AdLBv/VZBI8fQFMB4nk9KnSHDtyElPrMc8uoOqVbFf+Kf6rHB655W9FCv0X8nIHk4F++sfHKRMZMTaetws0NWU8iKMbgA14MeUTay+2jT3j8z+75TNh0iQ3NaCKkMsARMtPN04cBnDqmb9yHbTh0sFWenoZMUG5VsOWG7gx5tIIvA9We8hHdmmJ6uaPmtz2qGnSoqfUibb3Mvocy0o70hDxgjH8Ny7Pjbv3cZ+u0pTTW9tqadiKXEW9bfCOJPka8ydU7TPguV7M= 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:(4636009)(376002)(39860400002)(346002)(396003)(136003)(46966006)(36840700001)(82310400003)(426003)(47076005)(82740400003)(110136005)(316002)(2616005)(4326008)(5660300002)(478600001)(81166007)(36860700001)(1076003)(44832011)(2906002)(7696005)(36756003)(336012)(8676002)(8936002)(70206006)(186003)(86362001)(26005)(70586007)(6666004)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2021 10:26:11.3144 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 424edb30-3815-4983-ade0-08d95cb270aa 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: AM5EUR03FT027.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB6348 X-ZohoMail-DKIM: pass (identity @armh.onmicrosoft.com) X-ZM-MESSAGEID: 1628677935332100003 Content-Type: text/plain; charset="utf-8" We have not wanted to make Xen guest be NUMA aware in this patch series. So in this patch, Xen will skip NUMA distance matrix node and skip the numa-node-id property in CPU node and memory node, when Xen is creating guest device tree binary. Signed-off-by: Wei Chen --- 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 cf341f349f..e62fa761bd 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -584,6 +584,10 @@ static int __init write_properties(struct domain *d, s= truct kernel_info *kinfo, continue; } =20 + /* Guest is numa unaware in current stage */ + if ( dt_property_name_is_equal(prop, "numa-node-id") ) + continue; + res =3D fdt_property(kinfo->fdt, prop->name, prop_data, prop_len); =20 if ( res ) @@ -1454,6 +1458,8 @@ static int __init handle_node(struct domain *d, struc= t 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 =3D --=20 2.25.1 From nobody Sat May 4 03:49:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=2; a=rsa-sha256; t=1628677881; cv=pass; d=zohomail.com; s=zohoarc; b=YVGUb2obF64Q1rUjQdEUemYD3hwfbpP96/QqexxdwLYalj10QpxVXr8Xy99NYv5cgnkzctBepTtTz3cSsQwLjmsPN3kaQfnRomGBnIEJS3NAb26fo5eE5foTJVMwWPkoNCsdiBYNsVu71+uYsCGhFEjKor97hN9DuRbLDfMg2rw= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628677881; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=MAOWUGxgQoZW9KSsCECQDLvP30ypWGfceAqtMnccDqI=; b=bVy60x3Gu30Xb9jGjW7tSP2UrTnj0sEDqsTHDK9mPt/1KZElz+p5kbmfu1mpiy9XQZdHsJi5Y7+Po+UBKQY6VIp3db9P+bu2oqrBYwrt7pBadASj9BcZZ1NFPagEwWjUv5SY6plbm6n7kSruvKsPnocu3tZBqiUc6hUXI70eEt0= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1628677881904527.8378592060229; Wed, 11 Aug 2021 03:31:21 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.165696.302803 (Exim 4.92) (envelope-from ) id 1mDlVp-0002E1-Qp; Wed, 11 Aug 2021 10:31:05 +0000 Received: by outflank-mailman (output) from mailman id 165696.302803; Wed, 11 Aug 2021 10:31:05 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlVp-0002DI-JS; Wed, 11 Aug 2021 10:31:05 +0000 Received: by outflank-mailman (input) for mailman id 165696; Wed, 11 Aug 2021 10:31:03 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlTw-0000BQ-Jl for xen-devel@lists.xenproject.org; Wed, 11 Aug 2021 10:29:08 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (unknown [2a01:111:f400:7e1a::60d]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 30ccf2c0-2a42-4497-92e0-c621481b8df3; Wed, 11 Aug 2021 10:26:14 +0000 (UTC) Received: from AS8P250CA0006.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:330::11) by AM6PR08MB4215.eurprd08.prod.outlook.com (2603:10a6:20b:90::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.16; Wed, 11 Aug 2021 10:26:12 +0000 Received: from AM5EUR03FT008.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:330:cafe::9b) by AS8P250CA0006.outlook.office365.com (2603:10a6:20b:330::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:26:12 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT008.mail.protection.outlook.com (10.152.16.123) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:26:12 +0000 Received: ("Tessian outbound ab45ca2b67bc:v101"); Wed, 11 Aug 2021 10:26:12 +0000 Received: from df66873e980b.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id F6BB0B95-9AE4-4090-AC77-AC10317BAE2F.1; Wed, 11 Aug 2021 10:26:05 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id df66873e980b.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 11 Aug 2021 10:26:05 +0000 Received: from DB6P191CA0007.EURP191.PROD.OUTLOOK.COM (2603:10a6:6:28::17) by VE1PR08MB5662.eurprd08.prod.outlook.com (2603:10a6:800:1a9::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.14; Wed, 11 Aug 2021 10:26:04 +0000 Received: from DB5EUR03FT017.eop-EUR03.prod.protection.outlook.com (2603:10a6:6:28:cafe::d1) by DB6P191CA0007.outlook.office365.com (2603:10a6:6:28::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.15 via Frontend Transport; Wed, 11 Aug 2021 10:26:04 +0000 Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT017.mail.protection.outlook.com (10.152.20.114) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:26:04 +0000 Received: from AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2308.14; Wed, 11 Aug 2021 10:26:02 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Wed, 11 Aug 2021 10:26:03 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Wed, 11 Aug 2021 10:26:00 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 30ccf2c0-2a42-4497-92e0-c621481b8df3 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=MAOWUGxgQoZW9KSsCECQDLvP30ypWGfceAqtMnccDqI=; b=0+4RNNd9rIzQDgMAZALu0X/PrFSt9qdft4P+rkUzUMghkKU9bR60hBlQKUbxq4ywXjfgKL0AbUKj2F0/PgBdvxN2ppOMuMzbbSH0NXUCkFaBihmsUPt0Q5/tt6Td2QHnJVDuYcthe1mXldeBBuLJ+9bBK8YjGtSLS17C89M+L3A= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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; X-CheckRecipientChecked: true X-CR-MTA-CID: b6f26dd225189abc X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ma7/fIYPLSgdIXfB2wv9QOcLAZfjTbs6vUWBgFXoHaL9/QBaRnpGXtdx21iz77YyJ1wPDyZvnKzD3q42oJGk9fmJcm/DYUx7eL80zQgLxnAw0zv6zA7x2dNEuQJsz4wChxeYKNWshajZRKNgoS9gwbRZ1KzgrEVPrHHIXKRAcsgl8wG/jUVZGviMN/tfkSRuaQfA+vYvpK7+qCAbjSQnVR1So2WDpwBGNKeUC9h5UQQKHnnEBHBQ44jsW/YvWPV3rurF41O9wk78kEj+LG61K3Dx36xO2sEAShBtjEqlURwAsKmwqqiw8XFxowUShOrS1unQZcYygAG5wJHZfbFdGA== 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-SenderADCheck; bh=MAOWUGxgQoZW9KSsCECQDLvP30ypWGfceAqtMnccDqI=; b=PT8zSMHRUUPiVjBkXZEG2zUZRCGcFkUehTqGhc8+5HL5jYQXa464g9BFGfRJALUzztrccMMHfHarmwJqw3eK8lhrXWadWmoZScEPBRIf2AfgHaaOuKCDdaNX+Ydh4VCqMs/6rtZ12JXLXpc16f1aAgHy7bjrrRedUy8yHLzf4uRKDj7lg6sAypF87xGdsddFpO5od5jyNA08bS1jQlgUdHsFha+CGPhj95bWsxzgIFtecMd9gpkoWB/zAU8kbQd9LuzRjRFj3F19xjXJnbYsksoGNPkgNC2LeyXZVcWHRZCcHqgUaAX2yoZcDId6c9lRCJfmGGnPARE24PkT1XULVw== 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=MAOWUGxgQoZW9KSsCECQDLvP30ypWGfceAqtMnccDqI=; b=0+4RNNd9rIzQDgMAZALu0X/PrFSt9qdft4P+rkUzUMghkKU9bR60hBlQKUbxq4ywXjfgKL0AbUKj2F0/PgBdvxN2ppOMuMzbbSH0NXUCkFaBihmsUPt0Q5/tt6Td2QHnJVDuYcthe1mXldeBBuLJ+9bBK8YjGtSLS17C89M+L3A= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; 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; From: Wei Chen To: , , , , CC: Subject: [XEN RFC PATCH 37/40] xen: introduce an arch helper to do NUMA init failed fallback Date: Wed, 11 Aug 2021 18:24:20 +0800 Message-ID: <20210811102423.28908-38-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210811102423.28908-1-wei.chen@arm.com> References: <20210811102423.28908-1-wei.chen@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2451caa0-5cc1-473a-39a1-08d95cb27177 X-MS-TrafficTypeDiagnostic: VE1PR08MB5662:|AM6PR08MB4215: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:1284;OLM:1284; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: MOJeYIqZ+6SGZoYBf5ezJYX/hRMcbW/Wfwq+39tVgYTnplpTIYhjD2+3+wo19UDIcDL5yTr2ru4gZ0guzj8UV5ms9Z5rLrAnGo16YIP/vig3KUAWpRAsDuTYSwjvOAns9ocTm8qxCl3Xx9JEgvHnzKdQyoLaxoO+ehbZA+xQaSklsVbug2kj8/l2S0ZlwKEnEkOTorcS6rKB02gFKa0fI6H3RiqYSdEwU5yrb2ZMYJ7jbTfYcNTb1BJg0M15b2XfTmc87hJp+tnvRYXjvPF02CQ9pDEOvEZ9/U6oVsYW3X0Zb+OSV6Da5sb+CjkNhByIjgTiaNGef1FkjlBKf6qq4aJIGmr1gcGzAxyhFa4xVjAwt7HdUFxQzuDiJup7xGaoIP4LpBJXXSh1avoPGoakgkZxxGkJQA5UjYAsvrMdqW+eD5vr4HcVbLnD2FBB1gQ+y3Jy7Prgc1T2KCsPKL4OJUxxfBmgPRraz8XuGuYs+IeD14NDCfxsdfVLIrvakUUok73mI+kUxVehjvXg6IbPAfagqVQofVGYmTp+J58CPPFWfc9cLXiS7BRAyir961D6YXrN7eBV0E1nCBNKS6cNFyqcmadPGD4uuVDi9/b1xY9TFp9QTDLzdDxJMg/7me8gsBuxf2ibXNg7WPwpD4Qim9R7A5NdiuRGcME9mfvcyipnFnl4RmjT4YoIfTQMkX6J0WW/7+SpWCmtbxxabbWRfbDyhg+nIHo+uZmp1qq4aJ+IWmJ/BUsVYGGJ8rTBpqE+p9ybF4+eIJFTeNhWxXCMDqa0qrtSudUAnNbfrk35hSA= 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:(4636009)(46966006)(36840700001)(2906002)(4326008)(5660300002)(86362001)(508600001)(82310400003)(8936002)(81166007)(34070700002)(426003)(336012)(36860700001)(26005)(6666004)(316002)(36756003)(83380400001)(186003)(47076005)(110136005)(356005)(70206006)(7696005)(44832011)(70586007)(8676002)(2616005)(1076003)(2101003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB5662 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT008.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 4cdb308f-d60a-4e02-1af6-08d95cb26c53 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SLOi23Q+MPSbOEPvPLPBmDPVxQiDRIPyZSKL08R837unH/tBEzuw/3emZmyCHo/tj3wgVQhPJ9i/rC5Ix30LRDsokn3zxNJqbtoY90urf0wg7HUxoeMvlfNvLNJxpbWfeF/Aia01qFktfBZCiaCXFP9sC/LI+tk90qbRw3vYxHgJNKtRQzecgRW+Yw41fT+TTreZMdoZSOlQgAJyNP5Gv7JHVYIAMpr1vhF49efVgdIFYQ+Ri6xieR1c8sXjjg6tbn7kJr4j3KHjUK7QFWUdSDfGA1b4bSQkpjl9HRNJClWKfDMfvjtZvGnoeBw8kPM8hP6z6khuekyD0OQD4aPGUtUQiFrsbBOWiTii5i1F10Pue1EYKtTVms3rDdE9MSb+BRdlqKkANdkzkOvUDcexnNeuhYi2yKsm22yvZI02mwEJBj8teB6mQQdW1lq1//niQ7CNUcqj7CJIhKIg/RNwASEfsJgpKatEKb71TqAkekoRPRPGjU239Nyyd6Sgc7UY9rcEID2s8hAPdUw7gjCpcGEeSwyV7etOFq9ovGqYoPjaHWJRPAyVrcUe75L+5p+p3theGJV5GUQs/FvTsB2w8cTK8Jsn075q3mbxnFs6vTRlyt1EjUstP6vafpr4DISmDX+uwEEqPVHWlfe+7FilWyYEI32iqL9mIQf5uZ6q2M4vj8tS4ALqiQGrkgcwff9TqiY9gQ2pnWSTb05IC+75JqwKUojvMItGfAPJ9souOTk= 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:(4636009)(346002)(376002)(396003)(39860400002)(136003)(46966006)(36840700001)(82310400003)(44832011)(86362001)(36860700001)(2906002)(83380400001)(47076005)(5660300002)(316002)(110136005)(8676002)(8936002)(82740400003)(1076003)(36756003)(70586007)(70206006)(426003)(7696005)(186003)(26005)(81166007)(4326008)(336012)(6666004)(2616005)(478600001)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2021 10:26:12.6619 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2451caa0-5cc1-473a-39a1-08d95cb27177 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: AM5EUR03FT008.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB4215 X-ZohoMail-DKIM: pass (identity @armh.onmicrosoft.com) X-ZM-MESSAGEID: 1628677883501100004 Content-Type: text/plain; charset="utf-8" When Xen initialize NUMA failed, some architectures may need to do fallback actions. For example, in device tree based NUMA, Arm need to reset the distance between any two nodes. Signed-off-by: Wei Chen --- xen/arch/arm/numa.c | 13 +++++++++++++ xen/common/numa.c | 3 +++ xen/include/asm-arm/numa.h | 1 + xen/include/asm-x86/numa.h | 6 ++++++ 4 files changed, 23 insertions(+) diff --git a/xen/arch/arm/numa.c b/xen/arch/arm/numa.c index 6eebf8e8bc..2a18c97470 100644 --- a/xen/arch/arm/numa.c +++ b/xen/arch/arm/numa.c @@ -140,3 +140,16 @@ int __init arch_meminfo_get_ram_bank_range(int bank, =20 return 0; } + +void __init arch_numa_init_failed_fallback(void) +{ + int i, j; + + /* Reset all node distance to remote_distance */ + for ( i =3D 0; i < MAX_NUMNODES; i++ ) { + for ( j =3D 0; j < MAX_NUMNODES; j++ ) { + numa_set_distance(i, j, + (i =3D=3D j) ? NUMA_LOCAL_DISTANCE : NUMA_REMOTE_DISTANCE); + } + } +} diff --git a/xen/common/numa.c b/xen/common/numa.c index d15c2fc311..88f1594127 100644 --- a/xen/common/numa.c +++ b/xen/common/numa.c @@ -405,4 +405,7 @@ void __init numa_initmem_init(unsigned long start_pfn, = unsigned long end_pfn) cpumask_copy(&node_to_cpumask[0], cpumask_of(0)); setup_node_bootmem(0, (u64)start_pfn << PAGE_SHIFT, (u64)end_pfn << PAGE_SHIFT); + + /* architecture specified fallback operations */ + arch_numa_init_failed_fallback(); } diff --git a/xen/include/asm-arm/numa.h b/xen/include/asm-arm/numa.h index dd31324b0b..a3982a94b6 100644 --- a/xen/include/asm-arm/numa.h +++ b/xen/include/asm-arm/numa.h @@ -28,6 +28,7 @@ extern s8 device_tree_numa; extern void numa_init(bool acpi_off); extern int numa_device_tree_init(const void *fdt); extern void numa_set_distance(nodeid_t from, nodeid_t to, uint32_t distanc= e); +extern void arch_numa_init_failed_fallback(void); =20 /* * Temporary for fake NUMA node, when CPU, memory and distance diff --git a/xen/include/asm-x86/numa.h b/xen/include/asm-x86/numa.h index e63869135c..26280b0f3a 100644 --- a/xen/include/asm-x86/numa.h +++ b/xen/include/asm-x86/numa.h @@ -22,4 +22,10 @@ extern void init_cpu_to_node(void); void srat_parse_regions(u64 addr); unsigned int arch_get_dma_bitsize(void); =20 +/* Dummy function for numa init failed in numa_initmem_init */ +static inline void arch_numa_init_failed_fallback(void) +{ + return; +} + #endif --=20 2.25.1 From nobody Sat May 4 03:49:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=2; a=rsa-sha256; t=1628677889; cv=pass; d=zohomail.com; s=zohoarc; b=MH2q7v4IU1wC+IxrxeWYznAhtZOoX1M5H899m+nD3Z96w+bz5v2zHiNjeWXtDYIYi8uXDoIAS9nx/FUlWo9b1398rBThiNQhzymxFCRqvL5ucT3EAh1hQh4xc/ecdMroqu13sl9ImTEexaO3y5OBQkXT6TbFJghgUN4RbEH/GsM= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628677889; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=tNXvFk8FEKwXourDz8d4PehitVjbuxBLUXjR0NlY49U=; b=eGuZn/g33Z8q4JG/5MM/kYiO402DBydyCwyNPjPi7CpdeGvqZOAbUvyDDBECMh7zSc10TX7G8DWsv+K148npq5JXBQwN5nHYviA35+9AI0n58SWdX5b6F6ucdPvUmYaESXnB8oKbFWXj/+dKUsjA1TYrcFqdqauwD7zZ3nbRDrw= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1628677889851951.7347479389163; Wed, 11 Aug 2021 03:31:29 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.165705.302866 (Exim 4.92) (envelope-from ) id 1mDlVw-0003n5-1S; Wed, 11 Aug 2021 10:31:12 +0000 Received: by outflank-mailman (output) from mailman id 165705.302866; Wed, 11 Aug 2021 10:31: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 1mDlVv-0003gT-5Q; Wed, 11 Aug 2021 10:31:11 +0000 Received: by outflank-mailman (input) for mailman id 165705; Wed, 11 Aug 2021 10:31:09 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlUB-0000BQ-KY for xen-devel@lists.xenproject.org; Wed, 11 Aug 2021 10:29:23 +0000 Received: from EUR02-VE1-obe.outbound.protection.outlook.com (unknown [2a01:111:f400:fe06::62c]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 34c2faa1-4647-4866-88c0-c4133a7f4e77; Wed, 11 Aug 2021 10:26:17 +0000 (UTC) Received: from PR0P264CA0161.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1b::29) by DB7PR08MB4219.eurprd08.prod.outlook.com (2603:10a6:10:34::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.14; Wed, 11 Aug 2021 10:26:15 +0000 Received: from VE1EUR03FT014.eop-EUR03.prod.protection.outlook.com (2603:10a6:100:1b:cafe::dc) by PR0P264CA0161.outlook.office365.com (2603:10a6:100:1b::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.13 via Frontend Transport; Wed, 11 Aug 2021 10:26:14 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT014.mail.protection.outlook.com (10.152.19.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.14 via Frontend Transport; Wed, 11 Aug 2021 10:26:14 +0000 Received: ("Tessian outbound 79bfeeb089c1:v101"); Wed, 11 Aug 2021 10:26:14 +0000 Received: from 9b3a9cd1f269.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 850E7038-7250-46FE-AB9E-3C4600A0B4FF.1; Wed, 11 Aug 2021 10:26:08 +0000 Received: from EUR03-AM5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 9b3a9cd1f269.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 11 Aug 2021 10:26:08 +0000 Received: from DU2PR04CA0313.eurprd04.prod.outlook.com (2603:10a6:10:2b5::18) by DB7PR08MB3243.eurprd08.prod.outlook.com (2603:10a6:5:21::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.19; Wed, 11 Aug 2021 10:26:06 +0000 Received: from DB5EUR03FT056.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:2b5:cafe::2f) by DU2PR04CA0313.outlook.office365.com (2603:10a6:10:2b5::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.13 via Frontend Transport; Wed, 11 Aug 2021 10:26:06 +0000 Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT056.mail.protection.outlook.com (10.152.21.124) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:26:06 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) 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.2308.14; Wed, 11 Aug 2021 10:26:04 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Wed, 11 Aug 2021 10:26:02 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 34c2faa1-4647-4866-88c0-c4133a7f4e77 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=tNXvFk8FEKwXourDz8d4PehitVjbuxBLUXjR0NlY49U=; b=ZV5NHLbWaJEMHi0fdueDdJeJFl0AVE9jeBO5qH3SH2MnD7OsVK6dZ9jkKZbpyilbhCnBhVBt+YjRIyzozJ+d+mDq9BKzhkxTGchmGHlxtEuK36vkyjXOTLAY3nF/jRB4cu4rIAPp5fAgxdLfkp4hLei/XgoreHlmMpG4U0nhDWI= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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; X-CheckRecipientChecked: true X-CR-MTA-CID: d577b5644bae3d81 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aHKu1MWg8iH7pqERv3UUNR5qfc3iZVblsYMD3jfsrINPly3eN+LwNfcVDKA2X+z2qIAEHKguCvZvmb7rJcp0XnsvcbHpKTt9SZK7OPQaWUEnRVCxtetByn8xzHMXoBYW5xQv4zG3sVEVAuEglIj7EX85pnKhGZXepSUfWbH1JnrkhScUM9j9C/hdG7SaQcWrpp+TPeFif3ogPqdLcAgrS4tauinQPm2OHlWP8HPob7Go5LK6XqdefR9R4/MjQNDjaKTYMecbNvpL49MlM/jEwUDYdxkCiQlIZgouLnL8ZhHqR0TVFm2YNU3emF+990UsnsoM9mmJOwyZNPYR208t1Q== 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-SenderADCheck; bh=tNXvFk8FEKwXourDz8d4PehitVjbuxBLUXjR0NlY49U=; b=MnRBQOlEmxeHRmPnQxHTdNRSPk6XV7FoL/iLgG6E3LwUaz5IvjzLnxsCdvg16SsN7oQla32RQ35ld5GDq0oqUj60ZwfUhh/ku13tLIwHE+3NwWbLwNmnFrd0AiEPZKoZrme93xlMygulRnN695ffatg1rQbz0KQmC3uBqwj3nh80eIuzCiEPX09E9E1EqVBN8rL7Eu31J/bK9fSfqqjRKh5kXJTWxBlHyPVia9THnrV2yZHHcAqUPJaqAEVoGmsbKmTJ4PIIRbv0Jy69Bposk8IzPub3w/t6CxbUnqRJKPMh5cg68HV77cvueUIYD5MkCaqFTWFA16wgQNwozDQFjw== 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=tNXvFk8FEKwXourDz8d4PehitVjbuxBLUXjR0NlY49U=; b=ZV5NHLbWaJEMHi0fdueDdJeJFl0AVE9jeBO5qH3SH2MnD7OsVK6dZ9jkKZbpyilbhCnBhVBt+YjRIyzozJ+d+mDq9BKzhkxTGchmGHlxtEuK36vkyjXOTLAY3nF/jRB4cu4rIAPp5fAgxdLfkp4hLei/XgoreHlmMpG4U0nhDWI= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; 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; From: Wei Chen To: , , , , CC: Subject: [XEN RFC PATCH 38/40] xen/arm: enable device tree based NUMA in system init Date: Wed, 11 Aug 2021 18:24:21 +0800 Message-ID: <20210811102423.28908-39-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210811102423.28908-1-wei.chen@arm.com> References: <20210811102423.28908-1-wei.chen@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7746d908-0939-44ed-e3e1-08d95cb272bf X-MS-TrafficTypeDiagnostic: DB7PR08MB3243:|DB7PR08MB4219: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:6790;OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: RI5aG7thv3m+0xdQB0znsJr8jaFyQYXt5P7obeLMvhjgKhAQexGChgvl9aVTZuJbluQKMkCz8mBlex9ffbQnWjuwB/7o5SrI8XEQiqRYBOwXjAIvRqUDZbWI8x0Yn87ZW3gOCQrDRSPwVnaEqJS2Xfsk+Lxo3DtuBB+LStvwoKkm3uhkTEoMAXo9jS+I1+qVUqvJh6bigIPB0TO1tPhl0F2JDGmbUvyOE5OTUvH8dotsIeZu9/sWgubYAcRQJu8IvnBdDhbFh+ZCFr9A//jWjNS6FOQ3KCyTILCKd+NjSw1WvME4ASuG0UuQv3OYIuzaSQ+LLESJC9hKduxMWNWxUU3mKR0qKoxghlA8kHmvh4SA1WjiltICWvhBpacj1S6MJXqcXEOkHXb/MSrb0m5teLOMUuMbYxoLBbnX7g8xNlkCPqt2RWt6ZkzlpRC1IRvPGO+vS+SsClYVgGHFh+wISo0SP1iR7SRgRkMGEv/steDsl+J2Dh327bHGCXRIrD1k+r2i65jW2niMK22Tmgk4BpPQ6N0MGXozmjUgYXwYAiCR9Z/dXGtdyxY19ZVVpztWjCpsYDspehqLqxo9iDDFfGIjpN4Cea4D/6G6C7SSRPMQzCw2ovb7nD61WmAqZFhlXmWJgR36ugHsvd2welvwUmg80wR5RtioaT2YZKdTITZ80jgy85pzQrX1h0g9wlrbn5NGWTQLrNYBxMryrlAMZFNfLhqBcbRm5gsfw5AEWy0i7m3WvWdpd1hO2ilfGYvKhmuIBh6y4breCyg1vljft6cKxtjPQsI+t2ffEOxs0QI= 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:(4636009)(376002)(346002)(39850400004)(396003)(136003)(46966006)(36840700001)(34070700002)(478600001)(44832011)(186003)(82310400003)(110136005)(26005)(82740400003)(1076003)(4326008)(336012)(2616005)(36756003)(47076005)(5660300002)(70586007)(426003)(70206006)(8676002)(316002)(86362001)(356005)(83380400001)(36860700001)(2906002)(6666004)(7696005)(8936002)(81166007)(2101003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB3243 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT014.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 8e3550b5-a747-4645-88ed-08d95cb26df4 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nP6+GRLoirLDwiIDtYb0GYYuPk5KWvR2Q4fYnFQFcqD2iEDKamCBgs1WfgkRTi99PbzVUT9x7ZHWzZ2V4HjaQK5UCdpZgomeC054ZKv0fdnPGQi7J9uL+A3cIxqgMKZfxqMx+c9PyWSJbtrtrxIRsInEHubxYAq5p0cUY+NhR5zbp1sZo6KALbYdoZxe9EmF2HczTzC832TKtjjnTiujEBZn7rmSwSjTgP3mtWT9htO8H3ZIeBGNlmQNrHT/4IQvhA2YTOYj7gxOnmx/UhqkO4m/vUlN1RK7GBsdI0QdF0jY5mLONU9xOATxoAV2woPj5A+kJnKaTZo2S+o56nOQ7360uHdqLa1IRO2RrC8A7CVGrPJ13yg7Xa6A9+B9fXMcJnqetqBgzDD8pMxVgn8wWsx4c8TK9q/jvVEtPucMDG/tuW8uDUeMsQakF/lSkMgtxCB6/z7M/AuXFB3p+RSXmlogdhHGV379OGQT5qAM6tJ/0FoJbfRBFkB1HD4PyeK3fqRrzM9iSvfc9mShSmKUgwap5UhKIF6NlIRK1vTb8u1azyI8j8qCcfIQIsQNmhcmqcJwUbAUIofaldF7XlhJSYfE+bHbWCKwUK7YpyNiDBjzn1OSK/HUzAzCRF8n7EcKQyb6gDAPmJQNURny5QJNNPNqYfj1T5wLOBuxgmT9xbQLTcJ+PXSfl/b8bPVRVjOg804ij8rBlHIq2zKWMjH2k9UXoJseEG3wHiSinpvEgr0= 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:(4636009)(346002)(136003)(39860400002)(376002)(396003)(46966006)(36840700001)(5660300002)(110136005)(82740400003)(81166007)(7696005)(6666004)(83380400001)(8936002)(36860700001)(4326008)(316002)(47076005)(26005)(70586007)(36756003)(2906002)(70206006)(8676002)(336012)(426003)(186003)(1076003)(86362001)(2616005)(44832011)(478600001)(82310400003)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2021 10:26:14.7628 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7746d908-0939-44ed-e3e1-08d95cb272bf 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: VE1EUR03FT014.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB4219 X-ZohoMail-DKIM: pass (identity @armh.onmicrosoft.com) X-ZM-MESSAGEID: 1628677890533100001 Content-Type: text/plain; charset="utf-8" Everything is ready, we can remove the fake NUMA node and depends on device tree to create NUMA system. Signed-off-by: Wei Chen --- xen/arch/arm/numa.c | 45 ++++++++++++++++++++++---------------- xen/include/asm-arm/numa.h | 7 ------ 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/xen/arch/arm/numa.c b/xen/arch/arm/numa.c index 2a18c97470..3b04220e60 100644 --- a/xen/arch/arm/numa.c +++ b/xen/arch/arm/numa.c @@ -18,6 +18,7 @@ * */ #include +#include #include #include #include @@ -83,28 +84,34 @@ void __init numa_init(bool acpi_off) paddr_t ram_size =3D 0; paddr_t ram_end =3D 0; =20 - printk(XENLOG_WARNING - "NUMA has not been supported yet, NUMA off!\n"); - /* Arm NUMA has not been implemented until this patch */ - numa_off =3D true; + /* NUMA has been turned off through Xen parameters */ + if ( numa_off ) + goto mem_init; =20 - /* - * Set all cpu_to_node mapping to 0, this will make cpu_to_node - * function return 0 as previous fake cpu_to_node API. - */ - for ( idx =3D 0; idx < NR_CPUS; idx++ ) - cpu_to_node[idx] =3D 0; - - /* - * Make node_to_cpumask, node_spanned_pages and node_start_pfn - * return as previous fake APIs. - */ - for ( idx =3D 0; idx < MAX_NUMNODES; idx++ ) { - node_to_cpumask[idx] =3D cpu_online_map; - node_spanned_pages(idx) =3D (max_page - mfn_x(first_valid_mfn)); - node_start_pfn(idx) =3D (mfn_x(first_valid_mfn)); + /* Initialize NUMA from device tree when system is not ACPI booted */ + if ( acpi_off ) + { +#ifdef CONFIG_DEVICE_TREE_NUMA + int ret =3D numa_device_tree_init(device_tree_flattened); + if ( !ret ) + goto mem_init; + printk(XENLOG_WARNING + "Init NUMA from device tree failed, ret=3D%d\n", ret); +#else + printk(XENLOG_WARNING + "CONFIG_DEVICE_TREE_NUMA is not set, NUMA off!\n"); +#endif + numa_off =3D true; + } + 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 =3D true; } =20 +mem_init: /* * Find the minimal and maximum address of RAM, NUMA will * build a memory to node mapping table for the whole range. diff --git a/xen/include/asm-arm/numa.h b/xen/include/asm-arm/numa.h index a3982a94b6..425eb9aede 100644 --- a/xen/include/asm-arm/numa.h +++ b/xen/include/asm-arm/numa.h @@ -30,13 +30,6 @@ extern int numa_device_tree_init(const void *fdt); extern void numa_set_distance(nodeid_t from, nodeid_t to, uint32_t distanc= e); extern void arch_numa_init_failed_fallback(void); =20 -/* - * Temporary for fake NUMA node, when CPU, memory and distance - * matrix will be read from DTB or ACPI SRAT. The following - * symbols will be removed. - */ -extern mfn_t first_valid_mfn; - #else =20 /* Fake one node for now. See also node_online_map. */ --=20 2.25.1 From nobody Sat May 4 03:49:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=2; a=rsa-sha256; t=1628677881; cv=pass; d=zohomail.com; s=zohoarc; b=dhbefmgtuNmO03Rqa+n9OLcTrTMAGx9YKbw3qk8TyxHNt6G618wSUijQNsTYMY803eUtEUp1j2aaEhtZIJ8VoHv0KKHDbpPWijOz2oLeVBDXZZnHW4BZIZn8Hc8eNC1hozEVhg2npu4fSi/Z+zASEwbzUhkk15IGBqZd+/DQDUM= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628677881; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=C6uEbUCOtY0G4Js6EVeJsE/jBJeRxOOkeE9Bv4MxOuk=; b=T3AqoqeuNHOSd9yFRHp5CYoFaNEYiWAi7EqUYskA+pVb/E5y4rNfMqlYtc38RnbTJ9WrN3Ns6iggvRaZe/p2qYYOM3D+9wMMvBFyRGUipH/2QFtPFFd+GvGqRlrfrscU8IZFtiDdg99ov0CoFKp96BP07Vt9956jLKVqgupRGjM= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1628677881659431.5301886319478; Wed, 11 Aug 2021 03:31:21 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.165695.302799 (Exim 4.92) (envelope-from ) id 1mDlVp-0002AV-Cr; Wed, 11 Aug 2021 10:31:05 +0000 Received: by outflank-mailman (output) from mailman id 165695.302799; Wed, 11 Aug 2021 10:31:05 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlVp-00029y-8U; Wed, 11 Aug 2021 10:31:05 +0000 Received: by outflank-mailman (input) for mailman id 165695; Wed, 11 Aug 2021 10:31:03 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlRy-0002Qj-Hr for xen-devel@lists.xenproject.org; Wed, 11 Aug 2021 10:27:06 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (unknown [40.107.6.76]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 903b8011-fa8e-11eb-a052-12813bfff9fa; Wed, 11 Aug 2021 10:26:19 +0000 (UTC) Received: from AM6P195CA0001.EURP195.PROD.OUTLOOK.COM (2603:10a6:209:81::14) by DB7PR08MB2955.eurprd08.prod.outlook.com (2603:10a6:5:17::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.13; Wed, 11 Aug 2021 10:26:16 +0000 Received: from VE1EUR03FT029.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:81:cafe::49) by AM6P195CA0001.outlook.office365.com (2603:10a6:209:81::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.14 via Frontend Transport; Wed, 11 Aug 2021 10:26:16 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT029.mail.protection.outlook.com (10.152.18.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:26:16 +0000 Received: ("Tessian outbound 312d863716bf:v101"); Wed, 11 Aug 2021 10:26:16 +0000 Received: from 60c3a5c7c6ac.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 9F8E8969-6555-4481-BCFF-AF1DAC4CE6D0.1; Wed, 11 Aug 2021 10:26:10 +0000 Received: from EUR03-DB5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 60c3a5c7c6ac.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 11 Aug 2021 10:26:10 +0000 Received: from DB6PR0202CA0030.eurprd02.prod.outlook.com (2603:10a6:4:a5::16) by AM5PR0802MB2387.eurprd08.prod.outlook.com (2603:10a6:203:9d::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.15; Wed, 11 Aug 2021 10:26:09 +0000 Received: from DB5EUR03FT013.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:a5:cafe::b) by DB6PR0202CA0030.outlook.office365.com (2603:10a6:4:a5::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:26:09 +0000 Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT013.mail.protection.outlook.com (10.152.20.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:26:09 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) 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.2308.14; Wed, 11 Aug 2021 10:26:07 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Wed, 11 Aug 2021 10:26:05 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 903b8011-fa8e-11eb-a052-12813bfff9fa 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=C6uEbUCOtY0G4Js6EVeJsE/jBJeRxOOkeE9Bv4MxOuk=; b=+Pbmtl6qJfy63GrZ33q+ZmjuniiBMifrvKrrl9Pm3zk+qrNbuKnUpfEeC0mcITdENNIemQtjIlzSTHl32sgGYq9pC2bpU+WOWoKs8QsFtGp0BgBsSToc7bdvfUtE/KdIwte92uEaM6wY0CBz6ZXleBawzpRJ3JAke5LgS1xp3Nc= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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; X-CheckRecipientChecked: true X-CR-MTA-CID: 3017cd1959655c14 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YNL7/cgqaqNTm4Dlp8gGKpcCu3aDZgyxA7XLdkY7YksdBftAD7Yz8gpCZ6ae2XsnhgceMUIbRyOvYMfa4WC1Juc+oE+bW3uP5sLj5+LYDInZ7pwDphaB+9KC2k9BLfbUcQ7pY45dGdRYlHBTDwqHQVzysVRmHLC9nRcoXys60idEDK++RXfUpGQvf9EsJ5zn68FLGkG++XeQ+VivabMVtPFEr5UQox7C5eQruU+YSKtWvFz8H/+eR0uUsAb2LcdIJbpuzv9x5U8G3uUVxR968jtKvnPTk4tBrfBkXK8rM7izdiCvjHp4abLYuLCEZaRvi98GsHmPAyOe03wCt0zMAw== 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-SenderADCheck; bh=C6uEbUCOtY0G4Js6EVeJsE/jBJeRxOOkeE9Bv4MxOuk=; b=EnPuOUQBOeZkR5lIF/jev7oUVOcPGKCC5LUAwhUslVWJO6qeMLt502OzojEjEDsj7ugFcUxjlATagaUXsYOKqgf5K7lGLvy2CULoe13rowKMKG+JHL4ay+jL7vFXHtwSU/+uQY22//WWvLc8Lw02OD7VDwH12A5LXhHl9eUE4IbRsoQcG5GkWE/JbmEH35swkSnG+PQdaZxxUS/qqSgzAKTrTOc/8MKTxYu04wU2O+TEqu+Eqze7GV91Pek++LRS+8OWiSftxVV+ngCLnyQpW6iQn2o/K8csQ81zYm7bS4Pw9iciS/GIlKLjG0v/fW6kVh9L1nLJRppV1LslXMPcnQ== 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=C6uEbUCOtY0G4Js6EVeJsE/jBJeRxOOkeE9Bv4MxOuk=; b=+Pbmtl6qJfy63GrZ33q+ZmjuniiBMifrvKrrl9Pm3zk+qrNbuKnUpfEeC0mcITdENNIemQtjIlzSTHl32sgGYq9pC2bpU+WOWoKs8QsFtGp0BgBsSToc7bdvfUtE/KdIwte92uEaM6wY0CBz6ZXleBawzpRJ3JAke5LgS1xp3Nc= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; 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; From: Wei Chen To: , , , , CC: Subject: [XEN RFC PATCH 39/40] xen/x86: move numa_setup to common to support NUMA switch in command line Date: Wed, 11 Aug 2021 18:24:22 +0800 Message-ID: <20210811102423.28908-40-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210811102423.28908-1-wei.chen@arm.com> References: <20210811102423.28908-1-wei.chen@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ba97dedd-24f5-420e-f440-08d95cb273db X-MS-TrafficTypeDiagnostic: AM5PR0802MB2387:|DB7PR08MB2955: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:248;OLM:248; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: aJKV9aIT6VvU0VQQ2gsmp8pkFCd7/oHwlxnVF4iWA2smFq5lool1qBR09uvjjWOdBmZ0fZmJhWNk/rF0S5T8Hc40MAgUCRIkcRyb/MBo3hB4/yKkPZQrc4kt10r/4jLlwuvaRabwbSq7teNWwZtx+kXIGSbhKntSjRSl9MHwt26f5lOhnqtwzWkZQ+AHHpgJagyA2ZLVhcXz2+X2FHYVLem+FrLNYKljHkiAQ08VxMVeMPUu7SnsbzU97urh7C4ZiAuL7C6pA6RBDUIm7AnQ7VNfrkcg8NitwPth7cxItMRIrAZjp9WXwngzsdeZIH5m4lwTz7PrmwQse49CNimjEZVII9bz0qxxsZqxlAv7YWtZ0bKxMxQabkxy7aPSGDr9OYMz2asosOggTkPO9d1vJkGjGz9/p1X1EZEWftk0ziVwYDMbQ+ZnEFb6XnihAQpG7X6Af6eEdJiASll3DkGaMppRz5TFsa4nj4GRtJAw4QNYOwiuw9r714Z+E6l+yn8QI2GLB09ugHUQfNo1M4hc/VCtA9RIw9mmj5No5Cz+aCpKGCJtyJchN8vrOpOD1JSU4de2JToSEWR2h8mIFAWcFR/Uw71NjNG3DUe3+AHo3mhyuA+FeXLm/fbvZh/dMTN4ladXWBBhub/Z7fulT7KTzPe1HdbdL3hs9JD6iYtFvrrS97NWFXVWjHkulMpnJh2UwVAVZc/SipWVYhXWQfN1NIf9bPnp+xndP1ZAT7oDGvWbtpU+gsiVnGy+sD3MXX5+BBMdmuhmVcEs1XRvNEZBysw6rS0f3Hk/BxyiTgrMUds= 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:(4636009)(36840700001)(46966006)(81166007)(5660300002)(508600001)(336012)(186003)(34070700002)(8936002)(4326008)(7696005)(26005)(86362001)(8676002)(36860700001)(47076005)(6666004)(70206006)(2616005)(82310400003)(1076003)(2906002)(316002)(36756003)(110136005)(44832011)(426003)(356005)(83380400001)(70586007)(36900700001)(2101003);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0802MB2387 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT029.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 22bdec4f-04c8-46a7-0f81-08d95cb26f55 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: aoOPARhOJxwQ1yg9Rds87wupenStNO7v8FqkrbQIhmKh2Ndfun93SnSRcfck0UTi0yCUlSScMCrL/Il+cjQoQ7na08DvAGGmo/ohyZ8aiSjgZzQ8HohSB/KGU/HBIdn0WSxMIx1W80RGI4flVOwdj3X/HT9ESJXq4V8qdRvMd0N/w2+sOB+ewl9JJX5ogR6y4+aHj8nQXv2tB92CQ1iDLktVdbcZPxhNM7CJkE2x/R3igWKozExcXGZkW60YLAG/eG6+UE6WspdPTpsRGnTITkbGWSS94YRYpyA2781DjXEqFP+7VATJT2lE4GQVttU54YlLxeNcFSzyeffhnSIj721k4cStqtsPMAGY6BKMABjKIb0h1CjLiMuIWSvk4t21Y+srMoBQBYbE1d5Fgw5qfHy1J5XyMgSydznhisA/5nuUbjJ9P/qiJotWPutAs8wzg+99jCIuZgEC86ug8R9jLmqH9Mny4Sqv7E9FjNm3rASrmnPbCTalT6lw6zhs0T3cZJnlBT9RVsXOBzDBi76HB3JT5zHotcKkSrQpNSnkEIR3kFQgz5rO0SefKIWDCjQztHmuPC9iKLx8kW57OqQmpLfhWJxq2o0B9soMJ1OxP7uarJkSbD34Iy2GoQnFBisJGsCwavSuXjyio6Th11oLKlOORufvd442oF+Cpn+kPgHfezySjkFp7ngDxI5N+LcyBX7vhncU5BFgus2VMRk2OZsVYm3QEPop3YjLmYc/p7A= 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:(4636009)(36840700001)(46966006)(426003)(36860700001)(4326008)(36756003)(44832011)(2616005)(508600001)(336012)(86362001)(83380400001)(47076005)(8936002)(8676002)(6666004)(1076003)(81166007)(5660300002)(110136005)(70586007)(316002)(70206006)(7696005)(186003)(82310400003)(2906002)(26005)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2021 10:26:16.6186 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ba97dedd-24f5-420e-f440-08d95cb273db 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: VE1EUR03FT029.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB2955 X-ZohoMail-DKIM: pass (identity @armh.onmicrosoft.com) X-ZM-MESSAGEID: 1628677883472100003 Content-Type: text/plain; charset="utf-8" Xen x86 has created a command line parameter "numa" as NUMA switch for user to turn on/off NUMA. As device tree based NUMA has been enabled for Arm, this parameter can be reused by Arm. So in this patch, we move this parameter to common. Signed-off-by: Wei Chen --- xen/arch/x86/numa.c | 34 ---------------------------------- xen/common/numa.c | 35 ++++++++++++++++++++++++++++++++++- xen/include/xen/numa.h | 1 - 3 files changed, 34 insertions(+), 36 deletions(-) diff --git a/xen/arch/x86/numa.c b/xen/arch/x86/numa.c index 8b43be4aa7..380d8ed6fd 100644 --- a/xen/arch/x86/numa.c +++ b/xen/arch/x86/numa.c @@ -11,7 +11,6 @@ #include #include #include -#include #include #include #include @@ -19,9 +18,6 @@ #include #include =20 -static int numa_setup(const char *s); -custom_param("numa", numa_setup); - #ifndef Dprintk #define Dprintk(x...) #endif @@ -50,35 +46,6 @@ void numa_set_node(int cpu, nodeid_t node) cpu_to_node[cpu] =3D node; } =20 -/* [numa=3Doff] */ -static __init int numa_setup(const char *opt) -{ - if ( !strncmp(opt,"off",3) ) - numa_off =3D true; - else if ( !strncmp(opt,"on",2) ) - numa_off =3D false; -#ifdef CONFIG_NUMA_EMU - else if ( !strncmp(opt, "fake=3D", 5) ) - { - numa_off =3D false; - numa_fake =3D simple_strtoul(opt+5,NULL,0); - if ( numa_fake >=3D MAX_NUMNODES ) - numa_fake =3D MAX_NUMNODES; - } -#endif -#ifdef CONFIG_ACPI_NUMA - else if ( !strncmp(opt,"noacpi",6) ) - { - numa_off =3D false; - acpi_numa =3D -1; - } -#endif - else - return -EINVAL; - - return 0; -}=20 - /* * Setup early cpu_to_node. * @@ -287,4 +254,3 @@ static __init int register_numa_trigger(void) return 0; } __initcall(register_numa_trigger); - diff --git a/xen/common/numa.c b/xen/common/numa.c index 88f1594127..c98eb8d571 100644 --- a/xen/common/numa.c +++ b/xen/common/numa.c @@ -14,8 +14,12 @@ #include #include #include +#include #include =20 +static int numa_setup(const char *s); +custom_param("numa", numa_setup); + struct node_data node_data[MAX_NUMNODES]; =20 /* Mapping from pdx to node id */ @@ -324,7 +328,7 @@ int __init numa_scan_nodes(u64 start, u64 end) } =20 #ifdef CONFIG_NUMA_EMU -int numa_fake __initdata =3D 0; +static int numa_fake __initdata =3D 0; =20 /* Numa emulation */ static int __init numa_emulation(u64 start_pfn, u64 end_pfn) @@ -409,3 +413,32 @@ void __init numa_initmem_init(unsigned long start_pfn,= unsigned long end_pfn) /* architecture specified fallback operations */ arch_numa_init_failed_fallback(); } + +/* [numa=3Doff] */ +static __init int numa_setup(const char *opt) +{ + if ( !strncmp(opt,"off",3) ) + numa_off =3D true; + else if ( !strncmp(opt,"on",2) ) + numa_off =3D false; +#ifdef CONFIG_NUMA_EMU + else if ( !strncmp(opt, "fake=3D", 5) ) + { + numa_off =3D false; + numa_fake =3D simple_strtoul(opt+5,NULL,0); + if ( numa_fake >=3D MAX_NUMNODES ) + numa_fake =3D MAX_NUMNODES; + } +#endif +#ifdef CONFIG_ACPI_NUMA + else if ( !strncmp(opt,"noacpi",6) ) + { + numa_off =3D false; + acpi_numa =3D -1; + } +#endif + else + return -EINVAL; + + return 0; +} diff --git a/xen/include/xen/numa.h b/xen/include/xen/numa.h index b9b5d1ad88..c647fef736 100644 --- a/xen/include/xen/numa.h +++ b/xen/include/xen/numa.h @@ -83,7 +83,6 @@ extern void numa_initmem_init(unsigned long start_pfn, un= signed long end_pfn); extern void numa_set_node(int cpu, nodeid_t node); extern int numa_scan_nodes(u64 start, u64 end); extern bool numa_off; -extern int numa_fake; extern s8 acpi_numa; =20 extern void setup_node_bootmem(nodeid_t nodeid, u64 start, u64 end); --=20 2.25.1 From nobody Sat May 4 03:49:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=2; a=rsa-sha256; t=1628677916; cv=pass; d=zohomail.com; s=zohoarc; b=MELiYOt05KgtoRteRFJRo0Fa4WRi8QVj2LuHdE4TfeipeMfpFV9I0m1gDdEBjH+mJ7rqAhFxEt0JPsjuiW91zIm7vPR46Q24ZHOVNnSjybYgdO8Rd972cQG6Qcmk0HARDo0QtegLNvpltt3+Vpl/Aa4N8MrbcgtfGD9/oLxHR24= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628677916; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=TC7LKln6ahLVf1ZtsKqkIlBSpfKHZSkuLzsKHx1whuA=; b=cRYBaEpG6puJGPIOToWDDvifrFx13A7VIRwE2c1d0/E5lQftlbOPmkMZyEW5Wzyq9yuSW8DiosfSktDIs/rQ76J0j1G7Ih57/6tDCjhj+wVgCLkyMx6mYI61vwD81KbdDxu2Ppqb8dzlUgRCjbcoTAsQxHNLHIGUsYwQOwUixso= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=arm.com); dmarc=fail header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1628677916001994.8426014442143; Wed, 11 Aug 2021 03:31:56 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.165760.302972 (Exim 4.92) (envelope-from ) id 1mDlWN-0001HF-MP; Wed, 11 Aug 2021 10:31:39 +0000 Received: by outflank-mailman (output) from mailman id 165760.302972; Wed, 11 Aug 2021 10:31:39 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlWN-0001Em-0w; Wed, 11 Aug 2021 10:31:39 +0000 Received: by outflank-mailman (input) for mailman id 165760; Wed, 11 Aug 2021 10:31:35 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mDlS3-0002Qj-Ht for xen-devel@lists.xenproject.org; Wed, 11 Aug 2021 10:27:11 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (unknown [40.107.22.84]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 9914a608-fa8e-11eb-a052-12813bfff9fa; Wed, 11 Aug 2021 10:26:33 +0000 (UTC) Received: from AM6PR01CA0052.eurprd01.prod.exchangelabs.com (2603:10a6:20b:e0::29) by AM6PR08MB4230.eurprd08.prod.outlook.com (2603:10a6:20b:b3::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.21; Wed, 11 Aug 2021 10:26:22 +0000 Received: from AM5EUR03FT024.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:e0:cafe::94) by AM6PR01CA0052.outlook.office365.com (2603:10a6:20b:e0::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.14 via Frontend Transport; Wed, 11 Aug 2021 10:26:22 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT024.mail.protection.outlook.com (10.152.16.175) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Wed, 11 Aug 2021 10:26:22 +0000 Received: ("Tessian outbound 79bfeeb089c1:v101"); Wed, 11 Aug 2021 10:26:21 +0000 Received: from 953aac4d7777.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 240EC2A7-6D33-475B-A18B-3652790E2523.1; Wed, 11 Aug 2021 10:26:15 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 953aac4d7777.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 11 Aug 2021 10:26:15 +0000 Received: from DU2PR04CA0214.eurprd04.prod.outlook.com (2603:10a6:10:2b1::9) by VE1PR08MB4655.eurprd08.prod.outlook.com (2603:10a6:802:b2::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.17; Wed, 11 Aug 2021 10:26:11 +0000 Received: from DB5EUR03FT028.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:2b1:cafe::c8) by DU2PR04CA0214.outlook.office365.com (2603:10a6:10:2b1::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.17 via Frontend Transport; Wed, 11 Aug 2021 10:26:11 +0000 Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT028.mail.protection.outlook.com (10.152.20.99) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4415.14 via Frontend Transport; Wed, 11 Aug 2021 10:26:11 +0000 Received: from AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2308.14; Wed, 11 Aug 2021 10:26:10 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Wed, 11 Aug 2021 10:26:10 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Wed, 11 Aug 2021 10:26:07 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 9914a608-fa8e-11eb-a052-12813bfff9fa 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=TC7LKln6ahLVf1ZtsKqkIlBSpfKHZSkuLzsKHx1whuA=; b=Uc2JWPzPk4RaPqmlEr/GhDjg2cAz3GGRbv+hvnvaG8jKLqrXJ6GNcynv78wy0/G/kiVN5bQKnFP0a02ewo5q4IZR43fSJnLw4tzN0tR7p9HQJZ0DBsXNYHo55k2KJZgHkSNHNm2xIlDpqgA3rnYH/5b1M7yH7ZpGb3qMYdVfwiU= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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; X-CheckRecipientChecked: true X-CR-MTA-CID: 3bfa62c877f4a58c X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NdeJ5BlmKjY522cuSEd9qU8CbBDNWUW3iyu9lpoLvLMmRX2XdEDaRJjSQOhXhH2RX8mcM9bqYdl0D/6h4F9WnNs50HMpBx5aYL32For8CW4YYmPhPYjgnVjoyeX/25W+s5OoAtOvTrSObHSzh8uSjzb3q7l120eNKxQ8PnJiGSInx5Ss85cbce9Oiuo7w8fcNRnsedrL2rAm5GJ+sHwpy8dJIwU6d73WLelnti70XQbyI7vz7UteuObHYtSIIA/o0PQv0OooOlASVLK6rUzlVs7LO2FrBgMGWTTp1Q1/pkGsS2ItmiwWSAhyS7ugJokOPrZYAGL/RAojKC/gv8x8xg== 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-SenderADCheck; bh=TC7LKln6ahLVf1ZtsKqkIlBSpfKHZSkuLzsKHx1whuA=; b=ofkOqKaPfY9ht1fZqEGgvNpFknD2uBrC5Nvs718ZXufR40CP0fjI2BEAPtEkR2NX20Tt1qysnekyOyq/KmL5c/q9hPwfYi5yguZjcRdxAp9kPpbMybtqIAYVJqxCloBrG7xvzxOdGyx/qpMjyg7dHCNCW/dOWZExmZfe9TBvPF9c6W0EYd60bsMTIN0NzLED4+ti7lpNO9lp5lp4KNDnYxqbsDvBdXNEVm6Ijaf9A7qck4DRHwE/vht0X4VJBVD4jps5EyyqRVbmVaYqYcOXveWsasaEEfiIp+svHjji3T+OKkOF5oE5moc4HIP5McMeOuF/EQwa8tui7a9O7e8HXQ== 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=TC7LKln6ahLVf1ZtsKqkIlBSpfKHZSkuLzsKHx1whuA=; b=Uc2JWPzPk4RaPqmlEr/GhDjg2cAz3GGRbv+hvnvaG8jKLqrXJ6GNcynv78wy0/G/kiVN5bQKnFP0a02ewo5q4IZR43fSJnLw4tzN0tR7p9HQJZ0DBsXNYHo55k2KJZgHkSNHNm2xIlDpqgA3rnYH/5b1M7yH7ZpGb3qMYdVfwiU= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; 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; From: Wei Chen To: , , , , CC: Subject: [XEN RFC PATCH 40/40] xen/x86: move dump_numa info hotkey to common Date: Wed, 11 Aug 2021 18:24:23 +0800 Message-ID: <20210811102423.28908-41-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210811102423.28908-1-wei.chen@arm.com> References: <20210811102423.28908-1-wei.chen@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 84d24e0e-22c8-4345-5baa-08d95cb27737 X-MS-TrafficTypeDiagnostic: VE1PR08MB4655:|AM6PR08MB4230: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:229;OLM:229; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: fFX9f+oxeHoOwV2hfG37Kz7uwFVyY9bLz/MhWCcCkRGrsxLSNVYijVsO1aerGdoIe+o+rd847lXAlXkWg1KWymJoE0TXN+8PBDYAUdfny/drOe0KoGC18LLhSuCW1Wf94D3cgniV23ORrmzZOFVInZWvUmlQDujHgWiZakTxQae+GNdvQqMV/8Yd2/ejsShTjCity6QDbc/CRscZxI371f0W3NhHr5zG7VoHndOBSxuyCd8jhOzU7EZoW50v8wP8Uu/a867tCIi7jMJT678giJxskun9MJ0coCSPIqXpzYZIZ0YSdZCIS7QbzmZuUZVORZwWoXmkJIaiFVGsBZ01hlgYg/DckKT1LsoaDFk6UR9WycE1LKJ4cgrzzHQ4kRY5cldwZdZQ+Oqcv/kDGbWB/we0NN+7nPxaohwB7BZiB7frdjzxAMKPyac28sZ2i3V1CtaIPzI4hUTUZ5oVjPP3XaMC4vFKzVqGMNtzs4V2rBqLa9mKekUJpUksygECdau9XJJFw9Ugn6MpluwgC04P4+GhRce+nEiwjaY9W2cuLGv3rlTUm/+FRirl6FGAv+OjVB2RnK1CconQTMAqMjfZKMxzH46CniVLaeX5V6aoUSGwhWqwIHkBKPLqbiRcXpX1QO54s/3QYrQVkpoVQk0895HJl5lW+u9iFPvVKurxWC1klV8QwMATJfRDzv/65icvQWaRVP9xDGZ9URUP4EO/XFBB48XWa+stEvnao83o5M0rl72QouvxvXwG5PBG3IrHY3y33CR993KKSui5Or0URTR7AKPYmB5TA06KskqPVpM= 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:(4636009)(39860400002)(346002)(376002)(136003)(396003)(36840700001)(46966006)(8936002)(8676002)(86362001)(2616005)(6666004)(36756003)(5660300002)(70586007)(82740400003)(44832011)(426003)(81166007)(70206006)(356005)(2906002)(186003)(83380400001)(82310400003)(34070700002)(110136005)(4326008)(478600001)(36860700001)(26005)(336012)(316002)(47076005)(1076003)(7696005)(2101003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB4655 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT024.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 9b9f83ae-760f-429f-031c-08d95cb270d9 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5DU+2zZSNl1eyuz7qzDXYiED0DI6w7LuuRK1fxt0BQXdqjE4yTFhXwpzZVLUSHR2qTvF0STRV6fR4MhHtZtKoI7cN+PpQBsObeexMOIBPkTuU+ZVBOVXmMVcDF6VJ5mbKYWWrE5++7HcaJ4j5PnHp8a85F2lGPzanVoYVfc+UlCG5MgOaHThchQMkq+UPXraJQGk1J7+R7VO+Mvyiy71bInaEbs8YNHfXDyyHdMXUlh8+vkbITQdH8YDVLL9sflSB/HwLt8xmgZmzCK8k2zGfRr5R+mqcmO1UeL35FvjfYKwD/xKa3nb4nr11+sPemHwEbkiXCazOtLwOcvPUFBNAzXdlqvS8ri86D21UDGWnbLOb+HBTW4hDiN0ueiuNL8l73LUENGNwwfABQON5tO4PY6UYx2dodmCUQkFpxEcjtJ8cYDqFNlOuGjRKXEl/bOrxmB2cVSo7zD3pYpMFkVWgL1TEJmVhsRcFgbkQzU/VX7jccJv7cGplX65pi+rRZs8TDf363Zk2kGY9C1SpqF5UtfXM+DXs3gqx7gIkF3s7gkA/xMcf7Fjl1oeBakMkgQ/EJrCShMJtXIPWsMxWxCuSTOC8ivgl5RynemeeU5AmOyM3ob+uwl1rEC57OTFNVOSCXFmv9F4yT6j4Hkx4DgvDqC8EgN29HX2HdknHJsvSwTTsSPK4Y2NHuQoCJJ4dSMmIGscpCqIhNt8WLPTGvk03ygpq8WB1li1MI6jiXmJhC8= 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:(4636009)(36840700001)(46966006)(4326008)(336012)(1076003)(186003)(44832011)(36860700001)(82310400003)(8936002)(81166007)(36756003)(7696005)(5660300002)(86362001)(70206006)(316002)(26005)(2616005)(70586007)(426003)(47076005)(110136005)(6666004)(83380400001)(508600001)(2906002)(8676002)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Aug 2021 10:26:22.2986 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 84d24e0e-22c8-4345-5baa-08d95cb27737 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: AM5EUR03FT024.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB4230 X-ZohoMail-DKIM: pass (identity @armh.onmicrosoft.com) X-ZM-MESSAGEID: 1628677917323100002 Content-Type: text/plain; charset="utf-8" As device tree based NUMA has been enabled for Arm, so not only x86 needs to dump numa info through hotkey, but also Arm can use this hotkey to dump numa info. In this patch, we move this hotkey to common. Arm can use it to dump its numa information: (XEN) key 'u' (ascii '75') =3D> dump NUMA info (XEN) 'u' pressed -> dumping numa info (now =3D 8805901249990) (XEN) NODE0 start->524288 size->520192 free->257673 (XEN) NODE1 start->8912896 size->524288 free->499676 (XEN) CPU0...1 -> NODE0 (XEN) CPU2...3 -> NODE1 (XEN) Memory location of each domain: (XEN) Domain 0 (total: 262144): (XEN) Node 0: 262144 (XEN) Node 1: 0 Signed-off-by: Wei Chen --- xen/arch/x86/numa.c | 142 ------------------------------------------- xen/common/numa.c | 144 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 144 insertions(+), 142 deletions(-) diff --git a/xen/arch/x86/numa.c b/xen/arch/x86/numa.c index 380d8ed6fd..322801cb17 100644 --- a/xen/arch/x86/numa.c +++ b/xen/arch/x86/numa.c @@ -112,145 +112,3 @@ int __init arch_meminfo_get_ram_bank_range(int bank, =20 return 0; } - -static void dump_numa(unsigned char key) -{ - s_time_t now =3D NOW(); - unsigned int i, j, n; - struct domain *d; - struct page_info *page; - unsigned int page_num_node[MAX_NUMNODES]; - const struct vnuma_info *vnuma; - - printk("'%c' pressed -> dumping numa info (now =3D %"PRI_stime")\n", k= ey, - now); - - for_each_online_node ( i ) - { - paddr_t pa =3D pfn_to_paddr(node_start_pfn(i) + 1); - - printk("NODE%u start->%lu size->%lu free->%lu\n", - i, node_start_pfn(i), node_spanned_pages(i), - avail_node_heap_pages(i)); - /* sanity check phys_to_nid() */ - if ( phys_to_nid(pa) !=3D i ) - printk("phys_to_nid(%"PRIpaddr") -> %d should be %u\n", - pa, phys_to_nid(pa), i); - } - - j =3D cpumask_first(&cpu_online_map); - n =3D 0; - for_each_online_cpu ( i ) - { - if ( i !=3D j + n || cpu_to_node[j] !=3D cpu_to_node[i] ) - { - if ( n > 1 ) - printk("CPU%u...%u -> NODE%d\n", j, j + n - 1, cpu_to_node= [j]); - else - printk("CPU%u -> NODE%d\n", j, cpu_to_node[j]); - j =3D i; - n =3D 1; - } - else - ++n; - } - if ( n > 1 ) - printk("CPU%u...%u -> NODE%d\n", j, j + n - 1, cpu_to_node[j]); - else - printk("CPU%u -> NODE%d\n", j, cpu_to_node[j]); - - rcu_read_lock(&domlist_read_lock); - - printk("Memory location of each domain:\n"); - for_each_domain ( d ) - { - process_pending_softirqs(); - - printk("Domain %u (total: %u):\n", d->domain_id, domain_tot_pages(= d)); - - for_each_online_node ( i ) - page_num_node[i] =3D 0; - - spin_lock(&d->page_alloc_lock); - page_list_for_each(page, &d->page_list) - { - i =3D phys_to_nid(page_to_maddr(page)); - page_num_node[i]++; - } - spin_unlock(&d->page_alloc_lock); - - for_each_online_node ( i ) - printk(" Node %u: %u\n", i, page_num_node[i]); - - if ( !read_trylock(&d->vnuma_rwlock) ) - continue; - - if ( !d->vnuma ) - { - read_unlock(&d->vnuma_rwlock); - continue; - } - - vnuma =3D d->vnuma; - printk(" %u vnodes, %u vcpus, guest physical layout:\n", - vnuma->nr_vnodes, d->max_vcpus); - for ( i =3D 0; i < vnuma->nr_vnodes; i++ ) - { - unsigned int start_cpu =3D ~0U; - - if ( vnuma->vnode_to_pnode[i] =3D=3D NUMA_NO_NODE ) - printk(" %3u: pnode ???,", i); - else - printk(" %3u: pnode %3u,", i, vnuma->vnode_to_pnode[= i]); - - printk(" vcpus "); - - for ( j =3D 0; j < d->max_vcpus; j++ ) - { - if ( !(j & 0x3f) ) - process_pending_softirqs(); - - if ( vnuma->vcpu_to_vnode[j] =3D=3D i ) - { - if ( start_cpu =3D=3D ~0U ) - { - printk("%d", j); - start_cpu =3D j; - } - } - else if ( start_cpu !=3D ~0U ) - { - if ( j - 1 !=3D start_cpu ) - printk("-%d ", j - 1); - else - printk(" "); - start_cpu =3D ~0U; - } - } - - if ( start_cpu !=3D ~0U && start_cpu !=3D j - 1 ) - printk("-%d", j - 1); - - printk("\n"); - - for ( j =3D 0; j < vnuma->nr_vmemranges; j++ ) - { - if ( vnuma->vmemrange[j].nid =3D=3D i ) - printk(" %016"PRIx64" - %016"PRIx64"\n", - vnuma->vmemrange[j].start, - vnuma->vmemrange[j].end); - } - } - - read_unlock(&d->vnuma_rwlock); - } - - rcu_read_unlock(&domlist_read_lock); -} - -static __init int register_numa_trigger(void) -{ - register_keyhandler('u', dump_numa, "dump NUMA info", 1); - return 0; -} -__initcall(register_numa_trigger); diff --git a/xen/common/numa.c b/xen/common/numa.c index c98eb8d571..eb1950c51a 100644 --- a/xen/common/numa.c +++ b/xen/common/numa.c @@ -14,7 +14,9 @@ #include #include #include +#include #include +#include #include =20 static int numa_setup(const char *s); @@ -442,3 +444,145 @@ static __init int numa_setup(const char *opt) =20 return 0; } + +static void dump_numa(unsigned char key) +{ + s_time_t now =3D NOW(); + unsigned int i, j, n; + struct domain *d; + struct page_info *page; + unsigned int page_num_node[MAX_NUMNODES]; + const struct vnuma_info *vnuma; + + printk("'%c' pressed -> dumping numa info (now =3D %"PRI_stime")\n", k= ey, + now); + + for_each_online_node ( i ) + { + paddr_t pa =3D pfn_to_paddr(node_start_pfn(i) + 1); + + printk("NODE%u start->%lu size->%lu free->%lu\n", + i, node_start_pfn(i), node_spanned_pages(i), + avail_node_heap_pages(i)); + /* sanity check phys_to_nid() */ + if ( phys_to_nid(pa) !=3D i ) + printk("phys_to_nid(%"PRIpaddr") -> %d should be %u\n", + pa, phys_to_nid(pa), i); + } + + j =3D cpumask_first(&cpu_online_map); + n =3D 0; + for_each_online_cpu ( i ) + { + if ( i !=3D j + n || cpu_to_node[j] !=3D cpu_to_node[i] ) + { + if ( n > 1 ) + printk("CPU%u...%u -> NODE%d\n", j, j + n - 1, cpu_to_node= [j]); + else + printk("CPU%u -> NODE%d\n", j, cpu_to_node[j]); + j =3D i; + n =3D 1; + } + else + ++n; + } + if ( n > 1 ) + printk("CPU%u...%u -> NODE%d\n", j, j + n - 1, cpu_to_node[j]); + else + printk("CPU%u -> NODE%d\n", j, cpu_to_node[j]); + + rcu_read_lock(&domlist_read_lock); + + printk("Memory location of each domain:\n"); + for_each_domain ( d ) + { + process_pending_softirqs(); + + printk("Domain %u (total: %u):\n", d->domain_id, domain_tot_pages(= d)); + + for_each_online_node ( i ) + page_num_node[i] =3D 0; + + spin_lock(&d->page_alloc_lock); + page_list_for_each(page, &d->page_list) + { + i =3D phys_to_nid(page_to_maddr(page)); + page_num_node[i]++; + } + spin_unlock(&d->page_alloc_lock); + + for_each_online_node ( i ) + printk(" Node %u: %u\n", i, page_num_node[i]); + + if ( !read_trylock(&d->vnuma_rwlock) ) + continue; + + if ( !d->vnuma ) + { + read_unlock(&d->vnuma_rwlock); + continue; + } + + vnuma =3D d->vnuma; + printk(" %u vnodes, %u vcpus, guest physical layout:\n", + vnuma->nr_vnodes, d->max_vcpus); + for ( i =3D 0; i < vnuma->nr_vnodes; i++ ) + { + unsigned int start_cpu =3D ~0U; + + if ( vnuma->vnode_to_pnode[i] =3D=3D NUMA_NO_NODE ) + printk(" %3u: pnode ???,", i); + else + printk(" %3u: pnode %3u,", i, vnuma->vnode_to_pnode[= i]); + + printk(" vcpus "); + + for ( j =3D 0; j < d->max_vcpus; j++ ) + { + if ( !(j & 0x3f) ) + process_pending_softirqs(); + + if ( vnuma->vcpu_to_vnode[j] =3D=3D i ) + { + if ( start_cpu =3D=3D ~0U ) + { + printk("%d", j); + start_cpu =3D j; + } + } + else if ( start_cpu !=3D ~0U ) + { + if ( j - 1 !=3D start_cpu ) + printk("-%d ", j - 1); + else + printk(" "); + start_cpu =3D ~0U; + } + } + + if ( start_cpu !=3D ~0U && start_cpu !=3D j - 1 ) + printk("-%d", j - 1); + + printk("\n"); + + for ( j =3D 0; j < vnuma->nr_vmemranges; j++ ) + { + if ( vnuma->vmemrange[j].nid =3D=3D i ) + printk(" %016"PRIx64" - %016"PRIx64"\n", + vnuma->vmemrange[j].start, + vnuma->vmemrange[j].end); + } + } + + read_unlock(&d->vnuma_rwlock); + } + + rcu_read_unlock(&domlist_read_lock); +} + +static __init int register_numa_trigger(void) +{ + register_keyhandler('u', dump_numa, "dump NUMA info", 1); + return 0; +} +__initcall(register_numa_trigger); --=20 2.25.1