From nobody Wed May 15 11:12:57 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=2 dmarc=pass fromdomain=arm.com); dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=3; a=rsa-sha256; t=1653287205; cv=pass; d=zohomail.com; s=zohoarc; b=NHU2lAtit0N4VfpPgFVWKlRlnoctweG17Wj9xrSMMPTxwubO0egskZZ+A36thshyd+JI4h46cXSy9u7evnOfx8ram9Q9+YiTJRaf0BeZJHXFdtSBMeiOve3kYmCocjP5ezocRCxisbuPeRe1gPfL+66u/eRp5U4Xg0S7F1AngCw= ARC-Message-Signature: i=3; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1653287205; 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=oo+mgb4JbHlmUNvz//rcx4bdSUBO9I8LAbHX+BGSbl8=; b=GYLtpGlAsB7/1pDXWuVJYqY31NWAaGP7c4X5wLZzKupQCWqsOVg2xp03moxnnjJR4bryYdaTsakhO2w2dMR3iP0NVvscspiuziQd/M32GHmaEJmmgEdgQ8XOBWVzbA/Qtmoila8m2tmPKK77P7Sj5Pg0e0XN/FFiKMx6700y97Q= ARC-Authentication-Results: i=3; 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=2 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 1653287205459489.5444930479838; Sun, 22 May 2022 23:26:45 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.335351.559515 (Exim 4.92) (envelope-from ) id 1nt1W5-00085d-Ck; Mon, 23 May 2022 06:26:09 +0000 Received: by outflank-mailman (output) from mailman id 335351.559515; Mon, 23 May 2022 06:26: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 1nt1W5-00085W-8w; Mon, 23 May 2022 06:26:09 +0000 Received: by outflank-mailman (input) for mailman id 335351; Mon, 23 May 2022 06:26:08 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nt1W3-0007pn-Ny for xen-devel@lists.xenproject.org; Mon, 23 May 2022 06:26:07 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on20630.outbound.protection.outlook.com [2a01:111:f400:7e1b::630]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 3a16bae3-da61-11ec-837e-e5687231ffcc; Mon, 23 May 2022 08:26:06 +0200 (CEST) Received: from AS8PR07CA0054.eurprd07.prod.outlook.com (2603:10a6:20b:459::32) by PAXPR08MB7549.eurprd08.prod.outlook.com (2603:10a6:102:24c::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.22; Mon, 23 May 2022 06:26:03 +0000 Received: from AM5EUR03FT047.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:459:cafe::c0) by AS8PR07CA0054.outlook.office365.com (2603:10a6:20b:459::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5293.12 via Frontend Transport; Mon, 23 May 2022 06:26:03 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT047.mail.protection.outlook.com (10.152.16.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.14 via Frontend Transport; Mon, 23 May 2022 06:26:02 +0000 Received: ("Tessian outbound 07c1c99345b0:v119"); Mon, 23 May 2022 06:26:02 +0000 Received: from b2b1ae26b73d.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 49E9562D-944A-4F42-8459-EA8E520D366B.1; Mon, 23 May 2022 06:25:55 +0000 Received: from EUR02-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id b2b1ae26b73d.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 23 May 2022 06:25:55 +0000 Received: from DB6P191CA0015.EURP191.PROD.OUTLOOK.COM (2603:10a6:6:28::25) by VI1PR08MB4302.eurprd08.prod.outlook.com (2603:10a6:803:fb::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.17; Mon, 23 May 2022 06:25:52 +0000 Received: from DBAEUR03FT028.eop-EUR03.prod.protection.outlook.com (2603:10a6:6:28:cafe::6c) by DB6P191CA0015.outlook.office365.com (2603:10a6:6:28::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.15 via Frontend Transport; Mon, 23 May 2022 06:25:51 +0000 Received: from nebula.arm.com (40.67.248.234) by DBAEUR03FT028.mail.protection.outlook.com (100.127.142.236) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5273.14 via Frontend Transport; Mon, 23 May 2022 06:25:51 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Mon, 23 May 2022 06:25:50 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.86) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2308.27 via Frontend Transport; Mon, 23 May 2022 06: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: 3a16bae3-da61-11ec-837e-e5687231ffcc ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=Fb4hL0yc09MLsc5zFMdAdz3FRS2CMqlYrpjijDzFgp4vypMRT6ZWxGCaRILJba5L3BRx4A3iVRKTsxMbmF/7uCuvgBD7RLHcQM2v7yPyYHssl6JtbEblpeycMLw1Zu+i4Z2IiQZncC9MFoEg+9pUkvRN/EV4+XUep5Wtklq6UXClBTBMurygzoj1E6xWWmAxTamaQQ8oVgfFvch+njX4GoxcVFVgzi/xgcHtVTYL5JlT2/jMQTfsldfnCZmeKUQ86aTJRpI8paajrWiSNNy2P+j1DdnFejsDlF/9o7NOOHYJVl6bsMJV8FuxIzLJ4qgJacVMkMztdF+8wg/TEnZOAQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=oo+mgb4JbHlmUNvz//rcx4bdSUBO9I8LAbHX+BGSbl8=; b=C6ey0GQe3dQ6sDy+bFe0OmrBZsl67YT3MOJYftRdhkJvEpALVxA8iX7jpvVuNmuDEOG8jiDeWWwehCeqZeZCJVgpzx7QyEW6wWXkvaiXxGDSGtSEn5Yr86mZvuDSRrm5isA8RgDW2V8i67Ggn+cVESpKY2M8GzsIfqKesmgPnu0JN3E0GRxkVffemqLrecDH0UalbQYG2hvoykOnIqioHNkd7iS940J8iTo2ypTrgmJFylhaXqFKVZoDAUF/9yjTq4uh7VaWvRqjezLRbrKuiXldrgtI+EvOvXKVTLpWPNe29VLymK6G/8ICXXMIZhAJU4iYBl9Gy0//3XMnc5GJpg== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dmarc=[1,1,header.from=arm.com]) 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=oo+mgb4JbHlmUNvz//rcx4bdSUBO9I8LAbHX+BGSbl8=; b=naldSN/AGHLaBYh1998QuFBtcCjP00xCEuLo1/iN/nL/JpwVveuXzJhPpPo4EWe2PO79lxpRIsg/jPF4LGvHaXc1I9e/djX/FVvX3HubpxhRhIebzNRa5jhTRF1ObgvbYWrW+CNd8MBzV5stmzLxOX7VfS1n7rfZaELxQTqtHag= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: pass (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; pr=C X-CheckRecipientChecked: true X-CR-MTA-CID: 10ac714f71a4c7c1 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ib1MBpQnmeGgtnymx/w4iwDdthDhyeILfda7T3zsGU4xk6r+QO2FoucSIAGNZsttkdYwTE+MytyPb2Yaju1aThdTa678jIH8J63TMDvXv4dfc8YgK0w+2B5KwvhRYhurPHO4QPtJf7U32CtqHeDqpTi2rTGF1R/DfJsOMI7yHY0Cedi/w962zssC3I6msAeTKXbRJANRJYkY69Dg83Xm3OirRvYFdNtZWphnbowGgrFGQmfvFO5f14LsdBhRoCls+RhRRPTlptpGoD6dr1Pabu6boZm60rYsaCNU9W590aLlxoFAkwkTgG79zpK0erccVipHqQjur6fQWNk0X8kvcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=oo+mgb4JbHlmUNvz//rcx4bdSUBO9I8LAbHX+BGSbl8=; b=XdmlnRwpK7W9eKfvbtLlNcPxCv5xnwt22rLyJT6mXaKeiN6psNuFm+Z/+WRjBKAYn/bLfVyKenfUSyLPxKkOGXnaXeMr+9ti5Cu7zgWOH/JwBV7Gti1xzomQFmH9VSbvfA+t4OkMhLxdsOwbWhQJThHTpwOjOeJxHBniokURFmQW+pRY7BCmbFfcejQdlxLkh6vVCG7G8nRm5/flfYUrISgsMbsO8bb14q4ODMs5Q34CV4Cp43WYBj4glvi0S0OGikQgDepDYGPjYp7iUW0hHmNO2v21TLrYT6K278JoTPAuDnK7DgDp9I26+uVkgZxsHJ7VR0Ixw2Y+gUdODBdZSw== 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=oo+mgb4JbHlmUNvz//rcx4bdSUBO9I8LAbHX+BGSbl8=; b=naldSN/AGHLaBYh1998QuFBtcCjP00xCEuLo1/iN/nL/JpwVveuXzJhPpPo4EWe2PO79lxpRIsg/jPF4LGvHaXc1I9e/djX/FVvX3HubpxhRhIebzNRa5jhTRF1ObgvbYWrW+CNd8MBzV5stmzLxOX7VfS1n7rfZaELxQTqtHag= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C From: Wei Chen To: CC: , Wei Chen , Stefano Stabellini , Julien Grall , Bertrand Marquis , Volodymyr Babchuk , Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Wei Liu , Jiamei Xie Subject: [PATCH v4 1/8] xen: reuse x86 EFI stub functions for Arm Date: Mon, 23 May 2022 14:25:18 +0800 Message-ID: <20220523062525.2504290-2-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220523062525.2504290-1-wei.chen@arm.com> References: <20220523062525.2504290-1-wei.chen@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-Correlation-Id: 6caa2191-6d48-4feb-44a2-08da3c851c48 X-MS-TrafficTypeDiagnostic: VI1PR08MB4302:EE_|AM5EUR03FT047:EE_|PAXPR08MB7549:EE_ X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: GMommwcAWmF5rJFW2Wu1Kgcte/Ed+NVBxpzCuyepcEV9VD/vLKnli3RCFMzy9rJr2L4zVF+tHtI+ivggU5ao/dYfiXEeX3+TPA3voU/msu08gkKkJQGTw4D3QOEerrXUmyJslmTRdXLBJH5wtJBD18LJs/MF/tfDQazejkc3tuaYAYbbREWIxLIku1zRmRqom8zo4x1Rto7e5q5G599m73LMssCFyRvwzTc9b9JxWhWpujaPqy6TorOFxaf5Oe78QV54hihGnOmswqBC6q/uH0nAli6PUSYgeQmyV7/YGh+CYDCoeqoektpQht3oi0PL7hMahX0ILVCOBte59+4jWaEw9YOI7vr4q691qgFAEWwhbSRRXw0voAI9IukslAzmoe4NkC5qNtf24lKR6K0DS9i6ABa+U+CyINcBplCm6JiiHcfnhtM/LcCQHgknLHx5BDFEu4qhRQaCX61aI4u/JQmp8zICDEi4VU0s0ufBVKh+1UGyHz3mGOxkfjIG+yr9ZD1J+2idXpSyo4FCROlgulSNvRgfvqxlsqxfz1e+5XOYyy8UHlQraBXX+Lo0ZKV8Sa2YGodgNoixAbQkQpjLAGplG4cGfsdTZgdkLZZRvTXSF6ZbPARtMxgfmtMw2nWTg7FnpM/Lu8IbPczitwnqktwzQEvR3yDIc8xBdR8z27dAz6qi2V0Ea2pdSQ/Iu45T2tkIkXsCxrIjKrlUiWnkYQ== 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:(13230001)(4636009)(36840700001)(46966006)(82310400005)(5660300002)(2616005)(81166007)(36860700001)(36756003)(44832011)(2906002)(8936002)(6666004)(316002)(356005)(426003)(86362001)(1076003)(26005)(70206006)(7696005)(70586007)(508600001)(6916009)(54906003)(8676002)(47076005)(83380400001)(336012)(4326008)(186003)(21314003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB4302 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT047.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: deb31881-8cac-49e3-1bb3-08da3c851574 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xVjx4cgcVqh5ZvtKZQ00GezPeE539MZimGr6hhBxFlJeVIXKLOk+7gOrCkBxFhtE3PuWO0xrJxz1GNf3QzmBGZHTugZW3fzQVUD25LWXPrU4mqP8ax8JQSipaRqIQ8WB8h6vyGLdccy93uHD3ojJCigDn3f+M/szeRsvX2TcdfH1OYx9HEYHNKMUXJE80U7iixEk9lR1v0/0pNgxtSYsoXzWEiZCwmKPtjBvlu3hczThQxWlOI7BCui6/y/bf3XdfgKy8rj2u3W8WneDPJ/jTPvYGO3DcOTyRlTvSEYe6mp9HzgsbRkmLcxVbvQOdB8gHZjL4bv48/2Fn9s/JX9WtN+KLED9Op0NFKUTRWCnXrKwe2yjclIorPrD6fiZ4DWdpUS3gPSuxB1mhaG57T3+U+yNnYuhK+gnAhvOu8vl8LafXm3A1gz4CE0mcpkw9aHA/NAq/t0CzVSbYsGy8v3TiOkXrky75PVShuNAzbInhNfVm3h80cP8VmMnkYa1dJLF6iAagWwt32q7gkM+eIW4OzOFC/VEwGgukb4G+zLbsb2dhvSF6aVm3HldfOlE83/SoQJm29CUgUtSJAVz1UjowlzRRhCUsVw53R3ctoQTEiC1giolC/0vc1snGtzTaVCadpUfn8ekp0PQR8kMHyf68rgTUP7eOEAk6GWT1WVcvwASFICQ6EC4qdkLHcEMERAIKh56CxSfQBkQoc7LjaJCqg== 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:(13230001)(4636009)(46966006)(40470700004)(36840700001)(70586007)(70206006)(83380400001)(6666004)(40460700003)(2616005)(7696005)(316002)(36860700001)(82310400005)(8676002)(2906002)(336012)(5660300002)(4326008)(47076005)(426003)(1076003)(26005)(8936002)(81166007)(508600001)(6916009)(54906003)(36756003)(44832011)(86362001)(186003)(21314003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 May 2022 06:26:02.8536 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6caa2191-6d48-4feb-44a2-08da3c851c48 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: AM5EUR03FT047.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB7549 X-ZohoMail-DKIM: pass (identity @armh.onmicrosoft.com) X-ZM-MESSAGEID: 1653287206904100007 Content-Type: text/plain; charset="utf-8" x86 is using compiler feature testing to decide EFI build enable or not. When EFI build is disabled, x86 will use an efi/stub.c file to replace efi/runtime.c for build objects. Following this idea, we introduce a stub file for Arm, but use CONFIG_ARM_EFI to decide EFI build enable or not. And the most functions in x86 EFI stub.c can be reused for other architectures, like Arm. So we move them to common and keep the x86 specific function in x86/efi/stub.c. To avoid the symbol link conflict error when linking common stub files to x86/efi. We add a regular file check in efi stub files' link script. Depends on this check we can bypass the link behaviors for existed stub files in x86/efi. As there is no Arm specific EFI stub function for Arm in current stage, Arm still can use the existed symbol link method for EFI stub files. Change-Id: Idf19db1ada609d05fc0c0c3b0e1e8687c9d6ac71 Issue-Id: SCM-2240 Signed-off-by: Wei Chen Tested-by: Jiamei Xie Acked-by: Jan Beulich --- v3 -> v4: 1. Add indent to make ln and test to be aligned. v2 -> v3: 1. Add existed file check, if a regular stub files, the common/stub files' link will be ignored. 2. Keep stub.c in x86/efi to include common/efi/stub.c 3. Restore efi_compat_xxx stub functions to x86/efi.c. Other architectures will not use efi_compat_xxx. 4. Remove ARM_EFI dependency from ARM_64. 5. Add comment for adding stub.o to EFIOBJ-y. 6. Merge patch#2 and patch#3 to one patch. v1 -> v2: 1. Drop the copy of stub.c from Arm EFI. 2. Share common codes of x86 EFI stub for other architectures. 3. Use CONFIG_ARM_EFI to replace CONFIG_EFI 4. Remove help text and make CONFIG_ARM_EFI invisible. 5. Merge one following patch: xen/arm: introduce a stub file for non-EFI architectures 6. Use the common stub.c instead of creating new one. --- xen/arch/arm/Kconfig | 4 ++++ xen/arch/arm/Makefile | 2 +- xen/arch/arm/efi/Makefile | 8 ++++++++ xen/arch/x86/efi/stub.c | 32 +------------------------------- xen/common/efi/efi-common.mk | 3 ++- xen/common/efi/stub.c | 32 ++++++++++++++++++++++++++++++++ 6 files changed, 48 insertions(+), 33 deletions(-) create mode 100644 xen/common/efi/stub.c diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig index ecfa6822e4..8a16d43bd5 100644 --- a/xen/arch/arm/Kconfig +++ b/xen/arch/arm/Kconfig @@ -6,6 +6,7 @@ config ARM_64 def_bool y depends on !ARM_32 select 64BIT + select ARM_EFI select HAS_FAST_MULTIPLY =20 config ARM @@ -33,6 +34,9 @@ config ACPI Advanced Configuration and Power Interface (ACPI) support for Xen is an alternative to device tree on ARM64. =20 +config ARM_EFI + bool + config GICV3 bool "GICv3 driver" depends on ARM_64 && !NEW_VGIC diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile index 1d862351d1..bb7a6151c1 100644 --- a/xen/arch/arm/Makefile +++ b/xen/arch/arm/Makefile @@ -1,6 +1,5 @@ obj-$(CONFIG_ARM_32) +=3D arm32/ obj-$(CONFIG_ARM_64) +=3D arm64/ -obj-$(CONFIG_ARM_64) +=3D efi/ obj-$(CONFIG_ACPI) +=3D acpi/ obj-$(CONFIG_HAS_PCI) +=3D pci/ ifneq ($(CONFIG_NO_PLAT),y) @@ -20,6 +19,7 @@ obj-y +=3D domain.o obj-y +=3D domain_build.init.o obj-y +=3D domctl.o obj-$(CONFIG_EARLY_PRINTK) +=3D early_printk.o +obj-y +=3D efi/ obj-y +=3D gic.o obj-y +=3D gic-v2.o obj-$(CONFIG_GICV3) +=3D gic-v3.o diff --git a/xen/arch/arm/efi/Makefile b/xen/arch/arm/efi/Makefile index 4313c39066..dffe72e589 100644 --- a/xen/arch/arm/efi/Makefile +++ b/xen/arch/arm/efi/Makefile @@ -1,4 +1,12 @@ include $(srctree)/common/efi/efi-common.mk =20 +ifeq ($(CONFIG_ARM_EFI),y) obj-y +=3D $(EFIOBJ-y) obj-$(CONFIG_ACPI) +=3D efi-dom0.init.o +else +# Add stub.o to EFIOBJ-y to re-use the clean-files in +# efi-common.mk. Otherwise the link of stub.c in arm/efi +# will not be cleaned in "make clean". +EFIOBJ-y +=3D stub.o +obj-y +=3D stub.o +endif diff --git a/xen/arch/x86/efi/stub.c b/xen/arch/x86/efi/stub.c index 9984932626..f2365bc041 100644 --- a/xen/arch/x86/efi/stub.c +++ b/xen/arch/x86/efi/stub.c @@ -1,7 +1,5 @@ #include -#include #include -#include #include #include #include @@ -10,6 +8,7 @@ #include #include #include +#include "../../../common/efi/stub.c" =20 /* * Here we are in EFI stub. EFI calls are not supported due to lack @@ -45,11 +44,6 @@ void __init noreturn efi_multiboot2(EFI_HANDLE ImageHand= le, unreachable(); } =20 -bool efi_enabled(unsigned int feature) -{ - return false; -} - void __init efi_init_memory(void) { } =20 bool efi_boot_mem_unused(unsigned long *start, unsigned long *end) @@ -62,32 +56,8 @@ bool efi_boot_mem_unused(unsigned long *start, unsigned = long *end) =20 void efi_update_l4_pgtable(unsigned int l4idx, l4_pgentry_t l4e) { } =20 -bool efi_rs_using_pgtables(void) -{ - return false; -} - -unsigned long efi_get_time(void) -{ - BUG(); - return 0; -} - -void efi_halt_system(void) { } -void efi_reset_system(bool warm) { } - -int efi_get_info(uint32_t idx, union xenpf_efi_info *info) -{ - return -ENOSYS; -} - int efi_compat_get_info(uint32_t idx, union compat_pf_efi_info *) __attribute__((__alias__("efi_get_info"))); =20 -int efi_runtime_call(struct xenpf_efi_runtime_call *op) -{ - return -ENOSYS; -} - int efi_compat_runtime_call(struct compat_pf_efi_runtime_call *) __attribute__((__alias__("efi_runtime_call"))); diff --git a/xen/common/efi/efi-common.mk b/xen/common/efi/efi-common.mk index 4298ceaee7..ec2c34f198 100644 --- a/xen/common/efi/efi-common.mk +++ b/xen/common/efi/efi-common.mk @@ -9,7 +9,8 @@ CFLAGS-y +=3D -iquote $(srcdir) # e.g.: It transforms "dir/foo/bar" into successively # "dir foo bar", ".. .. ..", "../../.." $(obj)/%.c: $(srctree)/common/efi/%.c FORCE - $(Q)ln -nfs $(subst $(space),/,$(patsubst %,..,$(subst /, ,$(obj))))/sour= ce/common/efi/$( +#include +#include + +bool efi_enabled(unsigned int feature) +{ + return false; +} + +bool efi_rs_using_pgtables(void) +{ + return false; +} + +unsigned long efi_get_time(void) +{ + BUG(); + return 0; +} + +void efi_halt_system(void) { } +void efi_reset_system(bool warm) { } + +int efi_get_info(uint32_t idx, union xenpf_efi_info *info) +{ + return -ENOSYS; +} + +int efi_runtime_call(struct xenpf_efi_runtime_call *op) +{ + return -ENOSYS; +} --=20 2.25.1 From nobody Wed May 15 11:12:57 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=2 dmarc=pass fromdomain=arm.com); dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=3; a=rsa-sha256; t=1653287204; cv=pass; d=zohomail.com; s=zohoarc; b=LGBWpuhEyVx6eFORAScsVB7Ni6dPqD+Cf58UkAsgNFfyCD+IFqNwsgOkzPIZoaHPikcFGPGoyh3P6EyJeQFg6SgCz5nyyDwi0eRet6Uhzklxlo57JO68yXzdIywVuO+CdVDnoSU09dGJLkPe7QCznUfbvVgP9D5HNVEls4ZZ0o8= ARC-Message-Signature: i=3; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1653287204; 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=T3Bvh2fxVQKbOjJTKRlirSTts06RHaeGkbdUGi12wmA=; b=Z09rfAGKZ1Y5+GVcp4GNamUmFwYzyP35TLqnU+6q+brP5e2B1xYTe9XdGxtCEPnqx3FKLTBlIH+IemdxBSvSwBdnu2TVzFp53ofhrzSkGH8NIpfyqEX1Ryhp7+JFImUWIcVlA+d3+snuVhiDxvEByVF33nah969TvoD64GF03iM= ARC-Authentication-Results: i=3; 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=2 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 1653287204362471.7444732429892; Sun, 22 May 2022 23:26:44 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.335353.559536 (Exim 4.92) (envelope-from ) id 1nt1WD-0000H6-2n; Mon, 23 May 2022 06:26:17 +0000 Received: by outflank-mailman (output) from mailman id 335353.559536; Mon, 23 May 2022 06:26:17 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nt1WC-0000Ga-Vu; Mon, 23 May 2022 06:26:16 +0000 Received: by outflank-mailman (input) for mailman id 335353; Mon, 23 May 2022 06:26:16 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nt1WC-0008Q2-2c for xen-devel@lists.xenproject.org; Mon, 23 May 2022 06:26:16 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on0614.outbound.protection.outlook.com [2a01:111:f400:fe0d::614]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 3e95f427-da61-11ec-bd2c-47488cf2e6aa; Mon, 23 May 2022 08:26:14 +0200 (CEST) Received: from AM5PR0701CA0014.eurprd07.prod.outlook.com (2603:10a6:203:51::24) by AM0PR08MB3827.eurprd08.prod.outlook.com (2603:10a6:208:104::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.14; Mon, 23 May 2022 06:26:06 +0000 Received: from VE1EUR03FT064.eop-EUR03.prod.protection.outlook.com (2603:10a6:203:51:cafe::69) by AM5PR0701CA0014.outlook.office365.com (2603:10a6:203:51::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5293.12 via Frontend Transport; Mon, 23 May 2022 06:26:06 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT064.mail.protection.outlook.com (10.152.19.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.14 via Frontend Transport; Mon, 23 May 2022 06:26:05 +0000 Received: ("Tessian outbound 6580ae46f51e:v119"); Mon, 23 May 2022 06:26:05 +0000 Received: from da875ee8d977.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 21F0A427-C99C-43AC-8521-962A7984EE93.1; Mon, 23 May 2022 06:25:58 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id da875ee8d977.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 23 May 2022 06:25:58 +0000 Received: from AM6P193CA0110.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:85::15) by AM6PR08MB3336.eurprd08.prod.outlook.com (2603:10a6:209:41::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.16; Mon, 23 May 2022 06:25:56 +0000 Received: from VE1EUR03FT063.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:85:cafe::f) by AM6P193CA0110.outlook.office365.com (2603:10a6:209:85::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.15 via Frontend Transport; Mon, 23 May 2022 06:25:56 +0000 Received: from nebula.arm.com (40.67.248.234) by VE1EUR03FT063.mail.protection.outlook.com (10.152.18.236) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5273.14 via Frontend Transport; Mon, 23 May 2022 06:25:55 +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.27; Mon, 23 May 2022 06:25:54 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) 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.27; Mon, 23 May 2022 06:25:53 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.86) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2308.27 via Frontend Transport; Mon, 23 May 2022 06:25: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: 3e95f427-da61-11ec-bd2c-47488cf2e6aa ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=Y7m3nVdANowdvf2tVP9Es8exkjovarxVOk4cOG+cJN0dHqaNQ0yAT7bz7RtizrPAVo5YfiWa1suOvKV1EHOV+sQ35RnoAxWVGxhyX9nVsNMzSlAkkzpkERtCXeXDO88AihZxvuzWIP6h3FUR2ZOQuAJyraWo8a6AMQI85kKQyJtfjVRfwj3mTI8lSasNXXFOKYWaDRMMgKxMVhXcM/8Wnp6sJTUysc973ZJa6qgZflb6DMJZJiy0hDoGduK63h7tad1gj/9NDGLIf8UO+brzycTmseuVxsdB6ccYIVCpxBDUxXx06465Xs+nVVHHc5nR+Y/QQRRhDbFFUpm2Gm5OfQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=T3Bvh2fxVQKbOjJTKRlirSTts06RHaeGkbdUGi12wmA=; b=Cpf1lZ1/0dK7htdifj13RRQ20fB8tNeVOoIdRL/XFuIHW0ryFgEyv8JlFOAMbJnCeIKofG3ZXuOKLgP08Jakt6K9GT9gf/xvsUSeMkvlE9oysQ4oPIuhUIEaKT/S4Tgiywct3DowTpxEOvy7bWXKn2NUNg9yGVUH+Kvklyp509VNXGT2nbAteObRZQl0jr0xn5PE0wlLsY8HqxpkaHSsInU8TjYE4EerqMsTkNoS5nvB9GZmjXhaLDoimQkObGFNTSljWE1UtpfK/+LRrkjSa1B2em2xLTKBRc//gb3bUXFRnui8szVQi5xKMJ8JIDEJ7sTh4yrPxbXeG+oA5MP0Wg== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dmarc=[1,1,header.from=arm.com]) 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=T3Bvh2fxVQKbOjJTKRlirSTts06RHaeGkbdUGi12wmA=; b=xULc6Pedz5pXWao5FTyRojNZ+Hgs/001uB45mBEqr24NcvA6mgM2la3n0g5rj9zkszCOyV2leGK7UmFuDegi09hHznruI2Vg+2cHxmIJicE6X00I3N5xCqo4kmfA6gXv1t9tUny39AGa4YRTgrQ2/Ft3G6KXOxIQUxd4D8/1Vzg= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: pass (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; pr=C X-CheckRecipientChecked: true X-CR-MTA-CID: 270bdc83925346d5 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QP7UzN22hKthGQljDyM+tGb4qsuKWMnWw59lwAbVwIgO+XSB6BZktXkEloXC4dD9tHalNq0Xk0gYfBEGosCwW3WLbSWF+7ZffBRXqWZ5H1G5h9IQU/ktZVHmGOJLac6mUFUWeqC9n9HxsyRAm0bRi9Ebtm84dC+FZiNCmt4v5KhqFONRSgYv/O9ZBptDlfeQMqcZS0UiT9Y/BgiOuddIB2ZvqlwWDcRAfrDZR5NBG0S+91SpKjmIeVY2nWTkoSmQjHc4CMCKwIeqoTPI6PYddBbXOfsT3lwsJ4FTLfss8oSkupRuz441uYPBlJT/4+vu0oFnxmgiBh/pRceXrlkjMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=T3Bvh2fxVQKbOjJTKRlirSTts06RHaeGkbdUGi12wmA=; b=XuJQ8gKFZppNJVytLZ13qHoeaPRFZpFkpMH5sb/UDuQc4J2Fkm/ofuamnB1ApHLKfXWPgeF0hdSuppieqXnfvAQYRENc0H+inQ4jLV872DoM9EgQFcTCOU7F19UAIXIjLssunTbMjORE/F3bzIud1RVdGydDTsIwO0K//hoV6WUBue/ECSY0v/NH3oycV0yikapFOE5WUPoTnQh/l7gV1vcWxvzINY2WipXLFmNVhx7+AhE2FKRv6UkjlJHWZc7/Ry7xjVigciDAkeP4HZ/A45aDRbm13outmgchP+olwQ+2IeiMJASbhygSYW8AwBIu4MsacdmcpPPa7C+SBQhAQA== 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=T3Bvh2fxVQKbOjJTKRlirSTts06RHaeGkbdUGi12wmA=; b=xULc6Pedz5pXWao5FTyRojNZ+Hgs/001uB45mBEqr24NcvA6mgM2la3n0g5rj9zkszCOyV2leGK7UmFuDegi09hHznruI2Vg+2cHxmIJicE6X00I3N5xCqo4kmfA6gXv1t9tUny39AGa4YRTgrQ2/Ft3G6KXOxIQUxd4D8/1Vzg= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C From: Wei Chen To: CC: , Wei Chen , Stefano Stabellini , Julien Grall , Bertrand Marquis , Volodymyr Babchuk , Jiamei Xie Subject: [PATCH v4 2/8] xen/arm: Keep memory nodes in device tree when Xen boots from EFI Date: Mon, 23 May 2022 14:25:19 +0800 Message-ID: <20220523062525.2504290-3-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220523062525.2504290-1-wei.chen@arm.com> References: <20220523062525.2504290-1-wei.chen@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-Correlation-Id: 5b99b23b-7e10-433b-8d7e-08da3c851e22 X-MS-TrafficTypeDiagnostic: AM6PR08MB3336:EE_|VE1EUR03FT064:EE_|AM0PR08MB3827:EE_ X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: cf2B1NtiL6CTXvhKzZ9LIItc1aGkDmOatslT44HU/4DRyUijrLnX0nX2liXVFal5TLSJwFckhxrh6mycj1VzzZe+cGbJb1T/ZGiHkOii13CVcDBNgzo7RcwvppyI1qqsV7sidG0Lad5V9pymZUUVZpAFwT6eFLhfPQyR6tMnMojRpfClNdvcfB313CjZ1kSqXK0aZzINyHsva0vmBzXPGdkQC9vqHxLloki9vUSL9UiIiYGFmET7Jq5Q30dhviHyDuZMrof2DUnAWAUsVn1kMdslOOOG2KxSnJJD+n1xG2VMKmG3xTJhkUYJ2w6nsmB6SrO1W/BD6CF++Zyc2ukaWMndvegsdMFt+gVJ8Kf9Oh2SHWOaU3zsC+g8TSyp0h8Em5WfrQTN6Uth+ZCN1ajVS3LfSevIJpyC6JkaMJ13CVUBIjy7cHqSddO+sEAA81InmHvNRp2GyLOZIKhDDXgv4sbDMHRGcYHQmuG4CkvASqzORR+rjTtE1stW9dh0GB6j2b5Uhl0dtWpiI9/uq5SqRfxUp4eN7bP4jOTWRB2SUGQx8pUmgPTU9ylSexQdew4xaVv0oMVhcGp7/EjgCEyXyGzoK6KybHe3hnIa/mg6Xnpq8X2jQQz57Y723cQomgVg9UT4rWUuWUVKWpADNeiiphncaSrUyhU/39LYWQj28uP35MAftF1mRLh+TSn1pIa9Zw3i+m6Wqt2e106dJLw5Ig== 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:(13230001)(4636009)(40470700004)(46966006)(36840700001)(44832011)(426003)(36860700001)(508600001)(6916009)(47076005)(336012)(54906003)(1076003)(40460700003)(83380400001)(2906002)(316002)(26005)(6666004)(70206006)(7696005)(86362001)(356005)(2616005)(82310400005)(5660300002)(8676002)(70586007)(36756003)(8936002)(186003)(81166007)(4326008)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3336 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT064.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 3545e596-d5a7-4818-057b-08da3c8517e7 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AB3k6r/Nx8px9orO3za25NCNhRjOJecfHwWOt/fxvC3W3p3vTI8tCVYSLcRFjUXL3DWYoEFwKQBOqnaKQeiwtzsX7lNnD45KjqT3fuYSQK4HwNKHWzn5/NRtDYZctIUyA0sNsH2Q+8Ts3GSnWM+NEjtj8O11MTVY6k7aAv4IwTN5lw6bd1EqPJWWLGV19Ow8mYdr26FEJy6hD3Twr/dyJCc8f4lQ8slhQpy2RuMgh374w6WsWpVmTjmuDO1kOBIeOk0+0gqt4v0Pgex9uVPgZTaXQodt2j0Ca9IHE1jynRPYgjMfToFc3n25wX6yNZKk6U3wsbmPX3JMjJ2eUDB0KpOGhNW2+iK4ZCXqTU1TGBZrCOarz0pUpkTwwuAfTaU8DrlzIArbLWrCrl5geHKAmmBNaFw4547b+Wqn7xQVafi6e2Y7Mk+Mk5bRpxTBW6qcndg7ETGJXZGdxvm921YLqijGUzWmPo0pI9BQEa/ZC6IOM08hojRUoJd2I4lgrV76TKFRoi4aGjnD6kMm9XmgSeHWJC56UZhCdauryh8lJVkvDQEZyNr3jvMsV/oWFQ0Tlczd9VI9/MlTnXbem98uqBpfVG64AmggKQ3CLomN4NRyYz6v0/zXMqHv8gGhIFl6xHmvFDhRsd1dvIJQCvr7REimEqSGRci1SPMSAEvMTJj8M9xhJwp42nH9YeFH8OJH 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:(13230001)(4636009)(46966006)(40470700004)(36840700001)(5660300002)(70586007)(70206006)(8676002)(26005)(44832011)(86362001)(4326008)(8936002)(2906002)(40460700003)(81166007)(6666004)(54906003)(6916009)(508600001)(186003)(1076003)(336012)(7696005)(82310400005)(426003)(47076005)(36860700001)(2616005)(83380400001)(316002)(36756003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 May 2022 06:26:05.9216 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5b99b23b-7e10-433b-8d7e-08da3c851e22 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: VE1EUR03FT064.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB3827 X-ZohoMail-DKIM: pass (identity @armh.onmicrosoft.com) X-ZM-MESSAGEID: 1653287205357100001 Content-Type: text/plain; charset="utf-8" In current code, when Xen is booting from EFI, it will delete all memory nodes in device tree. This would work well in current stage, because Xen can get memory map from EFI system table. However, EFI system table cannot completely replace memory nodes of device tree. EFI system table doesn't contain memory NUMA information. Xen depends on ACPI SRAT or device tree memory nodes to parse memory blocks' NUMA mapping. So in EFI + DTB boot, Xen doesn't have any method to get numa-node-id for memory blocks any more. This makes device tree based NUMA support become impossible for Xen in EFI + DTB boot. 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 prevent early_scan_node to parse memory nodes in EFI boot. Change-Id: Ia1acab203887114c9f31cb3eeeb38794868efc9d Issue-Id: SCM-2240 Signed-off-by: Wei Chen Tested-by: Jiamei Xie Reviewed-by: Stefano Stabellini --- v3 -> v4: 1. No change. v2 -> v3: 1. Add Rb. v1 -> v2: 1. Move this patch from later to early of this series. 2. Refine commit message. --- xen/arch/arm/bootfdt.c | 8 +++++++- xen/arch/arm/efi/efi-boot.h | 25 ------------------------- 2 files changed, 7 insertions(+), 26 deletions(-) diff --git a/xen/arch/arm/bootfdt.c b/xen/arch/arm/bootfdt.c index 29671c8df0..ec81a45de9 100644 --- a/xen/arch/arm/bootfdt.c +++ b/xen/arch/arm/bootfdt.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -367,7 +368,12 @@ static int __init early_scan_node(const void *fdt, { int rc =3D 0; =20 - if ( device_tree_node_matches(fdt, node, "memory") ) + /* + * If Xen has been booted via UEFI, the memory banks are + * populated. So we should skip the parsing. + */ + if ( !efi_enabled(EFI_BOOT) && + device_tree_node_matches(fdt, node, "memory") ) 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 e452b687d8..59d93c24a1 100644 --- a/xen/arch/arm/efi/efi-boot.h +++ b/xen/arch/arm/efi/efi-boot.h @@ -231,33 +231,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. --=20 2.25.1 From nobody Wed May 15 11:12:57 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=2 dmarc=pass fromdomain=arm.com); dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=3; a=rsa-sha256; t=1653287208; cv=pass; d=zohomail.com; s=zohoarc; b=kdeOM2Sm160e3Al8h2MbAtUFXrORpQVvRDvIk2rErdMybt75c/dYUBt43vx33gckdfXnQkDmTTwGTVk7eDw04AF6CSK5cmc/vnYZeQrnVy6tIdpDGvsFYahb/vCuVkY2HWkurAloMGysRaEbM3qp9wVUC4SUe+aAC6kVnpfvW4s= ARC-Message-Signature: i=3; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1653287208; 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=+h4lby9uhtIt+w9bPcDu7mqnxP5TtPdNw4xy2M6UuS8=; b=DvdFACHd7RLpbxkRRVqhyChDJlbSIRtztfgHPD+3ozcPhka+Nlmu9D4aF9Ve4F6LN9dKca23q1vlEGM2cpZdoYZWHPplSWbMk38c5ZclbHmC2KGT2s26LGGHNzmbpaYJTSGKGvwPr7Ql62raoA9IiAtN135i47B1GoBY8JdTdyU= ARC-Authentication-Results: i=3; 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=2 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 1653287208499283.95213128799264; Sun, 22 May 2022 23:26:48 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.335352.559526 (Exim 4.92) (envelope-from ) id 1nt1WB-0008Qh-Px; Mon, 23 May 2022 06:26:15 +0000 Received: by outflank-mailman (output) from mailman id 335352.559526; Mon, 23 May 2022 06:26: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 1nt1WB-0008QY-Lp; Mon, 23 May 2022 06:26:15 +0000 Received: by outflank-mailman (input) for mailman id 335352; Mon, 23 May 2022 06:26:14 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nt1W9-0007pn-Rf for xen-devel@lists.xenproject.org; Mon, 23 May 2022 06:26:14 +0000 Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-am5eur03on060d.outbound.protection.outlook.com [2a01:111:f400:fe08::60d]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 3deefd84-da61-11ec-837e-e5687231ffcc; Mon, 23 May 2022 08:26:12 +0200 (CEST) Received: from DB6PR0501CA0014.eurprd05.prod.outlook.com (2603:10a6:4:8f::24) by AM9PR08MB6802.eurprd08.prod.outlook.com (2603:10a6:20b:308::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.15; Mon, 23 May 2022 06:26:11 +0000 Received: from DBAEUR03FT037.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:8f:cafe::6d) by DB6PR0501CA0014.outlook.office365.com (2603:10a6:4:8f::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.22 via Frontend Transport; Mon, 23 May 2022 06:26:11 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DBAEUR03FT037.mail.protection.outlook.com (100.127.142.208) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.14 via Frontend Transport; Mon, 23 May 2022 06:26:10 +0000 Received: ("Tessian outbound 3314dea8c23c:v119"); Mon, 23 May 2022 06:26:10 +0000 Received: from 789b36f4b8f4.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 037BA0AD-56EC-4408-BEA3-BCB4ECA73B7A.1; Mon, 23 May 2022 06:26:04 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 789b36f4b8f4.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 23 May 2022 06:26:04 +0000 Received: from DU2PR04CA0262.eurprd04.prod.outlook.com (2603:10a6:10:28e::27) by DBAPR08MB5590.eurprd08.prod.outlook.com (2603:10a6:10:1aa::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.13; Mon, 23 May 2022 06:25:59 +0000 Received: from DBAEUR03FT019.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:28e:cafe::9) by DU2PR04CA0262.outlook.office365.com (2603:10a6:10:28e::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.22 via Frontend Transport; Mon, 23 May 2022 06:25:59 +0000 Received: from nebula.arm.com (40.67.248.234) by DBAEUR03FT019.mail.protection.outlook.com (100.127.142.129) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5273.14 via Frontend Transport; Mon, 23 May 2022 06:25:58 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Mon, 23 May 2022 06:25:57 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.86) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2308.27 via Frontend Transport; Mon, 23 May 2022 06:25: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: 3deefd84-da61-11ec-837e-e5687231ffcc ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=VkdGOfwZCpAxM9Jzo5tGmJ5BViErXu0puJe9N2mjh4G0nxpAUnRc9BcQeoqbhoHE/hlNWHXtABLhepIxmFN/RYBMZlD6OuHtQ8jy9Cxa5ySbPM9kp/gSvYh6R872VzMRQMn1VnpuM6Jx6zz47NsPCQfabXmTT/Cx7UpPidbmhv9yPD9F67sBZekyqS+qPCTcfWonxa1iY8ycdT9tNjw4QuZuHCcT7coa/tEudh1eeFoKn8BsQ3zzi8Sa4o9nZ6gMnz9YnC0uICxoUYZmDVHFYxm66KOm3i+oO71IHrp7i1QSKtZYjaJg8HwU3LmdbJD5GIi23ecjBZEPECHbsiBvTw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+h4lby9uhtIt+w9bPcDu7mqnxP5TtPdNw4xy2M6UuS8=; b=c9wVCdFX+x/8ZbqpgR2iJhL6Sz+AiYwlybcQNVLi6KnNt+L/dwuqSvV9hNuhqEsJgnAtwAa/xtPLo6Uh0mCBQk+Y362QC+o5GpVm8wZ905ldcB9eWBDs6YdQnxe3TAxrbmFNx4VLh1XEMY68JFNqvalK52dimqx/7mCscQwfntJi9WuJlym4vdTLZc+7vqiIuzsbfC3woOtFM38HW+MATKoieIJD6e7uNYlD60j3vnJ0JrHfYTfoyu3UrYLvxTV5W8ENgzJbGAlGcWx/sWEmFOJokpkGc7TYKpc/u29NnH+9H8AEY8JC+DgzfD65zu76x+vlLQH9pFViXUodI8Z95A== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dmarc=[1,1,header.from=arm.com]) 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=+h4lby9uhtIt+w9bPcDu7mqnxP5TtPdNw4xy2M6UuS8=; b=XdW+R8RNyJMX5YmOufsq/CthT6YyujFW95cvy2ueGGrkpDblMBEF5/1BR7M/z4jDCmE7X/EdalaouqIGeV1lLx4bpF//zvck9NVbGfp6oHYXTAslN+ejJK9cYqK+MOBeadaNMOI/gUHYx9uwUHMoR1+Rm3rlXebWYbVGaOek4bk= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: pass (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; pr=C X-CheckRecipientChecked: true X-CR-MTA-CID: 04c0b99e10f7ac77 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hwWWL+gfuMnP8wkhlWCzKDJuxK82tndhDUkbQAxXWyXNR3BuxTphMA/OtvKbIr8qXCN0vO96i6pd7WGhdmyRfN5nMVwBOK/GeFwFwSMgRyoVKCvIygRCKFdY2xHjO1yVBYonfGYxu/gSo/gjsP/S5KORRk6KJQ6SkBVgoJijDcfVBehmihvqOMcV9hs3wzGUDPncGJQF62KaTcR0LMT/kbmGOkuLClfiErdHU0Ef0xUn6Z5CHFddULILlMBHeIBJeaTpJYhefK+KWM2E1CrK8kl8J8eIHgpT1gyd1M+25p/11QIDoXalZ2OIPHFJu3issC4lBfq9GtjiqMEU53EX6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+h4lby9uhtIt+w9bPcDu7mqnxP5TtPdNw4xy2M6UuS8=; b=T6ULq8KwbsvABEefPWX1df52oUJpOa7i8Z9tQ43P3acddPp5nNo2x9Mon9U4wHlQROFOHPO5/mc941yZ3rpHYSV8vSbGlGGh2+bLht0CY2K9xihXhOew1e/GZ7vq1jrNZDbtoz5cgRE4K6QkaQDB1dWbShYqHpdwuYnpURp8mOyaiQHYk8/zGBtEiHuryDp7/3A8isbGBf/b3Cj9xciX38Xp9n8GkqYf8er/6bZudrSKG1Y73jbba4QGwgQqV+y6ZHSXN5EMd2mOIV4v4zwzzZSczzP/NePsQKR9NKliK8QWzpVEPhY1ILklOZUlXIHBhsA+BVzqB7LUULglQJpydw== 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=+h4lby9uhtIt+w9bPcDu7mqnxP5TtPdNw4xy2M6UuS8=; b=XdW+R8RNyJMX5YmOufsq/CthT6YyujFW95cvy2ueGGrkpDblMBEF5/1BR7M/z4jDCmE7X/EdalaouqIGeV1lLx4bpF//zvck9NVbGfp6oHYXTAslN+ejJK9cYqK+MOBeadaNMOI/gUHYx9uwUHMoR1+Rm3rlXebWYbVGaOek4bk= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C From: Wei Chen To: CC: , Wei Chen , Stefano Stabellini , Julien Grall , Bertrand Marquis , Volodymyr Babchuk , Andrew Cooper , George Dunlap , Jan Beulich , Wei Liu , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Jiamei Xie Subject: [PATCH v4 3/8] xen: introduce an arch helper for default dma zone status Date: Mon, 23 May 2022 14:25:20 +0800 Message-ID: <20220523062525.2504290-4-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220523062525.2504290-1-wei.chen@arm.com> References: <20220523062525.2504290-1-wei.chen@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-Correlation-Id: a81e30a7-b06e-49ce-bca8-08da3c8520fa X-MS-TrafficTypeDiagnostic: DBAPR08MB5590:EE_|DBAEUR03FT037:EE_|AM9PR08MB6802:EE_ X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: ivJGpZea3Qu0DD8urVw0nJNA7nL5PLjtKmYfDwqWnLw1mXouGP3j50P6sSm5a62F9p3NaiB2hReaQfD6+CxPxOnqjK/WHEfUfNoec7MJ9kuSfJ0UFBIlIkvhxdH5Ob2BxFKEltYIek0Oyhde81YbbFWWrpmdu+8iXRAN1o+tG1dlUMBLh7vPP2VrSpPC5qh+qvJxxn6VofABR/Y+cYCk4M/IAMIP2bkAekikk1FGANnPjytAJMY1gAGt4QvAtRjWWbrtAQv5AX9Z7KMAUT1BPfCv+Snbt13SW3nhzTT/ZmAcqNMWegNCWZG3raZ8SlWOPr29JU9abioH+ucVWNlnp1CV3hQ0PDMXpdGNH58Km8XgLf92FwpPZZLX0cwstvCvVmF7UyFZPXY3ZFxMP/MsAc7vpj/pY9RjulxmCMskC8HDlYdattQ9y0A+ktICOCG4nzST/MuloWFyjlfclCBwxanhYMkjmdbKhCpuzrlEsFUF7b5q/Gd9BC2MmOgHYeUbCVoR5QkBzuczDupchFMMEvyzroH1Tid6ZX+l6UrxobmoMuvqHZ1w0atr6Ie6uvaCUadAauaAZH11kRnHGpJJ/Z6EOAgERy/8Ipc8E+2OVst/AasYUG3c8JXmn7bfABswcqlIQ4wj43aAtruNAD4KjVxuAxn4pwfW85bza4xbZfD553nnK6Szm8O1U5YY7JSg 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:(13230001)(4636009)(46966006)(36840700001)(26005)(54906003)(2616005)(6916009)(316002)(336012)(426003)(47076005)(1076003)(6666004)(186003)(7696005)(36756003)(83380400001)(82310400005)(508600001)(8936002)(70586007)(2906002)(4326008)(8676002)(86362001)(70206006)(81166007)(44832011)(5660300002)(36860700001)(356005)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR08MB5590 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT037.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 11e4956e-f20c-44a4-4d7c-08da3c8519d2 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kZvuxfR7IYHI1s7M6yMwAWuuzSgf7bS7zHoZw3nqJwS0Rc6h9mLjNXH6yFN3jL+kej/mhulxlPulhwVuO2ul7P1hYqGndyihj2ngJxCZfz2FYRO85UnYy14LqjJGaY7evGbKhNoLXvcNeUgvs4V34y4kp6BTJcN3xZcAD6cBQE3TzDseONUMCa0pY7YCJcJxaZDz9yRdTwfBzYeRMgcIxy95nausYBEeq+X5gIMoVCQ7yh+Bv6nHF5YKD3KoTKPnAWvFoqC3YNohZZS0+G9PuizbfWqM+kS+NZirPjoc8/kOLgBkCpoGGGdEps6M1ZQGWE7pupfXG599K01ZiSj6DryE1ttCKUlq+cKHyk08jMUOi7UG3ox3TKzUTC3Te5K5kfyrba1eG8CaIC62LHnYc7ooRsKtHEr176RkVvRIrY7hB+TK9Smuj7eYvhY4uY533c3C8IViDvPbexXjaDCqmR8V/MsDc0BrBv6sCO2BdqgfhGhVmztfCMQ3x+qus08XJ2g8ibfFVPKn2a5PXRdqPl34A2u1aNl+z9AtT+oI1N++1312XKj2/LIbBPonLmZAla09iM+c8UcFLowByVzo5cNHOlvYrSIca8QYneOYN8l4WtYCjRXAmTrOTthvP6JAZJVZGnNUnC+y2n0JHH63WAiyw6EIckMy36lzOM+7OMZvWDmCzhRUdgKQM9vtrlUi 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:(13230001)(4636009)(46966006)(36840700001)(40470700004)(44832011)(6666004)(82310400005)(40460700003)(36756003)(86362001)(5660300002)(316002)(36860700001)(26005)(2906002)(7696005)(83380400001)(8676002)(4326008)(2616005)(6916009)(54906003)(47076005)(70206006)(426003)(186003)(81166007)(8936002)(508600001)(1076003)(336012)(70586007);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 May 2022 06:26:10.7966 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a81e30a7-b06e-49ce-bca8-08da3c8520fa 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: DBAEUR03FT037.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR08MB6802 X-ZohoMail-DKIM: pass (identity @armh.onmicrosoft.com) X-ZM-MESSAGEID: 1653287208749100009 Content-Type: text/plain; charset="utf-8" In current code, when Xen is running in a multiple nodes NUMA system, it will set dma_bitsize in end_boot_allocator to reserve some low address memory as DMA zone. There are some x86 implications in the implementation. Because on x86, memory starts from 0. On a multiple-nodes NUMA system, if a single node contains the majority or all of the DMA memory, x86 prefers to give out memory from non-local allocations rather than exhausting the DMA memory ranges. Hence x86 uses dma_bitsize to set aside some largely arbitrary amount of memory for DMA zone. The allocations from DMA zone would happen only after exhausting all other nodes' memory. But the implications are not shared across all architectures. For example, Arm cannot guarantee the availability of memory below a certain boundary for DMA limited-capability devices either. But currently, Arm doesn't need a reserved DMA zone in Xen. Because there is no DMA device in Xen. And for guests, Xen Arm only allows Dom0 to have DMA operations without IOMMU. Xen will try to allocate memory under 4GB or memory range that is limited by dma_bitsize for Dom0 in boot time. For DomU, even Xen can passthrough devices to DomU without IOMMU, but Xen Arm doesn't guarantee their DMA operations. So, Xen Arm doesn't need a reserved DMA zone to provide DMA memory for guests. In this patch, we introduce an arch_want_default_dmazone helper for different architectures to determine whether they need to set dma_bitsize for DMA zone reservation or not. At the same time, when x86 Xen is built with CONFIG_PV=3Dn could probably leverage this new helper to actually not trigger DMA zone reservation. Issue-Id: SCM-2240 Change-Id: I08c5d463995322ecaf7e6755d417c814825010eb Signed-off-by: Wei Chen Tested-by: Jiamei Xie Acked-by: Jan Beulich --- v3 -> v4: 1. Add Acked-by. v2 -> v3: 1. Add Tb. 2. Rename arch_have_default_dmazone to arch_want_default_dmazone. v1 -> v2: 1. Extend the description of Arm's workaround for reserve DMA allocations to avoid the same discussion every time. 2. Use a macro to define arch_have_default_dmazone, because it's little hard to make x86 version to static inline. Use a macro will also avoid add __init for this function. 3. Change arch_have_default_dmazone return value from unsigned int to bool. 4. Un-addressed comment: make arch_have_default_dmazone of x86 to be static inline. Because, if we move arch_have_default_dmazone to x86/asm/numa.h, it depends on nodemask.h to provide num_online_nodes. But nodemask.h needs numa.h to provide MAX_NUMANODES. This will cause a loop dependency. And this function can only be used in end_boot_allocator, in Xen initialization. So I think, compared to the changes introduced by inline, it doesn't mean much. --- xen/arch/arm/include/asm/numa.h | 1 + xen/arch/x86/include/asm/numa.h | 1 + xen/common/page_alloc.c | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/include/asm/numa.h b/xen/arch/arm/include/asm/num= a.h index 31a6de4e23..e4c4d89192 100644 --- a/xen/arch/arm/include/asm/numa.h +++ b/xen/arch/arm/include/asm/numa.h @@ -24,6 +24,7 @@ extern mfn_t first_valid_mfn; #define node_spanned_pages(nid) (max_page - mfn_x(first_valid_mfn)) #define node_start_pfn(nid) (mfn_x(first_valid_mfn)) #define __node_distance(a, b) (20) +#define arch_want_default_dmazone() (false) =20 #endif /* __ARCH_ARM_NUMA_H */ /* diff --git a/xen/arch/x86/include/asm/numa.h b/xen/arch/x86/include/asm/num= a.h index bada2c0bb9..5d8385f2e1 100644 --- a/xen/arch/x86/include/asm/numa.h +++ b/xen/arch/x86/include/asm/numa.h @@ -74,6 +74,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) +#define arch_want_default_dmazone() (num_online_nodes() > 1) =20 extern int valid_numa_range(u64 start, u64 end, nodeid_t node); =20 diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c index 319029140f..b3bddc719b 100644 --- a/xen/common/page_alloc.c +++ b/xen/common/page_alloc.c @@ -1889,7 +1889,7 @@ void __init end_boot_allocator(void) } nr_bootmem_regions =3D 0; =20 - if ( !dma_bitsize && (num_online_nodes() > 1) ) + if ( !dma_bitsize && arch_want_default_dmazone() ) dma_bitsize =3D arch_get_dma_bitsize(); =20 printk("Domain heap initialised"); --=20 2.25.1 From nobody Wed May 15 11:12:57 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=2 dmarc=pass fromdomain=arm.com); dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=3; a=rsa-sha256; t=1653287213; cv=pass; d=zohomail.com; s=zohoarc; b=Jgne+NE95PXoV8/fHnq79Xrkop2uPKsmYcamkH5FeQY4hUh2IzgswN0UyDDOS3lX9HbSNS646BaJoUCn75AGxriTUAMSc6nQ7Sj9ej2bZlv94ohDDqrNDb4ceKkdTVlftHuaeeE97yZl64OVxT2XEvoA1dYB8z/RLuPvtXDXlHw= ARC-Message-Signature: i=3; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1653287213; 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=1GQ8cRjoyAomDmwPvqhEhvMhEOhwa4PJfeQ52AeZoUY=; b=BatOb3g7QKBeTHQPxaSrwxYlNtfSamsyj1/dhy6GdeEsPEBdSOUMdu8DWYt4yTpqF/Ugb/Wiz9rNoBVM6CIA4ei8gJKjzdsgnqiPmQkgnLr0d5Dj8/Gj2zDUxmhC9UTCdXDDDm/CP+x59AqipXieTvrlC+K2znvC7GQP1VrFPYQ= ARC-Authentication-Results: i=3; 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=2 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 1653287213390830.6045982634529; Sun, 22 May 2022 23:26:53 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.335362.559569 (Exim 4.92) (envelope-from ) id 1nt1WN-0001TU-Ty; Mon, 23 May 2022 06:26:27 +0000 Received: by outflank-mailman (output) from mailman id 335362.559569; Mon, 23 May 2022 06:26: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 1nt1WN-0001TH-QF; Mon, 23 May 2022 06:26:27 +0000 Received: by outflank-mailman (input) for mailman id 335362; Mon, 23 May 2022 06:26:26 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nt1WM-0008Q2-M6 for xen-devel@lists.xenproject.org; Mon, 23 May 2022 06:26:26 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2061c.outbound.protection.outlook.com [2a01:111:f400:7e1b::61c]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 458d16e5-da61-11ec-bd2c-47488cf2e6aa; Mon, 23 May 2022 08:26:25 +0200 (CEST) Received: from DB9PR02CA0016.eurprd02.prod.outlook.com (2603:10a6:10:1d9::21) by DU0PR08MB7613.eurprd08.prod.outlook.com (2603:10a6:10:311::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.16; Mon, 23 May 2022 06:26:13 +0000 Received: from DBAEUR03FT043.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:1d9:cafe::90) by DB9PR02CA0016.outlook.office365.com (2603:10a6:10:1d9::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.22 via Frontend Transport; Mon, 23 May 2022 06:26:13 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DBAEUR03FT043.mail.protection.outlook.com (100.127.143.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.14 via Frontend Transport; Mon, 23 May 2022 06:26:13 +0000 Received: ("Tessian outbound 6580ae46f51e:v119"); Mon, 23 May 2022 06:26:13 +0000 Received: from 40971db31545.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 3F52B494-63F4-45C3-85DC-6468C30B9DC6.1; Mon, 23 May 2022 06:26:07 +0000 Received: from EUR03-AM5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 40971db31545.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 23 May 2022 06:26:07 +0000 Received: from DB9PR06CA0022.eurprd06.prod.outlook.com (2603:10a6:10:1db::27) by AM6PR08MB4936.eurprd08.prod.outlook.com (2603:10a6:20b:eb::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.18; Mon, 23 May 2022 06:26:02 +0000 Received: from DBAEUR03FT006.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:1db:cafe::8b) by DB9PR06CA0022.outlook.office365.com (2603:10a6:10:1db::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.13 via Frontend Transport; Mon, 23 May 2022 06:26:02 +0000 Received: from nebula.arm.com (40.67.248.234) by DBAEUR03FT006.mail.protection.outlook.com (100.127.142.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5273.14 via Frontend Transport; Mon, 23 May 2022 06:26:02 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Mon, 23 May 2022 06:26:01 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.86) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2308.27 via Frontend Transport; Mon, 23 May 2022 06:25:58 +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: 458d16e5-da61-11ec-bd2c-47488cf2e6aa ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=nq9/h4o66eCTO62J8SHiEvmv/+W8LAEeSWjQ110P5xycNwN3hxFOXytPIQonnKEg04dLVMAVyCnlvUFvVMfKUcOsSMSITelyy6uoIESqDjlCh/zh2VZnWrTHKO2I2A6WLfseS0Kmrut9pb1LnTwFMMFviCWqlKiYk4ADRaNE7G8JeJxFZ+gYny65UIGiLLbR3JsWkv78Lttf0zzDZP55mcwzvXCv+WIQty2InFyVcVv5+UXt+kitFEUZKVe0tS2Kq4khjXadKv5xsihtJOTvxr7H3HdW1IerKT+Mbaw+2HEjIcWTCM2kLDB315zt3Fx1L2It+XqJWbzwRNOmpJAl6Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=1GQ8cRjoyAomDmwPvqhEhvMhEOhwa4PJfeQ52AeZoUY=; b=FcUbvcGuVhpqM5Gkolfm/WhXKjEPxx5uXa5R2J4ngUmflG5j5Vx0CP6aoGWFEJrmiu9McYLTh0u6PLJfdNnW7zkFLT7MTgwrdy4ul6YxXxBHjMpOzIzI6ED7vrkpUhijK7fB2hKFi55PNUqX3lQ2+CPgDjrqq5DWODvIq7vR4lhzTGx2h9oojeTujAkhX1sR8zrmWprAnHz9w3xdW/YEailwix6EVrZSsLDugHsO+R441GL8IUu2tu66DqB5uJdmhiDUJD9FVBWh4Stk98Zu84Mq/k1c5/KY0i/l2mU/yAETJZNWYyMvfU1BKyfsGzEPOTfDOHwrWIPHHigcxjfp6Q== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dmarc=[1,1,header.from=arm.com]) 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=1GQ8cRjoyAomDmwPvqhEhvMhEOhwa4PJfeQ52AeZoUY=; b=jS5uYugkkXeX6jZ/zj7kV0DMzaqLtDgK2pKUVMmelch8H3zJgfZd7TvEf613PbTkU++LJbHBDI2PHcpHukdDWZc3VYSiZSOh7RINSgSX8nMcmjd6Mk66tLEMbP1hYmpBX5kK9CQ6GHRIiD8qIHM9lm9qsqN4HJx4vFIJVuAjfik= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: pass (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; pr=C X-CheckRecipientChecked: true X-CR-MTA-CID: 3e3845afd65344b0 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Oz136JsgiiXMSykpSmpkv3GtkcDiJ1F9snFVy8vuC0yEH5Z9xJLV5HFGfMAzJvhEphNpArGWhGzNURgp5OdsZEQrvtexTvCVMRA9gUPdG+ZcB+PDRha+qhwPn0X5t7Wg3Nxn8UyGzJo3GfT3n81rSU505bWaJDzhkJSPGicP74XWhPyKpx6AlVrvX/0nVr93kinBePpUUAg+pAxRIsX2DNxuEzzFrKPULH7eVAN78CaY+lWjOI5AQRQwYNvH5S/IFa09pwHNB50DrDmR6kpUwCsWjn3cyTktC9LQztJ8cvPHV5HBYcyJ3Ug3BkzkmnRH1SH6ZZF/e3VxAHSmD39Bgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=1GQ8cRjoyAomDmwPvqhEhvMhEOhwa4PJfeQ52AeZoUY=; b=GJvhalGY5whTNIjpCkJpqaxp3sl5tTkDZ8x3WbmA+kqLclttKpFJqngPUzSWM0G9XEyeYVJ+gJzMiUWBEjyGT5ZeoLRQV3l89nbe8Znn3ijKiqAIG9ALeHUiDN6+zrf964Uj5wC/3LgQjnT8uO0M33c5p9thnIzNKCf/RQy+NGc8MjUVmwfQ6nqgBwvdad8U2VCHq6Agrv2sRccVYryxMgaqUWaPUcf1V12gPBF16AoABTPOCD+vHapgeL60A4/TzXkDadQZWPmE/5JjacH/LcmXIx3KGQjvMSCuKE4/BG9DCkBr4oyNgWyFyuWUcJaGkSFXb8pZlYmOy9bxFWK+yg== 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=1GQ8cRjoyAomDmwPvqhEhvMhEOhwa4PJfeQ52AeZoUY=; b=jS5uYugkkXeX6jZ/zj7kV0DMzaqLtDgK2pKUVMmelch8H3zJgfZd7TvEf613PbTkU++LJbHBDI2PHcpHukdDWZc3VYSiZSOh7RINSgSX8nMcmjd6Mk66tLEMbP1hYmpBX5kK9CQ6GHRIiD8qIHM9lm9qsqN4HJx4vFIJVuAjfik= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C From: Wei Chen To: CC: , Wei Chen , Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Wei Liu , George Dunlap , Julien Grall , Stefano Stabellini , Jiamei Xie Subject: [PATCH v4 4/8] xen: decouple NUMA from ACPI in Kconfig Date: Mon, 23 May 2022 14:25:21 +0800 Message-ID: <20220523062525.2504290-5-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220523062525.2504290-1-wei.chen@arm.com> References: <20220523062525.2504290-1-wei.chen@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-Correlation-Id: 89bbd995-69e4-4830-1b22-08da3c8522b7 X-MS-TrafficTypeDiagnostic: AM6PR08MB4936:EE_|DBAEUR03FT043:EE_|DU0PR08MB7613:EE_ X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 8wrQRKmB2bxTo5kapelnM3YNFawBKWt5VD2SsjvISJ3Y0zdN9Mp+cJmpnmpYS5n5fyvsGHoWqcec9BStC5oBBY2rZRqmN1UPPerGXK6Ej2qddZUqvHIqVrPkYOgVO31DjeZyKmC7ky7/b0wbiXATm3xMJhmhf64JmP4SHVxWdnoxQkkQW3YFDVYVn7ICVy/otT+6WkoaNMKNzQDZLeMmaoyAZpsLI3euoiF3+szxJRm7uVzmkhcK14zxunm7X0PgD12fHHntUvHw3Pl99pCoac1Wg/coIm/4ac8vPoIKHyNfxQzYiIdtCFqYURlE9MmmzQvmv1xOrpyCgz8SZbfXX8PIA0TYhe0DakbvL5qSRxec5pozIcgXhujzv+D9PgDjA6kO+PKgQR2/lWkQ/eUuVh+XQ2cgRxwwI7y8M37E+38md7aZaR4UeIcBiHgg9FXdY+hd6RaqD6kZoC+t9kWn9wxxx9uKLKFP7+5hwFuGUVv8g18OjnMj4MpbY27dSCYkoFlH8trFGvuQ3JNMWMStX9cLrnLEsRZLoNVME4/28ux4CRq9O6F2EObZvDksaIHq9YACNqgcaYfw+Il/1b6FQSqb+AMQciiGg/PnNwYT09/c+3W0fwjM4go/Nutz8po1EVC1FqubrxQLSQq0wnMmvDECJxlYVPOepRuOOae/W49RjMuPTqYXlBcHc94uIhByugNXzkVhziBFJjrjtE7Z8A== 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:(13230001)(4636009)(40470700004)(36840700001)(46966006)(81166007)(83380400001)(82310400005)(86362001)(5660300002)(40460700003)(356005)(316002)(508600001)(6666004)(36756003)(36860700001)(7696005)(2906002)(47076005)(8676002)(1076003)(26005)(6916009)(426003)(336012)(70586007)(70206006)(8936002)(54906003)(44832011)(4326008)(186003)(2616005)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB4936 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT043.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: de5541b3-f6e0-40e5-7fad-08da3c851bcd X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MCzm8p5R8g/OYzMg/OPgTBwfQqbGlqe4/d2+K//AsUr/3jplZd1WxMrybHUDRAQhdkfialZndlvYYqTqxP1FPlReIlosiqUXvliYrSKjpSkc4MQi+7xbMA7r5pIC8Y/gRpOGfkcmmFsNjlWF38SeSCrGLXdtV63aaIaiq80YodpjSj0WnPqzS08vqbsUNYDUHRSNApMS4gnowDiYRd+L/U+eSuYm/ILRdCbBJUbvn46tJbmuW03sPr+57FRzSKuMCrMnj4BC7pO5vDfYeoN2eosOpyjwImqtDTy4mi6dU0VlQ0lAvy/f9FkYjGzFFAL2PA8fcdcvbJvM6UGQIs2und//4jI9YO6PWV5x8GQFj49ZRCyl26EYZtE1+DAXxbYrNy9lMxrpgOwzxcvD8FOZW/e7j4TP32wRRxlLtbDjITZRO2i5vAPIEwYhqZOo+ZboBEG3QpiNs0Pnw/LnYndT+lp78/0arvJIsvu0NeZOCd+9/8T2mVUp6BRSKDc0BWJEKTgtD2suvX6FDCGOXFOgLI6HvVdc31z6gpZWgAcOn988fpQE+WFBtKzCe8JUO2Ee78S46B95ZF4Qxi+1BDidmCHD9CN7caY9dpzjOQJBWJn3tUswSX9gkGeidzoE84WzrufigiSv3JfRBTcR5g+XZIwnv83RwPEdE8EZ5KY6RUEnM8gQMlqY/nmEctyjXiPr 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:(13230001)(4636009)(46966006)(36840700001)(40470700004)(186003)(7696005)(1076003)(47076005)(86362001)(336012)(426003)(2616005)(81166007)(26005)(36860700001)(83380400001)(5660300002)(6666004)(82310400005)(44832011)(8676002)(4326008)(36756003)(2906002)(70586007)(54906003)(40460700003)(6916009)(508600001)(316002)(8936002)(70206006);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 May 2022 06:26:13.7088 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 89bbd995-69e4-4830-1b22-08da3c8522b7 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: DBAEUR03FT043.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB7613 X-ZohoMail-DKIM: pass (identity @armh.onmicrosoft.com) X-ZM-MESSAGEID: 1653287214823100002 Content-Type: text/plain; charset="utf-8" In current Xen code only implements 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 a follow-up patch, we will introduce support for NUMA using the device tree. That means we will have two NUMA implementations, 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. Change-Id: I926c73c10aa9bb8e1e7ff77596afb11d3ea18363 Issue-Id: SCM-2240 Signed-off-by: Wei Chen Tested-by: Jiamei Xie Reviewed-by: Jan Beulich --- v3 -> v4: no change. v2 -> v3: Add Tb. v1 -> v2: No change. --- xen/arch/x86/Kconfig | 2 +- xen/arch/x86/include/asm/config.h | 1 - xen/common/Kconfig | 3 +++ xen/drivers/acpi/Kconfig | 3 ++- xen/drivers/acpi/Makefile | 2 +- 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig index 06d6fbc864..1e31edc99f 100644 --- a/xen/arch/x86/Kconfig +++ b/xen/arch/x86/Kconfig @@ -6,6 +6,7 @@ config X86 def_bool y select ACPI select ACPI_LEGACY_TABLES_LOOKUP + select ACPI_NUMA select ALTERNATIVE_CALL select ARCH_SUPPORTS_INT128 select CORE_PARKING @@ -26,7 +27,6 @@ config X86 select HAS_UBSAN select HAS_VPCI if HVM select NEEDS_LIBELF - select NUMA =20 config ARCH_DEFCONFIG string diff --git a/xen/arch/x86/include/asm/config.h b/xen/arch/x86/include/asm/c= onfig.h index de20642524..07bcd15831 100644 --- a/xen/arch/x86/include/asm/config.h +++ b/xen/arch/x86/include/asm/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 diff --git a/xen/common/Kconfig b/xen/common/Kconfig index d921c74d61..d65add3fc6 100644 --- a/xen/common/Kconfig +++ b/xen/common/Kconfig @@ -70,6 +70,9 @@ config MEM_ACCESS config NEEDS_LIBELF bool =20 +config NUMA + bool + config STATIC_MEMORY bool "Static Allocation Support (UNSUPPORTED)" if UNSUPPORTED depends on ARM 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 --=20 2.25.1 From nobody Wed May 15 11:12:57 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=2 dmarc=pass fromdomain=arm.com); dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=3; a=rsa-sha256; t=1653287206; cv=pass; d=zohomail.com; s=zohoarc; b=Nd4mp5i61V0OoCJvjiiprX1Adtsw9jfLPSknkXLUabTZIhAICcHVFCMH/pkNVOOZ5LKCQuQUDKb+l1DcUX2USpRXNLuteOacgPTAq73cl0iBAvvArvdZgkYLNgtZoBkogZIpvdxRXpffm4RZEykTJ3I0mN6y7JJxEw8gKODKNOU= ARC-Message-Signature: i=3; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1653287206; 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=bZH7C2DqN/PCll0sk/Ops4kNowCdYB+hJ4yS3CHVcHc=; b=dpJ8IKajeyzRSk1nXi7V85rMzfmjKTKAMWL87wMUMan59XC8DKgCs4ZEzY02Edc0d8Fj0T/HFHup4eM2hFjSxWqdnOZ98MFjFH67lwogcECeRy2NmdPgHWEQNSW/L3xb3olpeh8b5E+AyN9ncmonUmnguS/pkOvbp35Gi2criMc= ARC-Authentication-Results: i=3; 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=2 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 1653287206495352.7603556793953; Sun, 22 May 2022 23:26:46 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.335354.559548 (Exim 4.92) (envelope-from ) id 1nt1WH-0000eq-RJ; Mon, 23 May 2022 06:26:21 +0000 Received: by outflank-mailman (output) from mailman id 335354.559548; Mon, 23 May 2022 06:26:21 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nt1WH-0000ed-Mq; Mon, 23 May 2022 06:26:21 +0000 Received: by outflank-mailman (input) for mailman id 335354; Mon, 23 May 2022 06:26:20 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nt1WF-0007pn-QL for xen-devel@lists.xenproject.org; Mon, 23 May 2022 06:26:20 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2061a.outbound.protection.outlook.com [2a01:111:f400:7e1b::61a]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 4165afca-da61-11ec-837e-e5687231ffcc; Mon, 23 May 2022 08:26:19 +0200 (CEST) Received: from DBBPR09CA0001.eurprd09.prod.outlook.com (2603:10a6:10:c0::13) by DB6PR0801MB1847.eurprd08.prod.outlook.com (2603:10a6:4:3c::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.17; Mon, 23 May 2022 06:26:12 +0000 Received: from DBAEUR03FT023.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:c0:cafe::7) by DBBPR09CA0001.outlook.office365.com (2603:10a6:10:c0::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.15 via Frontend Transport; Mon, 23 May 2022 06:26:12 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DBAEUR03FT023.mail.protection.outlook.com (100.127.142.253) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.14 via Frontend Transport; Mon, 23 May 2022 06:26:12 +0000 Received: ("Tessian outbound 32b886dfa5b9:v119"); Mon, 23 May 2022 06:26:12 +0000 Received: from b5eab67ce7ec.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id D0DB6EC1-099D-4C69-856F-F6F8094BDFE1.1; Mon, 23 May 2022 06:26:06 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id b5eab67ce7ec.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 23 May 2022 06:26:06 +0000 Received: from DU2PR04CA0261.eurprd04.prod.outlook.com (2603:10a6:10:28e::26) by DB8PR08MB4153.eurprd08.prod.outlook.com (2603:10a6:10:a2::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.14; Mon, 23 May 2022 06:26:05 +0000 Received: from DBAEUR03FT019.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:28e:cafe::a) by DU2PR04CA0261.outlook.office365.com (2603:10a6:10:28e::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.22 via Frontend Transport; Mon, 23 May 2022 06:26:05 +0000 Received: from nebula.arm.com (40.67.248.234) by DBAEUR03FT019.mail.protection.outlook.com (100.127.142.129) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5273.14 via Frontend Transport; Mon, 23 May 2022 06:26:05 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Mon, 23 May 2022 06:26:04 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.86) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2308.27 via Frontend Transport; Mon, 23 May 2022 06:26: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: 4165afca-da61-11ec-837e-e5687231ffcc ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=NdPYEV01QDiACvm/kmTgxYwzuqpZSLww43AgDcfdiqeDKk4h9W9+YtikM7cPYFocVtbKZ77YksZJo7NYXDo3+Ykm443huQZuve9l4IGJQ+eV9PMuPYQ0+JA8Xi3XxkYzCEyvrcFt08vEYr22oOK4MV35waRN7+YNBhZaE9rkUsXkLx71ecedD3YBANE/iEp5+/rof9L1OnELgiJPHhD7jtlIF5JShexHrMovCPww8Wt/FDOqXV09mMoYfuy+Q37ebWbuOPwcBjm7N90sAvkqF3N3tCpgdBFYuokDvTSRI4P9ifTrIKI/bAt/WBSOE1Ht+wqkmCB36EzJPf5P8/6n0A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=bZH7C2DqN/PCll0sk/Ops4kNowCdYB+hJ4yS3CHVcHc=; b=YNwzrFL2s6lTcTt3cPm0qPOXXZN2vqxOWi22N5IT1BJU+Dr3iAt0Axw0OnIMpo9Cv3vguIXuojGLyqOVuF82Sfg/coEqSk5A9FweKVHo9TKA4V+aQHtRublAz1QwIMQCDY6SLv3SbrwlLOQViYVnGMGoFncXWFsZ57dz/U9SkxT7lM5Hthhup9T6P1B18mynaL5Nx/hGFlq/jeqVYVJkJh2iLOi7BB1gHT9xvFAxSgrih2G7mwgwZCj7h+OD3gZxNc5M2hspk8De8uB+cn9djpmjV6khrRdOQPd35ctKCViSxnkBROLN6XPzThtk9Gd5OyEzXOSGyDqhcKWR+LXMbg== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dmarc=[1,1,header.from=arm.com]) 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=bZH7C2DqN/PCll0sk/Ops4kNowCdYB+hJ4yS3CHVcHc=; b=R78yTLitvo0Flswj6c3nZ0LS3eifhq/mKyVmdGjjdsYjxEl25CdARYWsV4NT7D9TTHHt+tn2Y5i80dPb0cGChAVmX+ynuaqK4T157cuGc8GO2O6tE5p36yqhLHbkh92kieqWTWby5gaz3U/nLnjMclYIi0MyMa0Yb52bnCrl+3s= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: pass (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; pr=C X-CheckRecipientChecked: true X-CR-MTA-CID: a65b5303d344cfe3 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jAIFWLCjmQXthbN4ZoXQ5i+lsYqPxahW7b65r617zFULgmhpfYu9t2KzeorjQkzjnVedT7vod5nFkEUmO0CkCzwDxvGxIMjLB4YCyM2G6hQvMKpRrkEiq7UKOElzKYdM6nzOuxGOJwXNGd3yeZ0BKWKyUSWhDgX8WjL/ac6INSikg2bxavXEemtWw2eLMAsB4WRZi7bIkZ7ESJ+woM/2llDX8U44rl6bKuiY9f5TCZ88S2L694oX0pzlkxLXXAdDCcGbjQH06od803ynBt2IntLmQd2WR4bwVC/DmOfwnS7IdOIlK7RA7pDBkpb3aD+gMBkF6chqSfCGzGY3Ij451Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=bZH7C2DqN/PCll0sk/Ops4kNowCdYB+hJ4yS3CHVcHc=; b=iUBDpgBhVclV4KsQGSwFbi8ePEOen9jplc1ia9my5ex/knSDDcOhuWu+RQbehPqCmGEYtNsQ/id04iAGFcOpJTI/dZiGT1sxSVZrZMk/+vF9/qMRFtxzWNwffcUcODaZ+vZgGMamXr9SSuooYkHngkwUM0HB10CRaFJaEWAdxtXKFNhzwLazCnSwh/5HbveFYKh9I8l19F575BJ/hcrteoXzBfx9vqyvyJA38G3KiUdXGuEhw19UReCJIVqJv4oWoDOlPIlwBsmHlAZFAPIxFRlWHap7p5LSTUg/Pzqq2+xpbvV2JLTwu9/GAS28oPc5MCLjB+f8jcYxQoJASCHthg== 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=bZH7C2DqN/PCll0sk/Ops4kNowCdYB+hJ4yS3CHVcHc=; b=R78yTLitvo0Flswj6c3nZ0LS3eifhq/mKyVmdGjjdsYjxEl25CdARYWsV4NT7D9TTHHt+tn2Y5i80dPb0cGChAVmX+ynuaqK4T157cuGc8GO2O6tE5p36yqhLHbkh92kieqWTWby5gaz3U/nLnjMclYIi0MyMa0Yb52bnCrl+3s= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C From: Wei Chen To: CC: , Wei Chen , Stefano Stabellini , Julien Grall , Bertrand Marquis , Volodymyr Babchuk , Jiamei Xie Subject: [PATCH v4 5/8] xen/arm: use !CONFIG_NUMA to keep fake NUMA API Date: Mon, 23 May 2022 14:25:22 +0800 Message-ID: <20220523062525.2504290-6-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220523062525.2504290-1-wei.chen@arm.com> References: <20220523062525.2504290-1-wei.chen@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-Correlation-Id: 526069b3-284d-44d5-69e7-08da3c8521f7 X-MS-TrafficTypeDiagnostic: DB8PR08MB4153:EE_|DBAEUR03FT023:EE_|DB6PR0801MB1847:EE_ X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: EWaPCoDYcZaTPJMKbRtZdzJucY/XFqnRmG/TQSEKGr2d6jSAeGhlka710iN9dAXCr7iIsHXOvSbYwhI3+FR3+O5RDlNwkImxNTBshVYBr3Xtv9n3j8jGKRqUd+DCjnp4XV7sAqKB0iwRgQs2bhVdPaEBE4KZ6t2i1XvrdQn4jgK8ke/Tij9M/LWmSm+rXi5RbH9xQwj9crutKzQqztFjxEmC0q+33r/K22zAcTrZZdCvay0a3/tg+VJZKNYrNwVSr3HoKZeczSs1kJl8+kXpxtCSPcf9dpLa3RVjXnm+dfGFW91OBdfjKrdoZ/6zuO082RdsTTu0l0PTCkMauX3MhZmIxwqmIPa5f4TDeiA42DkHfwygNsGFDX4XaxgC5XBIYMEmIkESjgO4+05nyZsy7uyvoYjFC8jMn+ZW7uKhnQtawQx37CQrVjEypG5lzdQxmsahQbbwdUUqOscNj77mvUeQ2qxD0vlOSi7NZ5l5/IKddeMcXu3aen9CJm30A5BAJv12UEXYl4nzNXc5BTAzeQWRhUdYFdFoI2CBDev2ZOWyngOzjPtEwJXBU5L7/7906AJgMFTbxHXeBn7gJteRfQm3mqIiE+BjYv3Ie+cXF3MnrIUlqbqc88ajjG5UJNNDgG2TyVZIdcR+w0DcVlPlr5lGjQztv7Dk1rTdIL151+ESsGzGoeE1mBrLWAfx0XRyYtsjr/yHAQ1qFSnK2t/cLg== 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:(13230001)(4636009)(40470700004)(46966006)(36840700001)(356005)(40460700003)(81166007)(1076003)(2616005)(70586007)(70206006)(6666004)(26005)(8676002)(4326008)(44832011)(86362001)(7696005)(8936002)(5660300002)(54906003)(36860700001)(6916009)(316002)(186003)(82310400005)(83380400001)(336012)(508600001)(47076005)(426003)(36756003)(2906002)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB4153 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT023.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 798b3546-7772-48c9-e5e4-08da3c851d8b X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: U6cHKa6fau1rZm9lniL+OXs5fiYhvHRugZ7Ff/eanHw3R3/Wg3+v7jbcSo835vUg38HzkBQeBhR8zypLr0wIr8Y8ClJXE8P0XQ14xHJ/GnKu9SgM58XrccpDqiKJWPj8OZEL5pC4GKyrvF+CYr61VAr8DHJdwS+ZxYbjZvLFYdqifcGCZKu96cL5Et/WAIbZNcTu6csCzjqZclaj2hlvCrz9UifbGYlA9z6gjm6Y86zPUPV5NVZKR2U1sYyTVOMFTvXA5v9iwY/50rrHJ09b+/Xcd1KtL77emzAWVMwLGDElbXE6DiWSIJ28k/+4koPvl42ahvpIuedUfe7v+J2MBcDQ1cLWrKCJN7+HIq8GdY+EdgfjQ/SwUm/APIDAQscrnMOVJB4e6OP/bKKxnCQh10KHUoc0OnczcDeustQ+mSzXl2YtLYWikFkWmHEiBAYzV7iK9YcLav84dnkoO4pctRUIfGhMsXPhSy84BkJr+3+WVtmQxFNEX1F1jYExG5boYxfdc3s9lPBR9ghwnX5Lmag2RHGw0vQ26NBfWj6fkDeuPkwX6q9iSNi/k43vjHJ3e6VBFfvTC/i2LvvoisYanuofF6G831aoaslDepQfutrZQY54qfz7DnvmsSuplKrJpeaHezjJnSyIh5j8UZGMMw== 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:(13230001)(4636009)(46966006)(36840700001)(44832011)(6666004)(82310400005)(36756003)(86362001)(5660300002)(316002)(36860700001)(26005)(2906002)(7696005)(83380400001)(8676002)(4326008)(2616005)(6916009)(54906003)(47076005)(70206006)(426003)(186003)(81166007)(8936002)(508600001)(1076003)(336012)(70586007);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 May 2022 06:26:12.4369 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 526069b3-284d-44d5-69e7-08da3c8521f7 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: DBAEUR03FT023.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0801MB1847 X-ZohoMail-DKIM: pass (identity @armh.onmicrosoft.com) X-ZM-MESSAGEID: 1653287206751100003 Content-Type: text/plain; charset="utf-8" We have introduced CONFIG_NUMA in a previous patch. And this option is enabled only on x86 at the current stage. In a follow up patch, we will enable this option for Arm. But we still want users to be able to disable the CONFIG_NUMA via Kconfig. In this case, keep the fake NUMA API, will make Arm code still able to work with NUMA aware memory allocation and scheduler. Change-Id: I595b4c84f61f0b827ad9dfbeef03aae30f4752f0 Issue-Id: SCM-2240 Signed-off-by: Wei Chen Tested-by: Jiamei Xie Reviewed-by: Stefano Stabellini --- v3 -> v4: no change v2 -> v3: Add Tb. v1 -> v2: No change. --- xen/arch/arm/include/asm/numa.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/xen/arch/arm/include/asm/numa.h b/xen/arch/arm/include/asm/num= a.h index e4c4d89192..268a9db055 100644 --- a/xen/arch/arm/include/asm/numa.h +++ b/xen/arch/arm/include/asm/numa.h @@ -5,6 +5,8 @@ =20 typedef u8 nodeid_t; =20 +#ifndef 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) @@ -24,6 +26,9 @@ extern mfn_t first_valid_mfn; #define node_spanned_pages(nid) (max_page - mfn_x(first_valid_mfn)) #define node_start_pfn(nid) (mfn_x(first_valid_mfn)) #define __node_distance(a, b) (20) + +#endif + #define arch_want_default_dmazone() (false) =20 #endif /* __ARCH_ARM_NUMA_H */ --=20 2.25.1 From nobody Wed May 15 11:12:57 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=2 dmarc=pass fromdomain=arm.com); dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=3; a=rsa-sha256; t=1653287207; cv=pass; d=zohomail.com; s=zohoarc; b=Ie3SaoyG1aV4SJ5H3grxgbIED5Zsj5cChpF+tiBK9ga6hbFfjQjFN3ihX9cF2Zuq8k+TGgtnw1xM/EL6M13lArUUD4DWaY1vsk8OIwzwaC4VyBCZ0Br664E3PhNUk+d985qO1bJO32SzUiKmMWn2+Ov7rB+jiBPxe9InL+NEj5A= ARC-Message-Signature: i=3; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1653287207; 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=OLz9U4f5kBuwv8fnxvQyEObMqpaBQsZ5NTftoU1ebo0=; b=Qix7bMXYxuFbsA97ct6ZOF8c8PSPtBByI8iF23A2+9pOmWc5X9N9Hg8RY/RqHLOVVJOo+/6pqazQA66xonOZtuHsAPTzxVtOoY9R8IRH/Dc3efloN2TcL6+eu3c2M4uszSJILWg3sGBXEgszirRd81+epKBR/vQAmE24L2g+QXE= ARC-Authentication-Results: i=3; 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=2 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 1653287207351457.56721918816925; Sun, 22 May 2022 23:26:47 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.335357.559559 (Exim 4.92) (envelope-from ) id 1nt1WK-0000yp-6w; Mon, 23 May 2022 06:26:24 +0000 Received: by outflank-mailman (output) from mailman id 335357.559559; Mon, 23 May 2022 06:26: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 1nt1WK-0000yd-3L; Mon, 23 May 2022 06:26:24 +0000 Received: by outflank-mailman (input) for mailman id 335357; Mon, 23 May 2022 06:26:23 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nt1WI-0007pn-Qu for xen-devel@lists.xenproject.org; Mon, 23 May 2022 06:26:23 +0000 Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0600.outbound.protection.outlook.com [2a01:111:f400:fe1f::600]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 42aecdae-da61-11ec-837e-e5687231ffcc; Mon, 23 May 2022 08:26:21 +0200 (CEST) Received: from AS9PR04CA0098.eurprd04.prod.outlook.com (2603:10a6:20b:50e::29) by DB7PR08MB3642.eurprd08.prod.outlook.com (2603:10a6:10:4a::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.14; Mon, 23 May 2022 06:26:19 +0000 Received: from VE1EUR03FT044.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:50e:cafe::d6) by AS9PR04CA0098.outlook.office365.com (2603:10a6:20b:50e::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.22 via Frontend Transport; Mon, 23 May 2022 06:26:19 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT044.mail.protection.outlook.com (10.152.19.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.14 via Frontend Transport; Mon, 23 May 2022 06:26:18 +0000 Received: ("Tessian outbound 3314dea8c23c:v119"); Mon, 23 May 2022 06:26:18 +0000 Received: from 1df778f9afdf.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id BD48433C-39B2-4CE4-9B55-16FBCDE8EB08.1; Mon, 23 May 2022 06:26:11 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 1df778f9afdf.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 23 May 2022 06:26:11 +0000 Received: from DB6P191CA0003.EURP191.PROD.OUTLOOK.COM (2603:10a6:6:28::13) by AM6PR08MB4551.eurprd08.prod.outlook.com (2603:10a6:20b:70::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.13; Mon, 23 May 2022 06:26:08 +0000 Received: from DBAEUR03FT047.eop-EUR03.prod.protection.outlook.com (2603:10a6:6:28:cafe::c4) by DB6P191CA0003.outlook.office365.com (2603:10a6:6:28::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.14 via Frontend Transport; Mon, 23 May 2022 06:26:08 +0000 Received: from nebula.arm.com (40.67.248.234) by DBAEUR03FT047.mail.protection.outlook.com (100.127.143.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5273.14 via Frontend Transport; Mon, 23 May 2022 06:26: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.27; Mon, 23 May 2022 06:26:07 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) 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.27; Mon, 23 May 2022 06:26:07 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.86) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2308.27 via Frontend Transport; Mon, 23 May 2022 06:26: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: 42aecdae-da61-11ec-837e-e5687231ffcc ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=VgE00X9kVtQbIzXXEG9qzacXaXWER5WfS3RgOLR5DLxg2hemNnh3nh0nGjbNaFdNaZqqxNee3jbJ07RWFPQipE2yAnL9n32B+QOZc8bJi73fzIlXQxClg/sJ1CpSyc3Y0P55GPuyASt2NBtnYWr9UQCmBA5uEk5vKEknMznGk8AlhCLyGbvM5Rj2IQcnjWDxZ4V/ZSF6NmK9mnOql7TMrkg9bNGZJGbAtpw0uRmjxdFOu2JhcG0IBB0m7XmCffQutrCsCg1/5z/y3e0EUxNDXQ7JuZhqpiKjoDYZZ1oTjj/tJokYrkMIlhx4Cl+gQSBTOrknzRfhFh1qWwyYH25aug== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=OLz9U4f5kBuwv8fnxvQyEObMqpaBQsZ5NTftoU1ebo0=; b=n3prIL8aCyivzg5zQ7tLjU6DctejpEnpIoUazvi1tIrgCi1Lj8UxzyITFDldqn0UDxse+R1qDUSNy13y/NVxnzdy9yNlrqfeqP+49Zffz3UNcXIhmcZ+FMHGqWSJy/e/TGFAVCdqaSQ+/dB0YRpQENwWUp450R/7ec5KPbROPSEvvgS5gt6B/FVd7k2Lteoqedluy3VtmRQm5VPcPC9rDKAvD/Tf4NdfQN3IBShLYcUHNPSYSnXJICSs8LrCxqQRkgHvnaJj7m9/E+1/ExBczE/Y7zFMIzbQ1kqxHGFb2D1tECzseoiQ0lYrLsjN+tZEg6fhSniRCbUmJl55fQgBhg== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dmarc=[1,1,header.from=arm.com]) 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=OLz9U4f5kBuwv8fnxvQyEObMqpaBQsZ5NTftoU1ebo0=; b=Sb6cy0hPMNnvEwSqRE1pz9YQAl/r4PXPATqrH0cPntT7VVGCA4Tz94AkZURZb79Z2FrSeD0jVGwLKJHPQBsipDTgFm/FnKl0or2HOBlzVsKL+ZfhmAZTACZ21JkMIQivqJqdCZKnxzaNbkCB581k5QPRlccaC4U5pMV4iYOC29k= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: pass (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; pr=C X-CheckRecipientChecked: true X-CR-MTA-CID: f5aa893e04a90374 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=izPrzjYtgf8q4E/3BmZOqMEJZyvmbSQNpw3zRAA7Ik2rGtlZ1NJcMyoovq0rSlJnHLFbF70+4i5LZDyFjm542mc30wIs+nQ3RYSyE/kZlQB/xdpXTPZNC+jnp3f9JFPx8hMsmDls5y586x85pzj0d2ka/DbiPwkNPLlQoxPCbF1PG557uYJyWyVDXFHDMLZgku7/Lv0xCt9knj8slJTtMxKVz3XA0uQNmunBmo1RbEWxUqQDIlW8h4V6fKLRs7P/zdrYFE6eozPM1hAO/A2qYNf+rK+QBYUaA0ZHk9ELgiZfgRQAkh1xUKIrNwPrcbMAjACpp8q+/5gJPHMvZZLqNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=OLz9U4f5kBuwv8fnxvQyEObMqpaBQsZ5NTftoU1ebo0=; b=Rz/dc0gMbVSgScVb6fYy0gyutK8Y1fnpaJffOLTMaA3p5KUhp4FckbPSEPdyRfDXnOUSSZ77VvQswWp+mmLoH4J9g4ypPTWd8WL5p1OaCVfFqrtbUkJrllQE0DdrR+MSHkvelLKgRPnUDxMIbP+ud5xNZydieUuoMZkrO4D2sZNrgA7w2BCgETFtsznW7wwLP+moXuI9USZNRsDhDHnsT4vfqypbiL2ut78ESqUvZe8WZ4AVC5pXUj2e/BDrIj4aVAlDuFmPJ2/IoVxePmNiKaB1krUl4dmuCYuNYhBm8FtBuKYD/hKl9Yrd6mCKfNOTMXb9VDn5xwQBn+KwCDvhQg== 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=OLz9U4f5kBuwv8fnxvQyEObMqpaBQsZ5NTftoU1ebo0=; b=Sb6cy0hPMNnvEwSqRE1pz9YQAl/r4PXPATqrH0cPntT7VVGCA4Tz94AkZURZb79Z2FrSeD0jVGwLKJHPQBsipDTgFm/FnKl0or2HOBlzVsKL+ZfhmAZTACZ21JkMIQivqJqdCZKnxzaNbkCB581k5QPRlccaC4U5pMV4iYOC29k= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C From: Wei Chen To: CC: , Wei Chen , Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Wei Liu , Jiamei Xie Subject: [PATCH v4 6/8] xen/x86: use paddr_t for addresses in NUMA node structure Date: Mon, 23 May 2022 14:25:23 +0800 Message-ID: <20220523062525.2504290-7-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220523062525.2504290-1-wei.chen@arm.com> References: <20220523062525.2504290-1-wei.chen@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-Correlation-Id: 0b5b9c2a-c195-4d8d-76a8-08da3c85259e X-MS-TrafficTypeDiagnostic: AM6PR08MB4551:EE_|VE1EUR03FT044:EE_|DB7PR08MB3642:EE_ X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: GJU/wEYLfiuXfxxnb/OkXgmAGgo9v8i1LBqLNl6GsNEL5d+PNXDK83Lp2t7SX5H3d2pV1jFX2NRNqYMQqR8rtSNNyUex7aW/EQFRhyTZpB8TqrX4JX2lIqPvyi1Sv+LD86/7xUgT17frvPQ4aQDg0XbYjrt5mdi/CBpOJGugNEqLOE9lhUrq4pgc0GUgmiHnXRjTcKW6BQJXMLMV2VvKcGi4RPfLw+79D5zlmxdsDKOsEk9mSPA7bCuGoNzk1WKTeArstSVAqo7JNsbKFeNxg91zcXbhmn/r0/mzLZZyoFB97EKrjjNd+AvNOvPni3CfJ8YCdDrCE/9LoX5sYPdbwX3c0xO6JFKqlCXrAycQY8WoLNTqXdljxlyXXAPl5FM/IYcJ2pCTAIDQ6Y0Xz42uYcTJsC0dLwd4RIA8LDoFlSbOIpWWW5uKJYlYE1fneOTFY2sWZFQ7M3niYqbTkxByhK5/EBQuXchFfkuc17195WNWd4+t8okINr5thy54GQdH+fi9mU1z0pdCo0Qp/NvL33P0DcTUR7dlCB3kVn49pypShQZTBfE+ZIfNisK4eHvxnLnNjVUHKoEI4eZhJDZIL9PLg7G90vpqBtWm6MxEpqfS9Xxn5PQKNBOzZuxnP3VRktVzKW5lJm7sUaGdcy44FywqPgCZEg3rztKh/2D+7/Bx2PV2hsCokfsDFaWWIoXad+S4eBoXCeeRtg0XgA+keA== 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:(13230001)(4636009)(46966006)(36840700001)(40470700004)(47076005)(316002)(54906003)(4326008)(336012)(426003)(83380400001)(8676002)(82310400005)(70586007)(70206006)(86362001)(36860700001)(356005)(81166007)(2906002)(26005)(2616005)(508600001)(6666004)(44832011)(36756003)(7696005)(40460700003)(186003)(6916009)(1076003)(5660300002)(8936002)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB4551 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT044.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 37b3d7dd-7440-41b1-9fdf-08da3c851f9a X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hs/ZPJRdBIgS/J3az0a2mKOs4wC1ndzzYEPeg+Po1qQpWDQEMI9hV7O7bAfUZ7470cO+2tIRyXzPNzF7vvnylMSarY6VmACC4ZcxtO8G0Ci7E61bUoJXZ2yKGkn4Gb/JX8dRr6IgsayOJMtSpPNibT4eZSnXvr1AVo1rY92eSjHzjRCZCZgseG8yt1FRaufKKd5G3+EMD5DwrVA8fqrLrjyQ7uJV3kM3Jg2J6gnn+Orc9Asnz3v6T03vfWGnftVthlM1hKDlbgmkwpmYVAtqZEqXsVkY7FGF3MYvG7CP9QQHApRdxXBtLJRIjUat9R/CJizjFbYmedJqkEnod5pFzZSD2tRwkEMMTDCUXBgLiryilmbmZ5qqpIaFnsDRCFHyjCW1FOzMC/urS+mS3hTDo5S1bfeSzRC3V/F8lKOwh9j6YJjtynf8zj2FQdLAh9+K5kIA4mVsDjKWRR2eHLK02yFFl1qCCprtdi9qPexfPsUO/esmz2T67aNqPP1cIqHhIjOz2E3P0Ui/gf8GnMS+7CbCouGYz+v+4/i48cAa79US5ynuDzLG11NpCiMSVrmyLfybbLIrsZT9FG4IcYKvOdavrXGViRTpJSzZKAh1y16n1z9otuChP10krXFHqBU0Es2L/kS/CDpcM5e0LZZ2AQ== 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:(13230001)(4636009)(46966006)(36840700001)(4326008)(83380400001)(86362001)(5660300002)(36756003)(8936002)(508600001)(8676002)(7696005)(316002)(47076005)(426003)(336012)(82310400005)(70586007)(70206006)(36860700001)(81166007)(6916009)(1076003)(54906003)(44832011)(186003)(2616005)(6666004)(2906002)(26005);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 May 2022 06:26:18.4399 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0b5b9c2a-c195-4d8d-76a8-08da3c85259e 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: VE1EUR03FT044.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB3642 X-ZohoMail-DKIM: pass (identity @armh.onmicrosoft.com) X-ZM-MESSAGEID: 1653287208768100010 Content-Type: text/plain; charset="utf-8" NUMA node structure "struct node" is using u64 as node memory range. In order to make other architectures can reuse this NUMA node relative code, we replace the u64 to paddr_t. And use pfn_to_paddr and paddr_to_pfn to replace explicit shift operations. The relate PRIx64 in print messages have been replaced by PRIpaddr at the same time. And some being-phased-out types like u64 in the lines we have touched also have been converted to uint64_t or unsigned long. Change-Id: Iac64ff398c10f6e642d40d06fc57e28806a1a4ff Issue-Id: SCM-2240 Tested-by: Jiamei Xie Signed-off-by: Wei Chen Acked-by: Jan Beulich --- v3 -> v4: 1. Add Tb. v2 -> v3: 1. Use uint64_t for size in acpi_scan_nodes, make it be consistent with numa_emulation. 2. Add Tb. v1 -> v2: 1. Drop useless cast. 2. Use initializers of the variables. 3. Replace u64 by uint64_t. 4. Use unsigned long for start_pfn and end_pfn. --- xen/arch/x86/include/asm/numa.h | 8 ++++---- xen/arch/x86/numa.c | 32 +++++++++++++++----------------- xen/arch/x86/srat.c | 25 +++++++++++++------------ 3 files changed, 32 insertions(+), 33 deletions(-) diff --git a/xen/arch/x86/include/asm/numa.h b/xen/arch/x86/include/asm/num= a.h index 5d8385f2e1..c32ccffde3 100644 --- a/xen/arch/x86/include/asm/numa.h +++ b/xen/arch/x86/include/asm/numa.h @@ -18,7 +18,7 @@ extern cpumask_t node_to_cpumask[]; #define node_to_cpumask(node) (node_to_cpumask[node]) =20 struct node {=20 - u64 start,end;=20 + paddr_t start, end; }; =20 extern int compute_hash_shift(struct node *nodes, int numnodes, @@ -38,7 +38,7 @@ 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 void setup_node_bootmem(nodeid_t nodeid, paddr_t start, paddr_t end= ); extern nodeid_t apicid_to_node[]; extern void init_cpu_to_node(void); =20 @@ -76,9 +76,9 @@ static inline __attribute__((pure)) nodeid_t phys_to_nid(= paddr_t addr) NODE_DATA(nid)->node_spanned_pages) #define arch_want_default_dmazone() (num_online_nodes() > 1) =20 -extern int valid_numa_range(u64 start, u64 end, nodeid_t node); +extern int valid_numa_range(paddr_t start, paddr_t end, nodeid_t node); =20 -void srat_parse_regions(u64 addr); +void srat_parse_regions(paddr_t addr); extern u8 __node_distance(nodeid_t a, nodeid_t b); unsigned int arch_get_dma_bitsize(void); =20 diff --git a/xen/arch/x86/numa.c b/xen/arch/x86/numa.c index 680b7d9002..627ae8aa95 100644 --- a/xen/arch/x86/numa.c +++ b/xen/arch/x86/numa.c @@ -162,12 +162,10 @@ int __init compute_hash_shift(struct node *nodes, int= numnodes, return shift; } /* 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; +void __init setup_node_bootmem(nodeid_t nodeid, paddr_t start, paddr_t end) +{ + unsigned long start_pfn =3D paddr_to_pfn(start); + unsigned long end_pfn =3D paddr_to_pfn(end); =20 NODE_DATA(nodeid)->node_start_pfn =3D start_pfn; NODE_DATA(nodeid)->node_spanned_pages =3D end_pfn - start_pfn; @@ -198,11 +196,12 @@ void __init numa_init_array(void) static int numa_fake __initdata =3D 0; =20 /* Numa emulation */ -static int __init numa_emulation(u64 start_pfn, u64 end_pfn) +static int __init numa_emulation(unsigned long start_pfn, + unsigned long end_pfn) { int i; struct node nodes[MAX_NUMNODES]; - u64 sz =3D ((end_pfn - start_pfn)< 1 ) @@ -218,9 +217,9 @@ static int __init numa_emulation(u64 start_pfn, u64 end= _pfn) memset(&nodes,0,sizeof(nodes)); for ( i =3D 0; i < numa_fake; i++ ) { - nodes[i].start =3D (start_pfn<start < start) { @@ -275,7 +275,7 @@ acpi_numa_processor_affinity_init(const struct acpi_sra= t_cpu_affinity *pa) void __init acpi_numa_memory_affinity_init(const struct acpi_srat_mem_affinity *ma) { - u64 start, end; + paddr_t start, end; unsigned pxm; nodeid_t node; int i; @@ -318,7 +318,7 @@ acpi_numa_memory_affinity_init(const struct acpi_srat_m= em_affinity *ma) bool mismatch =3D !(ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE) !=3D !test_bit(i, memblk_hotplug); =20 - printk("%sSRAT: PXM %u (%"PRIx64"-%"PRIx64") overlaps with itself (%"PRI= x64"-%"PRIx64")\n", + printk("%sSRAT: PXM %u (%"PRIpaddr"-%"PRIpaddr") overlaps with itself (%= "PRIpaddr"-%"PRIpaddr")\n", mismatch ? KERN_ERR : KERN_WARNING, pxm, start, end, node_memblk_range[i].start, node_memblk_range[i].end); if (mismatch) { @@ -327,7 +327,7 @@ acpi_numa_memory_affinity_init(const struct acpi_srat_m= em_affinity *ma) } } else { printk(KERN_ERR - "SRAT: PXM %u (%"PRIx64"-%"PRIx64") overlaps with PXM %u (%"PRIx6= 4"-%"PRIx64")\n", + "SRAT: PXM %u (%"PRIpaddr"-%"PRIpaddr") overlaps with PXM %u (%"P= RIpaddr"-%"PRIpaddr")\n", pxm, start, end, node_to_pxm(memblk_nodeid[i]), node_memblk_range[i].start, node_memblk_range[i].end); bad_srat(); @@ -346,7 +346,7 @@ acpi_numa_memory_affinity_init(const struct acpi_srat_m= em_affinity *ma) nd->end =3D end; } } - printk(KERN_INFO "SRAT: Node %u PXM %u %"PRIx64"-%"PRIx64"%s\n", + printk(KERN_INFO "SRAT: Node %u PXM %u %"PRIpaddr"-%"PRIpaddr"%s\n", node, pxm, start, end, ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE ? " (hotplug)" : ""); =20 @@ -369,7 +369,7 @@ static int __init nodes_cover_memory(void) =20 for (i =3D 0; i < e820.nr_map; i++) { int j, found; - unsigned long long start, end; + paddr_t start, end; =20 if (e820.map[i].type !=3D E820_RAM) { continue; @@ -396,7 +396,7 @@ static int __init nodes_cover_memory(void) =20 if (start < end) { printk(KERN_ERR "SRAT: No PXM for e820 range: " - "%016Lx - %016Lx\n", start, end); + "%"PRIpaddr" - %"PRIpaddr"\n", start, end); return 0; } } @@ -432,7 +432,7 @@ static int __init cf_check srat_parse_region( return 0; } =20 -void __init srat_parse_regions(u64 addr) +void __init srat_parse_regions(paddr_t addr) { u64 mask; unsigned int i; @@ -457,7 +457,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 acpi_scan_nodes(paddr_t start, paddr_t end) { int i; nodemask_t all_nodes_parsed; @@ -489,7 +489,8 @@ int __init acpi_scan_nodes(u64 start, u64 end) /* Finally register nodes */ for_each_node_mask(i, all_nodes_parsed) { - u64 size =3D nodes[i].end - nodes[i].start; + uint64_t 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); --=20 2.25.1 From nobody Wed May 15 11:12:57 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=2 dmarc=pass fromdomain=arm.com); dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=3; a=rsa-sha256; t=1653287222; cv=pass; d=zohomail.com; s=zohoarc; b=SIld5K23EZVgWf1GKrU3JLM3p6wvRZ2UCtIQ9GcBKb9450fDFI8muNYH6cRVc723Mg1KGrsT2c2JrdP6QQTEYUmqP4YXlF+IKyBQEgRcsDTU/IvzUmFjOgu+RZ0DXRlI0sHYJLv9g+vd5avRlArdcxc3flTYxAy1fiy9DTBCGwY= ARC-Message-Signature: i=3; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1653287222; 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=F+0l6aEvx/DTIL60yMCTuk7IatOAWAYvcrFcxcdYsBY=; b=JUERued5uFXSn+uUBYccw6s5kFldAoa/JQ5kY/leybt65au6Z+bjt7mYLEj2JHyUHztSx+XYzY4vCxI/h+zLu4NhtH1KuLJ9I/wqUGlHeCxKru1x59se4Pk01PtnqKe7myx2Z56FAHRuRmE7hPxdD6P+K25DhTpKO6IahTJEEW8= ARC-Authentication-Results: i=3; 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=2 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 165328722248876.89489119951338; Sun, 22 May 2022 23:27:02 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.335369.559592 (Exim 4.92) (envelope-from ) id 1nt1WU-0002a3-A1; Mon, 23 May 2022 06:26:34 +0000 Received: by outflank-mailman (output) from mailman id 335369.559592; Mon, 23 May 2022 06:26: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 1nt1WU-0002YR-1S; Mon, 23 May 2022 06:26:34 +0000 Received: by outflank-mailman (input) for mailman id 335369; Mon, 23 May 2022 06:26:32 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nt1WS-0008Q2-E0 for xen-devel@lists.xenproject.org; Mon, 23 May 2022 06:26:32 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2060e.outbound.protection.outlook.com [2a01:111:f400:7e1a::60e]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 48c0547f-da61-11ec-bd2c-47488cf2e6aa; Mon, 23 May 2022 08:26:31 +0200 (CEST) Received: from AS9PR06CA0213.eurprd06.prod.outlook.com (2603:10a6:20b:45e::12) by VI1PR08MB4144.eurprd08.prod.outlook.com (2603:10a6:803:e2::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.14; Mon, 23 May 2022 06:26:27 +0000 Received: from AM5EUR03FT030.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:45e:cafe::b1) by AS9PR06CA0213.outlook.office365.com (2603:10a6:20b:45e::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.13 via Frontend Transport; Mon, 23 May 2022 06:26:26 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT030.mail.protection.outlook.com (10.152.16.117) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.14 via Frontend Transport; Mon, 23 May 2022 06:26:26 +0000 Received: ("Tessian outbound 3314dea8c23c:v119"); Mon, 23 May 2022 06:26:26 +0000 Received: from a5a1382e5d4a.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 153250D8-CC9C-45D7-970F-CCD81DEDCAA7.1; Mon, 23 May 2022 06:26:19 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id a5a1382e5d4a.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 23 May 2022 06:26:19 +0000 Received: from DB3PR08CA0019.eurprd08.prod.outlook.com (2603:10a6:8::32) by DB8PR08MB5193.eurprd08.prod.outlook.com (2603:10a6:10:e6::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.19; Mon, 23 May 2022 06:26:11 +0000 Received: from DBAEUR03FT052.eop-EUR03.prod.protection.outlook.com (2603:10a6:8:0:cafe::a2) by DB3PR08CA0019.outlook.office365.com (2603:10a6:8::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.15 via Frontend Transport; Mon, 23 May 2022 06:26:11 +0000 Received: from nebula.arm.com (40.67.248.234) by DBAEUR03FT052.mail.protection.outlook.com (100.127.142.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5273.14 via Frontend Transport; Mon, 23 May 2022 06:26:10 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Mon, 23 May 2022 06:26:10 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.86) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2308.27 via Frontend Transport; Mon, 23 May 2022 06: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: 48c0547f-da61-11ec-bd2c-47488cf2e6aa ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=W6U93C3iqDqKgWwNjzaPS7oz/qfdWlCdm36MVBXIRIK9DPf/RZi1PYJ8Wq1uVOOVfh2v27dAz55hTErbnBG9RYP6Mw8iiLqPLGOpbN82KMWnmz9TDSi1lw327/FjIkh/fjh7fxfNPkKgcsrFy0mChxXQl3lg5WNOLf+5509R1PprK09x1ZD7GQ2LXpo/f6T85OKO3Uge27VNtVbO7JCvBAv/gcehgOIb45fZDJ82wyMsdCO0zrdX2v7iaJ+Cj3CppSt07VhJADrae7x60LOUbzhREueTOf9i1+5K2j3tS00SDXlTH2fcET1uuxuwahKaw6IjazM6IdYTNfbFFt+f3A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=F+0l6aEvx/DTIL60yMCTuk7IatOAWAYvcrFcxcdYsBY=; b=dJTN3zW08Kze9SrSFUe/zLkwO/gYpFgOXQeLHV8BP5Q9ejIs4Eoi9VOk5Sofj/BM1cZ/7MLLham2l6PbzPI227JQFe3CKB2Mid4R+NLNUSMlG6H5lkqgEk1PT1MDUOsFrmzjM0hN1EO2u+FTXd2GQ+MmJymhmrMoO3xh8Xs+E45qR5kcVykqJSaFLUg35Q/FsWx0nyDbiSNmG/MlwarENlW8yKATPjrCu+6IZRX761H/T5gtC092qnyRYZLiWUiaAtjudhRglWsjSBj5oKZPAwDNkP2koRFat4AG8dU+Qbc28malPeD3MFMrlZbOiVYqzQM4O7Q8XPeRNnjB+PPYwA== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dmarc=[1,1,header.from=arm.com]) 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=F+0l6aEvx/DTIL60yMCTuk7IatOAWAYvcrFcxcdYsBY=; b=Fqrh7eOvFNqtq9REfZ6ZU47LvfGm75/1YRCS1qti3uQGoQUD8sFOoOk691y8dh3ZTAUooOHuULkAoySUzOXPn3oxh50beQrKwxVhpJNM8VWKaeIlOwiRdvMaVXPx7WDqF9LQoIHbTUKZHX0fQKUWht8pDorFaBSmItaJ5yAIS9g= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: pass (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; pr=C X-CheckRecipientChecked: true X-CR-MTA-CID: 34b6f2de4d519696 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OFmI2/1rpqQLiZs7vkmXz5FNmlvBsh7XI1cpACZFKLfpTI00M0+3/FbUwq0WGlRUVNDEsQB9FlVkn8nXvhwfKUZ80VbM6d2VaXrML46DckOZbgG5rZbGQrLzl2Gxrrb6g+ZU/pW+SqSoSm2STjI0e0u++eOs3f0mBbQqzT281KaDB7Rn7WAlQ1Nf9pfwE77emClK5mL4ERBhrorRd+K8UsKBspvoUGseZqLCROd3nXVohvCyhslj18VCHaBZBBaDDl4GKP3BRnFH/kLLeUqoApotElESrFEBUabsV3ec0aJy6SDZ2GfETA0Uy0MuKgDQfECRwiIRCQHeUowKjIARJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=F+0l6aEvx/DTIL60yMCTuk7IatOAWAYvcrFcxcdYsBY=; b=Tql3jfskXYQ8KGYCpvdi8vDJd+W8mboMkY4DM34UlkfxFIsu2gwABncl1CcJtfUMFM2J2Xhm95n3wsYRSu4YrhbiYuCxWE9PFMXw/dDNs3YLYkL6kCraYCpmCZw841W3Kf0Dmy0Yl4mW7el9EzDp1Zswst/LAnK2/YZNwJhYLJtbk/qHedha22DzCKGtKJGYYkxuq6m8kLBywzpmHtXOJHGlEbIcaENuIlvKdi7SxcuBehVEFFyBO3ZdOB54X2knkItt2DbKdvFw4dcaoeptDKqwf/50rhQA6amU6qs12NxRUTghn/PJjV41uMxHx5pOzaC4RcEBNWRWwDGyD3bUGg== 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=F+0l6aEvx/DTIL60yMCTuk7IatOAWAYvcrFcxcdYsBY=; b=Fqrh7eOvFNqtq9REfZ6ZU47LvfGm75/1YRCS1qti3uQGoQUD8sFOoOk691y8dh3ZTAUooOHuULkAoySUzOXPn3oxh50beQrKwxVhpJNM8VWKaeIlOwiRdvMaVXPx7WDqF9LQoIHbTUKZHX0fQKUWht8pDorFaBSmItaJ5yAIS9g= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C From: Wei Chen To: CC: , Wei Chen , Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Wei Liu , Jiamei Xie Subject: [PATCH v4 7/8] xen/x86: add detection of memory interleaves for different nodes Date: Mon, 23 May 2022 14:25:24 +0800 Message-ID: <20220523062525.2504290-8-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220523062525.2504290-1-wei.chen@arm.com> References: <20220523062525.2504290-1-wei.chen@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-Correlation-Id: 61b5c1e2-c789-4f87-f12b-08da3c852a5a X-MS-TrafficTypeDiagnostic: DB8PR08MB5193:EE_|AM5EUR03FT030:EE_|VI1PR08MB4144:EE_ X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: EfCIdYz6JRxum8gInCmgE0/QSQ685/890se25ATAhJR1rEsMcG86Q14VjE+5HeJl+ESgXTk/D6N0/9mZafIoYFwvlR9vM83n+eABnnQfBtT5G/HwENs7IFCb97ihp4S4qeJ4ZopDy3AlSxcJUxSO6D1FQtssvu5u4s1HBGKIstf3uXBISctQxcM+ZTPkO5BZDIPI2tYc2jeJHlRpqul1AJvpFDnOnTYCXR1u5mde8MlGqAe55pNnEDxCeMF7XJlFwDfQ2G5g0cklA8243lhymkFzCUZbYyS+m5Ihjr/swqrW1YgvPsg7g6wZCaZnPjccdEI3M7Yl5JDEY1e3WR6PqGox9rRxb/VRG3zStW8XgAOeXcekEpHxOdrDGA1APiQ7VchRb9sI8cBsU2SvtWxWQqJmpNjMK7oZVM7iinSR4bm/Am3GJi1vAIQH9GZZZnAJ1TENYQg15CgM7FmgOH3Mz00qIJlLksy497/wpjFcs3fZz6HqC7YD7PO34yJjvMNJguWH82ENm8qJNTbWXDCmzfiQDnVkFANljC24iru7hC3uHUcJsxB1G7xoK5aTqkQ335QuXDZJp18pdWDNJO5V8j1YKiGUk341HNRkA6070wBweiUbUFJiNb+3GihbNNv5Zqi+pCiwtyzEAsRDYFYdKOXNvEKU6G5ssAaxdPRQ5teQen8AF61WjMBQHSlxEzzQzuvxauG87HPhPnadcZKH8Q== 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:(13230001)(4636009)(40470700004)(36840700001)(46966006)(5660300002)(36756003)(356005)(508600001)(7696005)(6666004)(54906003)(26005)(44832011)(40460700003)(81166007)(316002)(70586007)(70206006)(4326008)(8676002)(6916009)(8936002)(82310400005)(426003)(336012)(186003)(47076005)(2906002)(36860700001)(86362001)(83380400001)(2616005)(1076003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB5193 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT030.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 68ea353d-2482-48a3-f06d-08da3c852117 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 81nemQxR9m2B27sh7Cp0st257eeFLIZ9upT5PMyutlvWk7RTVt3PKlrHfhTmVN0W6LElJsVGAKy7K/g/N0nEmwHyYtucsWAttjFry9f/2lGb7vbcd013d/t3LwEmSvG/uTsomYk7kv3fJFCOGyOGYHQDWSmcGvEjo0Gz0VtFf+RUTxPl88rCKF4F4m3Co2oDA6FM6umHjCj8xfSx2CUb8thwad75/mCtRuzsyyzWO7ELkDHcfK7Qx5dODW+Nx3YyrvUx8nlAk3Kzy/pmUpmi4HUoTxBtl/zQZbheHngZagbY4ZK5KHySPQYwaUhz+ZLceUU2z07B1lRgyTU+oerntQuooW6l0Xj9DPJ8m+4Hfa8o/RGTIvu5JMMx4LKgEr3UEs1y+8vxIf9gV2eBEgOFAqAWoHIFB+BsBeMut9/vVcFvjF8zgVAM+ijJCbF5kepLTzAbxb4jHp482MXy1usOiPJjCX8rSixdJQUUG+8sZ5dQFJcLLIf6r0QuzcaQotFddQnyOMrjQf1NtetI6nMGex5EE4jT6mPOQwTd3zB5Fs81PQDL7rjKu02u3hX9HVIK3pkv5KoZIsKoxIdidgJ4G9ueExFDGPJ7pYmmyJz3wsIiCWVA/oS0K6SuhWGLzwTPVwPIlbaicLYaCbBxR0fnRA== 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:(13230001)(4636009)(36840700001)(46966006)(26005)(186003)(81166007)(7696005)(47076005)(36860700001)(8936002)(426003)(6666004)(2616005)(2906002)(36756003)(1076003)(44832011)(5660300002)(336012)(316002)(82310400005)(83380400001)(4326008)(70586007)(70206006)(508600001)(86362001)(8676002)(54906003)(6916009);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 May 2022 06:26:26.4641 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 61b5c1e2-c789-4f87-f12b-08da3c852a5a 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: AM5EUR03FT030.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB4144 X-ZohoMail-DKIM: pass (identity @armh.onmicrosoft.com) X-ZM-MESSAGEID: 1653287222852100001 One NUMA node may contain several memory blocks. In current Xen code, Xen will maintain a node memory range for each node to cover all its memory blocks. But here comes the problem, in the gap of one node's two memory blocks, if there are some memory blocks don't belong to this node (remote memory blocks). This node's memory range will be expanded to cover these remote memory blocks. One node's memory range contains other nodes' memory, this is obviously not very reasonable. This means current NUMA code only can support node has no interleaved memory blocks. However, on a physical machine, the addresses of multiple nodes can be interleaved. So in this patch, we add code to detect memory interleaves of different nodes. NUMA initialization will be failed and error messages will be printed when Xen detect such hardware configuration. Change-Id: Ia7ff9a9128ecbe3eb4dddd1307ae8fbe65575ccf Issue-Id: SCM-2240 Signed-off-by: Wei Chen Tested-by: Jiamei Xie --- v3 -> v4: 1. Drop "ERR" prefix for enumeration, and remove init value. 2. Use "switch case" for enumeration, and add "default:" 3. Use "PXM" in log messages. 4. Use unsigned int for node memory block id. 5. Fix some code-style comments. 6. Use "nd->end" in node range expansion check. v2 -> v3: 1. Merge the check code from a separate function to conflicting_memblks. This will reduce the loop times of node memory blocks. 2. Use an enumeration to indicate conflict check status. 3. Use a pointer to get conflict memory block id. v1 -> v2: 1. Update the description to say we're after is no memory interleaves of different nodes. 2. Only update node range when it passes the interleave check. 3. Don't use full upper-case for "node". --- xen/arch/x86/srat.c | 132 +++++++++++++++++++++++++++++++++----------- 1 file changed, 101 insertions(+), 31 deletions(-) diff --git a/xen/arch/x86/srat.c b/xen/arch/x86/srat.c index 8ffe43bdfe..a831df7648 100644 --- a/xen/arch/x86/srat.c +++ b/xen/arch/x86/srat.c @@ -42,6 +42,12 @@ 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 +enum conflicts { + NO_CONFLICT, + OVERLAP, + INTERLEAVE, +}; + static inline bool node_found(unsigned idx, unsigned pxm) { return ((pxm2node[idx].pxm =3D=3D pxm) && @@ -119,20 +125,45 @@ int valid_numa_range(paddr_t start, paddr_t end, node= id_t node) return 0; } =20 -static __init int conflicting_memblks(paddr_t start, paddr_t end) +static +enum conflicts __init conflicting_memblks(nodeid_t nid, paddr_t start, + paddr_t end, paddr_t nd_start, + paddr_t nd_end, unsigned int *mblkid) { - int i; + unsigned int i; =20 + /* + * Scan all recorded nodes' memory blocks to check conflicts: + * Overlap or interleave. + */ for (i =3D 0; i < num_node_memblks; i++) { struct node *nd =3D &node_memblk_range[i]; + + *mblkid =3D i; + + /* Skip 0 bytes node memory block. */ if (nd->start =3D=3D nd->end) continue; + /* + * Use memblk range to check memblk overlaps, include the + * self-overlap case. + */ if (nd->end > start && nd->start < end) - return i; + return OVERLAP; if (nd->end =3D=3D end && nd->start =3D=3D start) - return i; + return OVERLAP; + /* + * Use node memory range to check whether new range contains + * memory from other nodes - interleave check. We just need + * to check full contains situation. Because overlaps have + * been checked above. + */ + if (nid !=3D memblk_nodeid[i] && + (nd_start < nd->start && nd->end < nd_end)) + return INTERLEAVE; } - return -1; + + return NO_CONFLICT; } =20 static __init void cutoff_node(int i, paddr_t start, paddr_t end) @@ -275,10 +306,13 @@ acpi_numa_processor_affinity_init(const struct acpi_s= rat_cpu_affinity *pa) void __init acpi_numa_memory_affinity_init(const struct acpi_srat_mem_affinity *ma) { + enum conflicts status; + struct node *nd; + paddr_t nd_start, nd_end; paddr_t start, end; unsigned pxm; nodeid_t node; - int i; + unsigned int i; =20 if (srat_disabled()) return; @@ -310,42 +344,78 @@ acpi_numa_memory_affinity_init(const struct acpi_srat= _mem_affinity *ma) bad_srat(); return; } + + /* + * For the node that already has some memory blocks, we will + * expand the node memory range temporarily to check memory + * interleaves with other nodes. We will not use this node + * temp memory range to check overlaps, because it will mask + * the overlaps in same node. + * + * Node with 0 bytes memory doesn't need this expandsion. + */ + nd_start =3D start; + nd_end =3D end; + nd =3D &nodes[node]; + if (nd->start !=3D nd->end) { + if (nd_start > nd->start) + nd_start =3D nd->start; + + if (nd_end < nd->end) + nd_end =3D nd->end; + } + /* It is fine to add this area to the nodes data it will be used later*/ - i =3D conflicting_memblks(start, end); - if (i < 0) - /* everything fine */; - else if (memblk_nodeid[i] =3D=3D node) { - bool mismatch =3D !(ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE) !=3D - !test_bit(i, memblk_hotplug); - - printk("%sSRAT: PXM %u (%"PRIpaddr"-%"PRIpaddr") overlaps with itself (%= "PRIpaddr"-%"PRIpaddr")\n", - mismatch ? KERN_ERR : KERN_WARNING, pxm, start, end, - node_memblk_range[i].start, node_memblk_range[i].end); - if (mismatch) { + status =3D conflicting_memblks(node, start, end, nd_start, nd_end, &i); + switch(status) + { + case OVERLAP: + { + if (memblk_nodeid[i] =3D=3D node) { + bool mismatch =3D !(ma->flags & + ACPI_SRAT_MEM_HOT_PLUGGABLE) !=3D + !test_bit(i, memblk_hotplug); + + printk("%sSRAT: PXM %u (%"PRIpaddr"-%"PRIpaddr") overlaps with itself (= %"PRIpaddr"-%"PRIpaddr")\n", + mismatch ? KERN_ERR : KERN_WARNING, pxm, start, + end, node_memblk_range[i].start, + node_memblk_range[i].end); + if (mismatch) { + bad_srat(); + return; + } + break; + } else { + printk(KERN_ERR + "SRAT: PXM %u (%"PRIpaddr"-%"PRIpaddr") overlaps with PXM %u (%"= PRIpaddr"-%"PRIpaddr")\n", + pxm, start, end, node_to_pxm(memblk_nodeid[i]), + node_memblk_range[i].start, + node_memblk_range[i].end); bad_srat(); return; } - } else { + } + + case INTERLEAVE: + { printk(KERN_ERR - "SRAT: PXM %u (%"PRIpaddr"-%"PRIpaddr") overlaps with PXM %u (%"P= RIpaddr"-%"PRIpaddr")\n", - pxm, start, end, node_to_pxm(memblk_nodeid[i]), + "SRAT=EF=BC=9A PXM %u: (%"PRIpaddr"-%"PRIpaddr") interleaves with= PXM %u memblk (%"PRIpaddr"-%"PRIpaddr")\n", + node, nd_start, nd_end, node_to_pxm(memblk_nodeid[i]), node_memblk_range[i].start, node_memblk_range[i].end); bad_srat(); return; } - if (!(ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE)) { - struct node *nd =3D &nodes[node]; =20 - 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; - } + default: + break; + } + + if (!(ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE)) { + node_set(node, memory_nodes_parsed); + nd->start =3D nd_start; + nd->end =3D nd_end; } + printk(KERN_INFO "SRAT: Node %u PXM %u %"PRIpaddr"-%"PRIpaddr"%s\n", node, pxm, start, end, ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE ? " (hotplug)" : ""); --=20 2.25.1 From nobody Wed May 15 11:12:57 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=2 dmarc=pass fromdomain=arm.com); dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=3; a=rsa-sha256; t=1653287213; cv=pass; d=zohomail.com; s=zohoarc; b=G3nJfx66ZXQkwyZJXt0VcH6YLg/QJw1HMmYdC871xEZ+iG5EByuYGx3p/RJO0IkNpdySogPJT3LNAAik5hSsaHvoTKp4eyhkk96VsESzJIvE2j9A8yRPc90eu/r8lEJy3/9dMevmLivkPgeFdc/bPYMeTB1Gy4HWeTb2dPoUPiE= ARC-Message-Signature: i=3; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1653287213; 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=nGzvy5CI0O3ZOxHFKXykWCIAbSrQeBaDVkYt3xk4464=; b=QQyrOqFlK47O8NMeaEIl4ePpDOHhNLnzbi7yfwNBY3nt+7oF26AkzWG9zAk1SX+zUpue0I4Pp3mN7p+Gi/rjYtZ9XsPWqKc/rqUvv0Lnu5EN+YE4piNqZpx2Eb7SiPpOEy66aD89MKFtnrbceY+AX2WlfvClHvmMO7J2OuieMGo= ARC-Authentication-Results: i=3; 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=2 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 1653287213497350.28046613774825; Sun, 22 May 2022 23:26:53 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.335365.559581 (Exim 4.92) (envelope-from ) id 1nt1WQ-0001wz-Ep; Mon, 23 May 2022 06:26:30 +0000 Received: by outflank-mailman (output) from mailman id 335365.559581; Mon, 23 May 2022 06:26:30 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nt1WQ-0001wm-8j; Mon, 23 May 2022 06:26:30 +0000 Received: by outflank-mailman (input) for mailman id 335365; Mon, 23 May 2022 06:26:29 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nt1WP-0007pn-Co for xen-devel@lists.xenproject.org; Mon, 23 May 2022 06:26:29 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on062b.outbound.protection.outlook.com [2a01:111:f400:fe0d::62b]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 461f1715-da61-11ec-837e-e5687231ffcc; Mon, 23 May 2022 08:26:26 +0200 (CEST) Received: from AS9PR04CA0096.eurprd04.prod.outlook.com (2603:10a6:20b:50e::26) by VI1PR0802MB2512.eurprd08.prod.outlook.com (2603:10a6:800:b0::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.18; Mon, 23 May 2022 06:26:23 +0000 Received: from VE1EUR03FT044.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:50e:cafe::1d) by AS9PR04CA0096.outlook.office365.com (2603:10a6:20b:50e::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.22 via Frontend Transport; Mon, 23 May 2022 06:26:23 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT044.mail.protection.outlook.com (10.152.19.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.14 via Frontend Transport; Mon, 23 May 2022 06:26:23 +0000 Received: ("Tessian outbound 3314dea8c23c:v119"); Mon, 23 May 2022 06:26:23 +0000 Received: from 087b98c53955.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 70469D15-99EB-41AA-98D4-AE064CED749F.1; Mon, 23 May 2022 06:26:16 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 087b98c53955.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 23 May 2022 06:26:16 +0000 Received: from DB8P191CA0011.EURP191.PROD.OUTLOOK.COM (2603:10a6:10:130::21) by AS8PR08MB5944.eurprd08.prod.outlook.com (2603:10a6:20b:297::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.16; Mon, 23 May 2022 06:26:14 +0000 Received: from DBAEUR03FT050.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:130:cafe::bb) 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.5273.16 via Frontend Transport; Mon, 23 May 2022 06:26:13 +0000 Received: from nebula.arm.com (40.67.248.234) by DBAEUR03FT050.mail.protection.outlook.com (100.127.142.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5273.14 via Frontend Transport; Mon, 23 May 2022 06:26:13 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Mon, 23 May 2022 06:26:12 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.86) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2308.27 via Frontend Transport; Mon, 23 May 2022 06:26:10 +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: 461f1715-da61-11ec-837e-e5687231ffcc ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=KCVcJZhJUZbhnkKSMpKaO3cdh3pvmYhNpz7DFCUDQRkq0UF02uqcokFBBB/ZGRHwQu3iOeKB+1Dz4AgJJDxqhZdzT65lNQSKs8elOBRz0SXDZYBoDfETJZwFthH2Pv4lRq57+eRyHewLV1Rdc93nYpNAcL7E8jPjz7753SKt6P4wKttlyIxs65krkENwL9dyfxX9vUN3gIWauOCymZROvBdxW32pBpYe3mA5vLkjpY7PBJUGRIAiyNrb2v+5JAfGKkF6gdd4A0AgNSg023PZSwstidwUIqnQv0LYWeOAVZmVzPgxlCjD7+xovL7MU1p5QbcaMElSeyL912pPPTDD/A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=nGzvy5CI0O3ZOxHFKXykWCIAbSrQeBaDVkYt3xk4464=; b=MxRw32muwCC5hE+EmCg7ucoXyUnukSHBAgCBeC+jub9xc6JGZoj6ydnWeD535Kas8cfv02ROtgJ9t4Kl5vo/rd2SC2ff+3VDqms/ah7Qc/sQkdaXzwHlMtE3qRmV9LO0rg4kmpB5lVtJBFO1Fe95amifSwAd58+tTKuNxOmrAlnCONVebrMPZFe6iQzjn3A3C8CDygzRZgiRN+4oTP1836UTwqWk/FnIuj0UQipC1MRfLoAA1lN8ob9vMTAYTWCPh0w9u5nAsUmGdHUawnJQu6mHTtiE16C2VC6yoNbhXxP+2hHP2W4cpge6J460c93XHIh4HaL2W0bo/iXSZsTtPQ== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dmarc=[1,1,header.from=arm.com]) 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=nGzvy5CI0O3ZOxHFKXykWCIAbSrQeBaDVkYt3xk4464=; b=KBaZZdq74csLi6ln6eYuQxJ5hU6Xqwf3fWSAQKknxJo369e7PtEuf3NDNFXs5DJN8Gb5qCvWq19VYLmVb/j3sUNKk9pXdTv6TSFo+76j+IwR0Ghp55etdeMU+/88gRnuIo5kOwlBcNsmf6TSt8NUO9VVYe860bkvA7DDJF1rOxQ= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: pass (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; pr=C X-CheckRecipientChecked: true X-CR-MTA-CID: bcb0d0647ddc198f X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aYNw9B522rvIP5stLZMPI7Aswxl5/52XMGIb9s59D2LfNrlPBivZraUuhjPg4ltIYzTmn7sHkvqjMTOrl91wqay/XSNYQ9+dK7GfLK4P/Eg3RkjepdTO2z8WVmfIhzICTkKP1iqRk++GWasKebDUqwOaEpK3y6VfzT4xDaJKXKHrMKzCJ3suWyyzpODdnUbj9tURfuJRtAa7aCFGSBj6LSJ4/lAwdU8ykKTTfUJhGgKAInqRihXyvuQqafkNbsyWm4TyYVCWd6+FNCZK5XO+PUPGWoGcqLqKAm/IT2rxnacr915zJQ0TF7aM7zQgCBCpdNvBwiFMFemjytNwmDK/Ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=nGzvy5CI0O3ZOxHFKXykWCIAbSrQeBaDVkYt3xk4464=; b=QdvKwzQ0NKb6fXKS2hfI844uZq3LnVYD3PlXPtzFMB7owJQtsk+vQdV6mHGOOChR+rBhD7OV+1H3wGtjodZJ7ji58GJHkRiXQhcby42NybL7dtOMlnHlmQZtRnMvfkXB3L3JuP3ra4LPQY3q/UpQgpGaGG/mNeXzRJMcfqctO5PaKGwOlvKgO+Yhrv7fFkicBA+SE7S4keK0t/nCW3LhyMTt9459zSK1rRrZiGaXhelSs4yhbk3cVfEQ1ktOyAz647GyQx5C45mDqynxiN8syQHGqwW+GTrq/fwvMphBDq5zvdTV4YYPkmBpeQc6pOYMZLmi3VaKwjqe2fxgxDfBjA== 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=nGzvy5CI0O3ZOxHFKXykWCIAbSrQeBaDVkYt3xk4464=; b=KBaZZdq74csLi6ln6eYuQxJ5hU6Xqwf3fWSAQKknxJo369e7PtEuf3NDNFXs5DJN8Gb5qCvWq19VYLmVb/j3sUNKk9pXdTv6TSFo+76j+IwR0Ghp55etdeMU+/88gRnuIo5kOwlBcNsmf6TSt8NUO9VVYe860bkvA7DDJF1rOxQ= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C From: Wei Chen To: CC: , Wei Chen , Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Wei Liu Subject: [PATCH v4 8/8] xen/x86: use INFO level for node's without memory log message Date: Mon, 23 May 2022 14:25:25 +0800 Message-ID: <20220523062525.2504290-9-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220523062525.2504290-1-wei.chen@arm.com> References: <20220523062525.2504290-1-wei.chen@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-Correlation-Id: 3b7b541f-472f-40cb-f96b-08da3c852877 X-MS-TrafficTypeDiagnostic: AS8PR08MB5944:EE_|VE1EUR03FT044:EE_|VI1PR0802MB2512:EE_ X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: vH2pEClYPyETMjP1jSI42xqA+RGpwNvFb0/TxkMJFNllPZM5neyrMHjp0K2Sj1dJDgpaGktBTUcxJeta0o8I3rsfEVnAgTQ6Sj/YAOYflkI32zxbwVj/yT9N698pChFDvACleixHuDfLbX4qpY2hiyjfhY/6qNqRSkLV950WqamI3PmWn0Bk9YmX1UvTwEj3FCe8rVM4EParSNXqOk6WLE5dMN2+reUZSXj1r8PgbRvEBdIfnYmhWW86j/0A+4VeZ2nAK2gCjyGFTV+knezNtFu/3DZliQuZSCNMidiRA0I2+qbeY3U2EPb2jcJyqdU+Ou2Os9R1Iz+PKV1fMxJ7iY7d1N1yUMp1ot173BvrMZc7zDbbOKJyEnKgc63uLbQdMdCQSkT9QHwIOZ4FOiNOMVPBirZ5Pbz+JfuzBOK2f+QkhAZoyfFl9aAAxW5r78s1O1YnVlHFjh18mvULUXZyIL4t/bEIYa14lY3udgTKtoko8/FC+JIjePMAMsyydnpG1n6t0z0lZABcLI44KcF5RYGvrCbM/bjLR0LF4jXRrz/BL/hvRE5k4C1BCX4ZSZoPRjGFCIqF4FO258NxohLNnclGsGRgz+8B38se7Fm3tXrqoOELGHFOZZu8w22oOfXY6SEe7IMIyXy5cBsW09xGBlekVjMgY6B7XonY4AYJBNSz94AcQV/XRlzFnntPO7H1f14TJVLSMB0KoIApUCCbfQ== 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:(13230001)(4636009)(46966006)(40470700004)(36840700001)(86362001)(356005)(7696005)(70206006)(8936002)(36756003)(81166007)(4326008)(186003)(2616005)(5660300002)(8676002)(70586007)(82310400005)(1076003)(54906003)(508600001)(6916009)(47076005)(336012)(15650500001)(83380400001)(40460700003)(44832011)(36860700001)(426003)(26005)(6666004)(316002)(2906002)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB5944 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT044.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 0557d275-4b3f-4df0-32a7-08da3c85229c X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BhB3vtE7jOpPhvqJx5zZ407sfN0vKKMNNf+UNh797H7b91j7kU/WXXCl7lXyaq++L1CvBG7caYZl+hB4l4xwhZW5HW+iD4PBo1jwUQmLNFQFZTpvS2Zr/yptDds7OflPVhxegTkFCLSpqr6zZOm7yHQFD8uR0pduv9vICSGa0UMd/uKdMD3je+VV1U4LEairxedDCNanHk+KRt16ezmOnOWhf4P6OyrnndBaTqBokChnWKRxDiCqQfbvGWoTtbVv8+LK+Nid/I8+Q7gvae4P3ZVhBtOnyBVN/RoHG1vhmD11t+VUHFCugwdSqtESyI6WRWEH63oeF+DYXU+AUIelI4L71DF+3Kc5+j8hMLU5d0p2BX0k610OyFnBi5Fsi1lNEXNZhCd24s8GdRqiEQ03hPnRs1A35LgjwwIJRTyY8K7JDeI7d25cuaeLdQ3xEiP6J41nYGEdQGk1KXTiAY5RyoIapbirZNg7lzq+8fS6Bo9F2020Q3BXCKSX4tbjVI8tqY99SA5qYPG+hzdzkgCH4hLj/d+UuiGTUwua4F+2rn+NiXUvUurgPL1VTiidNFGJ6gComII1FNYwooDl296MYfCOqT/3bXHAM/DfVmbce+u6SUXCOeRHIcPshrfCLxEo7KerzcI2j9Ce8x3XG19z2g== 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:(13230001)(4636009)(36840700001)(46966006)(70206006)(70586007)(36756003)(47076005)(2906002)(426003)(336012)(186003)(2616005)(1076003)(26005)(4326008)(82310400005)(6666004)(8676002)(83380400001)(15650500001)(7696005)(81166007)(316002)(5660300002)(6916009)(44832011)(54906003)(508600001)(86362001)(8936002)(36860700001);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 May 2022 06:26:23.2521 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3b7b541f-472f-40cb-f96b-08da3c852877 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: VE1EUR03FT044.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0802MB2512 X-ZohoMail-DKIM: pass (identity @armh.onmicrosoft.com) X-ZM-MESSAGEID: 1653287214816100001 Content-Type: text/plain; charset="utf-8" In previous code, Xen was using KERN_WARNING for log message when Xen found a node without memory. Xen will print this warning message, and said that this may be an BIOS Bug or mis-configured hardware. But actually, this warning is bogus, because in an NUMA setting, nodes can only have processors, and with 0 bytes memory. So it is unreasonable to warn about BIOS or hardware corruption based on the detection of node with 0 bytes memory. So in this patch, we remove the warning messages, but just keep an info message to info users that there is one or more nodes with 0 bytes memory in the system. Issue-Id: SCM-2240 Change-Id: I922a5f17e8d7e9d250a70eb3f703dabe4698027a Signed-off-by: Wei Chen Reviewed-by: Jan Beulich --- v3 -> v4: 1. Remove full stop and use lower-case for node. 2. Add Rb. v2 -> v3: new commit. --- xen/arch/x86/srat.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/xen/arch/x86/srat.c b/xen/arch/x86/srat.c index a831df7648..5bd6279920 100644 --- a/xen/arch/x86/srat.c +++ b/xen/arch/x86/srat.c @@ -562,8 +562,7 @@ int __init acpi_scan_nodes(paddr_t start, paddr_t end) uint64_t size =3D nodes[i].end - nodes[i].start; =20 if ( size =3D=3D 0 ) - printk(KERN_WARNING "SRAT: Node %u has no memory. " - "BIOS Bug or mis-configured hardware?\n", i); + printk(KERN_INFO "SRAT: node %u has no memory\n", i); =20 setup_node_bootmem(i, nodes[i].start, nodes[i].end); } --=20 2.25.1