From patchwork Fri Jun 10 05:53:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 12876463 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 131BBC43334 for ; Fri, 10 Jun 2022 05:54:09 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.345792.571475 (Exim 4.92) (envelope-from ) id 1nzXaj-0007BS-Hw; Fri, 10 Jun 2022 05:53:53 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 345792.571475; Fri, 10 Jun 2022 05:53:53 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nzXaj-0007BF-Ej; Fri, 10 Jun 2022 05:53:53 +0000 Received: by outflank-mailman (input) for mailman id 345792; Fri, 10 Jun 2022 05:53:52 +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 1nzXah-00078y-Sq for xen-devel@lists.xenproject.org; Fri, 10 Jun 2022 05:53:52 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on0610.outbound.protection.outlook.com [2a01:111:f400:fe0c::610]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id b252cbcc-e881-11ec-8b38-e96605d6a9a5; Fri, 10 Jun 2022 07:53:48 +0200 (CEST) Received: from AS9PR05CA0002.eurprd05.prod.outlook.com (2603:10a6:20b:488::35) by AM0PR08MB5155.eurprd08.prod.outlook.com (2603:10a6:208:15f::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.11; Fri, 10 Jun 2022 05:53:45 +0000 Received: from VE1EUR03FT051.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:488:cafe::90) by AS9PR05CA0002.outlook.office365.com (2603:10a6:20b:488::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.14 via Frontend Transport; Fri, 10 Jun 2022 05:53:45 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT051.mail.protection.outlook.com (10.152.19.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.12 via Frontend Transport; Fri, 10 Jun 2022 05:53:44 +0000 Received: ("Tessian outbound e40990bc24d7:v120"); Fri, 10 Jun 2022 05:53:44 +0000 Received: from 68f3d0fdfe0a.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id F780FB04-C8D7-46D0-98EC-33D5B5BAAEBE.1; Fri, 10 Jun 2022 05:53:37 +0000 Received: from EUR01-DB5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 68f3d0fdfe0a.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 10 Jun 2022 05:53:37 +0000 Received: from AS9PR05CA0008.eurprd05.prod.outlook.com (2603:10a6:20b:488::28) by AM8PR08MB6435.eurprd08.prod.outlook.com (2603:10a6:20b:317::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.11; Fri, 10 Jun 2022 05:53:32 +0000 Received: from AM5EUR03FT003.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:488:cafe::e1) by AS9PR05CA0008.outlook.office365.com (2603:10a6:20b:488::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.15 via Frontend Transport; Fri, 10 Jun 2022 05:53:32 +0000 Received: from nebula.arm.com (40.67.248.234) by AM5EUR03FT003.mail.protection.outlook.com (10.152.16.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5332.12 via Frontend Transport; Fri, 10 Jun 2022 05:53:31 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Fri, 10 Jun 2022 05:53:25 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.86) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2308.27 via Frontend Transport; Fri, 10 Jun 2022 05:53:22 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: b252cbcc-e881-11ec-8b38-e96605d6a9a5 ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=F+UezYvx7ynEFWPzZKMVLYnkY8ho1BbsxYOeU6jnqWZs5ijTljwbBIG6/pcOsCqiG6SJhjcGOauQBTXmAPsD8ircrngWcHTCzDz3srgSv9DBSKNTKvZopCqrJc7Hth7igpnwxWDEjiRSBlJ/NKQP2fTFcjnO4qob/DhSQ9PLL/K6wsDTwsg+0U9iY6a2qulHihEvvlQ0ptMEHu4AxCX+x8sBAxnQ9EyRG+3GkArbSBU+Kv5M1SHNAsi1EiE5chr4rsIlnrb393tgDAebtTE8BggZ2jmajo/QP9355KfZKZ27so1JS8GJdPYCr07eSIDL5JcjETk5jhVuwvCvNqb24A== 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=h1Mk+96NdZCuYCNVMfuYJAf8YYMD5xhqAKxBbA5l6eU=; b=Box0C1tXqYBo77Cwteykhnycv/SiTPkA9Dh2UzBSvky7La1DcVdW0o+bBQh5Gg8W67o7JpXdhN9IKogHKSlGp0simasq3ncplDhv5t9emZxkSyYfQpvKiQzXcUg1WPHB/jMaPBEkkMXuCIkHe6NSvRh35IKjK1cIa2csyrt0Eymx1QrdPOzlXwC6on62tzzqCLFpp6xJKJpTSY5XXcBGhj4i8CzP0uFZjfxPXcAkEVZJ/pl75eGEWi7uFNVNgha/iX0HIC+8UBEc6YwZEJe85fuoDsKZn6Jmk3IMGuOGOWTRJ5BmMo9YOi0cI0iH59L/RY0NBLCvqEXrq0BaA2gBsg== 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=h1Mk+96NdZCuYCNVMfuYJAf8YYMD5xhqAKxBbA5l6eU=; b=hk0LL7BZPrbco/PiUfd8AJb4426z/uNgEwO7nVPPMn8OhFeESDnlHhXRYIija5zeYVf/ZO+0OFQSiadJpW+X1H9R8FFmEniomwfuaa83FSSKQjW8ryE8c893vPWw/gwWehmf6fBAnvEpQ31l1t4UErPV5WcszWLGTzd4u2ks2Xs= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C X-CheckRecipientChecked: true X-CR-MTA-CID: 6fb21e0bb163feb8 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Uh9EFywxyJKcGYkOb28UY55GopgAUmI/G8CPP/Bl0mzJgvnzvxAC3YsvH2ow7A/XYJTMIA+e2hSW/WVrCupGNzPJihlakDQhW4ib8WGiHfoL9h3HuCnOq95Dc04eTD8D/qaUPpPbPl8nnJY7xec0z4R9zkeyqGhFpAk1PjB4osoNSAmMAxHIxwrmGXQGjYtjzPejW/87Tr3J2RiV0xJgLLtOYnkJmCNJi9KuPjwsaPQNooAXFw52TRKOVdizHmIbJZJW6eHHilMI89BfnziONzLjoZV2pSbNb5jGWgtuYF2fUBcXBpiUc6yBL1+363w02fcNaMAverKnFF5+7W0RJA== 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=h1Mk+96NdZCuYCNVMfuYJAf8YYMD5xhqAKxBbA5l6eU=; b=f5wVGbRczca9b7iqsquDTyMIjP81AZeNsOa8VciyIxwDojEV6QwlkmQE6QHI9zF8mnT2kWSlazSR39RSmrrEbgfaOMt3mbHuNuTYORqT4t38lFr+RV8EZG5Laxm/FNvSlzO58v+JYXt0xDeVezEaKHEotlVMD11c4YjhXikUEwrCPa0yjmA6/8V+uL/55TFPGY2xmID0u6yeXQ72pnTd9A2uJtuf1N1z++a3CyqF0mHu2Kdgxm0Ed3DkGhAq4X/MHKU0sV3Pxg3mRtCo3ru7pIj4//eeqRnxNKThXmp/kTdttnnaBU0qWRFBZHWZHCh2ZjUMp/uB3Fb3WbAU7KF8LA== 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=h1Mk+96NdZCuYCNVMfuYJAf8YYMD5xhqAKxBbA5l6eU=; b=hk0LL7BZPrbco/PiUfd8AJb4426z/uNgEwO7nVPPMn8OhFeESDnlHhXRYIija5zeYVf/ZO+0OFQSiadJpW+X1H9R8FFmEniomwfuaa83FSSKQjW8ryE8c893vPWw/gwWehmf6fBAnvEpQ31l1t4UErPV5WcszWLGTzd4u2ks2Xs= 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_Pau_Monn=C3=A9?= , Wei Liu , Jiamei Xie Subject: [PATCH v6 1/8] xen: reuse x86 EFI stub functions for Arm Date: Fri, 10 Jun 2022 13:53:09 +0800 Message-ID: <20220610055316.2197571-2-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220610055316.2197571-1-wei.chen@arm.com> References: <20220610055316.2197571-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-Correlation-Id: 463e935d-7839-4355-975e-08da4aa5948a X-MS-TrafficTypeDiagnostic: AM8PR08MB6435:EE_|VE1EUR03FT051:EE_|AM0PR08MB5155: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: X1PKdMnFiLCqt1sXEdQazsDfx4yVraZ/BRTkf7nOFH6HkP+9Vox0tmc9JrfstOa209dXiZWt8zQjW6hKHPPXfEtfYQ467dvejzN9hBEyCt36zwD2SdUkkEO4YzudOUZo9Ax7N/hUcbfgwJaymFmWVPmK/O+mqvmm4JgMfW9APAcuLZr3lNWOreAiSSzpyEWlF2aBahKmj2mOMcqAcgWf2rKY7B4tXSpdL5u0M7azPbbKn7bSfo0RoQsNfR7uwj4ZRsvnix63vVRMiCTfY1+9QxylWVOHN+M+1VdHcr+NDjtrDfYr5fBSFgW3IMm/wHu+iZ6WLv3SY7Qb8H7JJxxEs0KOHTxxxlNW5FxIecaXpGMcQo8M57JuQxkqMytXNrcVAmc0cIcFnxkRUrij3HWNbxPW+PzfIOWOu4Q9pg4JyP9a/WI0/w3D6kLnRfkYt7Sj9OqYUpgqmqTutBJpnTHQ8XLjAVH+/c+UhMCV32O6zAgGW3aIJ/gVU0rhZ3fB+2shDphQUw2/5Jq7Q8Z+5r46IekNtPwQWVS6GTyMIt8Mx15j6TNWScOVXOQXy+dlesbkTDdQktGRaqu0XmlyMUTFhKh+tnnazDzAFeroux9/QxB0SEl0lI8A/AY7buwNvNx8DnuHnaNqcQHjdXVwn/X4u2RSrNLzKzDQHOZXT4OeKJJLmcSuV1F0WhkzaRqkt9FHJroLmdlESRUW+4/vmpJYeIEvJona0y8X+lyTilUDWSs= 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)(316002)(1076003)(44832011)(7696005)(82310400005)(40460700003)(8676002)(4326008)(36860700001)(70206006)(70586007)(26005)(2616005)(54906003)(6916009)(2906002)(426003)(8936002)(47076005)(83380400001)(81166007)(36756003)(86362001)(336012)(356005)(5660300002)(508600001)(186003)(6666004)(21314003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR08MB6435 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT051.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 4b9e15fb-4f6f-482d-cf6c-08da4aa58cca X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AwXtMinKcluzfivA0UI87TetRo+Tw2Pr5KsJsLYP/KvcJOjpkVIo1L4vWLbCzMzsi+okAnQBl/zHWaoH/xaqVR7gblYSYVasJlouhi+rd9DJfU2EyA87pX01u7/DZknv8eGhJmQ3xk6PRl+9iDmgwqUG64pPKNjtl6syLDDru11IYopG/Pn260eMAGNfMEFBhCH0z3S70W6Mnv18u324FNrKtYT7sJ+N5QOcOcWQHmlna0N+VFsCySf1ZOzrGWnwlg8f3owiKhyWGKAXvunKF9sh3HtECuKN+TY5wKoyigCCy9/Emx9IQkRcdju5/LVsUeTI38qaNOGSB+e9rhybBfb6nWvx9+mmAFhQoxYb/f+Yk1syvaXar5dX2MpIwWHoAE35cweRPiQF6cjNUenY4t/J4+aF7Y6nb40IzBtAv7UhPUONQTTs/AzpFyW0CaFcucEqvvwg0oBTObkVCoePQBcMogUqTfc6hxb2eAMW4g4KxBg0FqV4MXeFzfJ+Lr5/zt7PT4XSvn8J64Sahbm50Oz6Xg57TaJT1ak3sJ6UPsU47SRTsp71V2OiP9F7dY+ej6g5P917zjn5N5Yrxvx229okPZahuTnEpz7LWB+AwTJl8QEvCXHdQ9LWESOrAn6Kx2CG2rBoce/5kjtq+f3Lkb9kCafY+o4khVpotWScygmV2hquKg59GuYobI6kLhwKnapSyHCKSGBf3QqjY2xMBw== 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)(70206006)(44832011)(26005)(316002)(82310400005)(70586007)(83380400001)(81166007)(86362001)(2616005)(40460700003)(2906002)(1076003)(426003)(186003)(336012)(47076005)(5660300002)(8676002)(36756003)(6666004)(4326008)(508600001)(8936002)(36860700001)(54906003)(7696005)(6916009)(21314003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jun 2022 05:53:44.7422 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 463e935d-7839-4355-975e-08da4aa5948a 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: VE1EUR03FT051.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB5155 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. Signed-off-by: Wei Chen Tested-by: Jiamei Xie Acked-by: Jan Beulich --- v4 -> v5: 1. Add acked-by. 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 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. +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) += arm32/ obj-$(CONFIG_ARM_64) += arm64/ -obj-$(CONFIG_ARM_64) += efi/ obj-$(CONFIG_ACPI) += acpi/ obj-$(CONFIG_HAS_PCI) += pci/ ifneq ($(CONFIG_NO_PLAT),y) @@ -20,6 +19,7 @@ obj-y += domain.o obj-y += domain_build.init.o obj-y += domctl.o obj-$(CONFIG_EARLY_PRINTK) += early_printk.o +obj-y += efi/ obj-y += gic.o obj-y += gic-v2.o obj-$(CONFIG_GICV3) += 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 +ifeq ($(CONFIG_ARM_EFI),y) obj-y += $(EFIOBJ-y) obj-$(CONFIG_ACPI) += 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 += stub.o +obj-y += 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" /* * 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 ImageHandle, unreachable(); } -bool efi_enabled(unsigned int feature) -{ - return false; -} - void __init efi_init_memory(void) { } 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) void efi_update_l4_pgtable(unsigned int l4idx, l4_pgentry_t l4e) { } -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"))); -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 += -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))))/source/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; +} From patchwork Fri Jun 10 05:53:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 12876469 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3E3EFCCA47E for ; Fri, 10 Jun 2022 05:54:14 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.345795.571508 (Exim 4.92) (envelope-from ) id 1nzXao-000853-Sn; Fri, 10 Jun 2022 05:53:58 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 345795.571508; Fri, 10 Jun 2022 05:53:58 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nzXao-00084u-P3; Fri, 10 Jun 2022 05:53:58 +0000 Received: by outflank-mailman (input) for mailman id 345795; Fri, 10 Jun 2022 05:53:57 +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 1nzXan-0006br-4D for xen-devel@lists.xenproject.org; Fri, 10 Jun 2022 05:53:57 +0000 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2062d.outbound.protection.outlook.com [2a01:111:f400:fe1a::62d]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id b6dd9b8d-e881-11ec-bd2c-47488cf2e6aa; Fri, 10 Jun 2022 07:53:56 +0200 (CEST) Received: from AS8PR05CA0001.eurprd05.prod.outlook.com (2603:10a6:20b:311::6) by AM4PR0802MB2275.eurprd08.prod.outlook.com (2603:10a6:200:63::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.12; Fri, 10 Jun 2022 05:53:45 +0000 Received: from VE1EUR03FT026.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:311:cafe::20) by AS8PR05CA0001.outlook.office365.com (2603:10a6:20b:311::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.15 via Frontend Transport; Fri, 10 Jun 2022 05:53:45 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT026.mail.protection.outlook.com (10.152.18.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.12 via Frontend Transport; Fri, 10 Jun 2022 05:53:44 +0000 Received: ("Tessian outbound 6f53897bcd4e:v120"); Fri, 10 Jun 2022 05:53:44 +0000 Received: from c852e8c72b8f.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 99BE106C-8132-402C-B53A-215209236EB4.1; Fri, 10 Jun 2022 05:53:38 +0000 Received: from EUR01-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id c852e8c72b8f.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 10 Jun 2022 05:53:38 +0000 Received: from AS9PR05CA0005.eurprd05.prod.outlook.com (2603:10a6:20b:488::12) by PAXPR08MB7623.eurprd08.prod.outlook.com (2603:10a6:102:241::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.14; Fri, 10 Jun 2022 05:53:34 +0000 Received: from AM5EUR03FT003.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:488:cafe::bb) by AS9PR05CA0005.outlook.office365.com (2603:10a6:20b:488::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.15 via Frontend Transport; Fri, 10 Jun 2022 05:53:34 +0000 Received: from nebula.arm.com (40.67.248.234) by AM5EUR03FT003.mail.protection.outlook.com (10.152.16.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5332.12 via Frontend Transport; Fri, 10 Jun 2022 05:53:34 +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; Fri, 10 Jun 2022 05:53:29 +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; Fri, 10 Jun 2022 05:53:28 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.86) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2308.27 via Frontend Transport; Fri, 10 Jun 2022 05:53:26 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: b6dd9b8d-e881-11ec-bd2c-47488cf2e6aa ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=fG43HVGRzqgv268RgH4ZlslKXSyLWt+AjAAzjwzu/88XreU0HjoZ1HiIQY43wgnEOaZOG2jG+d1l+2u8+MN9ts6LohKPgslEfYhhOa0ofVKx5OrM9CMXgbkvqeImRr8PzAMyvX+Ric4wid8e/Joq9LlSPr2dzHe0K3Q1QiuM6sxOGZdJCc4oFjcFSrg61nb+KSzJibK1WIZ1QHXXSWJsOvT6oUZ6UpZqXNBRykB05MK7uEdahhv0hsZAoZRQJcPA9CEl+nSGfqrYPhX7jHr70Oigh8OLQKLMG64QN6OareLiicHheuPoe8fuHhWPWR98mz7aVzXsaxWakR0jzNiBYg== 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=fe/7SCgP8Par+1oz7XY3pgQuiN9XdtDg0NAdMEO3/oI=; b=OlC9r1/ueG6jm8gcw95bdK8Z7Zd2N7RdOjjsuu+vs69MqQhcGfJSQG93zqv2oAcco5DquPDRVtOW73i+YD7F5Uv7DhbFR5XtspbG4mZ0lsfY/VkwYzBJ4pnmra1+CTCEhD6NfKTLMmguuAAuBf+TkT9DVHSY/9afynxohCgRIxuyoJWHmOa7V7DDRxebJ2FmsSDWyyaO3YzGiWIbxMkJCK/gdAYxlv3eDuCt+G8AmtNW4VI196GKWj7ph2mq+OVRQahfxVY9ywE8O9ifxs5hnz2cm1be2vePFaYbb7bQndPSIen30BpKNpiAprqNMWG9MOzWQHBCdCbliCh/DNaUhQ== 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=fe/7SCgP8Par+1oz7XY3pgQuiN9XdtDg0NAdMEO3/oI=; b=xL6oTVx1ND7vOKqNFhfazXVx4p1w9pO0FxHvDrc2vwwn1OcFsBdCMMHdH5rveBqbiHirUl900js6GHSFfwUnOIYdiswN0vWogY9lqYXTOH5KEXStixjodpxTIDGGMYZBz3BzFiGSo+Z3qwGNGRJI/8UNobRHVJ04aPoLOcPL8Yc= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C X-CheckRecipientChecked: true X-CR-MTA-CID: f2fc4f47abb0d7fd X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ddq0wSrEF0nEyvtRkGTdBTBFasFvFEJ/2RpAiQy4FzzM4Diz8aixV+ow9uRVMqPqg5O7TqkPmF0dgN7++UToo+qhuJ2oqpZU7W3Nmdj16+ACDzKtUoS7k6zU14kjFSXkBDD54RR8yn1y309NG28C8sGsiWhVYNxAwwr/LZxH0yl3025yXHGneY1vsnFGamesDIaNkKFLHSxnSLk15+67MOCFeZj1YUj6/X9W3jNAfSm2MSeW6HhEJO30Yj+K+5SuOuuMgpKjBZEo/Cvcji3E+eRKEgTqHprI7pNd+P+S0TKku44DVReQq2FLdZk5D4O0lFZGTKm11ctH7mCJg8xryg== 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=fe/7SCgP8Par+1oz7XY3pgQuiN9XdtDg0NAdMEO3/oI=; b=ne7FhMXp4O3E3hp7VmY8xSKeyWXP310ReNPJ1i4bflH7pbDw5sAxO8omrbvxrDFse1OkiRYovzW44cNlXKU1weIY2oa8ad0XR55R9EEL4yzHOsgVD8QsRRBDvO36RU20dtvHPj1VQdeswUbMtjDCeWyvhSAoEGrRWLoXOCazA/T0vTdUV5TxPCf2NzzZpjlrqvkQfieJGYFUJH+nBgao03lq4LLkgMOJF27JdecFuNba4ElSwoVuCIQG54YATvzj3OAeHOYksDERzw+QfsMfErkoSyhrFZ71Qie68B/xhX7Ih0P4K7rucKowWQFNGXD1JsZeGIVh3PbK57+tRIAXdg== 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=fe/7SCgP8Par+1oz7XY3pgQuiN9XdtDg0NAdMEO3/oI=; b=xL6oTVx1ND7vOKqNFhfazXVx4p1w9pO0FxHvDrc2vwwn1OcFsBdCMMHdH5rveBqbiHirUl900js6GHSFfwUnOIYdiswN0vWogY9lqYXTOH5KEXStixjodpxTIDGGMYZBz3BzFiGSo+Z3qwGNGRJI/8UNobRHVJ04aPoLOcPL8Yc= 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 v6 2/8] xen/arm: Keep memory nodes in device tree when Xen boots from EFI Date: Fri, 10 Jun 2022 13:53:10 +0800 Message-ID: <20220610055316.2197571-3-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220610055316.2197571-1-wei.chen@arm.com> References: <20220610055316.2197571-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-Correlation-Id: 171d5972-bd2d-4ed6-b68f-08da4aa59463 X-MS-TrafficTypeDiagnostic: PAXPR08MB7623:EE_|VE1EUR03FT026:EE_|AM4PR0802MB2275: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: xqbBZG49TMPTCKs6rgn64JU+WscbTrWspYtSoyrw6puiiJ3/GI9+WB2DIxc/rlXK9rMdhkUtzf6bDk5CEnQZh1pKHozyVMPi2ItA3AkpCCWPhKatOOtIf6Zc5ac8zpx11QQvvbzsY+CbW6DZyyQHcNMmwse/gdYcyMxO6o5O1Ex80TZjsty3pa9rf6TT1YIxJ42EyC8D887KweUa7MuSeTumxmUgXalyZ5pkksBsbLmJH8GPU2xmf6mozAc30X5/GURz7UCgUrNDM0OAj0Wg+6SRxqXsoNnIRniJsWHCAB4pF6h51JepdDX0V9YplDxxktwXQwaGxaX0bOU4ukGjrBl7kaqiQN2Lif7wfgbBviAeFIhGzZpZNa2JYNi5pmhAMV4eD1pkDdONuzTgdw9cbFmSZJUeDro7vOPjnV6rGX/GdsIqXGn/XkgsV1WjcT4/eiEOs72jOTeTTdKaeD+ivZDsgt5wFGTkphVcNJTcMb5gDPKBtuIzSAhzZIke1f/7JpvlDxSh+MydCxJ3nBXqWiFvvleK4TAQ9Uvkf4SV4T0vqeV8FzdtzycliGgp7wPrR2DMXyeSA8Ihy5JrB+xFwrUf2+UH02tgcyCubM2g+JLXkLLlrCG5mBamgTuSsnKLLMnjve5x2RMeJLN22Oi7jP0IzY9nfjmjF+OiBSFfn8AbND1+nmyCKml12o0S55EAWiOVK81A7DIVs2xVvL+smA== 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)(26005)(7696005)(86362001)(6666004)(2616005)(426003)(47076005)(336012)(2906002)(6916009)(54906003)(8676002)(4326008)(70586007)(36756003)(316002)(82310400005)(70206006)(81166007)(44832011)(36860700001)(83380400001)(40460700003)(1076003)(186003)(356005)(8936002)(5660300002)(508600001)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB7623 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT026.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 5c68f653-54d1-4ece-5c64-08da4aa58e67 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rRmdD7QZJH6a0xhH7O+JB7iGrlvMeHvQy7k2UW5H3VVWDnSgL4GBGWuQc7nIlaxrtcZwoTVNK5EYglknivZNJAiG06jjKRxKQ5SbiAuY2TwJP+bmTtl8HlDqc/BJyrqSO1DsxrpjpeIIUR7ocOOVVxySITmu7hPf35I9qp/H+cA3G5VBv6iMmLofG8UouIDAKI6NqXQi+kkohqtRG7HKgzWx6Vl5KkcYCQuIbQtW4pJW1ukkeHpuqHHoEGeH7K/o1fLK1WmBh83+mSeFsI1Y1YP6QiXbF9soUGCuRHxZN2Ubsv/sAiKzVWNG/RQeuXCbzUzrW7Oix65kbe5xVEasjHhPsS7mp2Bh4sB++IIv4hFtBpY56id8a1/JuKA2EJxwY47nsUQd0ZesU8GypUA/lpYGtlMQJ1OWiCHK3LB7PydYhmjmwEl8ZseSa1hvea+AypTfcRgYsXuaUV5tsTYEY1PIE5y2qILeQ7CJeuTuPVJMGC7lEnfjG/fb3n0ptiwki9UtU0+U+XBLF9WKN668Zc9p2sYyeflwnY49QM0Jffznro0j9jYltodZs423rLFn9wvVjy2nJFn2DwoKKUdni54e7FmR5QlWowzmF4QB9cwDsHFmPT9u560IH7FItjkhfIGmuzehFzSRrZhY0Y+fLCtZ/0Z4xqRPaQGRGIpnef2wcetX/seVBjO0nT9rC/3T 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)(40470700004)(5660300002)(508600001)(82310400005)(44832011)(47076005)(6666004)(426003)(336012)(2906002)(83380400001)(40460700003)(36860700001)(54906003)(6916009)(8936002)(4326008)(2616005)(81166007)(316002)(7696005)(186003)(70206006)(70586007)(8676002)(86362001)(36756003)(1076003)(26005);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jun 2022 05:53:44.4874 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 171d5972-bd2d-4ed6-b68f-08da4aa59463 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: VE1EUR03FT026.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR0802MB2275 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. 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 = 0; - 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 = process_memory_node(fdt, node, name, depth, address_cells, size_cells, &bootinfo.mem); else if ( depth == 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; - /* - * Delete any memory nodes present. The EFI memory map is the only - * memory description provided to Xen. - */ - prev = 0; - for (;;) - { - const char *type; - int len; - - node = fdt_next_node(fdt, prev, NULL); - if ( node < 0 ) - break; - - type = fdt_getprop(fdt, node, "device_type", &len); - if ( type && strncmp(type, "memory", len) == 0 ) - { - fdt_del_node(fdt, node); - continue; - } - - prev = node; - } - /* * Delete all memory reserve map entries. When booting via UEFI, * kernel will use the UEFI memory map to find reserved regions. From patchwork Fri Jun 10 05:53:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 12876465 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9D79CCCA47B for ; Fri, 10 Jun 2022 05:54:09 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.345791.571463 (Exim 4.92) (envelope-from ) id 1nzXaf-0006t3-6z; Fri, 10 Jun 2022 05:53:49 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 345791.571463; Fri, 10 Jun 2022 05:53:49 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nzXaf-0006sw-3h; Fri, 10 Jun 2022 05:53:49 +0000 Received: by outflank-mailman (input) for mailman id 345791; Fri, 10 Jun 2022 05:53:47 +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 1nzXad-0006br-LE for xen-devel@lists.xenproject.org; Fri, 10 Jun 2022 05:53:47 +0000 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on20630.outbound.protection.outlook.com [2a01:111:f400:fe1a::630]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id b12a7e39-e881-11ec-bd2c-47488cf2e6aa; Fri, 10 Jun 2022 07:53:46 +0200 (CEST) Received: from AM6P193CA0110.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:85::15) by AS8PR08MB6840.eurprd08.prod.outlook.com (2603:10a6:20b:399::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5314.13; Fri, 10 Jun 2022 05:53:44 +0000 Received: from AM5EUR03FT005.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:85:cafe::88) 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.5332.13 via Frontend Transport; Fri, 10 Jun 2022 05:53:44 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT005.mail.protection.outlook.com (10.152.16.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.12 via Frontend Transport; Fri, 10 Jun 2022 05:53:44 +0000 Received: ("Tessian outbound 5b5a41c043d3:v120"); Fri, 10 Jun 2022 05:53:43 +0000 Received: from 76bfde828f41.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 3459B700-23A7-461F-9F45-6105FD6E087E.1; Fri, 10 Jun 2022 05:53:37 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 76bfde828f41.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 10 Jun 2022 05:53:37 +0000 Received: from AS9PR05CA0022.eurprd05.prod.outlook.com (2603:10a6:20b:488::16) by AS4PR08MB7504.eurprd08.prod.outlook.com (2603:10a6:20b:4e8::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.13; Fri, 10 Jun 2022 05:53:35 +0000 Received: from AM5EUR03FT003.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:488:cafe::53) by AS9PR05CA0022.outlook.office365.com (2603:10a6:20b:488::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.15 via Frontend Transport; Fri, 10 Jun 2022 05:53:35 +0000 Received: from nebula.arm.com (40.67.248.234) by AM5EUR03FT003.mail.protection.outlook.com (10.152.16.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5332.12 via Frontend Transport; Fri, 10 Jun 2022 05:53:34 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Fri, 10 Jun 2022 05:53:32 +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; Fri, 10 Jun 2022 05:53:29 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: b12a7e39-e881-11ec-bd2c-47488cf2e6aa ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=ZhPrZZpN7382oTc0J/fANBBTf0rsSLYY9Z/cyCcrRI931oxcAqKfxPhhsXuuBtRRloHNgZqFD2weJmHKqE7FyEJbNRpuew+qrRzTCYHLRfgLHTUPZzRdbeAWWITj/aoZdpO2GV3iIfOhCxvMv2bbfPED+l511su9A+OAvfRT2GL4k7GdRFwxrYJ6Gq5kC58VpnzNZ6lO3LT/jUU7hMAu3wFGG1lrKcNHefl5xuGPiHbaALUDy4ISjsLFlg0UC2vG9Qy6Wfbz4+IU/a5ZAgixuxV2rdb3I3FzB+vRY+j0OjZehBK4UcvR0+0O2iBuvtGvX+R9MhBpxi6mTlxJ9eIs6g== 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=z8kc1oeWJd8eJovTz7Jo1ZUCorNAUDwG0WrccA7BRjY=; b=hVtXnTU0ZVjnXiv7br87lV2lbiCjQ08X47hmuLncT9dKXuNmcNwqAGS9WoxMeY6sKgnkerUWQ7Kow8G9LM3WeJnl04igeJpOR3pdzUEwbqAr79UjoOC+nQ/5m5BMBK/TlesCBfDJiJYaL+6aoluNzA4tIb+xyUymNxvLge2QgsxAmOo4bwf7HttOiScqdtCqSDossytHggT/iOwME+C7tN2i9g61XCr742/Jr8762GqDO2y0+WdnKZ5WBb8D0ip5U8NEsXyRzOhXlB6CZeez9ZN41QiqTk5HzULL62+2ViKTrti6P+c+TC11JmGoWLq3WXeDc8fGSfRoONMLg/lkOA== 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=z8kc1oeWJd8eJovTz7Jo1ZUCorNAUDwG0WrccA7BRjY=; b=0+KJEYJZO+wU4CSdXMR/nXQcvXRWrf5EdRNZdpOETzGMHaueKQZV3aMn7x9lrilHf6clCl5WEnbtCgFz/bULJt8jnnfIa2cjoE1P7tQdHuhsolAUMNkI956uZ7I7W6tQOfiGmZI2GfMMHJNM7/Y8sI1esBMWD5ObGu2YR97qrMA= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C X-CheckRecipientChecked: true X-CR-MTA-CID: 12ae1ba1e1c0f8a6 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OdWSr5ELu63mkerJEd/A09nMapB1GsTJ2v+SGHQfZeIR4urHPQf46WeH0q/zzyUOMYjpbePDt+2F/YkjCHwWIPYyXRH4pdu+u89RV2XWnmRR43MwBqYogeMUSYtD+qEW71U6YzHxOXvHbLRA3+MXMXJg1xm2i2uY6ITlvupIkitze/qVpIoxH34pF/hs2h54Aqaqufhq+GiN2E3nPknUwKzqxz+sHLO5I8duDIfOH6DoV4Nn2YUoRutVCuo09D9K7cS+UxzAfU6Q0HIR+TZxZjreENDpryQF8DsXQldclo7/JBRKtijNmCQuXJPYVi2PnERzXGC8Tlm1K0kxNi0npA== 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=z8kc1oeWJd8eJovTz7Jo1ZUCorNAUDwG0WrccA7BRjY=; b=JDTfiuuTku9KXyoAJhp5kfeEoG364Idovu6rNyX/bef7ejYDZqy4cj/ZidA5r1g4E8ZoHjJbbLX5l4v50GuzzucljG9lhGhGeY9Uf4TDgKrbfoCLGL18UZAQ2cbOe8/6i4oOpUmUDeEHtdxrz449FiJWK2P7wZA6v7mv3+6Q6oZ1cru+3J64srHLOHy8jhwAFe0b7JZgCRgtBhY+fQJbGH2qavfbh/4mFpyA8ucIUMLfOpmxtSQlxYco5M+GJENU48p0NBHY63zJ03b1CaCZ/2QhqNdLcDT4N+74ZP0xR3cXjwfqGyP9Xl3Y/bYGZvwgycYhXut+gZca8qSEFo8RBQ== 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=z8kc1oeWJd8eJovTz7Jo1ZUCorNAUDwG0WrccA7BRjY=; b=0+KJEYJZO+wU4CSdXMR/nXQcvXRWrf5EdRNZdpOETzGMHaueKQZV3aMn7x9lrilHf6clCl5WEnbtCgFz/bULJt8jnnfIa2cjoE1P7tQdHuhsolAUMNkI956uZ7I7W6tQOfiGmZI2GfMMHJNM7/Y8sI1esBMWD5ObGu2YR97qrMA= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C From: Wei Chen To: CC: , Wei Chen , Stefano Stabellini , Julien Grall , Bertrand Marquis , Volodymyr Babchuk , Andrew Cooper , George Dunlap , Jan Beulich , Wei Liu , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Jiamei Xie Subject: [PATCH v6 3/8] xen: introduce an arch helper for default dma zone status Date: Fri, 10 Jun 2022 13:53:11 +0800 Message-ID: <20220610055316.2197571-4-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220610055316.2197571-1-wei.chen@arm.com> References: <20220610055316.2197571-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-Correlation-Id: 47c9265c-cf71-4ae8-95dc-08da4aa59435 X-MS-TrafficTypeDiagnostic: AS4PR08MB7504:EE_|AM5EUR03FT005:EE_|AS8PR08MB6840: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: fbiTxNa6aM5OvhUis7UUUpVekG4Q6/YHB9uFTPfq+9v9TngHu8CzqjixKf6e2Gk1MiGUD1P8/0gcpt9UB9Fmi8VWtV/opVc+HzFy6mO28Q0GxYgw2P8fjSQXCk6WTro1rOedxXDYI/rpLvE+TVLozpSZBNf5dHEdxWIC/IqV7Xu2fsEWdtk0XjJ+ik0ZDoltBo/ZhV6/h0Xl0geWBvMSvwCo0ahzNO5ruBLo73EXo/dFJLDQX0bi/NW9dkJxOgvptjorcaXjyxK80Kzm1IMMVZLjvd9Q9FJVC/TzWgUPZ58rQBzu6kk8MTRZZPduyY5jVbduZxXEIuO6N0nvMeSAbIj/+OgW8l41ALFGJwrIQ2oDd8QUXPDNOAmf4QGFNm669LALeJVtO6ZX4CCnQv4RV49NwcXlc3VvEOa6GwIA8BxQuekZjlkkzsKq3QwyZ51OAXXVvsXwSTui8JpkKTv+4uv08tPMAQMP8Z7yiEweGCsbCEd0tEFEVQlgyNkaSml4DJDVatEcp+k6aMWp1nA59Zw4WUL330tFpuY88+efbp16zcKEQ1QYlIWhYHfFh9tBEXATqY7MnJvBA2LV+jHw1/A8MZ4i2spJNsLhfk6u29bd63PI1P/yyVNJONEzOQxC+cX5PFaqR4q9Ze6KQgFOcifr9j+8mTgTb9ft4hqUN/qGXOCmnhb/Sj20z63aXZKUEorIk4GkSf6iULHAk0n+vw== 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)(316002)(83380400001)(70206006)(2906002)(8676002)(81166007)(70586007)(5660300002)(4326008)(44832011)(36756003)(6666004)(26005)(356005)(7696005)(86362001)(82310400005)(186003)(426003)(336012)(2616005)(47076005)(508600001)(1076003)(6916009)(40460700003)(36860700001)(8936002)(54906003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR08MB7504 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT005.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 2ec99269-d152-4322-c201-08da4aa58eb2 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: k+lmuKGde+qM+fa4M0Wf+4XTO95RzCAithceKtq/pl6bKJnM1oLLQuSMU2T8YqBy5zzfMAxDe5bXP9YY3ACUxgs8oKrNKsnRPBdvyKPK089rFR/dIxcJCp1RQnQfHzOnGyhGR24Zz/3ryP3gMtymK3c2+IR5EHCjNPLD5Lu3DDTjW5eOSjAXSf+zMHBNVLH5tmQvx6vCpbjoAHxIyMI+erkmPhUBLnOIjp0Uf7SeK5b0z1LPeWSC4Kj2gOABHftvIx8TebDaCRUHhzhk+fHk3kCngVjpxAI7iltXOq4rTvIDOolQRU4r5dw5Ej/mCzKVzCCPLwhizFysDp71SpmztvHmR7JxfK7peZyrbQFlgNdsXExFcMNy41dsbApHNid0FqMLjnjDVpL3/7tvlWoSpoYwGpfo9FSLurgw5Xw0juOCNmaX0XmPQXKw0QKVGDOwIV3XYiuOvLsXXpzj0Qg72V1WY8ieRe0n2CJUWVOCx0kpWm9NGPzuOmXl3aT8XJT/6HrkhhfeFHjasDIGB2PDeDtO9bioR1KhPhzXRn4Kq7FbahAGmiX43S010aCphXok+th363E5hmFKTXDqGvnxelpE4wK3/fuF5jrtkTIC2+A38Qeh69mxE8fxGDH1AvNCqT/YadJ+yjERn9ys3UyoExH3UahRgTz0PercIgvZus52WZxMjVCjLhBD/05Jb3hu 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)(40470700004)(46966006)(82310400005)(83380400001)(2906002)(36860700001)(40460700003)(81166007)(6666004)(26005)(7696005)(36756003)(4326008)(54906003)(508600001)(316002)(6916009)(5660300002)(8936002)(426003)(336012)(186003)(8676002)(2616005)(1076003)(70206006)(70586007)(47076005)(86362001)(44832011);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jun 2022 05:53:44.2320 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 47c9265c-cf71-4ae8-95dc-08da4aa59435 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: AM5EUR03FT005.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6840 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=n could probably leverage this new helper to actually not trigger DMA zone reservation. 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/numa.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) #endif /* __ARCH_ARM_NUMA_H */ /* diff --git a/xen/arch/x86/include/asm/numa.h b/xen/arch/x86/include/asm/numa.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) extern int valid_numa_range(u64 start, u64 end, nodeid_t node); diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c index ea59cd1a4a..000ae6b972 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 = 0; - if ( !dma_bitsize && (num_online_nodes() > 1) ) + if ( !dma_bitsize && arch_want_default_dmazone() ) dma_bitsize = arch_get_dma_bitsize(); printk("Domain heap initialised"); From patchwork Fri Jun 10 05:53:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 12876464 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7E2F6CCA47E for ; Fri, 10 Jun 2022 05:54:09 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.345793.571480 (Exim 4.92) (envelope-from ) id 1nzXaj-0007ET-UN; Fri, 10 Jun 2022 05:53:53 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 345793.571480; Fri, 10 Jun 2022 05:53:53 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nzXaj-0007E0-OW; Fri, 10 Jun 2022 05:53:53 +0000 Received: by outflank-mailman (input) for mailman id 345793; Fri, 10 Jun 2022 05:53:52 +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 1nzXai-00078y-J7 for xen-devel@lists.xenproject.org; Fri, 10 Jun 2022 05:53:52 +0000 Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-he1eur02on0615.outbound.protection.outlook.com [2a01:111:f400:fe05::615]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id b4239899-e881-11ec-8b38-e96605d6a9a5; Fri, 10 Jun 2022 07:53:51 +0200 (CEST) Received: from AM6PR0502CA0070.eurprd05.prod.outlook.com (2603:10a6:20b:56::47) by VI1PR0801MB1646.eurprd08.prod.outlook.com (2603:10a6:800:4f::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.13; Fri, 10 Jun 2022 05:53:49 +0000 Received: from VE1EUR03FT044.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:56:cafe::ee) by AM6PR0502CA0070.outlook.office365.com (2603:10a6:20b:56::47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.15 via Frontend Transport; Fri, 10 Jun 2022 05:53:49 +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.5332.12 via Frontend Transport; Fri, 10 Jun 2022 05:53:48 +0000 Received: ("Tessian outbound e40990bc24d7:v120"); Fri, 10 Jun 2022 05:53:48 +0000 Received: from 804bed6f1c78.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 975C0AF7-5E0E-4CDA-8934-36219FB31A39.1; Fri, 10 Jun 2022 05:53:41 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 804bed6f1c78.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 10 Jun 2022 05:53:41 +0000 Received: from AS9PR06CA0062.eurprd06.prod.outlook.com (2603:10a6:20b:464::12) by AM0PR08MB5377.eurprd08.prod.outlook.com (2603:10a6:208:181::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5314.13; Fri, 10 Jun 2022 05:53:39 +0000 Received: from VE1EUR03FT027.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:464:cafe::c6) by AS9PR06CA0062.outlook.office365.com (2603:10a6:20b:464::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.11 via Frontend Transport; Fri, 10 Jun 2022 05:53:38 +0000 Received: from nebula.arm.com (40.67.248.234) by VE1EUR03FT027.mail.protection.outlook.com (10.152.18.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5332.12 via Frontend Transport; Fri, 10 Jun 2022 05:53:38 +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; Fri, 10 Jun 2022 05:53:37 +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; Fri, 10 Jun 2022 05:53:36 +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; Fri, 10 Jun 2022 05:53:33 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: b4239899-e881-11ec-8b38-e96605d6a9a5 ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=Qkw7hl/cegNtumNBTnTQZtKSLnHzVtsTz9jcwCVvSIZ8l4zSwSl94lWGuFoIS5FyjHEOeG4ZJoSrWdzWGNZ5BNI87NZyLmS6tjw2oQS3QeBR8M+op/x0FJQV6uEvHo0RhzD0c2pDFobH5ynMxkwdckU+ANJeVU+ASCDZK9tdo04lHYQrZFbtFePWWNNi77Pq7cXCmP5l+ABq4UTeHA/IOGaCMt8uREZaLK9lckFvuRql/gBPed8jyIeSMX9HotKdAmnrphYTVAJEmiIgFoRY6xBJBRRcXAQbzk77YXWVKr7O8uoPX+Z0XryurcmBQsvC6VGn4fagLis4VGEEBO+7gQ== 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=V9wUoq3XTl/aE5RFIP3KDTc2vdcTUcKiAanOp0Qrrhc=; b=DDH4CSW3KpTePMHY66Qk0u8QK8dgjmQ23fNrn+xE+aXgW8gXGSqbL9BHrzpkNynnqwGG2GiQAOd1Z1/IpN20hHTw9RkUmUXZFAbcB8xXtjsd2MRokoGwClUYv1+QV8DvDiUjTgqvC/omPAtTSUYjgabBOu6c7TsAitjMj2+5lKOaWnVDV+xVVelpMQHqMRxLsjCOSrhiIjV5AWdo7p3aQJOiKmqs9A4jlMHpwvGKuymx2lDnmvtqS3sFWFDqnUn0TcnPqiizitzZnG+SK4OjwyAsbzn0fxePuFomiwV4Nbu/OTdLFMUk9iZCzPO9zXzsY4Ve041mKqznQmiCEduPNw== 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=V9wUoq3XTl/aE5RFIP3KDTc2vdcTUcKiAanOp0Qrrhc=; b=Qv4apFVaZkv+VSmHCPKx5/+7nhDz+GteI+zxPZD5xyqtLUNmP2qtOVjosfjmmeSqLbnD72wvcLt34JJbW9gEkJArYuKVmcgjFXHA6xqhS+kWTTyBGzlGWMNqiYgBD3QF5Z2nZsZfUDz+9xtxNUeqbG3PR3quBPcPY6lPIZ3imgU= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C X-CheckRecipientChecked: true X-CR-MTA-CID: b7530664715039b2 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oDZuDwLte6/pZpfGuvFpUbNpggKC5G/TRJlJO1W+ZwTKbZaREaIr2mGaSFVC2CznA/84gBTUuMNmSnJGwLUe/5RoDYBGIjn2WK/eWelUJar91XUti8G/inXYC1rgQeyMITO3uxOjSe+SGUm4ehVwwBXUAwOHSbz08awa/PIzibD5AA1MC+gRh7x/S90OnZTZSkl/U1eQvxE++30cVBZF/4Pu8ylfMApWWQtj2vsfOlYVW48O6bkcsFjsAR34N6asaBcoHvYWMA0BG8p+HZPhAb8BhLvfFPW0MP5G6wFy6AjYVDsIk6mVdsd0u1RRsXix3T9LZURRqsoieIRwZOAqmQ== 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=V9wUoq3XTl/aE5RFIP3KDTc2vdcTUcKiAanOp0Qrrhc=; b=i50GP0jxKwPGNu5rc1ItaH2BYqD9L32lcaCWE7uBxv7s1XKpdG0RZ7CK+KfaduRnVRnRFj5JkhNoMOlwcwLi1DaUWhXr76lKUYTRg6yH56P024LO2/u0BGflpALLpDDBNkgQB+1C/UCdrn+Bft9JQOIaTYS4TRtd2CSMSKmA6VV7cAXwweO5dJ6EJkTioOlVblNnuGCao+cTHeAyQ3vsi9CHTQ//eRsFqNjfqGUEvhoqIQqkgFloUYbhknbGNZ1FY558XVs47hx7BkBn6jQ2OzzK52hdiHfdi3RLbmVZFDNdQ7HvjZ6uJVwEph3kTO4AtUoQlz58pBr5gcEZd5wNtA== 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=V9wUoq3XTl/aE5RFIP3KDTc2vdcTUcKiAanOp0Qrrhc=; b=Qv4apFVaZkv+VSmHCPKx5/+7nhDz+GteI+zxPZD5xyqtLUNmP2qtOVjosfjmmeSqLbnD72wvcLt34JJbW9gEkJArYuKVmcgjFXHA6xqhS+kWTTyBGzlGWMNqiYgBD3QF5Z2nZsZfUDz+9xtxNUeqbG3PR3quBPcPY6lPIZ3imgU= 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_Pau_Monn=C3=A9?= , Wei Liu , George Dunlap , Julien Grall , Stefano Stabellini , Jiamei Xie Subject: [PATCH v6 4/8] xen: decouple NUMA from ACPI in Kconfig Date: Fri, 10 Jun 2022 13:53:12 +0800 Message-ID: <20220610055316.2197571-5-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220610055316.2197571-1-wei.chen@arm.com> References: <20220610055316.2197571-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-Correlation-Id: c2be363b-4279-4ca3-4005-08da4aa596d0 X-MS-TrafficTypeDiagnostic: AM0PR08MB5377:EE_|VE1EUR03FT044:EE_|VI1PR0801MB1646: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: 8ZnsLLGNhQt1a+6E/sppjADgD2EnCramADmjMwGQi5sbZHizMgD+9WibPkeRz8tpH2mqqK07A/1adKuK4uhjDuJTlEX1Q9Ib2dAXV/ck0nrrvpztUohb4mSovuCivW9H66NM2xCNuW0Qhou03VZ7OME0XG7P9fCr8YiNFWcVY/qRn+ml2svNoKDLDL248eKqUomQvLQ2gJZNXO7ed/n6gOrOvZFK3H9Rj4sO0sXmMeD0wOIDb2sibsaetaxQGvicRurY4nOtSCL0gmiPtadkYFUoCR2i6PAhTDNtEZkIv9P+Lrlj8IiInlpd7XkEzaw1ROrrb6Q8Mwgz2YajSrojK75KMlxW3Hgo5mdVX45/rRveMk73k6nOsiDGGZeCQKQNURip0Tv8BPgd1H9KjMfSkDBbYksZh02aDdztKsIzLAjGRHjim0kRmrFeCWZxfJujtpYBClNU3dUoxFXmUPoLgzAbJRG8+ip9ynSWD3566yLya5rriv6gsHVZYJk/s/cLebaXAqvrFC6rrjBE0HpKbq4MP5sL0DzHBBsYcbgpJ8ojrONA5G6dTvU9grICSXd17IwtMdV45CaaO6TDlUKnYzGqnohaRsESATfDmcxaRsoCkhk+irhjG/8lTV04H7Fm4qZgl9F9F4kczSGI82YduPx3oiY1OZ0xWQtvFMNam+Y4Q7u11KRrpRP6sIN2rZbMy9KPjorH5JqE6U3+ZHJ0tA== 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)(40470700004)(46966006)(2906002)(47076005)(316002)(36860700001)(8676002)(5660300002)(36756003)(4326008)(81166007)(82310400005)(356005)(70206006)(70586007)(8936002)(6666004)(508600001)(44832011)(83380400001)(426003)(86362001)(54906003)(26005)(1076003)(7696005)(186003)(6916009)(40460700003)(2616005)(336012)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB5377 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT044.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 7c48b166-d269-48eb-b6bf-08da4aa590b4 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: twtASVrJGitsdj1N1hpRc0RY20BcGr3VmpD/uujJSGgLv47CvJAXxtsfvgKn5qRpOsM3uHamm9VpskIUmQ+IaR6UUfzSJ2BXM4ssBP+/3Rr01Qlv5knbFf/45R1NjyOB/Ft/pKQ1A5J1uEDncO37fvnbccguLFvCgy4iUVdLN0O2Cd2zACDvo5Iw7gEBJvN1uS0qE8x6WQJfigNRSF7gtfGeItA6yyjijMe5ppXbgzsFr5SnspWka+W421X49+I+Ad1fkQkxYB9kypK2i7kmyVfF9LtwF9baPrhJUtl1qp8y9rh+LleDNUz0EVsvquDe3dR4c9qeb8PuJxQi74fXf2azJ81t/eU0pWBvUqSmdPPwuoba3cyn01tiDc0iW4E13d7IWP4g2huklbxhx6JR1Pg2i0WeHu9iGx/0gpYPCq5eFDn2ZiQO3kEs0SCHIG3xTyyk3g4H7tJVvj7kxEZ1jfM+9ZlCDwqHZBzLwhH5rUkQ1qU5r+SnEPVBJuc8cZao7U5EejtdMsxwcWpOGT4yWaSrv3PqXXuTo0B9Xkuzy/qIOmYADUFk9kINpwHSq9pBW9QusNsdEtxQ+ELPHc+vRiLhhRBnVdJmyRW2YW8HHz/Dk4Fj+9xOBUAPJ7909ZP84VSMd7Uq0YgnHyLr3tpwlvfQPm3Y4lfbyfv70Il80BGCqTeS9XNJWs20n77Ykq3G 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)(40470700004)(46966006)(86362001)(508600001)(8936002)(2906002)(4326008)(81166007)(8676002)(70206006)(82310400005)(70586007)(40460700003)(44832011)(36860700001)(5660300002)(54906003)(316002)(6916009)(26005)(83380400001)(2616005)(7696005)(47076005)(6666004)(1076003)(36756003)(426003)(336012)(186003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jun 2022 05:53:48.5542 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c2be363b-4279-4ca3-4005-08da4aa596d0 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: VI1PR0801MB1646 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. 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 config ARCH_DEFCONFIG string diff --git a/xen/arch/x86/include/asm/config.h b/xen/arch/x86/include/asm/config.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 -#define CONFIG_ACPI_NUMA 1 #define CONFIG_ACPI_SRAT 1 #define CONFIG_ACPI_CSTATE 1 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 +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 -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 += utilities/ obj-$(CONFIG_X86) += apei/ obj-bin-y += tables.init.o -obj-$(CONFIG_NUMA) += numa.o +obj-$(CONFIG_ACPI_NUMA) += numa.o obj-y += osl.o obj-$(CONFIG_HAS_CPUFREQ) += pmstat.o From patchwork Fri Jun 10 05:53:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 12876462 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4E097C433EF for ; Fri, 10 Jun 2022 05:54:08 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.345794.571496 (Exim 4.92) (envelope-from ) id 1nzXal-0007ht-EJ; Fri, 10 Jun 2022 05:53:55 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 345794.571496; Fri, 10 Jun 2022 05:53:55 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nzXal-0007hL-8n; Fri, 10 Jun 2022 05:53:55 +0000 Received: by outflank-mailman (input) for mailman id 345794; Fri, 10 Jun 2022 05:53:54 +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 1nzXak-0006br-Ka for xen-devel@lists.xenproject.org; Fri, 10 Jun 2022 05:53:54 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on0626.outbound.protection.outlook.com [2a01:111:f400:fe0e::626]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id b55134a2-e881-11ec-bd2c-47488cf2e6aa; Fri, 10 Jun 2022 07:53:53 +0200 (CEST) Received: from AM6PR04CA0016.eurprd04.prod.outlook.com (2603:10a6:20b:92::29) by AM8PR08MB5730.eurprd08.prod.outlook.com (2603:10a6:20b:1d5::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.11; Fri, 10 Jun 2022 05:53:51 +0000 Received: from AM5EUR03FT028.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:92:cafe::bf) by AM6PR04CA0016.outlook.office365.com (2603:10a6:20b:92::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.15 via Frontend Transport; Fri, 10 Jun 2022 05:53:50 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT028.mail.protection.outlook.com (10.152.16.118) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.12 via Frontend Transport; Fri, 10 Jun 2022 05:53:50 +0000 Received: ("Tessian outbound e40990bc24d7:v120"); Fri, 10 Jun 2022 05:53:50 +0000 Received: from a3ca2fe92f07.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 9CA918F4-8782-4CE1-908E-F754DF5B9AED.1; Fri, 10 Jun 2022 05:53:44 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id a3ca2fe92f07.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 10 Jun 2022 05:53:44 +0000 Received: from AM7PR02CA0024.eurprd02.prod.outlook.com (2603:10a6:20b:100::34) by AM0PR08MB3540.eurprd08.prod.outlook.com (2603:10a6:208:e3::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.12; Fri, 10 Jun 2022 05:53:42 +0000 Received: from AM5EUR03FT044.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:100:cafe::eb) by AM7PR02CA0024.outlook.office365.com (2603:10a6:20b:100::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.14 via Frontend Transport; Fri, 10 Jun 2022 05:53:41 +0000 Received: from nebula.arm.com (40.67.248.234) by AM5EUR03FT044.mail.protection.outlook.com (10.152.17.56) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5332.12 via Frontend Transport; Fri, 10 Jun 2022 05:53:41 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Fri, 10 Jun 2022 05:53:39 +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; Fri, 10 Jun 2022 05:53:37 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: b55134a2-e881-11ec-bd2c-47488cf2e6aa ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=kSfAkbNk81eQzNWPE3QDbQm3oD1YG9O7wL9/6vrLucxKacuXNpdQPqricAnJzqf2udy4AFeRioiFJ/DpSkYVaQJAvFQCM5oVqeuJyDbQt3l5q30XpwUyA1NGWD2xSUn2JmhL0+LNWTEgCyeZUKtPGt1FpuIi+V5D5YaVG6MVHOHn7t5hnkD3ZF0Q61dj46DzvuVHxxu8RMDc2+vGXAsY1mDJhXbcEyi9ofSrnUFSa1XO+YdUWqm8WPCGZfMK4673TsO+7J9WTMOdRjcmYxV8fvJFeEWvuAOi+on36+rBXbNNkYdZ2g9ZgvTIVTdM9tXnvn8LE5HUmZ+y1Mu7BQEdnw== 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=mmWNLdXhXdHZRodNywRZ0AluYyoEUalbdzqUNWlHEjU=; b=XkgdtfFf2aMCdZ90IIcIwVVr/SMQNPiwMZLkfOJA+7HMON5bnQejnwvj3/QXmCzf6Du9ITs8/rWaiWSl6VnUBLxxG6d+dbl2RijRpWXks3DhhdoLQHnyn58Np6wg/pO3sN0bzsWdR7WjSPRAQsFhLiQ1RHrN783w14DJMXG/2xPesLuWgoR1KHfy+bAQBQ0a44OYJsYftBWdPVKgwqT01ZmYrFNwnuEK4lCkEP2SOurXERn2pka46co0CDEd2GPJjKa3S6D+k76QC7SyjY6Xk8j5TaPpILUueUMZi5glbOjUgsCles9LY4snfKw4HhIjcMZy/kUqP1MwZ5bRpkwLFQ== 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=mmWNLdXhXdHZRodNywRZ0AluYyoEUalbdzqUNWlHEjU=; b=VVl79PuYH21t3JY8WZTzMoQDBh/zAOTbv1S7FUWXZEtF9GypSYnL9urhaTpAmvfz6rQkXxsOmNtzSHSHRAYHlNfmCnCW5BPr9+JhYGs4OMiR3NdibBKHyBlY0md73mnm94NJH6DptvfyIEl5EJJcgZNpaG0xLjNXTpGk5ruxQSs= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C X-CheckRecipientChecked: true X-CR-MTA-CID: dcb9a448a5a7c00a X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=m2HwBh7mrxuzD6NjMg95fVqfZIxZh82MZmLDvR1ciqt+sNplv+z0Hbx/QxDikDn/ZkEHwKjgt7Kw4AO2DXbpLohMmcZGrd2rwnaoBdiTMZEpCwTU0JQ779bhmlAITRRi8BT+Hbzn5QobEHlD7DjDDrHDa7uT5EY5WIsDgMiyNkdW7sy03fMpZzuQ87yCiUlUl/uQDNreQdejqFcqQb6YkG3Dccc1aUOoEJK7LxavixAurBkbM+VUFNBFfYu/biUIH71ll0g8SpwcKQeg6tZ8H23fTr4MhvFBbl4RoCxw8AteE8yMLpo5FepQnlnGexLF/wFDGFhs3Aga+x/Rv/TUwg== 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=mmWNLdXhXdHZRodNywRZ0AluYyoEUalbdzqUNWlHEjU=; b=h9fezbv4JRBSUPUgAnUQaCnD0ncE9Od4WDOgW8IaGgWUkBEYIf3/KQVV8UU1ZzVPFKdQYM7tN3xPaNKAr2DCCSzg6rXKVnqZIOshrRI1to1ArAVC34svEYqxEWQWx1fJv57HNM81tv440KHhdYbubqyD9ByXphanxAFRYMIq6cJQGtW1mJsDWygqiQB19haSo/d9TX17pUA2K84+NmC60BRFz4nWYKUkdK7aiZPw+KWz4C8BGHrc2rv47BJodkhiTi1Ig2Gi5fYFa3wsb+Sn79zx0mKoQkRao/gqC1iaKIv6ArAgakZYBaVJrRPPltVqD69t5wTcDhW30RLtFDqe0A== 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=mmWNLdXhXdHZRodNywRZ0AluYyoEUalbdzqUNWlHEjU=; b=VVl79PuYH21t3JY8WZTzMoQDBh/zAOTbv1S7FUWXZEtF9GypSYnL9urhaTpAmvfz6rQkXxsOmNtzSHSHRAYHlNfmCnCW5BPr9+JhYGs4OMiR3NdibBKHyBlY0md73mnm94NJH6DptvfyIEl5EJJcgZNpaG0xLjNXTpGk5ruxQSs= 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 v6 5/8] xen/arm: use !CONFIG_NUMA to keep fake NUMA API Date: Fri, 10 Jun 2022 13:53:13 +0800 Message-ID: <20220610055316.2197571-6-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220610055316.2197571-1-wei.chen@arm.com> References: <20220610055316.2197571-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-Correlation-Id: 468dd8fa-9af7-4ef8-07ea-08da4aa59806 X-MS-TrafficTypeDiagnostic: AM0PR08MB3540:EE_|AM5EUR03FT028:EE_|AM8PR08MB5730: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: GqdDHs7kS1W4EK09IJzUlGaJEjGEYKAXaxvNTRwGVQoMfusEqpbQ2lQ2RrvDD0hR6hHpYIlkdY+c03ukSt2rCMCcafUMKqmOVpM8UaNK0LqWSoNjuUOYFoTz8V/cTBN/obx+Lx27kWyY6XDZ9tIcPHOuXxfwIc081+UMFeODRQAKzuyeY/wZox/hicKmjt1FREO5ofd8OgmUiNL78Wa0hjJx+8rM+XMT23gDQeh53uy2eWNwHcy2VxvcNQ9cw8w0BfDe5gX01ei45EFnQVNuGCMAeFHpFCmFQBpUnU5BUVurMQJc2usVsiw+L66+r35vqpSQSSRklbuSKi8K7FsKSuQaCFrn3C0Nkap4kMPtXtG4fl6wrHBiNmMWDFwBvs2y2Z4CcB41q0j8FeNyILztMOdn+CFKKoBdYw11s+FOK+eJmtoNfdM9X2qn8oGE/+F14o7ENOf9IRjEcEeXGUqh2szUeDXs7VDNR0cBUGqKrTZGFy5+wZZLFWOVXnhK0upTJW5JEEuI+a6aDCXCudy28iNvdSKTdKI3JOrx9TiQjKUpthK2PiV6O0V+OP7yZjkCRbrAEO/xhJO6JKxYFMpB3zBDO0lgnvKDckfzX/wWyE1pwTEN4Jq3LFDOD3xjHYzCgrwYgSB3B8JGHTc/NLCc0f1gpeYyRbrsl2YPB8gR/RgLvEnxCxrI5snLZNiUBImYoOKix+pzUCOAZ2xNWStCnA== 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)(40470700004)(83380400001)(1076003)(47076005)(186003)(81166007)(70586007)(356005)(40460700003)(82310400005)(2616005)(70206006)(26005)(426003)(336012)(6916009)(4326008)(7696005)(54906003)(36756003)(316002)(508600001)(86362001)(8936002)(44832011)(2906002)(6666004)(36860700001)(5660300002)(8676002)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB3540 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT028.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 668805e6-5774-4489-fcdf-08da4aa59298 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CVDLQox4ssdRtS/wvPRIvPKKJMo/wgB93k46mTq9eiKqvaAG8SkZ3RFFk9GzDcNIKaSCQ53BO2emN+SHWRwRETyi+A83CuDUb/Bb3sVj7RkhtGMU4M2feOX+MyMx4lK2vxhLjeQx0CgMX0fU8q7Ve9jfyb9Poqi8vZeJLREN55m6uVSX4uGVMZQO2QS6xmGKpnDEK9IGhuwIlQduME9fBNxrEmDR3dvDtByV05CjWe9NG6IyMFx2mPzVhDlrvz46UfxJi0E9N9Un4A/JvEGFqZeYEVB6yCc0UWNRK626hVKj3Yyy4sZwpL6ZrSqPQnieaUF/A/ZMAkuCgsVkHR1CI/+pEMTXmy/eSoI792BnOZdrhARBjtRdgGEVilKBsI0ktX9TCISCy4F1rQO+/gZVTwQecHYFzBvR2v0DHQwR7o2y+ufn3E0qi25b9djln4fModFzwCL9VqUnMcRg9wbdXdTVUnTs66Yk/PYCaeCQElvD1hO/Q2qLQPbJpfRS2eVcn0b5JeMAytdX4Ugr3l94Rw2nsOHCPpeP45GeR65BocC/XwXm5IG8mO78vaWIBzZ+hfedEJUB/EOrU79o0UXeAmefmjssgFqr9PwAlRe3y+6PUWCFtRVff5BPrGCaQ7MqcO1K6VIFPj+d6daiiCNyYriemtuVXSiZ9y050FJkU0vB1Cr2Rmpg4P6JPZ6isZX6 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)(40470700004)(36840700001)(46966006)(1076003)(6916009)(7696005)(36756003)(86362001)(81166007)(47076005)(2616005)(316002)(82310400005)(4326008)(336012)(8676002)(36860700001)(70206006)(70586007)(426003)(40460700003)(54906003)(6666004)(8936002)(5660300002)(26005)(508600001)(83380400001)(186003)(44832011)(2906002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jun 2022 05:53:50.6312 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 468dd8fa-9af7-4ef8-07ea-08da4aa59806 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: AM5EUR03FT028.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR08MB5730 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. 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/numa.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 @@ typedef u8 nodeid_t; +#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) #endif /* __ARCH_ARM_NUMA_H */ From patchwork Fri Jun 10 05:53:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 12876468 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 22932C43334 for ; Fri, 10 Jun 2022 05:54:14 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.345799.571525 (Exim 4.92) (envelope-from ) id 1nzXas-00006f-Db; Fri, 10 Jun 2022 05:54:02 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 345799.571525; Fri, 10 Jun 2022 05:54:02 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nzXas-0008WN-3w; Fri, 10 Jun 2022 05:54:02 +0000 Received: by outflank-mailman (input) for mailman id 345799; Fri, 10 Jun 2022 05:54:01 +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 1nzXaq-00078y-PR for xen-devel@lists.xenproject.org; Fri, 10 Jun 2022 05:54:01 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on0618.outbound.protection.outlook.com [2a01:111:f400:fe0e::618]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id b86ad248-e881-11ec-8b38-e96605d6a9a5; Fri, 10 Jun 2022 07:53:58 +0200 (CEST) Received: from AS9PR06CA0366.eurprd06.prod.outlook.com (2603:10a6:20b:460::6) by VI1PR08MB5422.eurprd08.prod.outlook.com (2603:10a6:803:12e::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.13; Fri, 10 Jun 2022 05:53:54 +0000 Received: from VE1EUR03FT041.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:460:cafe::6f) by AS9PR06CA0366.outlook.office365.com (2603:10a6:20b:460::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.11 via Frontend Transport; Fri, 10 Jun 2022 05:53:54 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT041.mail.protection.outlook.com (10.152.19.163) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.12 via Frontend Transport; Fri, 10 Jun 2022 05:53:53 +0000 Received: ("Tessian outbound 6f53897bcd4e:v120"); Fri, 10 Jun 2022 05:53:53 +0000 Received: from 2aee9bf77758.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id FF9551B2-4BA4-46DC-8346-2B400D2B4580.1; Fri, 10 Jun 2022 05:53:47 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 2aee9bf77758.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 10 Jun 2022 05:53:47 +0000 Received: from AM7PR02CA0019.eurprd02.prod.outlook.com (2603:10a6:20b:100::29) by AM6PR08MB3864.eurprd08.prod.outlook.com (2603:10a6:20b:8e::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5314.15; Fri, 10 Jun 2022 05:53:44 +0000 Received: from AM5EUR03FT044.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:100:cafe::30) by AM7PR02CA0019.outlook.office365.com (2603:10a6:20b:100::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.14 via Frontend Transport; Fri, 10 Jun 2022 05:53:44 +0000 Received: from nebula.arm.com (40.67.248.234) by AM5EUR03FT044.mail.protection.outlook.com (10.152.17.56) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5332.12 via Frontend Transport; Fri, 10 Jun 2022 05:53:44 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Fri, 10 Jun 2022 05:53:42 +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; Fri, 10 Jun 2022 05:53:39 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: b86ad248-e881-11ec-8b38-e96605d6a9a5 ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=NKIKsuhwg6NHQyPfd4H1aAMUNMkPpGJgXSyLolAjD7UD/cFaKUGuSX8X+nFxJ15GJIsGyhxVmuZ9/yr16yCaqY17xXlMpb6hR3mvv5BRRQjdRF/ByaBOC4pXDS/BII/A9pF7D64XlSSab64kFu0WOEQ8LAgOD0QYVpy5h4DqsKxYgyl/PZxHgxQm8sAafpqtNAgddzeCkU5EQtv+Bi+lknjiLPIJ08puo3kZbcbXf4JfO2lw3dRDQTYfY+XWd8gXHdfbpQjCNkWRa4gE54Ms25+ia8DPQ1rD8/OhWWuA9k7rA4S84LJxh5JLl58zbP+e2qUBQmlYee/bwHjJHkSQkA== 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=YtTv1hIwjELwhmX84zR7R+LRlUkqarX1yb6jS7tn1R4=; b=VTBWJLjseepp3Ixtv0PBBS2+n19xx/0a88//HtySbawr38rSF2eHss+T1YoagMF8EE+QMKshPfJ7ABGP6Tsw9FcF86KEgYY+bEIBqNAjKbLQ8jMgwRds2wbMGmAfD7CRbLxkIEOdL+MUBGHZE75ED5irJkPvWl3klonf6x5/98Ma7VNF4ro+bufL9npyfG/wfLA6KE9YDDXiOMQWTRqyPb7kDcZAgcyYR53hsG0+NAgLyTzu0d9y4jloPbcT6xUBX7Vc9vJy4tjZhQvvyulT+wQPqvcQWkUOfn/8o9qO2KCIV40UXVnxDxNdAjlPWgaXwoTwO0LBzvw5467lv7cSjQ== 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=YtTv1hIwjELwhmX84zR7R+LRlUkqarX1yb6jS7tn1R4=; b=ERyGcs6zLVtmtlfUFnraYd+RnmZbeQcreQug1uJGVq/ZmmkMaC/n7OqGtI4UOwEyYbjHPRmr6PXn3MdLbl4nT6MODLjGuFpcFIpGc3isWfy5HNjpZIza15TPYu3YgEQy9xyOM/bswZ47O6qwHboqqjC4HLctcGPEzfqeIuy+3n4= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C X-CheckRecipientChecked: true X-CR-MTA-CID: 90f9115dc96b2a2f X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cXtUBV30FTrjgt+2vmyRNVGDJ9boZ2xnuAlcGcYdSDWPUV1lLYerpeMMzz3202Omq5TswlcWfEuJ4YUIrApUs0qj/QuBWvp/31jrNJ4pBOXyn1p0TsQhVczxTl4LhHkewXgJxgpb2ZscUYp5c3X4avyL13PjgyrSOBKYudCu8RKqASNyKYC3JyPimsB14f3dTiCx0BjBs4GhIssuWVNGUwhW/rghN9ukB+j8QCzONaWpoQcSYU2QfDFkUr/+b4iAZhArgiQKuuK3s2g8SGTGHX7e/Hrotna1W71/q8yi8Q8cOhWpStE/u+3BdMAcobSTIg55nxpSJcreteM0t7+xog== 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=YtTv1hIwjELwhmX84zR7R+LRlUkqarX1yb6jS7tn1R4=; b=jiCbxPZPInsleCVWOtE3Wjum31vNC5YCKu8OZpzv1gNcNGf2gAJcH2fJXCepV315YvpPA29CrGrHMH0v4y/+tEAZsSeZ7KK/FpxpfAMfHkEYpQ3lSBZzfi/BXWLW6nD8IGKPC/8zbg+C2YbwA4tBs4E4/PZD9UBdeeEmRthpQUFZckyexiw4yhC3zFJBnSsdDlp0nRfexNlP9JzRjzMUQ5wQ8zQB/MOXj3JTMHpKvEVbyznekTaSKE2qdj5FpVcG+CUeAB2x5wjHMd1MUCpg2dywcJRMTTpVayxjYSPj0Fq0GnX2ki2N2d8Pz86x8TUc/3evgYY1djdb9LiP0b6MIQ== 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=YtTv1hIwjELwhmX84zR7R+LRlUkqarX1yb6jS7tn1R4=; b=ERyGcs6zLVtmtlfUFnraYd+RnmZbeQcreQug1uJGVq/ZmmkMaC/n7OqGtI4UOwEyYbjHPRmr6PXn3MdLbl4nT6MODLjGuFpcFIpGc3isWfy5HNjpZIza15TPYu3YgEQy9xyOM/bswZ47O6qwHboqqjC4HLctcGPEzfqeIuy+3n4= 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_Pau_Monn=C3=A9?= , Wei Liu , Jiamei Xie Subject: [PATCH v6 6/8] xen/x86: use paddr_t for addresses in NUMA node structure Date: Fri, 10 Jun 2022 13:53:14 +0800 Message-ID: <20220610055316.2197571-7-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220610055316.2197571-1-wei.chen@arm.com> References: <20220610055316.2197571-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-Correlation-Id: 0d80f136-8adc-4d32-46b7-08da4aa599ec X-MS-TrafficTypeDiagnostic: AM6PR08MB3864:EE_|VE1EUR03FT041:EE_|VI1PR08MB5422: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: keccJe/YM9mtW1kZVaz/GVHp0cOMLOVwGXe0iUbMR8vTYch6V2NpidGo6mXg9Yob09r3nO5rRPPd4qPXR9XqCn3Z05PVrHeDwm76iI1Ae3ZcovWZVY4SeTG8HtiOZvc94iG9ixyMv1x/SdIwN+7koUirbsCLPmpCw+Ae7js6DZWChtBPsgSK1T+mZ3fFLWImUVO/yHre/68eycmz3Gf1lgGD/IoeWzd8KWebOXoboynfYiT0dOMntTXjG5Y6XnuFrj6WgyEJ+nPtr0ylPh9TV8eMTMNHGaEHXnI53f3qP65Ib527HB8GvPEpnkkAKBMAB/V+YdeDOXsUUw6lSA7by+Ggk+VBzElBanERyLjApR5H11vrpU6W+4BF6v24lSH2vSqEy7uZRNA6t1+FM+S69dK1Q51xBQbgOII4YiqvtOhfsghoM3EgoMczgQz8QsFMjQxmdr40qQgNrR2TupRtPQzCOjLBqWkCdboKhGaLxQIRTT5GJam2ti5CpSHSH5edX4DVKChDfJ53xEa/jTdSP9DD44f3YUs7QtYHJhQ4Ms0raOLIydx+6Wbyh3q0bLHuokg2mMy4PpqH+V08nrr6mFOtvvt7j2Uh4IfWok/E6fl3Nd0cmRiVK4tAxlErEE6IE+BlCDv7tMuYv6DhnNjkwIvXTYaIr8sprKuKVaegzaFnyAQcHmgX6B0DitdPrsg7Hg5WK5kz/SnvVdNNT4/AtA== 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)(36860700001)(40460700003)(508600001)(36756003)(83380400001)(47076005)(426003)(82310400005)(336012)(2906002)(44832011)(5660300002)(186003)(6916009)(70206006)(8676002)(54906003)(316002)(2616005)(1076003)(8936002)(70586007)(86362001)(4326008)(81166007)(6666004)(7696005)(356005)(26005)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3864 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT041.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 98df04af-478d-4930-b939-08da4aa59481 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: EIbmVwp9cvP9KVpFDOfm6bbD6gOx0Un++wSivO4Issb4qiAJ10NR5SoCgrOgGA/7GI0noX5LPCODQyq47kCdR7o1r78RiCEM+T+n6pKRnyYsXkEkc0pnWvrsK3+Xrqgf7XMhpzsv1zhwVs0KieY4RAONo3zwLoSy0m9ZDbTTocp4CwuIMlFqIXRzoKShKT8SWRn1+8Fn/uXCRApq6wxRwhmG3Mh2YtcaCl09haBlK0dEkVo4njRW/92cRpU5MEh3QqhiLxYcnqiPPA6LEfMyTCr2EZW61N1C/9jrZp76XgjnbvxCfhyGsGTiowNz5w50GU+ncHTKhtci5zSsrVw7A9CzDNHAWi/rg48IZ/nhxXrg/n0zXrUMe9LzZU/zr4zHm9pN4BQCqtHXGSjSMmAXdgyux5TC1shPa8iB53IjY5+En5l1s/tI1Le5flMQ0UM6Wv8tux5Kqgcle2rPan6sXw4LtyS7r6Btr3gQeOn8/92+NZ2iUYyeUKFih11UM9YMUdztVcD6ll/8qY+cuEACR78Jfg6s/gEHsqo23XJsYBhlmFOeyQVKudemp/cDWJ742m0Bgj7ptI9EPGoBSvwIdtgq0ilQ2NT4mWke2jNokosFjw2eOCI3o8y9Azk0wd6Aip7p4zehc07i94oYsofNstma7hW7ixqWgxuSjJEySxRlZBJTNaczZY03nEDu3Y9o 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)(40470700004)(46966006)(47076005)(426003)(7696005)(186003)(336012)(1076003)(4326008)(36756003)(508600001)(26005)(2616005)(6916009)(54906003)(2906002)(6666004)(8676002)(36860700001)(8936002)(82310400005)(44832011)(316002)(5660300002)(40460700003)(83380400001)(81166007)(86362001)(70206006)(70586007);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jun 2022 05:53:53.7252 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0d80f136-8adc-4d32-46b7-08da4aa599ec 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: VE1EUR03FT041.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB5422 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. 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/numa.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]) struct node { - u64 start,end; + paddr_t start, end; }; 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); -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); @@ -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) -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); -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); 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) -{ - unsigned long start_pfn, end_pfn; - - start_pfn = start >> PAGE_SHIFT; - end_pfn = end >> PAGE_SHIFT; +void __init setup_node_bootmem(nodeid_t nodeid, paddr_t start, paddr_t end) +{ + unsigned long start_pfn = paddr_to_pfn(start); + unsigned long end_pfn = paddr_to_pfn(end); NODE_DATA(nodeid)->node_start_pfn = start_pfn; NODE_DATA(nodeid)->node_spanned_pages = end_pfn - start_pfn; @@ -198,11 +196,12 @@ void __init numa_init_array(void) static int numa_fake __initdata = 0; /* 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 = ((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 = 0; i < numa_fake; i++ ) { - nodes[i].start = (start_pfn<start < start) { @@ -275,7 +275,7 @@ acpi_numa_processor_affinity_init(const struct acpi_srat_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_mem_affinity *ma) bool mismatch = !(ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE) != !test_bit(i, memblk_hotplug); - printk("%sSRAT: PXM %u (%"PRIx64"-%"PRIx64") overlaps with itself (%"PRIx64"-%"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_mem_affinity *ma) } } else { printk(KERN_ERR - "SRAT: PXM %u (%"PRIx64"-%"PRIx64") overlaps with PXM %u (%"PRIx64"-%"PRIx64")\n", + "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(); @@ -346,7 +346,7 @@ acpi_numa_memory_affinity_init(const struct acpi_srat_mem_affinity *ma) nd->end = 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)" : ""); @@ -369,7 +369,7 @@ static int __init nodes_cover_memory(void) for (i = 0; i < e820.nr_map; i++) { int j, found; - unsigned long long start, end; + paddr_t start, end; if (e820.map[i].type != E820_RAM) { continue; @@ -396,7 +396,7 @@ static int __init nodes_cover_memory(void) 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; } -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) } /* 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 = nodes[i].end - nodes[i].start; + uint64_t size = nodes[i].end - nodes[i].start; + if ( size == 0 ) printk(KERN_WARNING "SRAT: Node %u has no memory. " "BIOS Bug or mis-configured hardware?\n", i); From patchwork Fri Jun 10 05:53:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 12876467 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E0BDEC433EF for ; Fri, 10 Jun 2022 05:54:13 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.345797.571519 (Exim 4.92) (envelope-from ) id 1nzXar-0008Qh-C1; Fri, 10 Jun 2022 05:54:01 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 345797.571519; Fri, 10 Jun 2022 05:54:01 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nzXar-0008QN-4l; Fri, 10 Jun 2022 05:54:01 +0000 Received: by outflank-mailman (input) for mailman id 345797; Fri, 10 Jun 2022 05:54:00 +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 1nzXap-00078y-PJ for xen-devel@lists.xenproject.org; Fri, 10 Jun 2022 05:54:00 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on20608.outbound.protection.outlook.com [2a01:111:f400:7e1a::608]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id b845b981-e881-11ec-8b38-e96605d6a9a5; Fri, 10 Jun 2022 07:53:58 +0200 (CEST) Received: from AS8P250CA0005.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:330::10) by VI1PR08MB4605.eurprd08.prod.outlook.com (2603:10a6:803:b6::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.13; Fri, 10 Jun 2022 05:53:55 +0000 Received: from VE1EUR03FT006.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:330:cafe::57) by AS8P250CA0005.outlook.office365.com (2603:10a6:20b:330::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.15 via Frontend Transport; Fri, 10 Jun 2022 05:53:55 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT006.mail.protection.outlook.com (10.152.18.116) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.12 via Frontend Transport; Fri, 10 Jun 2022 05:53:54 +0000 Received: ("Tessian outbound 01afcf8ccfad:v120"); Fri, 10 Jun 2022 05:53:54 +0000 Received: from 1999e13fadf9.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 9987A261-D355-4830-9504-45351C5B4B42.1; Fri, 10 Jun 2022 05:53:49 +0000 Received: from EUR03-AM5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 1999e13fadf9.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 10 Jun 2022 05:53:49 +0000 Received: from AS8P189CA0046.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:458::18) by AS4PR08MB8189.eurprd08.prod.outlook.com (2603:10a6:20b:58c::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.13; Fri, 10 Jun 2022 05:53:47 +0000 Received: from VE1EUR03FT009.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:458:cafe::b4) by AS8P189CA0046.outlook.office365.com (2603:10a6:20b:458::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.13 via Frontend Transport; Fri, 10 Jun 2022 05:53:47 +0000 Received: from nebula.arm.com (40.67.248.234) by VE1EUR03FT009.mail.protection.outlook.com (10.152.18.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5332.12 via Frontend Transport; Fri, 10 Jun 2022 05:53:46 +0000 Received: from AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2308.27; Fri, 10 Jun 2022 05:53:45 +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; Fri, 10 Jun 2022 05:53:45 +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; Fri, 10 Jun 2022 05:53:42 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: b845b981-e881-11ec-8b38-e96605d6a9a5 ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=RSVIpQUx1tl/m9VdJg0XDqCj+cd4tn+v1vWc2aYLBXa6/ry1po+IZjsRUb4vugi56uBDPM97cnaYAPoWYUiRC5DtL2wZY4y6iaKkKGhARjq4LY7exhbXT7eB4l+2cXT3cJKIOPgeSEw1oAFuMZpw6uBZaJwQNPLhgxeHXcHhHJxj53hj6YVAj4vfqRwCr4iybCOgkZgTduxQbC9Xv3QcYIxvhUmo28SkidtMfaZry241YHiy715T6if/Jb/sqJb2GtW281SqYFUf94kcmY7EKS4KObXNgqZs2pdp4emedLYQpYG5nyeDbnvAqgFiXziH9QdSmJvUyapfTTcYPUhtHg== 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=icfZOJNrOUgyvQFQOa5zeweNoNaUqNft+ccqz7fu4Hk=; b=i6oV6X1KQUDMbeGvH/6/rEv5ZEhgVJtA8CUaf3xpVNcwDfHEAbx8RyBn23UtHmzPG5sl/g7wKheHxiCBwLVrGWtUczVdJWiFKHkbbVORJWn/iakZD/pf9jPgn5rgjdkuTWTbcPiX+ZgUAesnx5Wi7OPxjc6vz5T8FDCi5jyPRwJz/95CAwYBRDUKbwAZ3TTj0JBMuln4l16SCnD27zEYAH5F2NL+PCld2Cmvb6zfxLdO2Oe79kx12dH7PjzTN3P0f7pGCKhv49J17HLLIdLF7jsN1BGuk+FciiwMn9rnf2lDLQLb9He5fcaNMm9zg/GzpsdaFMSzKraqacIZbjZ3cQ== 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=icfZOJNrOUgyvQFQOa5zeweNoNaUqNft+ccqz7fu4Hk=; b=IXHWE6tgM+8wMbmyXFlMd495zvSMJSpPu2j3WLNA9KNWGATxprI8379rlxOVMImimKRQjP3JgBB0Z0KoXp7qXyDfnILgy5zOiOa/tKVZtAbMmmcxKx+Vi9b/6rwenjzKZ6v2PJEaEhlh00So/9zz1LbBiWJL0eIUYxC5T31XvtU= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C X-CheckRecipientChecked: true X-CR-MTA-CID: 145405ea45d947d3 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kj0p+OqyJaBp7/y8TKdRAQlMUXvIOKL22h76y0Vfz9WPJK9oaBEevWYb4FlfPQctlNcNHkxVAfi4cEZpsuHi0tK5ALNMElR3zemG47cb/yG4KgvNgOwC7RWY4F1NXuIZLaeD9EtALxC+l5VA9pBdtda6rtwr+CIoTjEG7npwOhc4BGJ9IJC0dd0lUXV4h0PoNe7iobYK/3oZ8vDOlABHEiuCzYEBHQovF8OuMbqFuvMiHZDjQ0IysPJWvWsuRG+MJO5nKMgifo7i1BZtvA5huTMYmiEks93k5VBARmS/qmqwy/KQuPMIQ5leIHzgWrm30W5RvKnXmeqBfrmwb6lirQ== 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=icfZOJNrOUgyvQFQOa5zeweNoNaUqNft+ccqz7fu4Hk=; b=GnINzBG0yJVGck0YXndGJiklYSOB2WoHwc//vjE7sznUID/AfH1WYPOJeMWRpQFHp8JB/xmdF4q6R+zH8EsIbgHYSEvD+fEpQrI0pkHyhb2oOFi9fS3N0AzS32fXO36lAKPYv7r6L/vTG0twwolbIEuLHux0+XEH4SMVHIMD0fOh72GczuNenhLRmQ0v1M98zXfqBjDnmA/dF+6+GLxuquiD+11u5F7Y3Bwy5UaTEM6e5fxFlHFJJ7NeatNL7VWAsIefXFhlVWPX6txv+bRA9q0pBuUcuUFKB9/uL0YqO70rKCw6tRjd4IVYHubxDCv9Dbo5NqiFdQZsAEIp76qS7A== 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=icfZOJNrOUgyvQFQOa5zeweNoNaUqNft+ccqz7fu4Hk=; b=IXHWE6tgM+8wMbmyXFlMd495zvSMJSpPu2j3WLNA9KNWGATxprI8379rlxOVMImimKRQjP3JgBB0Z0KoXp7qXyDfnILgy5zOiOa/tKVZtAbMmmcxKx+Vi9b/6rwenjzKZ6v2PJEaEhlh00So/9zz1LbBiWJL0eIUYxC5T31XvtU= 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_Pau_Monn=C3=A9?= , Wei Liu , Jiamei Xie Subject: [PATCH v6 7/8] xen/x86: add detection of memory interleaves for different nodes Date: Fri, 10 Jun 2022 13:53:15 +0800 Message-ID: <20220610055316.2197571-8-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220610055316.2197571-1-wei.chen@arm.com> References: <20220610055316.2197571-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-Correlation-Id: 567ad5cc-a726-446f-5c48-08da4aa59aac X-MS-TrafficTypeDiagnostic: AS4PR08MB8189:EE_|VE1EUR03FT006:EE_|VI1PR08MB4605: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: eCmcb8RlSzoSzOWYuBdV/hRNswM3Bl82ssDPaZ367co89FIZDxaCEqRNxYuxJsGlnzy6zPYs727fjel4LmbiqWIdjhHZwawj1SR7z0Fo0Kx/BDFPUIiFF2mg9S2GJWtOF4WsuD5pl3SxbKWaJcWWQNkG3RuKiOHM9EMGasFgn7KceQoFHJccJUo74PEXNVwyoEbQvi3urUdr0OIvYoPCOC55FbXiOVLgptImo8932I3q9v/BDLaqsIuEwb4VUU8q3PtBm6TGXfoZA3qvVu9zeyTOjioIaYOlN+5fW4w7aQBQTi8upu04jcShckgETcW9XKv7iEH+tX1t3eeUcEsLuXWBp5ZL4WfAKLmSz3t0lJfsFPHK8jyvGbgKaCmj8UqRJUckFbb/QYGUHIr/0a1wuD68B2fiJ7g7KZPHzPV6K6wkzRywLLI0wR/vzQiHXx7s4QgHCdbBBCE2Ej09I+v6RGgiKfSsiDf/N1gADBwVrmmJ376X7J1xXocYRqP9PoSrbnh7eEu+luN9nf90oORUBNe9xtALmNZxYqifJ1CbSTnKg1VMyzFOtLj8cnTQSMs3JOydw0+73Saa0vSSwwuzfnaU0cTEY+iBYhjBZC2QJA4Eci4IMan0s1K/NAcmjdD33LpoGK4/O+ODfcFzAdFh/LfcB4NmW26mC+VJh7BidnZn2H40Qiflkal5MH9qujn+gxVMau+o4KZt1RwASDW7Vg== 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)(47076005)(70586007)(2906002)(83380400001)(70206006)(4326008)(7696005)(8676002)(6666004)(8936002)(336012)(316002)(426003)(54906003)(6916009)(356005)(44832011)(81166007)(36756003)(2616005)(508600001)(86362001)(1076003)(186003)(82310400005)(5660300002)(40460700003)(36860700001)(26005)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR08MB8189 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT006.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 30777c25-eee9-41d7-5437-08da4aa595c6 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2WsY2wNBMaejaDQW3xuqkc1miFDjgA14kpnzbCQdciLZM+4rlYBErH0HA5sZnr99bXZ7pCiE6aiFP94x69NVpc99WR+FIN1+DZkmbPyLYORNyXOIZvWUPQr6nsJJYK0RNcT+vBEen2hqnLbMo/5XY60pkWIuJlfuJVSXIGTDuXwTkURHGhBm8rx5IfNDZbvKSNn+tp84wWtffjCTirPS25oa/dxUbeIwL7KhtJHV8KwoDC2YT2OqAklg2kPnrnnVigHiTQiHTqJcs5guMJKpZfbO7J1T8ZMCpLx9/+qVTOs9XzjTjMQcChv8fDQSh4yZf9dDRqr0L/uE8YyVhuj0mXCKjPjY/Pn2xdasQ6JjykC2ymeddS+H3yE4F0bVDP3WfUcxzCdwvHieXAwfkdWXczTTOyxPsuSB4OGKuU2Z83fNqmGmIC76zeZbg2xw3XZRL20Q0q7iSpIh+C1eAB71CMzzKI5rwKY1B9Ow+HeimFP4Wxqfab6ZHUw69UeB6YKOsPtQ8l1bHejiiV9uuK1GJ+S9GapSeH/MF9dLNWDLv0Okpo7qHTcGOVUO7HiEXJhKp1ClqQiK5/Va28LZYx23zYkeYsX/x13VJAJukDuKJeGfgp0XK0M6JNw/9UkaFIuiNTXTxpfJxrFuihP4Iqamb2NiPLNRluGes1BuM1ivdaZcJRqIeB6KqojeXryjuF93 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)(40470700004)(46966006)(36840700001)(70206006)(8676002)(70586007)(8936002)(26005)(4326008)(81166007)(508600001)(5660300002)(44832011)(36860700001)(40460700003)(47076005)(426003)(336012)(2616005)(2906002)(316002)(83380400001)(36756003)(82310400005)(186003)(1076003)(6916009)(54906003)(6666004)(86362001)(7696005);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jun 2022 05:53:54.9986 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 567ad5cc-a726-446f-5c48-08da4aa59aac X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR03FT006.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB4605 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. As we have checked the node's range before, for a non-empty node, the "nd->end == end && nd->start == start" check is unnecesary. So we remove it from conflicting_memblks as well. Signed-off-by: Wei Chen Tested-by: Jiamei Xie Reviewed-by: Jan Beulich --- v5 -> v6: 1. Use comma to replace dash for [start, end]. 2. Add Rb. v4 -> v5: 1. Remove "nd->end == end && nd->start == start" from conflicting_memblks. 2. Use case NO_CONFLICT instead of "default". 3. Correct wrong "node" to "pxm" in print message. 4. Remove unnecesary "else" to remove the indent depth. 5. Convert all ranges to proper mathematical interval representation. 6. Fix code-style comments. 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 | 139 ++++++++++++++++++++++++++++++++------------ 1 file changed, 101 insertions(+), 38 deletions(-) diff --git a/xen/arch/x86/srat.c b/xen/arch/x86/srat.c index 8ffe43bdfe..3d02520a5a 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); +enum conflicts { + NO_CONFLICT, + OVERLAP, + INTERLEAVE, +}; + static inline bool node_found(unsigned idx, unsigned pxm) { return ((pxm2node[idx].pxm == pxm) && @@ -119,20 +125,45 @@ int valid_numa_range(paddr_t start, paddr_t end, nodeid_t node) return 0; } -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; + /* + * Scan all recorded nodes' memory blocks to check conflicts: + * Overlap or interleave. + */ for (i = 0; i < num_node_memblks; i++) { struct node *nd = &node_memblk_range[i]; + + *mblkid = i; + + /* Skip 0 bytes node memory block. */ if (nd->start == nd->end) continue; + /* + * Use memblk range to check memblk overlaps, include the + * self-overlap case. As nd's range is non-empty, the special + * case "nd->end == end && nd->start == start" also can be covered. + */ if (nd->end > start && nd->start < end) - return i; - if (nd->end == end && nd->start == 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 != memblk_nodeid[i] && + nd->start >= nd_start && nd->end <= nd_end) + return INTERLEAVE; } - return -1; + + return NO_CONFLICT; } static __init void cutoff_node(int i, paddr_t start, paddr_t end) @@ -275,10 +306,12 @@ acpi_numa_processor_affinity_init(const struct acpi_srat_cpu_affinity *pa) void __init acpi_numa_memory_affinity_init(const struct acpi_srat_mem_affinity *ma) { + struct node *nd; + paddr_t nd_start, nd_end; paddr_t start, end; unsigned pxm; nodeid_t node; - int i; + unsigned int i; if (srat_disabled()) return; @@ -310,44 +343,74 @@ 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 = start; + nd_end = end; + nd = &nodes[node]; + if (nd->start != nd->end) { + if (nd_start > nd->start) + nd_start = nd->start; + + if (nd_end < nd->end) + nd_end = nd->end; + } + /* It is fine to add this area to the nodes data it will be used later*/ - i = conflicting_memblks(start, end); - if (i < 0) - /* everything fine */; - else if (memblk_nodeid[i] == node) { - bool mismatch = !(ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE) != - !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; + switch (conflicting_memblks(node, start, end, nd_start, nd_end, &i)) { + case OVERLAP: + if (memblk_nodeid[i] == node) { + bool mismatch = !(ma->flags & + ACPI_SRAT_MEM_HOT_PLUGGABLE) != + !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 - 1, node_memblk_range[i].start, + node_memblk_range[i].end - 1); + 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 - 1, node_to_pxm(memblk_nodeid[i]), + node_memblk_range[i].start, + node_memblk_range[i].end - 1); + bad_srat(); + return; + + case INTERLEAVE: 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); + "SRAT: PXM %u: [%"PRIpaddr", %"PRIpaddr"] interleaves with PXM %u memblk [%"PRIpaddr", %"PRIpaddr"]\n", + pxm, nd_start, nd_end - 1, node_to_pxm(memblk_nodeid[i]), + node_memblk_range[i].start, node_memblk_range[i].end - 1); bad_srat(); return; + + case NO_CONFLICT: + break; } + if (!(ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE)) { - struct node *nd = &nodes[node]; - - if (!node_test_and_set(node, memory_nodes_parsed)) { - nd->start = start; - nd->end = end; - } else { - if (start < nd->start) - nd->start = start; - if (nd->end < end) - nd->end = end; - } + node_set(node, memory_nodes_parsed); + nd->start = nd_start; + nd->end = nd_end; } - printk(KERN_INFO "SRAT: Node %u PXM %u %"PRIpaddr"-%"PRIpaddr"%s\n", - node, pxm, start, end, + + printk(KERN_INFO "SRAT: Node %u PXM %u [%"PRIpaddr", %"PRIpaddr"]%s\n", + node, pxm, start, end - 1, ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE ? " (hotplug)" : ""); node_memblk_range[num_node_memblks].start = start; @@ -396,7 +459,7 @@ static int __init nodes_cover_memory(void) if (start < end) { printk(KERN_ERR "SRAT: No PXM for e820 range: " - "%"PRIpaddr" - %"PRIpaddr"\n", start, end); + "[%"PRIpaddr", %"PRIpaddr"]\n", start, end - 1); return 0; } } From patchwork Fri Jun 10 05:53:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 12876470 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D4852C433EF for ; Fri, 10 Jun 2022 05:54:21 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.345806.571540 (Exim 4.92) (envelope-from ) id 1nzXb0-000105-Oq; Fri, 10 Jun 2022 05:54:10 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 345806.571540; Fri, 10 Jun 2022 05:54:10 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nzXb0-0000z9-JD; Fri, 10 Jun 2022 05:54:10 +0000 Received: by outflank-mailman (input) for mailman id 345806; Fri, 10 Jun 2022 05:54:08 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nzXay-0006br-M0 for xen-devel@lists.xenproject.org; Fri, 10 Jun 2022 05:54:08 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on20604.outbound.protection.outlook.com [2a01:111:f400:7e1a::604]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id bd6b350f-e881-11ec-bd2c-47488cf2e6aa; Fri, 10 Jun 2022 07:54:07 +0200 (CEST) Received: from DU2PR04CA0328.eurprd04.prod.outlook.com (2603:10a6:10:2b5::33) by AM6PR08MB3957.eurprd08.prod.outlook.com (2603:10a6:20b:a2::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5314.15; Fri, 10 Jun 2022 05:54:05 +0000 Received: from DBAEUR03FT010.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:2b5:cafe::5b) by DU2PR04CA0328.outlook.office365.com (2603:10a6:10:2b5::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.14 via Frontend Transport; Fri, 10 Jun 2022 05:54:04 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DBAEUR03FT010.mail.protection.outlook.com (100.127.142.78) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.12 via Frontend Transport; Fri, 10 Jun 2022 05:54:04 +0000 Received: ("Tessian outbound 6f53897bcd4e:v120"); Fri, 10 Jun 2022 05:54:04 +0000 Received: from 33806bc2eda2.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id DB52A1E6-B8CC-4081-A99C-0E5B26116A6C.1; Fri, 10 Jun 2022 05:53:59 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 33806bc2eda2.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 10 Jun 2022 05:53:59 +0000 Received: from AM6PR08CA0001.eurprd08.prod.outlook.com (2603:10a6:20b:b2::13) 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.5332.12; Fri, 10 Jun 2022 05:53:51 +0000 Received: from AM5EUR03FT033.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:b2:cafe::e) by AM6PR08CA0001.outlook.office365.com (2603:10a6:20b:b2::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.11 via Frontend Transport; Fri, 10 Jun 2022 05:53:51 +0000 Received: from nebula.arm.com (40.67.248.234) by AM5EUR03FT033.mail.protection.outlook.com (10.152.16.99) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5332.12 via Frontend Transport; Fri, 10 Jun 2022 05:53:50 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Fri, 10 Jun 2022 05:53:47 +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; Fri, 10 Jun 2022 05:53:45 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: bd6b350f-e881-11ec-bd2c-47488cf2e6aa ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=AIm+ukrKRp7SiLzo2UB3Zb/xaPUU667ynDB8ZLNrai8wIWQNDIVNr3gYCsJPdBS9V2FUZfPmLV74fHbkbyuyOkl99zotxER3BEMUeQO0Agb006c2JulISKh6Kmi+/qZcYOzPNv5G5K9HTOdaWL6lGBxhVZMRiQGcNf7ZWN49+4Q7PosTShTiIM9mYaNBOXQVs+2To50WP68M+IW6dL8aOszNLB6p4QCABNQd0wPkWUJ71ZnZ7d154DL4IcqwB+LA5Bt46QXJBb2bcvqyGguWTUeyOFS67cbR7KevY4SAmQQ74KeGUYC0fwibz+4S6w/0jaDwa6cRkAMdWGA2BoJ11Q== 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=71g1qCFmdU3XbQ0p2R4qHlQkvDUCjtYpciVZO/CP2Pc=; b=TPXs2x77o2i4gqfSDTeR5wGsglCCVxcKVf+bZpcMfLFsmURj9by4kRicw/evM0cbwxz8HEQT4IDQJA3/sACu/jOdNp+zotwgHWDKVeu0rRnOe8D408hr5CEYsg1FDquSMy0lCIgc96Zf2ZnHDrHRm4H3w4V1sNffi9+hSBGlM+hiNrs49HlYczbPTpXcL5mm52sOqvDZ5nvLgeCi+GBvZMy7l3E1lmQpjpvwWvXe7pTUsNwoGHxcTwWXOVWc3CVO/c3SXGBotI0KIH0JZOL1S2ILQLG5G1gTNFleB0HJx/gf52j02yAy5j5JBCxsdsr7/iMuOz3z63qEligsnebPjA== 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=71g1qCFmdU3XbQ0p2R4qHlQkvDUCjtYpciVZO/CP2Pc=; b=CzDjPGqwDAetOF4tqxe2rp1E0JF5d9FVZ6UrTB33XBroHuNYSibv5bA+MYQv0VmUHNNJjVIbwoofi0X3PENEXrSByQ2YNB1+O1zcpEFiVtyH2WboyZO2idW2Y11FuW+G4w6JA1XOQ3RT3c7UVgeQJN1NSp0CFjGrFj3T8SgFoDc= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C X-CheckRecipientChecked: true X-CR-MTA-CID: 8ab16ee7f36652e9 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=knwkhk5mwSdPpW9ZYo9K2GBneoFdNpKV8oWCqDJpMD55Anm69xPpP5mroImx/z2MjyoPfa3d/+HOaziC8DczfVU1L/Ksf5BMQYSTjV7Z3UdPXpD9xKqtxd4rpmLu57GHdDUuQpZeXXfFwD5XWOH2EnyyOmHXH9dBKnj4PDStxfAEhBT/37W2XfIXteniGcDnmDUWveHia34l+GQ8O2ZVHFN74mkrzlZodr3B1T6TLOqUP9vQApzLuP4VBVzKSoX6Po6KkVMRPf4hO0Yyw0NZBJwsYZRN4xnqXg3193pqaRZsMKfE9cD0P6SQBZg96PR3jjzwykVf/+AUF7oIOjeCEQ== 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=71g1qCFmdU3XbQ0p2R4qHlQkvDUCjtYpciVZO/CP2Pc=; b=Cj0tu/b8DLYdt1Te8BL4jeyFIgVA86FoLfq1winHpUGOxbBYLjXIdd7VxPSOj3F3V5gdTgRwRIemROqBjWBvi4uE8IASBPuWwwo67DS/StlfBjShUR/HtifNR2NEfFNQekXTOKg88E4rucfpozJ+9ZQ3PZF4t0Ywi7sUl04JIjQTfulka5WFj7zvSN62NzoFK69xId+dGhgEmCAV/RTJZEXyny28c2LeDjkdyVwDte26IrRAe23id1wtT3XEl/3AMv+6jhf+QnBTZb0VdRAkS+KwVydAShuqQOCVezIgOh3nm0jauLNft8s/DsSI+0MfDei8FUzchwE/sUi08ECeew== 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=71g1qCFmdU3XbQ0p2R4qHlQkvDUCjtYpciVZO/CP2Pc=; b=CzDjPGqwDAetOF4tqxe2rp1E0JF5d9FVZ6UrTB33XBroHuNYSibv5bA+MYQv0VmUHNNJjVIbwoofi0X3PENEXrSByQ2YNB1+O1zcpEFiVtyH2WboyZO2idW2Y11FuW+G4w6JA1XOQ3RT3c7UVgeQJN1NSp0CFjGrFj3T8SgFoDc= 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_Pau_Monn=C3=A9?= , Wei Liu Subject: [PATCH v6 8/8] xen/x86: use INFO level for node's without memory log message Date: Fri, 10 Jun 2022 13:53:16 +0800 Message-ID: <20220610055316.2197571-9-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220610055316.2197571-1-wei.chen@arm.com> References: <20220610055316.2197571-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-Correlation-Id: 3c8a299a-9af0-4388-c5b3-08da4aa5a060 X-MS-TrafficTypeDiagnostic: AM9PR08MB6802:EE_|DBAEUR03FT010:EE_|AM6PR08MB3957: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: nRBxxvS6+3OYtOYc2d6VW0I6xKS1Pide9bBnoRZhr4lwO14UI1e+c9m5n0twcqiI65PsFxHnuCcUl70cc8U1UfacYyMpNh7Lc5c2scpXeLaWpTvXLBfm1TuVot/Eme6v31x8MX3wXkA4KsWw3pq+6IufXE7dkbUU1Hv59nMh3ll69cKAxEGZ7qghs26X6Al/+Q6f/NqV3iwuDOZUsjzTrhBQRu19/h+9ep0IurPEvGeTUOyl1udJgJO6KCJvjDYlwbn9azP4FHhCG1LF4NvkimxD4qGx/tcFyrVUXYpOQiJJB8XUtk5JQbT3DBUR3M232n8QplWRfxu7rFV24MhFGGRaYx9G4f7AB6XNfAfQ3AblvajACVmXGhB3Z8qqnauoL/MlKeYx/WSKlh6dW8h0zqFvXW2aS1B4sFgEHfyz9+3rJjAuOjaTdBGqhKcDtDA0i1AaerA7PnKGUKpVI/34FBVRv40bGJ/vWSH8BIw1CEG7J8iPFTqtaO0gWM3GbhxYYfCymuanRU+g45hlBjLKV/kGFnUYgB40QHEu6i+bt4yW5Tyn2KDuDIQR3p2ZMpgMkuRGdNTM11gPmh3JCkv3Sb8ffIkisgGJC+lx8HYpOovD+lXTKgDwG+2WGRdlN6HCmd0nu6mMvFetsqwgSOYBdHiMtcfw/htfHRmX5ahS8PjRQckOY5BvbKp381RJmCRfe/vhB5BiE9vkAo6/R1wBHw== 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)(40470700004)(426003)(508600001)(336012)(44832011)(6916009)(70586007)(81166007)(54906003)(70206006)(316002)(40460700003)(15650500001)(82310400005)(8936002)(4326008)(6666004)(5660300002)(7696005)(8676002)(26005)(2906002)(36756003)(1076003)(36860700001)(47076005)(83380400001)(86362001)(186003)(356005)(2616005)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR08MB6802 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT010.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 4da6defc-fd78-455b-ac90-08da4aa59816 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9ZB4quyO7AnNEQelgEiMev4cj4bPpb4H8nB9OiD2Blk/jGkpjkR4ZG5A8GaPnCrN66tpHmTaCTqRel7AuNE/4U7xdDzyY4aiJPH0oMxMOrOAaB5izCamcRRHoaT16+VMjsWWEG9TSO6HvXWRL5rkSLKHnU8azNjOHb0+1aPDz6/54kg/OG6HXduG6r6+/Qyv8NKrWyqmr30/yFRh1KsYkKpb5i3k63JlI0ZhLQHgSyosyqeVh8XCItMI1LHpbaC85cr1P/sjusc26F2SFcVd/ympxMwrcXJkVrOznC2pZ4J7361gsmrohh/q3cRQkFaD66bZDWp4ZLV765EF1Fg7ocnKyO2I7JYNvPctDETuCnMIUuvv718hYjjohPRH6vcYs+QlmlGtbPo5QbxgNsY6iscH+ZGe4uIKuFE0T1ghJMOtf5XP15gb2i+atUW+0fEPpa2R4/3amHNmQlJmvdayDne5V3YizQHf5k4l6NsnFHTkuw+R24G3lSXCU2zUXt+MPhqopMND+xGU/rCKbfAUkK4Ezhe/VfzXX4BIEhTL8G9LRTw+VqzXmpBMAduKz5D1yDxTwrC3jaxMltflKNbVk0ixoqhk/ciwW0mKtf3EfilBH7psX7AeiScrSEuNcFdT5e8mjIdRqL7tXRoyKcNrqi6VC4t4K+1U4qvcb4SZa1ljFF+Z9M8IAhsA/YPu0UuW 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)(40470700004)(46966006)(70586007)(5660300002)(44832011)(4326008)(81166007)(36860700001)(86362001)(1076003)(47076005)(40460700003)(83380400001)(6916009)(186003)(15650500001)(82310400005)(8676002)(426003)(26005)(336012)(2616005)(70206006)(8936002)(36756003)(508600001)(7696005)(6666004)(2906002)(54906003)(316002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jun 2022 05:54:04.6946 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3c8a299a-9af0-4388-c5b3-08da4aa5a060 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: DBAEUR03FT010.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3957 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. 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 3d02520a5a..b62a152911 100644 --- a/xen/arch/x86/srat.c +++ b/xen/arch/x86/srat.c @@ -555,8 +555,7 @@ int __init acpi_scan_nodes(paddr_t start, paddr_t end) uint64_t size = nodes[i].end - nodes[i].start; if ( size == 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); setup_node_bootmem(i, nodes[i].start, nodes[i].end); }