From patchwork Thu Sep 23 12:02:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 12512521 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BC6E0C433EF for ; Thu, 23 Sep 2021 12:03:55 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 7765461248 for ; Thu, 23 Sep 2021 12:03:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7765461248 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.193817.345290 (Exim 4.92) (envelope-from ) id 1mTNS6-0006E3-KI; Thu, 23 Sep 2021 12:03:46 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 193817.345290; Thu, 23 Sep 2021 12:03:46 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNS6-0006Dp-GZ; Thu, 23 Sep 2021 12:03:46 +0000 Received: by outflank-mailman (input) for mailman id 193817; Thu, 23 Sep 2021 12:03:45 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNS5-0005bO-Mq for xen-devel@lists.xenproject.org; Thu, 23 Sep 2021 12:03:45 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (unknown [40.107.21.74]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 4a5d2a18-1c66-11ec-ba2e-12813bfff9fa; Thu, 23 Sep 2021 12:03:40 +0000 (UTC) Received: from AS8PR04CA0133.eurprd04.prod.outlook.com (2603:10a6:20b:127::18) by VI1PR08MB3823.eurprd08.prod.outlook.com (2603:10a6:803:c2::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13; Thu, 23 Sep 2021 12:03:38 +0000 Received: from AM5EUR03FT052.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:127:cafe::ad) by AS8PR04CA0133.outlook.office365.com (2603:10a6:20b:127::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.15 via Frontend Transport; Thu, 23 Sep 2021 12:03:38 +0000 Received: from 64aa7808-outbound-2.mta.getcheckrecipient.com (63.33.187.114) by AM5EUR03FT052.mail.protection.outlook.com (10.152.17.161) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:03:38 +0000 Received: ("Tessian outbound ac52c8afb262:v103"); Thu, 23 Sep 2021 12:03:37 +0000 Received: from 44d92c6500e8.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id F6E86E5D-73A2-41B7-8718-11882F6755A2.1; Thu, 23 Sep 2021 12:03:17 +0000 Received: from EUR01-DB5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 44d92c6500e8.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 23 Sep 2021 12:03:17 +0000 Received: from DU2PR04CA0164.eurprd04.prod.outlook.com (2603:10a6:10:2b0::19) by AS8PR08MB7223.eurprd08.prod.outlook.com (2603:10a6:20b:346::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.16; Thu, 23 Sep 2021 12:03:16 +0000 Received: from DB5EUR03FT026.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:2b0:cafe::8e) by DU2PR04CA0164.outlook.office365.com (2603:10a6:10:2b0::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:03:16 +0000 Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT026.mail.protection.outlook.com (10.152.20.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:03:16 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.14; Thu, 23 Sep 2021 12:03:10 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Thu, 23 Sep 2021 12:03:08 +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: 4a5d2a18-1c66-11ec-ba2e-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Jvn0ISo/HgoiboBWB5FbYbJTrYAvUyDADUFepjr42Sw=; b=6wUCbjwZbgV4QuMhjrJ6LpDOOGTuNUY4epgyn+Wu1jH2gVK3v34enDYKe7T8JgMVSwTOzHKqTiQ6T4QxB69tuNfvjWWS34TyywuxMCYlUrQt0xYN2YCquI5n4xYhEG9SgGZBFRxpPzwUULqA14fl8JdYs8cJKzKMW/TqZsOmKMw= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.33.187.114) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.33.187.114 as permitted sender) receiver=protection.outlook.com; client-ip=63.33.187.114; helo=64aa7808-outbound-2.mta.getcheckrecipient.com; X-CheckRecipientChecked: true X-CR-MTA-CID: 2406da346ef2d9e5 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gFvw+C6x1mEYUAyAcypHj6Ny9AHhhQdKsyh58VcmC9A19pZuivMGoBM2oPhTHYGTYkHAEX/JQz95AYvzaAifLyBwA0lPyWAvxKQIBEw/dKihQacyGbPWltZ7cwky2BtN0TeMBBMTA2pgGezwevhYHzGdiJbhx7a67wvKisUi8naeRiXiZMZ3sg277RNDxjuoYK6McD3SD6u9tyC4f58uBw0WXi6fmVy4/Vc3ufStuhGvUlW7RWQWy+mlldsuXdmyOQQxiyS0xXhP29jMrayAKtvZfNgKoSDXt52t74TMki0s9t/QFukFpdqnUZy5PSwyeecKVoeME/STuojWHDsUGw== 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; bh=Jvn0ISo/HgoiboBWB5FbYbJTrYAvUyDADUFepjr42Sw=; b=cb1BOiI2Kv9ixkOVfDQ79QYSsvmpXzjAuNDDzqYCTxroWBbATu6+P6VIMjc+3sv+EDmYQ7h8zPFQLam8+d9dreZRQ7Ako4xBSUtkwGfW7Yu3+4iYRp3z+cSR0NU5/kypti4XbGpUqnJOdCb1i7fE+/PNp5hno5vnlFb1K02UeDxmkfgROlTJ1jnCaOC6bLhSjYbe3TUCz7bUaRHAlNBnV+KlWmhiZN86HTKbSQz5p4LnRkdKy5tTvdrQBfWhBC5uDxsaoijnnl0uiKCViyE2UVApEf/n+6WekI4Xej6OjtfC7xErWTy5xJ73w2bdwnKkZRg1GhFWbL0xTaMi8CrQ0w== 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=Jvn0ISo/HgoiboBWB5FbYbJTrYAvUyDADUFepjr42Sw=; b=6wUCbjwZbgV4QuMhjrJ6LpDOOGTuNUY4epgyn+Wu1jH2gVK3v34enDYKe7T8JgMVSwTOzHKqTiQ6T4QxB69tuNfvjWWS34TyywuxMCYlUrQt0xYN2YCquI5n4xYhEG9SgGZBFRxpPzwUULqA14fl8JdYs8cJKzKMW/TqZsOmKMw= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; From: Wei Chen To: , , , CC: Subject: [PATCH 01/37] xen/arm: Print a 64-bit number in hex from early uart Date: Thu, 23 Sep 2021 20:02:00 +0800 Message-ID: <20210923120236.3692135-2-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210923120236.3692135-1-wei.chen@arm.com> References: <20210923120236.3692135-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 594b5d82-14c6-47b7-4c70-08d97e8a2d85 X-MS-TrafficTypeDiagnostic: AS8PR08MB7223:|VI1PR08MB3823: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:6108;OLM:6108; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 0gk4XAwLeFhtHLi9koYwmYtQP12yf72rkz3Wgz4BoRtum2YEeTav1FwXikW/FwyqJXAmlLPkqUI9LXPAv8BguhbN82q5ZdMcr2SSb/+OG28I1uUH16VMKuVXobeM+otoQbdl2r5X7V0h30FDh02W/riwszgorjFZFdWwFbBZgNtL0XuDiaRdJTdS2XVrV5E+Ko0XHZhRdRojg0HAX7chbqoy/Txw+IYr4OdotnTwCVPqQRdhL8x3nminmfhAuxL3vHhzAU/HmGMPEmWKJIrWO+ZnDPNaSaC0ezIlzqqQP0BomyKMgU5LrOfGmPaRrGzPBm2hQg9TRFEu227WKnbh/HPlXzdA1Ku98I2wFI8GC07hXfHx5CLIxFLS70iMKzoPdXHpjl2uqI3DajfBKuuci2XLETmtRtY6aejLXGY85GVsW+E1K5BAtJBrF6J3gw3W3K2OAqjomJxScf0wbGKgGftKPL8fellex228LK6nM0VaaJ8fJbyeETBvJBM5TbTc5yuzpqUDS6pMafpLMYAYsvTWknN7NU6L+kNcW5Qb+55CPAElbW6RslO7djqWdvNHzngNmzxLfpWTk1Zrf3DAmq2/TvHxvU131UQLWo69K8dZXirtzkrVJPDe33tvkuO4sXHTgz8YQzpVVETGYWj0MJEuSNpfQGvQar9sdlBGEoTL2RLoaCC9QpqBtAy8zu6gOl9bPTw4/86FWFXYAIoencZBxftpQYVVG5XxKkR+0TQ= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(4636009)(46966006)(36840700001)(1076003)(426003)(8936002)(70586007)(70206006)(44832011)(8676002)(26005)(186003)(356005)(2906002)(4326008)(86362001)(2616005)(5660300002)(36756003)(36860700001)(6666004)(82310400003)(336012)(110136005)(316002)(83380400001)(81166007)(508600001)(7696005)(47076005)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB7223 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT052.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 85b30f8a-48cd-4e87-0b32-08d97e8a205c X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 082+bzUt56zH+f5i0vl1OtSc3EgiB8kJjHTrQ98DreaJ/m8DX3X03+KgyGejeoDC3K0Qz0bVGdFwV8/b1rE1JLxh/Ckjq4AVXMjp4vWQc+zcH2rfmvhsf7YjTUUBOrhPErGGoJwrvddPoD++u2GGvP2b8fAW81L/IHp8/b0UbYnY04mxQgkR7syXpf66tUAIphGvl5l4iC1XYuJKaRnzaeYqnzPDmQaFVEMLvdr9M5y0Ga2c8wu3EEIRPefrX1helxhMp8FR7RgCm/yqhmAGsK6lXp+IadyQn6uFbRBimUNl+uIpgJhsE+M3c/abD+i+PLtztxzhv1xHN8DDADMZrlLwZD4JJnSY/HvQC9aJxomjuSWxldiHtwif4lZsoPYzILgP8kxUZRX4HbH6qyKZI1yfHWNM+i/KZ68U32hj+UJX8p1QkXX7Wjm6m9gsCgOb7+Z1/apxMynR4tkepx6qGOu0rPEWprTmP/Q0yBDpAUF1RRJ1nzT2/6nMWrmIQQC4EWt/GOHufxGpTNqZ9WLa3PDxBz07ATcDso2ZsdGJUuRhW2paUl9KibccxjJ8ekooI3wMTX+02hmo0I5oBgE/R50ROIztSFPPrP2OWXO11zi6aO5LjDwHMkTG/tOUCVpdFKe688EdfECuRgpRQO2xqvFTBaflPXZYme+wR2DMNNaD8Tg9WFJ0uVVb7wPw1wEEnoj9J2NF0eUmanLB5JZpQg== X-Forefront-Antispam-Report: CIP:63.33.187.114;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-2.mta.getcheckrecipient.com;PTR:ec2-63-33-187-114.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(4636009)(46966006)(36840700001)(70586007)(508600001)(8676002)(83380400001)(6666004)(70206006)(426003)(44832011)(82310400003)(26005)(336012)(7696005)(316002)(110136005)(1076003)(186003)(5660300002)(81166007)(36756003)(4326008)(86362001)(47076005)(36860700001)(2906002)(8936002)(2616005);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2021 12:03:38.3369 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 594b5d82-14c6-47b7-4c70-08d97e8a2d85 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.33.187.114];Helo=[64aa7808-outbound-2.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM5EUR03FT052.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB3823 Current putn function that is using for early print only can print low 32-bit of AArch64 register. This will lose some important messages while debugging with early console. For example: (XEN) Bringing up CPU5 - CPU 0000000100000100 booting - Will be truncated to (XEN) Bringing up CPU5 - CPU 00000100 booting - In this patch, we increased the print loops and shift bits to make putn print 64-bit number. Signed-off-by: Wei Chen Acked-by: Julien Grall --- xen/arch/arm/arm64/head.S | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S index aa1f88c764..d957ea377b 100644 --- a/xen/arch/arm/arm64/head.S +++ b/xen/arch/arm/arm64/head.S @@ -862,17 +862,18 @@ puts: ret ENDPROC(puts) -/* Print a 32-bit number in hex. Specific to the PL011 UART. +/* Print a 64-bit number in hex. * x0: Number to print. * x23: Early UART base address * Clobbers x0-x3 */ +#define PRINT_MASK 0xf000000000000000 putn: adr x1, hex - mov x3, #8 + mov x3, #16 1: early_uart_ready x23, 2 - and x2, x0, #0xf0000000 /* Mask off the top nybble */ - lsr x2, x2, #28 + and x2, x0, #PRINT_MASK /* Mask off the top nybble */ + lsr x2, x2, #60 ldrb w2, [x1, x2] /* Convert to a char */ early_uart_transmit x23, w2 lsl x0, x0, #4 /* Roll it through one nybble at a time */ From patchwork Thu Sep 23 12:02:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 12512519 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 82D75C433F5 for ; Thu, 23 Sep 2021 12:03:52 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 3A53860F4B for ; Thu, 23 Sep 2021 12:03:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3A53860F4B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.193816.345279 (Exim 4.92) (envelope-from ) id 1mTNS3-0005tR-Ab; Thu, 23 Sep 2021 12:03:43 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 193816.345279; Thu, 23 Sep 2021 12:03:43 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNS3-0005tE-50; Thu, 23 Sep 2021 12:03:43 +0000 Received: by outflank-mailman (input) for mailman id 193816; Thu, 23 Sep 2021 12:03:42 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNS1-0005KP-UE for xen-devel@lists.xenproject.org; Thu, 23 Sep 2021 12:03:41 +0000 Received: from EUR02-VE1-obe.outbound.protection.outlook.com (unknown [40.107.2.49]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 0a1bd4d9-cb2e-4520-945d-6a3fa9f0c920; Thu, 23 Sep 2021 12:03:36 +0000 (UTC) Received: from AS8PR04CA0176.eurprd04.prod.outlook.com (2603:10a6:20b:331::31) by DU2PR08MB7255.eurprd08.prod.outlook.com (2603:10a6:10:2d2::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13; Thu, 23 Sep 2021 12:03:34 +0000 Received: from VE1EUR03FT053.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:331:cafe::b6) by AS8PR04CA0176.outlook.office365.com (2603:10a6:20b:331::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:03:34 +0000 Received: from 64aa7808-outbound-2.mta.getcheckrecipient.com (63.33.187.114) by VE1EUR03FT053.mail.protection.outlook.com (10.152.19.198) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:03:34 +0000 Received: ("Tessian outbound 8b24208353e0:v103"); Thu, 23 Sep 2021 12:03:30 +0000 Received: from ae303b40b6ee.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 4F78024A-3A30-4E5E-9C73-E80203E1249C.1; Thu, 23 Sep 2021 12:03:19 +0000 Received: from EUR01-DB5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id ae303b40b6ee.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 23 Sep 2021 12:03:19 +0000 Received: from DU2PR04CA0161.eurprd04.prod.outlook.com (2603:10a6:10:2b0::16) by PA4PR08MB6016.eurprd08.prod.outlook.com (2603:10a6:102:e3::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.15; Thu, 23 Sep 2021 12:03:18 +0000 Received: from DB5EUR03FT026.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:2b0:cafe::82) by DU2PR04CA0161.outlook.office365.com (2603:10a6:10:2b0::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:03:18 +0000 Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT026.mail.protection.outlook.com (10.152.20.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:03:18 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.14; Thu, 23 Sep 2021 12:03:12 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Thu, 23 Sep 2021 12:03:10 +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: 0a1bd4d9-cb2e-4520-945d-6a3fa9f0c920 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=eYpFnlkmKkWIfrICpF9PJssjdhb8RblMf+bC222jYXo=; b=b1dYqPsaLbPvqLviSQLFGXLHi9ft/D1yAetHHVrqVT2Yjcgto5Uqk/Vmxx4o3DwXJ/GrjYesrJdEjhL4DUD5rR8ewwuZjtflaz21WAtgp+a+b+xNXY1Jc0N0JMyP0T7Zl02CGy0UBCqmusSimiEQ1GYU2dby6F589PfyoP6UyaU= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.33.187.114) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.33.187.114 as permitted sender) receiver=protection.outlook.com; client-ip=63.33.187.114; helo=64aa7808-outbound-2.mta.getcheckrecipient.com; X-CheckRecipientChecked: true X-CR-MTA-CID: 4bb2a889a10d83d5 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Je0JyCYcCahaXGSrIylgBYfOIHGv7kRCbedNWsePEU3KwaiV7Q2/OmUiTiCxNLMKr2T9vsESnKIiBfca33IfoTeWytocXYHr9jXoLcHupLpRGlTFo6Gm2TQq0NLjO8CAlM/Htr5yHZzz98uTPvIlSsv4/HLQvtSSi9kXjonC3oxmO6OuBzR7Fx3HzE5jf4UTkKnhIAdUuRS8g2/gyXLi9Vrom6xJFQ+6vR5y7HPpvrhDz1UbqChA1B+C/o4UD46TavLgAEoam+U21bTOG5+6VzTq1gu9pe0pw/dinapuVyk2yVIeWhp9Ae7t2riT3kL2WB2yp2HOSbGNBwwOPvdUtQ== 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; bh=eYpFnlkmKkWIfrICpF9PJssjdhb8RblMf+bC222jYXo=; b=dwnJs9g00gRFCpbil5HynnImfid70D/qOqU02x/+EJ14TSidLGaBhZ8V+wpnIqA3334OHeCmOvkFCrSt8jM9RU6AFXVhJ3me6IV6NAtFHRC9t+axyqrQuet6ARLGBnm99pk1BO78CK4clnSlqzAzwJRzgOohT+XyBEfeGWD6qV1DGrHGJUTn+q0eyVeT/wzFxF35opK/mEUpyKIghXBvqtlUAy2X54NxnS0Q/MJpd6oYMESTUv+U1cwI5mpU6BLDXRjaJpfb9OgqMGH5LLLRbT7rlYWjXJqYAyYgtqi1VkB/xskkcM59Tyh9P4tc2ZOFfAravvQoDUmsrzk3x/wwRA== 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=eYpFnlkmKkWIfrICpF9PJssjdhb8RblMf+bC222jYXo=; b=b1dYqPsaLbPvqLviSQLFGXLHi9ft/D1yAetHHVrqVT2Yjcgto5Uqk/Vmxx4o3DwXJ/GrjYesrJdEjhL4DUD5rR8ewwuZjtflaz21WAtgp+a+b+xNXY1Jc0N0JMyP0T7Zl02CGy0UBCqmusSimiEQ1GYU2dby6F589PfyoP6UyaU= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; From: Wei Chen To: , , , CC: Subject: [PATCH 02/37] xen: introduce a Kconfig option to configure NUMA nodes number Date: Thu, 23 Sep 2021 20:02:01 +0800 Message-ID: <20210923120236.3692135-3-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210923120236.3692135-1-wei.chen@arm.com> References: <20210923120236.3692135-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c18f4d07-b7fc-4990-593b-08d97e8a2afb X-MS-TrafficTypeDiagnostic: PA4PR08MB6016:|DU2PR08MB7255: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:8273;OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: F81usdegP21yaQyztrp2wr38GQL4K/hHAit67QRV2UTmp2BIq5CcxIsbTyzGOiGDKUgFVbWZcAHdUxUdyVX7YkqLhfxEy7HAAdm0QwDkK5Q72HI0S5wieAH1ug9uhSNCYw1jDzzRxg0u65y5Mm8Ay8Eo3hzqL20g1WK/EoWs8K5HyCpKjxD4t/4CAKEPCswRtp44tpZ9fjEWO0EQNDYyw0CLPtcWSfoayt60AYIpbO94whGd70QZMjoW5U1OS42rXYSdrUa/kGMryvoWWP3BrCN/PWL2uxj3x3FYwO/VJ1LuQ/uYmk3F+NhyHi2DmHnz9F+VlJApXwVy45QK6mSH7OiNIOrj6yzNhPnUSjfm3YbV91UI3+1VizyuDtVTaDs8UeYnFYqsrQsI7nTBFbsPJbNokSybPrsS8lDwqWyjD8c9r1ERPKz/bBHpf8B4Qsji99lvRlFiUxkuytgPwi18eOUKAIriW4DL/c1pRRHBUr2vWEWevAutDOXxdmDMCsD3t4aQ3zWEGfGtfk57Ac4zS1SvAfrRCZn6jbOFUQ5D9PhIEwDC3GII3ygGV+YPrNAoOILiDg1Hs1lkrSlr6iAJeC7ft1y1ye18qPh2plSR06ogSf9nd+2LICeVSiZT6TwcARbJk7GrFZlTPULkQ4SAvRKj++Gzk7JM7hecPKVRPAFuyp5ohDjjcnmBjiGbVD2EIhrrQKbCBJijWFec4naITnhzPvS0+6w0jlzUoPZbl3Y= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(4636009)(36840700001)(46966006)(2616005)(1076003)(26005)(44832011)(81166007)(86362001)(70586007)(4326008)(83380400001)(47076005)(6666004)(36860700001)(508600001)(336012)(82310400003)(356005)(110136005)(426003)(8676002)(8936002)(70206006)(186003)(316002)(5660300002)(36756003)(7696005)(2906002)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB6016 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT053.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 68dccb8a-de2f-41b9-5cc2-08d97e8a216f X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5uY23spjg57uWBOSGRStNZnzN64CNb4URXzhjV6cyD9fhUy66RTkZEnr/Vaz2HUKKHsJpOFPKIAymPmvcWjz/Io+/GKZboVaIDhUZ658S1lh0uV70sS2/LGQtGwsqfjp2dSuFKowua+iJXbFKTw/fW7MDp3GG6wMmEWgChrXNTvtwqACumDzlvcBWyBTgznSKtRdRRyN0WRR5pau0ufkjcNR0p9aZNzvD2iNKXM5nTLcgtzJIOnSd3izcKGLoSnT4FNMBNPBMjjjk9bziMeLrJS7aQ2KWpDcYKfOSVV71NHe2qyZQH0bKx3rYc89pr5MoaWU0GUgTS37x4VGzs/qwdvJphf9r45kl9CYeB1XygypYzpwVjr0h9fXWdRlZjMyL/KCULddy1DQBkXkIACOAhZq5RtOwRBTaFj9mPpmtrR3Ur6Lfa/QzbhX2TBw4vDquBLSft8/SU+7bcLOoYTOqlJ9G/e7yjJOkvv9CLQKp7BbNnsYHry9KnF7D1aUOir3HqgEUxBQIpiY9kbljzhuPKfa6ONUUaFOp/K/qPG/2NXy1+QdicqIfvT+1vHc0nA/lSH7Mfu69oXDzFu8uoPyd5PSdBvi2lZNorLt69aZVGhxK4jD6tWLecFM/4Nc6yRu7KdHh+Vz+1i5apRLDdhP0RnaZvPkchyWGznxXwtHtHD6J6L9g5hbvjxto6Pw9W9gflAg2ha4xLtGk9Mya/UxfQ== X-Forefront-Antispam-Report: CIP:63.33.187.114;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-2.mta.getcheckrecipient.com;PTR:ec2-63-33-187-114.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(4636009)(36840700001)(46966006)(5660300002)(70586007)(81166007)(7696005)(47076005)(2906002)(26005)(8936002)(82310400003)(86362001)(186003)(83380400001)(36756003)(6666004)(8676002)(2616005)(426003)(508600001)(336012)(4326008)(36860700001)(316002)(70206006)(44832011)(1076003)(110136005);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2021 12:03:34.0269 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c18f4d07-b7fc-4990-593b-08d97e8a2afb X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.33.187.114];Helo=[64aa7808-outbound-2.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR03FT053.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR08MB7255 Current NUMA nodes number is a hardcode configuration. This configuration is difficult for an administrator to change unless changing the code. So in this patch, we introduce this new Kconfig option for administrators to change NUMA nodes number conveniently. Also considering that not all architectures support NUMA, this Kconfig option only can be visible on NUMA enabled architectures. Non-NUMA supported architectures can still use 1 as MAX_NUMNODES. Signed-off-by: Wei Chen Reviewed-by: Stefano Stabellini --- xen/arch/Kconfig | 11 +++++++++++ xen/include/asm-x86/numa.h | 2 -- xen/include/xen/numa.h | 10 +++++----- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/xen/arch/Kconfig b/xen/arch/Kconfig index f16eb0df43..8a20da67ed 100644 --- a/xen/arch/Kconfig +++ b/xen/arch/Kconfig @@ -17,3 +17,14 @@ config NR_CPUS For CPU cores which support Simultaneous Multi-Threading or similar technologies, this the number of logical threads which Xen will support. + +config NR_NUMA_NODES + int "Maximum number of NUMA nodes supported" + range 1 4095 + default "64" + depends on NUMA + help + Controls the build-time size of various arrays and bitmaps + associated with multiple-nodes management. It is the upper bound of + the number of NUMA nodes the scheduler, memory allocation and other + NUMA-aware components can handle. diff --git a/xen/include/asm-x86/numa.h b/xen/include/asm-x86/numa.h index bada2c0bb9..3cf26c2def 100644 --- a/xen/include/asm-x86/numa.h +++ b/xen/include/asm-x86/numa.h @@ -3,8 +3,6 @@ #include -#define NODES_SHIFT 6 - typedef u8 nodeid_t; extern int srat_rev; diff --git a/xen/include/xen/numa.h b/xen/include/xen/numa.h index 7aef1a88dc..52950a3150 100644 --- a/xen/include/xen/numa.h +++ b/xen/include/xen/numa.h @@ -3,14 +3,14 @@ #include -#ifndef NODES_SHIFT -#define NODES_SHIFT 0 -#endif - #define NUMA_NO_NODE 0xFF #define NUMA_NO_DISTANCE 0xFF -#define MAX_NUMNODES (1 << NODES_SHIFT) +#ifdef CONFIG_NR_NUMA_NODES +#define MAX_NUMNODES CONFIG_NR_NUMA_NODES +#else +#define MAX_NUMNODES 1 +#endif #define vcpu_to_node(v) (cpu_to_node((v)->processor)) From patchwork Thu Sep 23 12:02:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 12512515 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DEAB2C433FE for ; Thu, 23 Sep 2021 12:03:49 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 969B661216 for ; Thu, 23 Sep 2021 12:03:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 969B661216 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.193815.345268 (Exim 4.92) (envelope-from ) id 1mTNS1-0005bz-Qp; Thu, 23 Sep 2021 12:03:41 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 193815.345268; Thu, 23 Sep 2021 12:03:41 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNS1-0005bs-Nl; Thu, 23 Sep 2021 12:03:41 +0000 Received: by outflank-mailman (input) for mailman id 193815; Thu, 23 Sep 2021 12:03:40 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNS0-0005bO-O6 for xen-devel@lists.xenproject.org; Thu, 23 Sep 2021 12:03:40 +0000 Received: from EUR02-VE1-obe.outbound.protection.outlook.com (unknown [40.107.2.79]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 4961292b-1c66-11ec-ba2e-12813bfff9fa; Thu, 23 Sep 2021 12:03:39 +0000 (UTC) Received: from DU2PR04CA0163.eurprd04.prod.outlook.com (2603:10a6:10:2b0::18) by VI1PR08MB5440.eurprd08.prod.outlook.com (2603:10a6:803:134::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13; Thu, 23 Sep 2021 12:03:37 +0000 Received: from DB5EUR03FT037.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:2b0:cafe::ff) by DU2PR04CA0163.outlook.office365.com (2603:10a6:10:2b0::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.14 via Frontend Transport; Thu, 23 Sep 2021 12:03:37 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT037.mail.protection.outlook.com (10.152.20.215) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:03:37 +0000 Received: ("Tessian outbound a492f2284909:v103"); Thu, 23 Sep 2021 12:03:37 +0000 Received: from 19d892eff777.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id B935D0E8-7C46-4B1E-960D-060BEDD1953C.1; Thu, 23 Sep 2021 12:03:22 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 19d892eff777.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 23 Sep 2021 12:03:22 +0000 Received: from DB6P193CA0014.EURP193.PROD.OUTLOOK.COM (2603:10a6:6:29::24) by VI1PR08MB3837.eurprd08.prod.outlook.com (2603:10a6:803:ba::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13; Thu, 23 Sep 2021 12:03:20 +0000 Received: from DB5EUR03FT032.eop-EUR03.prod.protection.outlook.com (2603:10a6:6:29:cafe::2a) by DB6P193CA0014.outlook.office365.com (2603:10a6:6:29::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:03:20 +0000 Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT032.mail.protection.outlook.com (10.152.20.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:03:20 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.14; Thu, 23 Sep 2021 12:03:14 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Thu, 23 Sep 2021 12:03:13 +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: 4961292b-1c66-11ec-ba2e-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GITypNRUWivldCkDa8kIMuzSIJwemWwJe9dN6aK1m/A=; b=Bqi4g2rSfJJh7O7sF7hJH30m6VkoukrC8wtlB/nc/OESL/27P7tb4yua3NrA7h0RNriOrSeQ4DrH5P209lJYeUyVVYnqtzPDxy5WQOj1NLtqe7EqWEs6f62PsesMLYSZ5gV2Pz4cR4H6do1/vYuSjFapFCyXZ1RPuYTfuPqW4u4= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; X-CheckRecipientChecked: true X-CR-MTA-CID: 45cdde9f39e78528 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ex5eH6YsdkCyllM+8FYxI4cJTlxkKWGwBI6gubTjguBZNWCQnJJ+kZGEk3Js7DyCMiTkj6KQJUXIK/x6bztVGtp2mirab+wX9TOhXKZHyC9nXB2NqN++BZt/P0LyH14enK+aHx0Rf7xHJeSzsr9AOMnfjBPTjYc3WAR9ErhXoKRZTdWzdiX0VOpfRxtgD/T2FSwlL5ODpArVxRLIorj2ZMIeOsTpW51o8wNb+5he7/fPRPZqFKqVNLu/GL/EfID2plAqwvqpETs2cVJQ0tuKOnY5h98ePGR6AeY3J1EG3g3KyV8osvPr8KwQe0Ev3e4N7Z6PizPu0TsUYIDE5W5IdQ== 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; bh=GITypNRUWivldCkDa8kIMuzSIJwemWwJe9dN6aK1m/A=; b=n7GWtL+gydl6NQEfDRnAeQ8IXjWJeiqf/lh4Q0Pc8kPs6l/9DmolJbFiQ60bY+pm4ehhm0Qu6GQ/PRNjquDz8fcJI5s9cBJ+lpLSwCIUytQGVT7PBc46jar6ARAl0cYbc4O8wwYLx0Ef0nSfrMB/7T0nv1BY0AnoneNrOCZiL6KnBATZEKG3hiBF0gF9nAsafzqLGoIV+YrLKq79G+f/zKBpI5HC7rrLA9Fh9fhVrSUZRYhmDFdHiDbFK8vl6r9kN3g19O71BCIyvqM9/GVaF+27urtsxAdEUkomcu1CMvii93pL5eSbmtnbTrwMFT+fHf1j5d5J+NgBVdUvH+Pw/g== 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=GITypNRUWivldCkDa8kIMuzSIJwemWwJe9dN6aK1m/A=; b=Bqi4g2rSfJJh7O7sF7hJH30m6VkoukrC8wtlB/nc/OESL/27P7tb4yua3NrA7h0RNriOrSeQ4DrH5P209lJYeUyVVYnqtzPDxy5WQOj1NLtqe7EqWEs6f62PsesMLYSZ5gV2Pz4cR4H6do1/vYuSjFapFCyXZ1RPuYTfuPqW4u4= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; From: Wei Chen To: , , , CC: Subject: [PATCH 03/37] xen/x86: Initialize memnodemapsize while faking NUMA node Date: Thu, 23 Sep 2021 20:02:02 +0800 Message-ID: <20210923120236.3692135-4-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210923120236.3692135-1-wei.chen@arm.com> References: <20210923120236.3692135-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 18a390a7-0593-4635-5883-08d97e8a2cda X-MS-TrafficTypeDiagnostic: VI1PR08MB3837:|VI1PR08MB5440: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:4502;OLM:4502; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: /6Mt1pU3T1qMlhujo/qYgxQjM8btZjryc7/ZChhFF55NHYVYzQlrkAzY6V39iBC49GpJn/r4gJjrvGBmfsGPbGXglIchf0MRGwZzziaawlVKXCPJeVks0B+ZO+X9BaTsNuyPjJWrUBMVt5nSEplkDAMzzcsLQEt0lrP52wZQdqdBI/iEOddItU/JXE+37kHcsJ2xUiWYjU3wsGKQM3CZcHsGgLkeKWLd0wBQ08Bt3FWICeHIfq5Zcw4qNmcTryEoi7pit9QUuLIQA+9tAtVZ7HnfgHW8fFN/oLfRhRwGz7vUTHZjkb2JyG0Aj5rh3S50XhkCaR4NFxT07Ue4tE1taExq9WNBnB7EwcN/S3V7YUfUu+r/KW2JFXi3N8DjNCNFVO/ThnD33lXI+mKQJGZvI0m0diF/fliv7Xa4l+eXNHZY67WyDtpxCB2GrcgZv7EYadh6yMmTkQZpGpT1E4rVHvQAYuqyqfx5qSPZiTGFLc7H5XQAGMNKUCAMoalXjWZClxHOHZMLUs3JSx1LmAeVuaxVuSGZGP+gCoEj3vVbf+U4GesXJV/zSb0GH/S6fuPooLRyxtJgjFMpGwvXm5QCY1SoJZHdDtDEUFSezobqKvePPC9YFxdY2si3kUvQHkdIeQLRU+NVJ1nRYbfnduG4kNGcEkwnRpaPsiT3BXxZIikjFPpgrJFujGrngclRzdssZ4nx5zHIgooV2pQSHvrA25+PFHf8dGsnoPWr8SfstfA= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(4636009)(46966006)(36840700001)(44832011)(4326008)(8936002)(83380400001)(2906002)(70206006)(36860700001)(356005)(110136005)(426003)(2616005)(8676002)(47076005)(81166007)(5660300002)(508600001)(70586007)(82310400003)(86362001)(36756003)(316002)(186003)(336012)(6666004)(7696005)(1076003)(26005)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB3837 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT037.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 3b7e8088-a045-4af3-395a-08d97e8a22a2 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gNdGmT+AwqJxVwjxXhTrZjD0hq/hvQ9NcEMXvUn9yJfiE1NZYYMCVstERHUNIIF2SYR+qtu6SVRgutpU46h6+jUTmDJojz9WQ1ecAO7XLFkY9qBrHMYh/OjNXJE2TBPmD5gj6SHKBDjcjVQXrA6nZy7uz7fnIvW7ZYdZPydh2lRZ/1kvo9CC8rWFhsiba9IeFrMXrwH/wZ0rlNkgy+7iYjjIE3/e7Kd0i1KSBSnzL3UWsdsuxUO1tRYvCZK90g3Bj6VaxEFc6AwLkLmIhBB6tcw2iUBgq9vOlLFrofpCxVoYM+7mwkEUEeRNtBNGwrR8Yz0e8G9mWFPwJ48HnvyK9+lcLwPlOXOGKmB40KpPEPGAY4TcISjPBui32kiI7eRpJTGfeQyaUcn+bKmUFEB1TF7uT/x2vB2gny2Th8K3n9dIkHhkq228Z8J8pwGDpSTKs1DfgKshojD0TQYnRzz+gu4Q3Ohmicd3wcBzf92ipY3CT/V/lNP23PfOgNWIKRhdUQOH9bc1lAmsSvsL6Q/SHeKd3G3sLHHgAQHos2NAIJkPpHayFPEZgVoOrM21vGjER0YQAtOtBg0vzwx+/pMRi4foFlQ5AO/mdVKjHv+U8ySVwWWCwBDxm8QCizru/o6O//lLjYtd13CrjuW6bcE+q24z2clURpc+Pus6aoVVnRXJHvAueb8ygthYi/Bi5+0cv6y1UqqFdVvjPohKsCA5Ig== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(4636009)(46966006)(36840700001)(44832011)(8936002)(4326008)(508600001)(70206006)(2906002)(426003)(110136005)(36860700001)(81166007)(2616005)(8676002)(47076005)(5660300002)(70586007)(6666004)(86362001)(186003)(336012)(316002)(82310400003)(36756003)(7696005)(83380400001)(26005)(1076003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2021 12:03:37.2649 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 18a390a7-0593-4635-5883-08d97e8a2cda 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: DB5EUR03FT037.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB5440 When system turns NUMA off or system lacks of NUMA support, Xen will fake a NUMA node to make system works as a single node NUMA system. In this case the memory node map doesn't need to be allocated from boot pages, it will use the _memnodemap directly. But memnodemapsize hasn't been set. Xen should assert in phys_to_nid. Because x86 was using an empty macro "VIRTUAL_BUG_ON" to replace SSERT, this bug will not be triggered on x86. Actually, Xen will only use 1 slot of memnodemap in this case. So we set memnodemap[0] to 0 and memnodemapsize to 1 in this patch to fix it. Signed-off-by: Wei Chen Acked-by: Jan Beulich --- xen/arch/x86/numa.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xen/arch/x86/numa.c b/xen/arch/x86/numa.c index f1066c59c7..ce79ee44ce 100644 --- a/xen/arch/x86/numa.c +++ b/xen/arch/x86/numa.c @@ -270,6 +270,10 @@ void __init numa_initmem_init(unsigned long start_pfn, unsigned long end_pfn) /* setup dummy node covering all memory */ memnode_shift = BITS_PER_LONG - 1; memnodemap = _memnodemap; + /* Dummy node only uses 1 slot in reality */ + memnodemap[0] = 0; + memnodemapsize = 1; + nodes_clear(node_online_map); node_set_online(0); for ( i = 0; i < nr_cpu_ids; i++ ) From patchwork Thu Sep 23 12:02:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 12512523 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 63ACAC4332F for ; Thu, 23 Sep 2021 12:03:57 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 1AB3F6124C for ; Thu, 23 Sep 2021 12:03:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1AB3F6124C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.193818.345301 (Exim 4.92) (envelope-from ) id 1mTNS7-0006Vq-Vr; Thu, 23 Sep 2021 12:03:47 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 193818.345301; Thu, 23 Sep 2021 12:03:47 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNS7-0006UY-Re; Thu, 23 Sep 2021 12:03:47 +0000 Received: by outflank-mailman (input) for mailman id 193818; Thu, 23 Sep 2021 12:03:47 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNS6-0005KP-Ua for xen-devel@lists.xenproject.org; Thu, 23 Sep 2021 12:03:46 +0000 Received: from EUR03-DB5-obe.outbound.protection.outlook.com (unknown [40.107.4.46]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 94fad7ee-6acf-4700-ba31-be03a623c15e; Thu, 23 Sep 2021 12:03:44 +0000 (UTC) Received: from AS8PR04CA0162.eurprd04.prod.outlook.com (2603:10a6:20b:331::17) by AM6PR08MB4151.eurprd08.prod.outlook.com (2603:10a6:20b:a2::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13; Thu, 23 Sep 2021 12:03:40 +0000 Received: from VE1EUR03FT053.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:331:cafe::1e) by AS8PR04CA0162.outlook.office365.com (2603:10a6:20b:331::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:03:40 +0000 Received: from 64aa7808-outbound-2.mta.getcheckrecipient.com (63.33.187.114) by VE1EUR03FT053.mail.protection.outlook.com (10.152.19.198) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:03:39 +0000 Received: ("Tessian outbound 8b24208353e0:v103"); Thu, 23 Sep 2021 12:03:39 +0000 Received: from 82cee3a26ade.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 6607CB9A-6AB8-4598-A9DB-7D96F11BFD3B.1; Thu, 23 Sep 2021 12:03:23 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 82cee3a26ade.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 23 Sep 2021 12:03:23 +0000 Received: from DB6P193CA0013.EURP193.PROD.OUTLOOK.COM (2603:10a6:6:29::23) by HE1PR0801MB1787.eurprd08.prod.outlook.com (2603:10a6:3:80::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13; Thu, 23 Sep 2021 12:03:21 +0000 Received: from DB5EUR03FT032.eop-EUR03.prod.protection.outlook.com (2603:10a6:6:29:cafe::39) by DB6P193CA0013.outlook.office365.com (2603:10a6:6:29::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:03:21 +0000 Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT032.mail.protection.outlook.com (10.152.20.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:03:21 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.14; Thu, 23 Sep 2021 12:03:16 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Thu, 23 Sep 2021 12:03:15 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 94fad7ee-6acf-4700-ba31-be03a623c15e 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=qPIL4uOxlIkWYH7gl2Qha1lsYRJ9hENlygoMT/WdWDg=; b=FPUwJr6Bcqw32TxYJGyhzXXnUnlgvka6mmIAwg7QWWOzKrzDBLsadKhY0GpjNKHZAgPp5PaP6VR5oQ8nepXvBiTAKg1npKDNzfVDvrT/bGYpyhbJLWd76gl50YaIqaO8+cIyvM6neu4RDlQAo7K3z+dsMCxk9WXVz4tiP8NXJfY= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.33.187.114) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.33.187.114 as permitted sender) receiver=protection.outlook.com; client-ip=63.33.187.114; helo=64aa7808-outbound-2.mta.getcheckrecipient.com; X-CheckRecipientChecked: true X-CR-MTA-CID: aff0860eda26db16 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WguwpjDgffGzGmCOjpptiVNbdB5ARbRxQBkFoQkXWga29AVz76bmf/b4Bb3VJEjc2xn/X5tuolfiCV46JQwJmOPvKrZxw0FHK0SY8shufHrdUpDDhE8Itca1TIMoNNAaUpJjTFqtC6HAXp7RhyfkzzKaUEX5dRK6b+eAcXI3G6D8E2TzS9WFyOCE/pJLf0cFW0kHgboi4xnhG1X4ddtNLjSJT0qjRSQ5KWRfiVQtAvXN+Apg9uv4mL+ggBeu/Mkb5UEnAuDW8DVAkvjlBxIKd0Jjh2G80KDSpo+WztJjDJfcRI0Oo+Mx1GuYwfL/6xeH8oUnNT289h+XxPqSxro9qg== 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; bh=qPIL4uOxlIkWYH7gl2Qha1lsYRJ9hENlygoMT/WdWDg=; b=aG9cg9/8imlY/aA0JURYkQFoGnFEakVZtjh8WoFVwECH8cvyg1J7UAUyNpFSqUcFhLngqZx5wQU3y/BQIzA4M7slDS98yZazGwjW+Psbsz+dUI0mke8nkN58Krx3uFb7q1o9ASRTwY0u4qTX1Xrya9nmHAAE71itkmeOshe3yClGEn92xCePffFu3H8gK9E0hPDLXqj0gIEbG+DIhP2IO2jdBIENQDht3v2Y4ivhBfsU7aRyNeH8a4ppAY8LPg9bFBXQ3pPzz84SzljcRZ2nRNjetQuwjch0S06ndZphkEw1mm8Mbqd4T65H2cyiN7WIj77Qaon2tN4UMfcJdWKJIA== 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=qPIL4uOxlIkWYH7gl2Qha1lsYRJ9hENlygoMT/WdWDg=; b=FPUwJr6Bcqw32TxYJGyhzXXnUnlgvka6mmIAwg7QWWOzKrzDBLsadKhY0GpjNKHZAgPp5PaP6VR5oQ8nepXvBiTAKg1npKDNzfVDvrT/bGYpyhbJLWd76gl50YaIqaO8+cIyvM6neu4RDlQAo7K3z+dsMCxk9WXVz4tiP8NXJfY= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; From: Wei Chen To: , , , CC: Subject: [PATCH 04/37] xen: introduce an arch helper for default dma zone status Date: Thu, 23 Sep 2021 20:02:03 +0800 Message-ID: <20210923120236.3692135-5-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210923120236.3692135-1-wei.chen@arm.com> References: <20210923120236.3692135-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6b836271-0681-4ed1-e560-08d97e8a2e78 X-MS-TrafficTypeDiagnostic: HE1PR0801MB1787:|AM6PR08MB4151: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:8882;OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: AOwDhD/TmYkLa/GO9jAAw9enNGXp5w83DjDe55s6mMacHPzb3G3SpB0sdBpw3x4oT0udK7m0Yb2LcH0wleZNSLWq2ANRhD+LUAcUhMVUEL+ZcpRfGFMTuswmkaTzoiXwjjE2zOHDVx/PtTTRmwxaDgF3K+J272WXTW36Vf3LK+2pdh4OaFXMYKdX5p2arNPMEk/0Hrj8tz5uiPnSS3yhgigdUQqqBKP5yV8T+pHKBmKiJZKFNYXRkNmCXB5VZ8tj6uq3jzznV0DOhBMEkRx32DF2vLP+2BQjLoFaPg2sRRirNmY58lhL4HXnRMMUjBmScDKexpN63qzC3UbbMy8oNINmyZAOl0NJNk6Umcb784nvKBA3bRcxNcgJq2KOkKIDeVOOqLkIEQNrbdugHHxKg4sfI/pXIX7mN/j3Q46b84e7XY3KUXCmapMdxk7lEa4xgSUKHvU/UmtmFWWtB4NqgrirOsW5BtfyfLPEAaxauWra9xizQfYR95Eta4dk42YXOTSDK9U2qqhuz0v/UAvFRbppHW1PZc/QbI6zE0AB1NuTgNwl32+8B5Fu7xscL3/uQ8XNx4Ge06sLKcQpQEbIhoZl+eYwvOYzW3ZmhtW3y+meW5f6YtV67OZFanm+2Cw5HjhYG2XKoUySQ08wGzJQXbm5brXU3Q4e+ErLUltdJzB3rhi86iS8GZugxekRT0VHfOIKQH22QjQ3Wrm93GdrNkvBC0onMwCxt6yOuzEuZvM= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(4636009)(36840700001)(46966006)(47076005)(8676002)(426003)(508600001)(44832011)(70586007)(82310400003)(86362001)(2616005)(316002)(336012)(81166007)(8936002)(70206006)(2906002)(4326008)(5660300002)(186003)(1076003)(36756003)(356005)(7696005)(36860700001)(6666004)(26005)(83380400001)(110136005)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0801MB1787 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT053.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 52c3eb3d-7cce-4a24-3bff-08d97e8a2333 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ulnXWjjtAl+f0X5ZF5BmbiTCTSr+5XK1fnakEfgIet6V9D04b6BkuJF1b5qYAJQ8SKMJVYNOvaHNUVWBueDcO+XEJ/fAVQ3S6FK/1PHlHthiuoux/g3n9qRbOwk70SPgBTguodYvvd1dOKM+WAQXNy0Ub2MvM5TtLtEz3+uh8LVqB9E6d5SYQ0hVmFKuDilyGE/RHknFGr95UtfF5a1Z7NW8wxya0pJrx2GhoW7a60XXDr0WS2SST+WIZDOdBUuJYSZJX0vx7eZJxmEYqSOmmdh6dBnP39mrpuFfT1z7inQJEbPqtREJuPoy0V49szpR4nGu1XshumKslqK8mjLnjqlBewXSQ3oOU/SoRyiRHd/Si5At+7M4GdzCkRPsdUtzXlAWchWhDpbIvSMJm9zQguA2MPcj/7p9X26jUQzBKOc9ka0ggLajt28SUgdUWAz7XvrzVxpQOGPrXDTbDO/w9qx+gBYTA8QgGBjFvK5u8FOk+UJBeuYwCdoeVDRwTG5eCiY5eRs5yjFIeOktXNzd4KI8/188dCAb1NsTlrFbC3P4iQocYFyvccVus6xzltDTkI3cvHNta9u65lzF0nwqgu0hBfRzfYcf9tHqoyl/ec9P/kPRzeW9NZmY8DfOYXPqblkgI4Ppd238SeU7JOlqWN8U3Awul+M4NHxHgoOk6wsJyasITQ1j5qhs4dMAYigyV3BUoXCG5OuwumsH3mrhzw== X-Forefront-Antispam-Report: CIP:63.33.187.114;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-2.mta.getcheckrecipient.com;PTR:ec2-63-33-187-114.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(4636009)(36840700001)(46966006)(4326008)(81166007)(36860700001)(426003)(5660300002)(508600001)(336012)(82310400003)(2616005)(2906002)(6666004)(36756003)(7696005)(8676002)(26005)(83380400001)(1076003)(316002)(110136005)(44832011)(70206006)(47076005)(70586007)(8936002)(86362001)(186003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2021 12:03:39.8789 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6b836271-0681-4ed1-e560-08d97e8a2e78 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.33.187.114];Helo=[64aa7808-outbound-2.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR03FT053.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB4151 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 for DMA. There are some x86 implications in current implementation. Becuase 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 prefer to give out memory from non-local allocations rather than exhausting the DMA memory ranges. Hence x86 use dma_bitsize to set aside some largely arbitrary amount memory for DMA memory ranges. The allocations from these memory ranges would happen only after exhausting all other nodes' memory. But the implications are not shared across all architectures. For example, Arm doesn't have these implications. So in this patch, we introduce an arch_have_default_dmazone helper for arch to determine that it need to set dma_bitsize for reserve DMA allocations or not. Signed-off-by: Wei Chen --- xen/arch/x86/numa.c | 5 +++++ xen/common/page_alloc.c | 2 +- xen/include/asm-arm/numa.h | 5 +++++ xen/include/asm-x86/numa.h | 1 + 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/numa.c b/xen/arch/x86/numa.c index ce79ee44ce..1fabbe8281 100644 --- a/xen/arch/x86/numa.c +++ b/xen/arch/x86/numa.c @@ -371,6 +371,11 @@ unsigned int __init arch_get_dma_bitsize(void) + PAGE_SHIFT, 32); } +unsigned int arch_have_default_dmazone(void) +{ + return ( num_online_nodes() > 1 ) ? 1 : 0; +} + static void dump_numa(unsigned char key) { s_time_t now = NOW(); diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c index 5801358b4b..80916205e5 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_have_default_dmazone() ) dma_bitsize = arch_get_dma_bitsize(); printk("Domain heap initialised"); diff --git a/xen/include/asm-arm/numa.h b/xen/include/asm-arm/numa.h index 31a6de4e23..9d5739542d 100644 --- a/xen/include/asm-arm/numa.h +++ b/xen/include/asm-arm/numa.h @@ -25,6 +25,11 @@ extern mfn_t first_valid_mfn; #define node_start_pfn(nid) (mfn_x(first_valid_mfn)) #define __node_distance(a, b) (20) +static inline unsigned int arch_have_default_dmazone(void) +{ + return 0; +} + #endif /* __ARCH_ARM_NUMA_H */ /* * Local variables: diff --git a/xen/include/asm-x86/numa.h b/xen/include/asm-x86/numa.h index 3cf26c2def..8060cbf3f4 100644 --- a/xen/include/asm-x86/numa.h +++ b/xen/include/asm-x86/numa.h @@ -78,5 +78,6 @@ extern int valid_numa_range(u64 start, u64 end, nodeid_t node); void srat_parse_regions(u64 addr); extern u8 __node_distance(nodeid_t a, nodeid_t b); unsigned int arch_get_dma_bitsize(void); +unsigned int arch_have_default_dmazone(void); #endif From patchwork Thu Sep 23 12:02:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 12512549 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 932DFC433F5 for ; Thu, 23 Sep 2021 12:04:16 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 4BB3460EE7 for ; Thu, 23 Sep 2021 12:04:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 4BB3460EE7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.193826.345345 (Exim 4.92) (envelope-from ) id 1mTNSQ-0000QV-V5; Thu, 23 Sep 2021 12:04:06 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 193826.345345; Thu, 23 Sep 2021 12:04:06 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNSQ-0000QA-Pf; Thu, 23 Sep 2021 12:04:06 +0000 Received: by outflank-mailman (input) for mailman id 193826; Thu, 23 Sep 2021 12:04:05 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNSP-0006xV-Nt for xen-devel@lists.xenproject.org; Thu, 23 Sep 2021 12:04:05 +0000 Received: from EUR02-HE1-obe.outbound.protection.outlook.com (unknown [40.107.1.42]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 51e1b6dc-1c66-11ec-ba2e-12813bfff9fa; Thu, 23 Sep 2021 12:03:53 +0000 (UTC) Received: from PR0P264CA0183.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::27) by PAXPR08MB6525.eurprd08.prod.outlook.com (2603:10a6:102:154::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.15; Thu, 23 Sep 2021 12:03:51 +0000 Received: from VE1EUR03FT011.eop-EUR03.prod.protection.outlook.com (2603:10a6:100:1c:cafe::29) by PR0P264CA0183.outlook.office365.com (2603:10a6:100:1c::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.14 via Frontend Transport; Thu, 23 Sep 2021 12:03:51 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT011.mail.protection.outlook.com (10.152.18.134) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:03:51 +0000 Received: ("Tessian outbound a77cafe56b47:v103"); Thu, 23 Sep 2021 12:03:47 +0000 Received: from caa7b4dcd7cb.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id A11E3031-0ACD-43CA-A9D7-E16F6FA992ED.1; Thu, 23 Sep 2021 12:03:29 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id caa7b4dcd7cb.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 23 Sep 2021 12:03:29 +0000 Received: from AM6PR0202CA0050.eurprd02.prod.outlook.com (2603:10a6:20b:3a::27) by AM9PR08MB7117.eurprd08.prod.outlook.com (2603:10a6:20b:41d::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.14; Thu, 23 Sep 2021 12:03:27 +0000 Received: from AM5EUR03FT009.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:3a:cafe::3e) by AM6PR0202CA0050.outlook.office365.com (2603:10a6:20b:3a::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:03:27 +0000 Received: from nebula.arm.com (40.67.248.234) by AM5EUR03FT009.mail.protection.outlook.com (10.152.16.110) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:03:27 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.14; Thu, 23 Sep 2021 12:03:19 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Thu, 23 Sep 2021 12:03:17 +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: 51e1b6dc-1c66-11ec-ba2e-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5Bj0MiZUkjRpuLNYU7r2jj8EyNrfRU+quQC40vND4xs=; b=a0GfpOWRG7JknM/pMBuTF26K0ly9DQCzJedWLlJUKC4Ly+Pn1E71QNRDXypogtDNd5rUXsGJqF94cS5uLQXmx1x5oVfG6oHbnI0aLi4WOkDbwrJAPvKQOYhpWdx48/sJAFSc9zwjMt/FRgSh3vwuhUb9WcT2dXRWtfV4wESvx4Y= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; X-CheckRecipientChecked: true X-CR-MTA-CID: cf82ffb760e15b2e X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=da8nWAOCURge37dfwRPFct2SZ1BQ4LF/AgWfRK6q//W6UUeFwOKhgJEwvLMoqqWqyqVtZpQpkpeBP7/vPAUuLzIHIfigQDktKw014jymWKxChM7v/lfgho/ayDfg9oLH4eMSqFesEj4qsRQdFHXWVjYgmZETVeuxU93/58DXXEsvWZBkHE7rNoH8HHoBWxvueSXK7w72tZcRRZRJvbpKxiNOGlsU2mm51T/+AjWy+M1mc0XX8kUIQNYqv4VoAliYeDi19SSC88OKEgLJnAvv1jy1YbxzyaOE9XltvIm9l58SWCkspLxJBDGhMlpdWiJDmzuyJ2XzaRmSa9NzAyaVbQ== 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; bh=5Bj0MiZUkjRpuLNYU7r2jj8EyNrfRU+quQC40vND4xs=; b=hPP6iOn6UOFbpgVxkaV+k1XPMNueoirTjkG1WtdQ0E0sPtPr9IrRtK5eg23Ov1Vmn/0CuNWzVR1WCacAQ0QQhid2qd27bpxh/VZ+gxC0qK877s2bxCYAbYvJwL1VO/2FI8b1xRxOiEyOEwUP6S6SST4NeZ6ITbd4GYnJcpMEhGtWr8Yq6OGxx72spHNMpZw2uGqxvuPodcehK4ePY7j7GmmJqs3vGM7xpO6OzgM50hXnUDRHfRa3R0lTlVxjAgBrdFmUP8KiFKnaKwluvVXifzDR6BY6Jaz7P3PAdrJbp0QtG5DjY+pCu2MAsDnJH1Cm3zAGemm5GR02bewRtj3G1Q== 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=5Bj0MiZUkjRpuLNYU7r2jj8EyNrfRU+quQC40vND4xs=; b=a0GfpOWRG7JknM/pMBuTF26K0ly9DQCzJedWLlJUKC4Ly+Pn1E71QNRDXypogtDNd5rUXsGJqF94cS5uLQXmx1x5oVfG6oHbnI0aLi4WOkDbwrJAPvKQOYhpWdx48/sJAFSc9zwjMt/FRgSh3vwuhUb9WcT2dXRWtfV4wESvx4Y= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; From: Wei Chen To: , , , CC: Subject: [PATCH 05/37] xen: decouple NUMA from ACPI in Kconfig Date: Thu, 23 Sep 2021 20:02:04 +0800 Message-ID: <20210923120236.3692135-6-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210923120236.3692135-1-wei.chen@arm.com> References: <20210923120236.3692135-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e70ab8b5-14b4-481b-383f-08d97e8a353f X-MS-TrafficTypeDiagnostic: AM9PR08MB7117:|PAXPR08MB6525: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:935;OLM:935; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: WGTXvtcGlJfOrMskUH8PFEP99JJ+k79pMI0AmoBzPCRXFzGyFmpvSTboI5WWNpo+18J38XAotRpBPiWQ7R60Zp4olsVc4HwgyuxzZrUPtPjq5+oIluSwDxnMccHrxFRtpIpU/CA2J3UWzT1bvIg1aCf91N7kyEST+qcFcuXjOvaOvDsvwNzqYaoa9bcGd+wi1VQ3bio2yOCPIatKIHuwai7tBC4Vn5s6JfkJnZReDLRSoOLilw5O3qrBewKAvqecLVTnX5sGVtAGH9t1v/hAoOF4QvbXgWW6TgRxeJMPPd993OPy7qneiVrvLGeeMhDo8EjypxvzFuBdWwIAEahePglVfQzME0VhLmmSMwNg4t5iQyFYl60fP70qsA7T7JVymr+Dq6wKWAqR0IcQ0PoRdXlthU9k13s/BrkgHl/u9naxIjhUbd5BloaolMxLcDowi7rNI6cQEDzZM1/6D+MEqeTvBv/NsbtMYQDinS1Y736lgB5VeDjX48CMOge/14ZCs7nOO8WdG21cg80EXt1mQpjIdvNljPw07DIQMSuRcG2nBnBU42XkM0EtDw3Tk7X7skIoPcAI6R1Zm4C6u3mq0qNPkXXJVxYNyUYF2TGPsGZY6KsmoVF5ncAMABcPJpjd0nvbf2NCmvfgtalg9Db1WcaFl9qds3iNG8OBCngEyyHp66Ip1CYY1hAOriNC/fwmR6RrxtPlepQv2JRdir7z60AwqMcR5k4FgRRhUqBw8Eg= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(4636009)(36840700001)(46966006)(7696005)(8936002)(2906002)(356005)(81166007)(508600001)(5660300002)(36756003)(26005)(2616005)(82310400003)(36860700001)(1076003)(47076005)(316002)(8676002)(70206006)(83380400001)(336012)(4326008)(6666004)(186003)(110136005)(86362001)(44832011)(70586007)(426003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR08MB7117 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT011.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: cb3a5a9e-9c97-487d-af5d-08d97e8a270b X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3RPlFvkCFNZMclfgKD9d4sKfv9SKt6SNqSfe78HlUj/FHF/bFngypu0ANtE1fyDkjlOUT9v0PESi3eUgUi0q0C9xUe4OHxnMLkZpcS424838v101OqmM+X2TCLoCi1N1OBCXrTL4bvrDaL3z6Zg51cI9czmsdWw8j7291o3qo6JekqnvGDpIpOJbzwBUla8qLRGIrSUlH2T+3ofGP0/3csYjWsAMwWJyTkfhxJs5wVRTVdt/Bk7ORCD3N5wf2dlHcOZAVHxDIUB+hA/C1ZvBGyZXOOaE1r254QIZ4REM+92oRdb+tgEPlPdAQxZtdYaNZGBj1jrpW4bf1OQChBvLj2yAMThL1tfaz6MffMoXewg8NeTPhjF1pQ7RgEmkvlQkw68USjv+kT23Z+rhp5jTfeuDRhAhJ2mbYmBLUT9vYB0+prhDaKoSImjNDsccvSAl4f4JCD+Z2TtRfXiQlXCfzi4JDBLmJHObCC7UAfktusIVP4QaEzDEEFMNv129xV4IPPDJ0qfOKF0wUEYqMSNysGknxjoA94PYFlJJPOtpITpMvnlj+5nObrc2uLpANedZIUMNqTskviGMEtg17uditfG84K10L/zKz5JIcG0Y8pfjeVXwoDMcd65x7D4VAqvPXQzN5h7Yr/2+FRYZcO1eiVbg+HqAlVhCE3tQj+/ZW4IJvzTl4P+1eOemsowF/7u4YRIkF5zOrN6SVXH9/eSk9g== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(4636009)(36840700001)(46966006)(186003)(36756003)(26005)(8676002)(7696005)(6666004)(426003)(82310400003)(44832011)(4326008)(336012)(83380400001)(2906002)(86362001)(508600001)(81166007)(1076003)(5660300002)(70586007)(36860700001)(2616005)(8936002)(316002)(70206006)(47076005)(110136005);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2021 12:03:51.2448 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e70ab8b5-14b4-481b-383f-08d97e8a353f 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: VE1EUR03FT011.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB6525 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 Reviewed-by: Jan Beulich --- xen/arch/x86/Kconfig | 2 +- xen/common/Kconfig | 3 +++ xen/drivers/acpi/Kconfig | 3 ++- xen/drivers/acpi/Makefile | 2 +- xen/include/asm-x86/config.h | 1 - 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig index 1f83518ee0..28d13b9705 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 @@ -25,7 +26,6 @@ config X86 select HAS_UBSAN select HAS_VPCI if HVM select NEEDS_LIBELF - select NUMA config ARCH_DEFCONFIG string diff --git a/xen/common/Kconfig b/xen/common/Kconfig index db687b1785..9ebb1c239b 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 diff --git a/xen/include/asm-x86/config.h b/xen/include/asm-x86/config.h index 883c2ef0df..9a6f0a6edf 100644 --- a/xen/include/asm-x86/config.h +++ b/xen/include/asm-x86/config.h @@ -31,7 +31,6 @@ /* Intel P4 currently has largest cache line (L2 line size is 128 bytes). */ #define CONFIG_X86_L1_CACHE_SHIFT 7 -#define CONFIG_ACPI_NUMA 1 #define CONFIG_ACPI_SRAT 1 #define CONFIG_ACPI_CSTATE 1 From patchwork Thu Sep 23 12:02:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 12512527 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4715CC433EF for ; Thu, 23 Sep 2021 12:04:04 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id EDFA960F11 for ; Thu, 23 Sep 2021 12:04:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org EDFA960F11 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.193820.345318 (Exim 4.92) (envelope-from ) id 1mTNSE-00076u-40; Thu, 23 Sep 2021 12:03:54 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 193820.345318; Thu, 23 Sep 2021 12:03:54 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNSD-00075r-Q4; Thu, 23 Sep 2021 12:03:53 +0000 Received: by outflank-mailman (input) for mailman id 193820; Thu, 23 Sep 2021 12:03:52 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNSC-0006xV-8h for xen-devel@lists.xenproject.org; Thu, 23 Sep 2021 12:03:52 +0000 Received: from EUR03-AM5-obe.outbound.protection.outlook.com (unknown [40.107.3.87]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 5095996a-1c66-11ec-ba2e-12813bfff9fa; Thu, 23 Sep 2021 12:03:51 +0000 (UTC) Received: from DU2PR04CA0162.eurprd04.prod.outlook.com (2603:10a6:10:2b0::17) by VI1PR08MB4158.eurprd08.prod.outlook.com (2603:10a6:803:e6::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.15; Thu, 23 Sep 2021 12:03:49 +0000 Received: from DB5EUR03FT037.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:2b0:cafe::9d) by DU2PR04CA0162.outlook.office365.com (2603:10a6:10:2b0::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.15 via Frontend Transport; Thu, 23 Sep 2021 12:03:49 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT037.mail.protection.outlook.com (10.152.20.215) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:03:49 +0000 Received: ("Tessian outbound a492f2284909:v103"); Thu, 23 Sep 2021 12:03:48 +0000 Received: from a328cebf5fe4.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 52144751-B383-4D99-A1E9-13435DC9C057.1; Thu, 23 Sep 2021 12:03:36 +0000 Received: from EUR01-VE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id a328cebf5fe4.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 23 Sep 2021 12:03:36 +0000 Received: from AM6PR0202CA0059.eurprd02.prod.outlook.com (2603:10a6:20b:3a::36) by DB6PR0802MB2375.eurprd08.prod.outlook.com (2603:10a6:4:87::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.15; Thu, 23 Sep 2021 12:03:28 +0000 Received: from AM5EUR03FT009.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:3a:cafe::ac) by AM6PR0202CA0059.outlook.office365.com (2603:10a6:20b:3a::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:03:28 +0000 Received: from nebula.arm.com (40.67.248.234) by AM5EUR03FT009.mail.protection.outlook.com (10.152.16.110) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:03:28 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.14; Thu, 23 Sep 2021 12:03:21 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Thu, 23 Sep 2021 12:03:19 +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: 5095996a-1c66-11ec-ba2e-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GcILUNZkNyOp7caaG1E8DDdtnvtY8zrWXypkM6x7c0E=; b=yTWwiwJFNWT7FbZnbCIXO3KF02rJVoinulqD4DyfnWLhZRg2t+u19F8f42gTE94xTBeTwgimq/gOVTbJOlm6WTmWN7mwc9O10oR1vdqF6GrfblYAVfhihfKMyx3VqhmCwCL3gVI4dcHQOXU1k9gW95oc419xR0bLwuiiOP1Ba14= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; X-CheckRecipientChecked: true X-CR-MTA-CID: 4ff5c38518d203d8 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CUxJnp4KkB22S450kfX906L/zN8PU/Nn4NrXnjcRgsFCyn4DnZUE+aj99WTW3GTRz4dLMhibkf7V0jRW0ouOex2ZaBZf8a0XNvAPp4oQT31RASAjFtcajgQypzRMAWxZoEjZFWKUfc9EzqcB8uPJfiFTrPyBrK6QM9r3F4VuWPYaujrQLTvzdCRSRZAi+WjGnhGoNCHCmsNnAtyhBAs5RTkGM95BQXpx0n6qiAg8fDBKGniui2b2JBrvWHYbD4lp8CuANecF+kFsMmnMwaHR3K8G+V9asM+kbzHDJeJ61pjdzquciNCWfHYQlOmIeGS2PPIT0xQs+v4R8EPLdWxeVw== 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; bh=GcILUNZkNyOp7caaG1E8DDdtnvtY8zrWXypkM6x7c0E=; b=O6lWhgrMBq+jFAp3hZ3UZFzzQ8hjXpFkWrEAkf1avrJ5jxnIarpFQeO12n5JC8nm54bDyys2FycIR9a9j+WLVXS68LYxOOcB08l7oI0M+HdntUNyehLS1Gs+XgXSlFXSNDWVqO8WSger31mV54c1loQUNcAeh6YJBTHXjbDKPPEJvnpz4dfpacXD+4poZQxV7A7f1oSjYw483dwpTIXnsmfxDK0W1GHtW4yhyf5RNVkUmqCCzPtx4EEPOaJjDgJYw4xifBmZsquVkaLOdFNwsHb5Ds2gQ+l5xOqB38rkpmKmMQAFCMN6a4+r41YhCsr6KgQ1rW7Xn6qgrG+douvV2Q== 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=GcILUNZkNyOp7caaG1E8DDdtnvtY8zrWXypkM6x7c0E=; b=yTWwiwJFNWT7FbZnbCIXO3KF02rJVoinulqD4DyfnWLhZRg2t+u19F8f42gTE94xTBeTwgimq/gOVTbJOlm6WTmWN7mwc9O10oR1vdqF6GrfblYAVfhihfKMyx3VqhmCwCL3gVI4dcHQOXU1k9gW95oc419xR0bLwuiiOP1Ba14= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; From: Wei Chen To: , , , CC: Subject: [PATCH 06/37] xen/arm: use !CONFIG_NUMA to keep fake NUMA API Date: Thu, 23 Sep 2021 20:02:05 +0800 Message-ID: <20210923120236.3692135-7-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210923120236.3692135-1-wei.chen@arm.com> References: <20210923120236.3692135-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 953a3fb4-ef0c-4d47-4e80-08d97e8a33ef X-MS-TrafficTypeDiagnostic: DB6PR0802MB2375:|VI1PR08MB4158: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:2512;OLM:2512; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: IYJzVLVHJm9ARQVk3lQE2eMUzEsiFSRl2kZ19AG1hqOiozAcNViMzhbrPLGE174snrq4QcV7XhGtb3qMUzIdfuZZUO0Uze12f2sEG/RfsWytY1SA3gENfaPtnI+C+ZP+teG3ws6s8p6NlTnn89WL+Kwov4XcAAQIkj/tPPghGTHFodVVI4vAyJDZrtgVg45KCQbN/8KToXoFpUDQlq59HYzrazT8MFnuu90r1nUGQiGOoqEm02m3nXdeArEp8NSZfjwEzTpDG/+zUqy/dtTI3oKnrt1uWRMKWIHpwcEYemuDkw95asvLzCqmtY52FhACu1S6bn9S92/uUQFxNaihqMPAlOcoY5qgPuMAH+mee67yP7D9vvyX4/7+PSl/24AUhp/kFG/PmaWAto2tolM7eLwD5+lnCr4XVo9A2vFyrViLcYgKGphF65wC8khBM1w2BXkJ6uFuCu9874nj7NTKwHbKQY24oqrAGp/kMMSpmstuFJbR2VdEv0lR0iYdEiF+WKqZ5a8Veui+f4qHwpji9RT8Mcp6/XYIxAdQf9qJAHo/p+jpboQCFSO+1RV3GrLB9oV7t0J4qhhwOmZVllyNCJvhzZHVw89oYy6UofH8BcvigS2AIvWLPe0x+SRnaeM36fp9AujnHK7QUBT3WOy/wTP25NlrnDpYNewZOHllt9JEOO1wg3u5GjWzCxFGVZ5WHTfKaSBt2AHn5zmCLErl3tNmGUEtU6svKn2f53Ni4eI= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(4636009)(36840700001)(46966006)(26005)(1076003)(7696005)(426003)(86362001)(186003)(508600001)(36756003)(36860700001)(336012)(2616005)(47076005)(83380400001)(4326008)(82310400003)(70206006)(110136005)(70586007)(6666004)(2906002)(8936002)(81166007)(356005)(5660300002)(316002)(8676002)(44832011)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0802MB2375 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT037.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 92c66c39-fdd7-40be-a709-08d97e8a27a0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 85r/UrjY0Bxj2pO3G5DuhAd1UdkRlv6Mj72cOkMjf2Kd3HWvinUncAH+XvV6oniL2bizFGXm1WBzVWlbd67NC/cI25WgEAASw/2zYxWeaEAAM8+816AT4kd349c1FK/qQN3x4Cfy16QtQ6apArBqSgR0pQsRTD7Xnreq6qahV4qVO9d5Ar3vSOxRUw1UR7a2pdexekGFYzlalT6z6TamvzsYDS1DdUi1hK9ERyyJVvabhE/ZeqfxzboGpN3beiuiXuymt4GQ2owtc320RhPZZNTB6ScUwUXJ/BsCcTYIorc2Oa5y/WNSymkGwRPOWshnC7Gh+uCVEz3rv+z0nr3J56fDFikhzuTTvQpeMy34cTFJxqIsR9KhbvNS5VWCxUlUWiaU7QXZwlEgrWOFciK0GjuEPu5qQ1wKaZrknWjXAh4TH7nWJtUyhoFrW95yiUGD2oAMMxxCTGQNeb/Frjddi6pAaS5F7WKc72L57uKLaBrWXqfanLMa7xLMmSqCqhIyZpmM2f7+WgbkuLi5/ftWRZ2rW7Un4wfSHFf3KdJJUyn6vRpogd/LgWAFZxLfPSXqiQE5ksBi3Fx26DWFh92ASjmC0fGhf8WiJIz1KKGLoe2OhsTP+Eejdj8wXV6khVx8rLPYjqoUTSWXVdAcc+cNmxOWPmapkIwsCCZjAjfIstdj6WV2LI5Lv70FT2T1iaQLFsgi0nuFvHplKIXxEOPcWg== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(4636009)(46966006)(36840700001)(6666004)(336012)(2616005)(316002)(5660300002)(86362001)(110136005)(426003)(4326008)(36756003)(47076005)(186003)(81166007)(2906002)(44832011)(26005)(8676002)(83380400001)(8936002)(1076003)(82310400003)(36860700001)(7696005)(70586007)(70206006)(508600001);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2021 12:03:49.1453 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 953a3fb4-ef0c-4d47-4e80-08d97e8a33ef 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: DB5EUR03FT037.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB4158 We have introduced CONFIG_NUMA in previous patch. And this option is enabled only on x86 in current stage. In a follow up patch, we will enable this option for Arm. But we still want users can disable the CONFIG_NUMA through Kconfig. In this case, keep current fake NUMA API, will make Arm code still can work with NUMA aware memory allocation and scheduler. Signed-off-by: Wei Chen Reviewed-by: Stefano Stabellini --- xen/include/asm-arm/numa.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xen/include/asm-arm/numa.h b/xen/include/asm-arm/numa.h index 9d5739542d..8f1c67e3eb 100644 --- a/xen/include/asm-arm/numa.h +++ b/xen/include/asm-arm/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) @@ -25,6 +27,8 @@ extern mfn_t first_valid_mfn; #define node_start_pfn(nid) (mfn_x(first_valid_mfn)) #define __node_distance(a, b) (20) +#endif + static inline unsigned int arch_have_default_dmazone(void) { return 0; From patchwork Thu Sep 23 12:02:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 12512565 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB176C433EF for ; Thu, 23 Sep 2021 12:07:42 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 6329460FA0 for ; Thu, 23 Sep 2021 12:07:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6329460FA0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.193867.345427 (Exim 4.92) (envelope-from ) id 1mTNVj-00067C-Df; Thu, 23 Sep 2021 12:07:31 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 193867.345427; Thu, 23 Sep 2021 12:07:31 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNVj-000669-5w; Thu, 23 Sep 2021 12:07:31 +0000 Received: by outflank-mailman (input) for mailman id 193867; Thu, 23 Sep 2021 12:07:29 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNSk-0005KP-W2 for xen-devel@lists.xenproject.org; Thu, 23 Sep 2021 12:04:27 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (unknown [2a01:111:f400:7e1a::620]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 8e392c35-b95e-4c30-8195-80009b707bb9; Thu, 23 Sep 2021 12:03:54 +0000 (UTC) Received: from PR0P264CA0184.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::28) by HE1PR08MB2873.eurprd08.prod.outlook.com (2603:10a6:7:30::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13; Thu, 23 Sep 2021 12:03:44 +0000 Received: from VE1EUR03FT011.eop-EUR03.prod.protection.outlook.com (2603:10a6:100:1c:cafe::e5) by PR0P264CA0184.outlook.office365.com (2603:10a6:100:1c::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.14 via Frontend Transport; Thu, 23 Sep 2021 12:03:44 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT011.mail.protection.outlook.com (10.152.18.134) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:03:44 +0000 Received: ("Tessian outbound a77cafe56b47:v103"); Thu, 23 Sep 2021 12:03:42 +0000 Received: from 9c69dda446e7.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id B77D722B-197B-4BEF-98E4-0803B71C25E7.1; Thu, 23 Sep 2021 12:03:26 +0000 Received: from EUR01-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 9c69dda446e7.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 23 Sep 2021 12:03:26 +0000 Received: from DB6P193CA0002.EURP193.PROD.OUTLOOK.COM (2603:10a6:6:29::12) by DB6PR0801MB1926.eurprd08.prod.outlook.com (2603:10a6:4:6c::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.16; Thu, 23 Sep 2021 12:03:24 +0000 Received: from DB5EUR03FT032.eop-EUR03.prod.protection.outlook.com (2603:10a6:6:29:cafe::67) by DB6P193CA0002.outlook.office365.com (2603:10a6:6:29::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:03:24 +0000 Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT032.mail.protection.outlook.com (10.152.20.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:03:24 +0000 Received: from AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2308.14; Thu, 23 Sep 2021 12:03:24 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Thu, 23 Sep 2021 12:03:22 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Thu, 23 Sep 2021 12:03:21 +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: 8e392c35-b95e-4c30-8195-80009b707bb9 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=hKGWyOZlxxh43KHp7ZOxfxEZJMhlD15ad4VHvSvtHzE=; b=bc4CJPDNJeBqmaNVOzPGFxoBH34QB5MFYuLELOKkalfMzHKJranlDRzX0bdvODm2Cqwhkd6C+BtDhC5mXnlBdfTR28J/y2HRhX6GpSRkUwpgBqPpGft97/yJcDsXKH+O8aNhTClmHb2JqwKtAR97GhNZ29gbXLvcxQ5s7EX3DJs= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; X-CheckRecipientChecked: true X-CR-MTA-CID: bfeb19c4adcec2df X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HfX+etrn9Uey+4KzLB96tj0eHEBNpInNru9o6XbSGLQ3jy1KuJRXbchW8AnkBav7m3yGUdxqkYXHsIFExSKxhoNUudRh7dBaHDvIGPceoijbxImTxI4yVyAGWxrUM7oTy9QDry/QTqDCV/2kzNH4UWlYsrvR7W0wU0mXERx/2o6gJdDWTVCy8PYglBc0mygdXkXeKOezwQssjf13rvB9mDwWVHp6MUHoiWITLV+H+caYaVMCYJi9VKmZmv/ExQmVDJAnAIfkSF51GQ8/U0pijzvVENIRz8cZoKvz4usV71RfJilqL5GDqZrXdF6lrrAbdoyLJqlav6T7996UM/aspA== 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; bh=hKGWyOZlxxh43KHp7ZOxfxEZJMhlD15ad4VHvSvtHzE=; b=dwLHbxyTLgfSdq9MnnactGv8eO/9dCt6W/ee5BVhgGghjCZjSXJU5UtEwPsNdlJnJoI20brbirH08mqxUUax9v1pcL1E2JG4eckuCDTIkik/jyx2pKi0YuPxvBTLgTCoVjW7UgU3Xf2wPVzH2Qa+9pMnST0/1wMNxJ9UfFFgRQOfDqgJhinpWUYuB77ebcgA5PjqDXlZUwpjpLJtYfSz3GP/lIbpVKTmE7mwAwxCDMOLEYcR+FDa0L1Lt0PT3OxT9VKkMnfnD8mAeOaYXmJc4ehM03nI9SHJEjmjNmUhUaeIHho+9riWGvZTay9mCxajs8KsBxj/GMFFjKkkZnuCOg== 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=hKGWyOZlxxh43KHp7ZOxfxEZJMhlD15ad4VHvSvtHzE=; b=bc4CJPDNJeBqmaNVOzPGFxoBH34QB5MFYuLELOKkalfMzHKJranlDRzX0bdvODm2Cqwhkd6C+BtDhC5mXnlBdfTR28J/y2HRhX6GpSRkUwpgBqPpGft97/yJcDsXKH+O8aNhTClmHb2JqwKtAR97GhNZ29gbXLvcxQ5s7EX3DJs= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; From: Wei Chen To: , , , CC: Subject: [PATCH 07/37] xen/x86: use paddr_t for addresses in NUMA node structure Date: Thu, 23 Sep 2021 20:02:06 +0800 Message-ID: <20210923120236.3692135-8-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210923120236.3692135-1-wei.chen@arm.com> References: <20210923120236.3692135-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5ab2834c-4178-4f9b-5bb7-08d97e8a3124 X-MS-TrafficTypeDiagnostic: DB6PR0801MB1926:|HE1PR08MB2873: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:935;OLM:935; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: Nnf+ibO55AWQQfBEFFAOvG+NflpSS8wWS7KOIrJmFExDxAFPE6TGxPzSk4wlb9pLY/j09CPafUFbfZbcfKqtWsEmDArxH0d0ULpukbifbz9i3Ev/OwenSWV/LCbC9nMRGnk46kzOGcp4X3TBwWMh4Y4E5zCbnF7Wg4JOoIpx7ct8xk8yeCMJ7OWH4+ivy78LBx4MpI7hbore9EFD3DVOQDpHaUF6lGleJZ9Wyopy34Ix51kVAA77xQZzxfEyM7Fo0eeYGYPUkAOZDdOzJ9Yax4k7ZDk2+Ip+BfyXDN0B400Dg999fBN550iKJdGGCXg7QQQzgk0H8RdYLAZ+QqIed7bWBGLWfXP2itLvSPjF8buk7A/oa5Y+7J8ji0nMnFaUR4seEUB/ITCTXaLsXYbmITcAQDEEFhKsKcYW3Zk0XM5f/YpVw1Q31ZzbYxVWDwdzA4IqsWSspFP5a3qNtCDmEnqdHwGLi7+2dWUNSSo8/ABTh0m11+ZoOh6W6jb2BNIs1DQ8m3Sps8zcFn8soCf5RdnyeMkJHPkfOL/2weO1rL6CjkS8vYdSScAQzfEsfjNbTGeggq7TeMP5cDCJidUL4+MQvP8alsosdAiA9TL1Pfk9kwEkMLr7WVS2rK661Xy6ZRklQQnXc2NhF3xZnT+yB9bvshgNFOmqWJL7eG9+bNMB2aG2zTU1evJ4I4VeZiIp0P23anvB+jTZNskg0387NgJqBCTV6Kxm71YdihpvPU8= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(4636009)(36840700001)(46966006)(83380400001)(508600001)(426003)(336012)(186003)(86362001)(82310400003)(70206006)(36860700001)(110136005)(7696005)(5660300002)(36756003)(81166007)(356005)(44832011)(316002)(70586007)(2906002)(8936002)(4326008)(47076005)(6666004)(2616005)(1076003)(26005)(8676002)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0801MB1926 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT011.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: e30fb11a-b275-4250-4e12-08d97e8a255d X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bVxWPuK1X2fgvk3Mu093LbsVC5OSkzfzl2vXnaJ4v67rED2pzcGZBnu9SyqnoTO8UnW4L+v1bYHg0g5o5hd9lsMcm/uIMdJIU9rfHxjCJm+HiQlf/7NzeeGaPpaJOo4mr5EmJ0yjdet/B4/wnzbjg/fY1MA+pUyyRAFKbpmoSCUIcoS9WMT8VhAJu4frZ+JjATpq16K68NnhVUSuQsMIvL6cjtoat66QhwXwBtog4gKsKWiI/IGOkL1YZirNhngQOjFA5k/nxq8pt6ce+2/nRQWUcGYr0zpV1T8Qhviaq3SevSJ84CT4wnEMOcl24zsBTIQ1HbPvVJL4pA3OWwBuogoDS1+i/AUVinOBVnC//NGNUsmlkj0WDLAR9lEAQexnp6MO/uuLSdsRmmOmyR2JPrbTIpB8oo/EXVpfM90IzF+DkPp83NLxGgQ+EGWvN9MDB40fEVlpq/KzPNFfeGZYXPNWoG++UIid6rdHUYYBRD67H4oICOPdGHjo+XYu1D2YLsP8VCiTgyo2KY1+/kjLnxRBK1JLDLiIPHZmzB+OlmjRQGFXFWY96eD/gWQ+OHPXA6bLOnshFLaokCt/nAHFLFRWtYuMV51uZ39pio4ShuxFM2gPPn5xv2ckFMYxKXVlN0Dz/KErmb7X5vOItxce/CNx4PN25AS5tN1rkpGG/uG+D6Sc15621yrHmb7vebMlHG91ogWKXuTLeq//P3ermA== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(4636009)(36840700001)(46966006)(186003)(81166007)(316002)(82310400003)(110136005)(83380400001)(508600001)(44832011)(86362001)(7696005)(70586007)(4326008)(336012)(36860700001)(1076003)(5660300002)(426003)(2616005)(47076005)(8676002)(26005)(36756003)(6666004)(2906002)(8936002)(70206006);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2021 12:03:44.3269 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5ab2834c-4178-4f9b-5bb7-08d97e8a3124 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: VE1EUR03FT011.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR08MB2873 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. Signed-off-by: Wei Chen --- xen/arch/x86/numa.c | 32 +++++++++++++++++--------------- xen/arch/x86/srat.c | 26 +++++++++++++------------- xen/include/asm-x86/numa.h | 8 ++++---- 3 files changed, 34 insertions(+), 32 deletions(-) diff --git a/xen/arch/x86/numa.c b/xen/arch/x86/numa.c index 1fabbe8281..6337bbdf31 100644 --- a/xen/arch/x86/numa.c +++ b/xen/arch/x86/numa.c @@ -165,12 +165,12 @@ 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) -{ +void __init setup_node_bootmem(nodeid_t nodeid, paddr_t start, paddr_t end) +{ unsigned long start_pfn, end_pfn; - start_pfn = start >> PAGE_SHIFT; - end_pfn = end >> PAGE_SHIFT; + start_pfn = paddr_to_pfn(start); + end_pfn = paddr_to_pfn(end); NODE_DATA(nodeid)->node_start_pfn = start_pfn; NODE_DATA(nodeid)->node_spanned_pages = end_pfn - start_pfn; @@ -201,11 +201,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 ) @@ -221,9 +222,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 srat_parse_region(struct acpi_subtable_header *header, return 0; } -void __init srat_parse_regions(u64 addr) +void __init srat_parse_regions(paddr_t addr) { u64 mask; unsigned int i; @@ -441,7 +441,7 @@ void __init srat_parse_regions(u64 addr) acpi_table_parse(ACPI_SIG_SRAT, acpi_parse_srat)) return; - srat_region_mask = pdx_init_mask(addr); + srat_region_mask = pdx_init_mask((u64)addr); acpi_table_parse_srat(ACPI_SRAT_TYPE_MEMORY_AFFINITY, srat_parse_region, 0); @@ -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,7 @@ 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; + paddr_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); diff --git a/xen/include/asm-x86/numa.h b/xen/include/asm-x86/numa.h index 8060cbf3f4..50cfd8e7ef 100644 --- a/xen/include/asm-x86/numa.h +++ b/xen/include/asm-x86/numa.h @@ -16,7 +16,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, @@ -36,7 +36,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); @@ -73,9 +73,9 @@ static inline __attribute__((pure)) nodeid_t phys_to_nid(paddr_t addr) #define node_end_pfn(nid) (NODE_DATA(nid)->node_start_pfn + \ NODE_DATA(nid)->node_spanned_pages) -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); unsigned int arch_have_default_dmazone(void); From patchwork Thu Sep 23 12:02:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 12512561 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 79306C433EF for ; Thu, 23 Sep 2021 12:07:21 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 298BD60F6D for ; Thu, 23 Sep 2021 12:07:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 298BD60F6D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.193849.345411 (Exim 4.92) (envelope-from ) id 1mTNVP-0005Hh-LK; Thu, 23 Sep 2021 12:07:11 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 193849.345411; Thu, 23 Sep 2021 12:07:11 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNVP-0005HV-Hy; Thu, 23 Sep 2021 12:07:11 +0000 Received: by outflank-mailman (input) for mailman id 193849; Thu, 23 Sep 2021 12:07:10 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNSv-0005KP-0E for xen-devel@lists.xenproject.org; Thu, 23 Sep 2021 12:04:37 +0000 Received: from EUR03-VE1-obe.outbound.protection.outlook.com (unknown [40.107.5.64]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 38991186-efbb-4ccb-9f64-24a4c1aa4c7b; Thu, 23 Sep 2021 12:03:54 +0000 (UTC) Received: from AM6PR04CA0044.eurprd04.prod.outlook.com (2603:10a6:20b:f0::21) by VI1PR0801MB1727.eurprd08.prod.outlook.com (2603:10a6:800:5a::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13; Thu, 23 Sep 2021 12:03:51 +0000 Received: from VE1EUR03FT041.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:f0:cafe::9c) by AM6PR04CA0044.outlook.office365.com (2603:10a6:20b:f0::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:03:51 +0000 Received: from 64aa7808-outbound-2.mta.getcheckrecipient.com (63.33.187.114) 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.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:03:51 +0000 Received: ("Tessian outbound ac52c8afb262:v103"); Thu, 23 Sep 2021 12:03:49 +0000 Received: from 9cf742a5989a.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id A8CAD156-9C5C-46D6-864B-12E3A182BFB0.1; Thu, 23 Sep 2021 12:03:35 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 9cf742a5989a.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 23 Sep 2021 12:03:35 +0000 Received: from AM5PR0602CA0024.eurprd06.prod.outlook.com (2603:10a6:203:a3::34) by DBBPR08MB6251.eurprd08.prod.outlook.com (2603:10a6:10:208::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.15; Thu, 23 Sep 2021 12:03:32 +0000 Received: from AM5EUR03FT042.eop-EUR03.prod.protection.outlook.com (2603:10a6:203:a3:cafe::72) by AM5PR0602CA0024.outlook.office365.com (2603:10a6:203:a3::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:03:32 +0000 Received: from nebula.arm.com (40.67.248.234) by AM5EUR03FT042.mail.protection.outlook.com (10.152.17.168) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:03:32 +0000 Received: from AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2308.14; Thu, 23 Sep 2021 12:03:26 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Thu, 23 Sep 2021 12:03:25 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Thu, 23 Sep 2021 12:03:24 +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: 38991186-efbb-4ccb-9f64-24a4c1aa4c7b 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=Qq6wTyOtVX+3FOXJpOSjlfoDJNYhe/IRFtzFw5fVKj4=; b=IPXnMSf4VYMZpzXVA9fCiTHr2TseQttPgKx36J3MFvKVJgRl8XhW6BQ7fCI4Jx1uozmN8DRFhGErfTZrp1xd08AZX6+HkUNnMlucr959QsJIIIItcShfpqFZQnjnvLmm3sUBkXyuJxIPcXidS5Votg/FO3xlBA3c08I2HQJwOtA= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.33.187.114) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.33.187.114 as permitted sender) receiver=protection.outlook.com; client-ip=63.33.187.114; helo=64aa7808-outbound-2.mta.getcheckrecipient.com; X-CheckRecipientChecked: true X-CR-MTA-CID: 075236bcbe98196f X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AIo3EqQhsCeV/fCeHZB6X314PnTI8tW7HR+6YpKLwuZGwSrFxWj1bjfJvdo98x05icNgXHF4WUW+heqCMTxpOZEwxSN9WCdIbEg/G5raUMp292pHZbAbuiA+hHQr8syAARNYJzALEesc2xkQIxtxeXihVw791GeLZGx5TTbU5J5Elu3SQoUThIVCW7FZLrzZn1/4DJ8vWbIgPqJQ9hV31HCz2g7hmoyS9Ws3wrSCagPry7/p5xRh13xgWsg/BDm0AyrwP6dbGQdPb3x2azqMuhPbOmWY/OizICFXPIvRygaXslqi53eUzTSZi6AV7StOpyAyz3G8ckJ9Ui4aDJJ6ig== 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; bh=Qq6wTyOtVX+3FOXJpOSjlfoDJNYhe/IRFtzFw5fVKj4=; b=OK0lF41h6aqkbdbqVCbk7GySxh5KaybLYwM7qpM6r9Vzo+mUQEw2/lO23UhR7YOavfAl2DFA8GSl71v5OL/y8qSDnbmvA2M1x++f6XnF0xy/J/cZyDyR3kiGibQz4yv6vIRoCPWWGCMORndSJw8P8qPJeH7DGcVb7en1oKF+zTJ9dr4Lv+XAOIeXeNJbK+VdDQz0uk/h79voyF4W5aOKQ49QQNkkLup9P+1lANHWkzP9fkirnjEgPFlR0JdsqpyYOR7atpSCnnq5GUl7QBfRo2yIDfZuJ++BshFQs9b18eAcO8/V6E+MfXzXKjvrnFvdflG8TJ0SepVHXFVo7xuZVg== 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=Qq6wTyOtVX+3FOXJpOSjlfoDJNYhe/IRFtzFw5fVKj4=; b=IPXnMSf4VYMZpzXVA9fCiTHr2TseQttPgKx36J3MFvKVJgRl8XhW6BQ7fCI4Jx1uozmN8DRFhGErfTZrp1xd08AZX6+HkUNnMlucr959QsJIIIItcShfpqFZQnjnvLmm3sUBkXyuJxIPcXidS5Votg/FO3xlBA3c08I2HQJwOtA= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; From: Wei Chen To: , , , CC: Subject: [PATCH 08/37] xen/x86: add detection of discontinous node memory range Date: Thu, 23 Sep 2021 20:02:07 +0800 Message-ID: <20210923120236.3692135-9-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210923120236.3692135-1-wei.chen@arm.com> References: <20210923120236.3692135-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b31a1b0e-3918-4675-0fd5-08d97e8a3521 X-MS-TrafficTypeDiagnostic: DBBPR08MB6251:|VI1PR0801MB1727: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:9508;OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: uy7r7emIWxUurtOpRer+cKjJzZDL7auIjL+c2A4QEVJS6VpcoLTrqdDyNVc8LHZwnP0Oi8X7fXg0dano/SodwiZMRJeXjPha0aM+9lzyxK9tAPpTEHdKZ9SdjEA29fPYkzYrolmQ8+AyslPF9aQa2T2NYw00hLnD6GzjW9KpFYuG6dPW0aWieMZgBrteWAEanZQsiqUgWIsn53Ddvn/4jEZIeXlvze4Wga8nDaUYrxyw7cHBIGP/ajdVKl1tn2QeCASd+wbTAJTi90WyzT2YtXKr8KbV6UO69YIJxkZ+MG5IiGaeYeKMG+90iBUf/PJnZ/nqr/OpImOX8aHFcqTm/68K4F0WkLhbNkQryynr0aTwcA0UNrAWf48gWHyixG6+y3weD/yB4Wr1RCNcINkZlMzQKEgQ4qyArj0SAYF3L2vTWxOAwcf8XuBniDULFmZjLiZENeMiVKF3owQSU8ZR4WfoJgkQNN0ClHWGI9+/4PQ6Bo7wW3N7CGJKoeGtqWGIawQO6LcA43opLNl6V5YJgRzBpnohgqiHtV10kO/6fxaXuOtTRUpYT+AA4J8IBmh/tBV9wn2/WrWZgejlcJBCZpodiVAZDxvh65J35dFZ62fzwKnn8TE1IXOImrDXtbaWIeDk4BcSqzdaRz0XrJ19jFIpJNTXJwqH0EatTWEJxHuMmWLFdIxs84yxCNWZgjf7+uLeSbnd1LE1HEv/GcZ2EDgGSO4EvQQx31ZAwj9G4/Y= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(4636009)(46966006)(36840700001)(81166007)(36860700001)(356005)(8676002)(47076005)(316002)(5660300002)(8936002)(44832011)(86362001)(110136005)(6666004)(2616005)(4326008)(70206006)(336012)(426003)(82310400003)(1076003)(83380400001)(2906002)(186003)(70586007)(26005)(36756003)(7696005)(508600001)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB6251 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT041.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: d5d596cd-dc95-4c7b-ab3e-08d97e8a29fb X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9UMxvly7c9LfuHITUmQhy3K2KZ1efgz8BFrzECO+BYdSUItM6dNRhG8qnNu/pPfzT33ecGHokezDjFKx6kOhb+aSaO5b4EvIXoJ+iUFH8PXBk7t4zEBcQ0x3B7yBJCMRnIlJApjyN6Q2lRhUoe+jVwXesR14SNnifVeOt7wpTEEpw9UfpNMOfq+ALU/SPKkiT8t50eRIH1sgIFYDN/D5WIDNcRgNPQGAXGKRVRpqZz3tfrHuftiQGWgXAndAXi12d29ULJt7GMSxUeW8ZVjlkYi2jTJ8fPXAfw+sbEoz4QgsRTLw7PnXqzP1hSMrFaGBS7txeSPFnZTStY5etnjhwzBtcuGAAmLtId918cfsOWlqi5Vm562X3xunqPNXl6XUHWupVIX8fTU+NrSEN091Tm/fS4qt9qPl8EqcW38gbtIHQtagprPN1OkuIltr98CELnCStcfZDZ5J9UM4DWZTqaMt0cudTOxGofnY/qiAopZZ6FTUY+VIlhwiteB6bTT3fkWffSBkH2jYJA5qaf/3NvTeNBlbe3eaFc4QrCgxOjTqo5ek324JDnbe8FiS/Py5kVIhJvmXkhSTPeA2gDzWx3IrADI7mJ/+D9zpJxGhzY3u1UNrAM5Ef3Lna5lD0MV5OzGLqFa6w/L3dEse6iBRh8MHvrJ/XisHdrrBmAarwXk/8KgtOKdzlcsHUJsx0zHGpVrN+vC1SdUyFr1gIKYqwA== X-Forefront-Antispam-Report: CIP:63.33.187.114;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-2.mta.getcheckrecipient.com;PTR:ec2-63-33-187-114.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(4636009)(46966006)(36840700001)(8936002)(186003)(86362001)(4326008)(508600001)(83380400001)(70586007)(426003)(82310400003)(2906002)(26005)(81166007)(7696005)(70206006)(47076005)(6666004)(44832011)(36756003)(36860700001)(316002)(1076003)(2616005)(8676002)(5660300002)(336012)(110136005);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2021 12:03:51.0522 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b31a1b0e-3918-4675-0fd5-08d97e8a3521 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.33.187.114];Helo=[64aa7808-outbound-2.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: VI1PR0801MB1727 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 othe nodes' memory, this is obviously not very reasonable. This means current NUMA code only can support node has continous memory blocks. However, on a physical machine, the addresses of multiple nodes can be interleaved. So in this patch, we add code to detect discontinous memory blocks for one node. NUMA initializtion will be failed and error messages will be printed when Xen detect such hardware configuration. Signed-off-by: Wei Chen --- xen/arch/x86/srat.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/xen/arch/x86/srat.c b/xen/arch/x86/srat.c index 7d20d7f222..2f08fa4660 100644 --- a/xen/arch/x86/srat.c +++ b/xen/arch/x86/srat.c @@ -271,6 +271,36 @@ acpi_numa_processor_affinity_init(const struct acpi_srat_cpu_affinity *pa) pxm, pa->apic_id, node); } +/* + * Check to see if there are other nodes within this node's range. + * We just need to check full contains situation. Because overlaps + * have been checked before by conflicting_memblks. + */ +static bool __init is_node_memory_continuous(nodeid_t nid, + paddr_t start, paddr_t end) +{ + nodeid_t i; + + struct node *nd = &nodes[nid]; + for_each_node_mask(i, memory_nodes_parsed) + { + /* Skip itself */ + if (i == nid) + continue; + + nd = &nodes[i]; + if (start < nd->start && nd->end < end) + { + printk(KERN_ERR + "NODE %u: (%"PRIpaddr"-%"PRIpaddr") intertwine with NODE %u (%"PRIpaddr"-%"PRIpaddr")\n", + nid, start, end, i, nd->start, nd->end); + return false; + } + } + + return true; +} + /* Callback for parsing of the Proximity Domain <-> Memory Area mappings */ void __init acpi_numa_memory_affinity_init(const struct acpi_srat_mem_affinity *ma) @@ -344,6 +374,12 @@ acpi_numa_memory_affinity_init(const struct acpi_srat_mem_affinity *ma) nd->start = start; if (nd->end < end) nd->end = end; + + /* Check whether this range contains memory for other nodes */ + if (!is_node_memory_continuous(node, nd->start, nd->end)) { + bad_srat(); + return; + } } } printk(KERN_INFO "SRAT: Node %u PXM %u %"PRIpaddr"-%"PRIpaddr"%s\n", From patchwork Thu Sep 23 12:02:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 12512525 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A7CD1C433FE for ; Thu, 23 Sep 2021 12:04:01 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 5C24960F4B for ; Thu, 23 Sep 2021 12:04:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5C24960F4B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.193819.345312 (Exim 4.92) (envelope-from ) id 1mTNSD-00072B-IH; Thu, 23 Sep 2021 12:03:53 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 193819.345312; Thu, 23 Sep 2021 12:03: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 1mTNSD-000724-Dk; Thu, 23 Sep 2021 12:03:53 +0000 Received: by outflank-mailman (input) for mailman id 193819; Thu, 23 Sep 2021 12:03:52 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNSB-0005KP-UZ for xen-devel@lists.xenproject.org; Thu, 23 Sep 2021 12:03:51 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (unknown [40.107.22.50]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 1eb32525-e5a8-45c0-aa12-c4acde350d6e; Thu, 23 Sep 2021 12:03:45 +0000 (UTC) Received: from DU2PR04CA0157.eurprd04.prod.outlook.com (2603:10a6:10:2b0::12) by AM6PR08MB4849.eurprd08.prod.outlook.com (2603:10a6:20b:c3::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.14; Thu, 23 Sep 2021 12:03:44 +0000 Received: from DB5EUR03FT037.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:2b0:cafe::f4) by DU2PR04CA0157.outlook.office365.com (2603:10a6:10:2b0::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:03:43 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT037.mail.protection.outlook.com (10.152.20.215) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:03:43 +0000 Received: ("Tessian outbound a492f2284909:v103"); Thu, 23 Sep 2021 12:03:42 +0000 Received: from f568312eedc8.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 95FF0764-608F-409F-816D-B7FE6DA940F1.1; Thu, 23 Sep 2021 12:03:30 +0000 Received: from EUR01-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id f568312eedc8.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 23 Sep 2021 12:03:30 +0000 Received: from DU2PR04CA0230.eurprd04.prod.outlook.com (2603:10a6:10:2b1::25) by AM9PR08MB6049.eurprd08.prod.outlook.com (2603:10a6:20b:2de::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13; Thu, 23 Sep 2021 12:03:29 +0000 Received: from DB5EUR03FT033.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:2b1:cafe::a4) by DU2PR04CA0230.outlook.office365.com (2603:10a6:10:2b1::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:03:29 +0000 Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT033.mail.protection.outlook.com (10.152.20.76) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:03:28 +0000 Received: from AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2308.14; Thu, 23 Sep 2021 12:03:28 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Thu, 23 Sep 2021 12:03:27 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Thu, 23 Sep 2021 12:03: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: 1eb32525-e5a8-45c0-aa12-c4acde350d6e 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=7+me4FoPz33FS1cQ5pOAkpgqjLy+g/9qUY65MaXt3uY=; b=rKYjq6WQv1Bgrpg0ZOkOGhWOb67ddyFqeC1zu2pWyTLWaNJgBC9WR13BAixZC/k3tt4rrmZge0AKh3UsV4X/aj9bGuP/EOtW8+SWg2FLoFlz7Xnv1jwt4HgCNQibX4d6SjdPk1EeIh+WmVHhZgAiJ5IplsTit4NlqPXeUEZr7Xk= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; X-CheckRecipientChecked: true X-CR-MTA-CID: 585b1ce00a515de2 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kVNJJfMRr8Ane83w7P6tHN1EJLgkv9HCKHJM5cRUHipLxd8Yj+CUcaz0WZYzKWKAM6cCbZD8jdia51kpvTVDHNBRdGKy+Hc79jp9f4L7LTRdhMrrnHI0RBsIPkljsBX/u0jz35SEVVpcO6e1Ql0lPWKVf3ANwf6S7npYy4s4HZ1aYv9QGGV7yksSryJFyCFW78lIfzcFWoVjXHCDSNqiJZJEj/wYQRcZnOV/390WJRJ5Mz7obLb1JGNyRK2FPxjXYbUlfGGv738s3MrQyIc2GnFr74j6O51eLHeq4Z/R20ltci+yQlkmDQTqW0+ARlvFQq6D5mEhUFvIYgLUzsy+gQ== 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; bh=7+me4FoPz33FS1cQ5pOAkpgqjLy+g/9qUY65MaXt3uY=; b=V4D92yE0UjSfZNXmoA/tnwYWl3sAAdUCOCjxx3RhEJ8ZL5NbfEYfZGe38eKtTO3D56Zvg79Kk/w1QYSc8uU9RB1YeI3oEo2buoCSsZ1Zmtr+hWE8356Mgq8kjKb5BFnYCcs3aNE+lR8uH/ET6vs2vPN2w4/lPvsALEFN5ntkm6qdbgbwEy/3ILCVEK5tCZW3aa4cYQR2tcJSwTK+2akoV489CIR2Nz96t1HxmMaKwnapY1qBWfxjKq77OGw0fe3rbrcVvQ7Wp07shqv9NI9v02jx+/+VSP4tOgUMqK46akUx/g3r6NwZI88q4Wix/64f2USZQSF7va0crXpwvRoMcA== 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=7+me4FoPz33FS1cQ5pOAkpgqjLy+g/9qUY65MaXt3uY=; b=rKYjq6WQv1Bgrpg0ZOkOGhWOb67ddyFqeC1zu2pWyTLWaNJgBC9WR13BAixZC/k3tt4rrmZge0AKh3UsV4X/aj9bGuP/EOtW8+SWg2FLoFlz7Xnv1jwt4HgCNQibX4d6SjdPk1EeIh+WmVHhZgAiJ5IplsTit4NlqPXeUEZr7Xk= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; From: Wei Chen To: , , , CC: Subject: [PATCH 09/37] xen/x86: introduce two helpers to access memory hotplug end Date: Thu, 23 Sep 2021 20:02:08 +0800 Message-ID: <20210923120236.3692135-10-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210923120236.3692135-1-wei.chen@arm.com> References: <20210923120236.3692135-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 76cdc768-a892-4049-c2d5-08d97e8a3086 X-MS-TrafficTypeDiagnostic: AM9PR08MB6049:|AM6PR08MB4849: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:6790;OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: RuUUUdBNTw2mQqdB6hKctYEwo7orXlwKISmDAvYkHG0pG/DMP8fazMz0ffjgrqpRVqmdcL4V5XniTIlsDuX4YaUI+XH+Rhj8COl0jqQ96CTm0mYEfiziEn+uw7N8catOFxnub38JZy/zQe2VyjHqRpxEQ7neS3Z1yBmo+WBDQ6pt8xpBVDgOTUpHuZ28vCXp1cRngGS9V9ITr0eTsz1zq0srBjh8t65zL/OjFn8rp5yIW2VfukswBOtxFWMfUAQcR5xvf7DSbx0okWajFkLaj8y7yVlSGTjhFofu49IhyTmeUBAIgaIfh9X7K8/1KDsbvpw/0iptgcbq2VuigbYzVFcITpipa1qwtn9/3xUwjfcByD+8k8c8DviPNjItB5xjAJrozPdbZIqYLcp40F3Ii9CX4hh6zqlN24om2jg5Y2EqSvxTzY92k2iu0g1fOnCArgsBip0Ch8ws9wkGqm9Ph3JVNdMADiqrMOYbV8KAOurv9bBYWlN37O1FJoGxB1H8HRVt7E6bBBmr8qHQ0UANtafxWGyiwQfnV92eH9IGtZS3dsvLxF84ctAkTzEUzhqoAO1DX5zNvDtAedChGHiGjCNqQh0ekGL/q0/1QZaqGWGkztKW2SBtmdhrgRVc32nhmhiKwlIwF+ZFc0rPgAWTPRe/u4cRgslYyuFYOghDzsPC60bKJrmYX1nJPgfomdGw5zlkiQcocZXRjBppz+dA5PlepjYRlXW1mca05NVnXUg= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(4636009)(36840700001)(46966006)(5660300002)(356005)(508600001)(186003)(2616005)(1076003)(81166007)(8936002)(36756003)(26005)(4326008)(426003)(8676002)(86362001)(336012)(47076005)(83380400001)(44832011)(36860700001)(70586007)(70206006)(7696005)(2906002)(110136005)(82310400003)(316002)(6666004)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR08MB6049 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT037.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: f642fd07-b7f4-4bc2-282f-08d97e8a27e5 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kL8SGwFY1oL/Yhchkippm4uPktKmc/NMabRtjfKqZRK7yliz0ZQINv9+Mwy7dLmG7mYD8p+QRWei3dTVDN10qWmktis5aygau4kvbV+ZrO3BUkBKmMxR71AfGVE7gAYv1cPlZZF9Msp14mSzJyW1WkNByytHBe/R5ZPAQZPmroRqww/v6HfpAQJDupa05ajRTD/YByAVQQ7pkexOta7r5atpd1AmifJi3nine2z5lLAviPVPlTtV82seqwUVyIa43rOUDNSxn5cIVcjKXj+kDaHJxn237V76bxVrKSYojJfZWC3jFiEcu5sl/4MStRWcmxNGB2qM8GW34RKPoBUR03AXwZgm6pd5sn/wnlrOr9QySVGqSCkJd+OkBrwOzfaq9yyKG0cG2IoX3mhliT+TrE61/QWrVuV145XOzx0Et3CBRJ9V62z1MZZWXhl4nu+Mg0ipNx2FvNIxCjhPdV4F93ANDXb5DvyphIuDBJs9aiLm1/dV1PTk1VSr9lsEfXIVm7Y/t7QJlbl+JR7Jps/ynrHgMu/ooGe1YHk2IHdE123/bwWRPXGA/juRL5YUcrdhb0SDW+rYH8MEv+er+IDmUufjKdjItjqvmxp5M25ccoVCxn5hTfm+nPn3FyO3vjMwRvYB3OTHUIMkEak8VCM7kMh95on8RvPv+dbRbXTbHmqoXILBzm/0OqQHhPmFjA+pZZuidintkCOqnWg3TmtxZQ== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(4636009)(36840700001)(46966006)(4326008)(1076003)(86362001)(7696005)(36860700001)(2616005)(8936002)(47076005)(186003)(508600001)(81166007)(426003)(83380400001)(336012)(70206006)(70586007)(5660300002)(2906002)(6666004)(44832011)(26005)(316002)(36756003)(82310400003)(110136005)(8676002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2021 12:03:43.4270 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 76cdc768-a892-4049-c2d5-08d97e8a3086 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: DB5EUR03FT037.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB4849 x86 provides a mem_hotplug to maintain the end of memory hotplug end address. This variable can be accessed out of mm.c. We want some code out of mm.c can be reused by other architectures without memory hotplug ability. So in this patch, we introduce these two helpers to replace mem_hotplug direct access. This will give the ability to stub these two API. Signed-off-by: Wei Chen --- xen/include/asm-x86/mm.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h index cb90527499..af2fc4b0cd 100644 --- a/xen/include/asm-x86/mm.h +++ b/xen/include/asm-x86/mm.h @@ -475,6 +475,16 @@ static inline int get_page_and_type(struct page_info *page, extern paddr_t mem_hotplug; +static inline void mem_hotplug_update_boundary(paddr_t end) +{ + mem_hotplug = end; +} + +static inline paddr_t mem_hotplug_boundary(void) +{ + return mem_hotplug; +} + /****************************************************************************** * With shadow pagetables, the different kinds of address start * to get get confusing. From patchwork Thu Sep 23 12:02:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 12512551 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3C62FC433EF for ; Thu, 23 Sep 2021 12:04:21 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id E889760EE7 for ; Thu, 23 Sep 2021 12:04:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E889760EE7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.193828.345356 (Exim 4.92) (envelope-from ) id 1mTNSW-0001BC-Cq; Thu, 23 Sep 2021 12:04:12 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 193828.345356; Thu, 23 Sep 2021 12:04:12 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNSW-0001Aq-6J; Thu, 23 Sep 2021 12:04:12 +0000 Received: by outflank-mailman (input) for mailman id 193828; Thu, 23 Sep 2021 12:04:10 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNSU-0006xV-O6 for xen-devel@lists.xenproject.org; Thu, 23 Sep 2021 12:04:10 +0000 Received: from EUR02-VE1-obe.outbound.protection.outlook.com (unknown [40.107.2.78]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 52d26e10-1c66-11ec-ba2e-12813bfff9fa; Thu, 23 Sep 2021 12:03:54 +0000 (UTC) Received: from DB6PR0501CA0042.eurprd05.prod.outlook.com (2603:10a6:4:67::28) by AS8PR08MB7063.eurprd08.prod.outlook.com (2603:10a6:20b:34b::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.15; Thu, 23 Sep 2021 12:03:50 +0000 Received: from DB5EUR03FT060.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:67:cafe::7f) by DB6PR0501CA0042.outlook.office365.com (2603:10a6:4:67::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:03:50 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT060.mail.protection.outlook.com (10.152.21.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:03:50 +0000 Received: ("Tessian outbound 78bf72cc015a:v103"); Thu, 23 Sep 2021 12:03:49 +0000 Received: from efa9648030a2.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 1D931F74-A602-4166-9477-DCDECB6C177E.1; Thu, 23 Sep 2021 12:03:39 +0000 Received: from EUR01-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id efa9648030a2.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 23 Sep 2021 12:03:39 +0000 Received: from AM5PR0602CA0002.eurprd06.prod.outlook.com (2603:10a6:203:a3::12) by AS8PR08MB6056.eurprd08.prod.outlook.com (2603:10a6:20b:299::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.14; Thu, 23 Sep 2021 12:03:37 +0000 Received: from AM5EUR03FT042.eop-EUR03.prod.protection.outlook.com (2603:10a6:203:a3:cafe::2e) by AM5PR0602CA0002.outlook.office365.com (2603:10a6:203:a3::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:03:37 +0000 Received: from nebula.arm.com (40.67.248.234) by AM5EUR03FT042.mail.protection.outlook.com (10.152.17.168) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:03:36 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.14; Thu, 23 Sep 2021 12:03:30 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Thu, 23 Sep 2021 12:03:28 +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: 52d26e10-1c66-11ec-ba2e-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=R3iJbN9Z/D/BKsINPG8vU2TydxYMORgZ/IZECSVdK5M=; b=Ggp0q+0NQWfK5pP+hhB//iP7G7iXZPfX1DGS9RMH/wtqHgoV4DaqFVbqFH2TnHPJBXDMCqFt4X3k5RofMo49hcwz703ZrH2x8QX5QcaYXcNQSlAYvPjfhmzYCAwD4oPmxdpM/X7DkdtSlJV7OhHyGIdo9G6N809Gw8tgxPY4Xyw= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; X-CheckRecipientChecked: true X-CR-MTA-CID: 83fdd838382d77e9 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DX++omQpgcZwp+kr6tHlHTcpyAB+Vvy8DJGSREttDOQk6NE+8iBhIOiS4BowpabmLtc61cC6IuuCInIHKekfli7HziZVb9L0Mej2volYkKVUPcYK1jARPf8s6PALywczjmLshesI8q1ktBBO7xSFGvkME/jDP+qLUdpTSurUOWlHZfBmziaIyTp5DcrgwugISlenUsWM72DBBS/wWvJRccX6wYvU8OR5cV3F+FhMXAcmCgE6a1SBSwPa1dEui3lGq3KHwQMT3wdqqz5KF3SxpxKpa4kPaZJYc1IBE09KOW953LmPRN/wxFWLc2F+QcMKkpxWLRiOwpYfj4+UZnHJxQ== 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; bh=R3iJbN9Z/D/BKsINPG8vU2TydxYMORgZ/IZECSVdK5M=; b=oOE3geR1EzoEqzzhmxhA9fj2MJ0BhJrv8c9LbCSw2WvOdfpye2b8+pBF3rLP2uLLXBiUQaBUp5pc5wnJw5x2a06Vn4PEEUWBniB+vT1p9YN+1InL+T14zy5QPNvMTlNhxYZ7Np/e0GUhPRjDZ0TJ4XXzqDMl0p1UcjrNk00WFEym7+wjahWYPTRpIpeTPdRtmj10sD5gOPsPHDOw/BsodzYliOnJ9tM8MHP9uMSss9/OI+dm6vIBzs6ieUou8VWKcSjMSM+FXgDEWbXOUqzgY1M8cI3N8qdrseS6D2PepI/qnz8ICMAF9VRYwotajqyoeQrLysLulZjSX5Hf/HtSdw== 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=R3iJbN9Z/D/BKsINPG8vU2TydxYMORgZ/IZECSVdK5M=; b=Ggp0q+0NQWfK5pP+hhB//iP7G7iXZPfX1DGS9RMH/wtqHgoV4DaqFVbqFH2TnHPJBXDMCqFt4X3k5RofMo49hcwz703ZrH2x8QX5QcaYXcNQSlAYvPjfhmzYCAwD4oPmxdpM/X7DkdtSlJV7OhHyGIdo9G6N809Gw8tgxPY4Xyw= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; From: Wei Chen To: , , , CC: Subject: [PATCH 10/37] xen/x86: use helpers to access/update mem_hotplug Date: Thu, 23 Sep 2021 20:02:09 +0800 Message-ID: <20210923120236.3692135-11-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210923120236.3692135-1-wei.chen@arm.com> References: <20210923120236.3692135-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7b2db7cb-3fd0-4c98-015a-08d97e8a34a7 X-MS-TrafficTypeDiagnostic: AS8PR08MB6056:|AS8PR08MB7063: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:1201;OLM:1201; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: vrNke+rC7Y4uRjIOePPoBbp0K10EFlfOAa1JteBra5a220WkdIVq2PDEmG1rSqpPJrhuaek0f2saxSDPVm3isW3nc7GbGWICj12hO5OQhINKl8z4w8bgq+5et0dIE6yNkuuPfo2gCsVlt34kQDgf+ninOfUI95aGZ4VHOIIPM0rsVwLfD2vtxNbnU3cL14zOg4PvmXxOC/I4vA2aX76guSRdNPORVGAP4ai2lqGkrFpu0O6gM2qy+31AsqVz0A8V8UxOKIUEhz+mCWbIiTAl/2vkaGaaIJuWzxTqIzzBEnavZZ1LC1j3SG3byBfnxQxsJ8wyOOdKCo7Q6U063J7pFgoPNEXHPzllFqkuBFc258BO2TFjDwTuh/5rMvT+wXTzS8mOX7bvgL3JXQk66ituSM/A7ZEq/RDzoFWioNUPY7U4feKuWnx8uZijgoOQes+FnVpKNHPlMM5LRy2lOJmat5ecAsni9VNqLUaDk4v0Udhrm9dg/jYpscVUGUteUga4PmKjA6Yy6myxnTngR5r3e0ueRNX0vhS3ZIJfJBM2pkFgzPYdGxxmXoKS7qJBD765NBrDhVM5yWBCPpgELLKRgPyrsGrMpezk619H71iJQ3zH+hj2pIOIiF3ktnoSb8diMiecw/KDXzvxnWTu+GvFWS6uQMBSwtxuzFL+a/YPm6YRbKc1hAe35auEK1v0PL4gHBLn7jaLDTDmnJwA+WSuASn6gNkl9gawd5g3PQ40bdI= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(4636009)(46966006)(36840700001)(8936002)(2616005)(4326008)(36756003)(316002)(186003)(356005)(86362001)(82310400003)(8676002)(6666004)(110136005)(426003)(336012)(44832011)(7696005)(2906002)(4744005)(508600001)(47076005)(5660300002)(36860700001)(70586007)(81166007)(26005)(70206006)(83380400001)(1076003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6056 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT060.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: db419007-5be9-4e60-97a2-08d97e8a2ca3 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ddIXjuWvIR4rJulL5ser2ASyFimea4KxEVUk3CRnfdjJGL78aSdPMGA9H/4uTm/d1nZcE3PjaCMCSTyHmWs3Q3OO0RNYMRncHvy+Mkayyz/L4g574MFHCfy5WYoKe2VagK+i0w2sZNMHCGrSJTjuTru510HV/ue1uhijIQ5LxFRSQA56QY1R5JQx0crunJYMr2EnlrjC2ZpIRBXmwB20DC9ULeguw1rPZq3aYOjhRf9s5HbxD10U7V8W2CFxFy7NPhnCUXUcNUZOxm/vjjSjAV2pfnQ0kQU5AGNYl9usyvCdliWkyHN994iL4IWzEDjIXNniXnbaFmgIZ3o4O3hyrKXnRTUjcqRue6QNimq/zxME63Tz11SGU4ix3C2CSF2fGs9GlSvFMV7qhKcUd7Xk5LcpbtjySwvxAPT7LonYBRPWfofIKuA2cqm2EP5KWO1eDRvKhaL3kxl559M5/5z/nTvkkeLY3CqfU7d0EPwnXzHAkKfX0Bpy3cf/29p9oXNJij3wk8lDQDqfom/aOY5EogumrL7euvhL3+ZrEG4gykSjDXwEmI2UBnFcxthhzU0OuNYCVoJckPKUa/1Fbjv8nnhlkMC92/fSJ21tKaBLwGeJA0gcvviMOyVnjiWUTp8pBD4TeGZvYpNlPMM5Trt92b43li2JA5kMGSj179kOrjJTAQb5Ca9cL+yarz9D29sd/v5/xmz7SO66gR+7ohxnWg== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(4636009)(36840700001)(46966006)(82310400003)(1076003)(36860700001)(4744005)(508600001)(70586007)(7696005)(70206006)(426003)(316002)(5660300002)(8936002)(86362001)(110136005)(4326008)(6666004)(336012)(2616005)(81166007)(2906002)(44832011)(26005)(186003)(83380400001)(8676002)(36756003)(47076005);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2021 12:03:50.3502 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7b2db7cb-3fd0-4c98-015a-08d97e8a34a7 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: DB5EUR03FT060.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB7063 We want to abstract code from acpi_numa_memory_affinity_init. But mem_hotplug is coupled with x86. In this patch, we use helpers to repace mem_hotplug direct accessing. This will allow most code can be common. Signed-off-by: Wei Chen --- xen/arch/x86/srat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/srat.c b/xen/arch/x86/srat.c index 2f08fa4660..3334ede7a5 100644 --- a/xen/arch/x86/srat.c +++ b/xen/arch/x86/srat.c @@ -391,8 +391,8 @@ acpi_numa_memory_affinity_init(const struct acpi_srat_mem_affinity *ma) memblk_nodeid[num_node_memblks] = node; if (ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE) { __set_bit(num_node_memblks, memblk_hotplug); - if (end > mem_hotplug) - mem_hotplug = end; + if (end > mem_hotplug_boundary()) + mem_hotplug_update_boundary(end); } num_node_memblks++; } From patchwork Thu Sep 23 12:02:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 12512547 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F0A6FC433F5 for ; Thu, 23 Sep 2021 12:04:12 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 9C8EB60F11 for ; Thu, 23 Sep 2021 12:04:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 9C8EB60F11 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.193823.345334 (Exim 4.92) (envelope-from ) id 1mTNSM-0008FK-FW; Thu, 23 Sep 2021 12:04:02 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 193823.345334; Thu, 23 Sep 2021 12:04: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 1mTNSM-0008Ea-A9; Thu, 23 Sep 2021 12:04:02 +0000 Received: by outflank-mailman (input) for mailman id 193823; Thu, 23 Sep 2021 12:04:00 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNSK-0006xV-Nj for xen-devel@lists.xenproject.org; Thu, 23 Sep 2021 12:04:00 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (unknown [40.107.21.62]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 51a1c4be-1c66-11ec-ba2e-12813bfff9fa; Thu, 23 Sep 2021 12:03:52 +0000 (UTC) Received: from PR0P264CA0139.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1a::31) by AM9PR08MB6915.eurprd08.prod.outlook.com (2603:10a6:20b:30f::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.15; Thu, 23 Sep 2021 12:03:49 +0000 Received: from VE1EUR03FT064.eop-EUR03.prod.protection.outlook.com (2603:10a6:100:1a:cafe::d9) by PR0P264CA0139.outlook.office365.com (2603:10a6:100:1a::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:03:49 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT064.mail.protection.outlook.com (10.152.19.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:03:49 +0000 Received: ("Tessian outbound 45760a30af4a:v103"); Thu, 23 Sep 2021 12:03:48 +0000 Received: from ec9bdfbe0915.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 04BA987C-A848-48A6-BA73-490F24ED3F12.1; Thu, 23 Sep 2021 12:03:35 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id ec9bdfbe0915.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 23 Sep 2021 12:03:35 +0000 Received: from DB6PR07CA0021.eurprd07.prod.outlook.com (2603:10a6:6:2d::31) by AM0PR08MB4322.eurprd08.prod.outlook.com (2603:10a6:208:148::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13; Thu, 23 Sep 2021 12:03:33 +0000 Received: from DB5EUR03FT019.eop-EUR03.prod.protection.outlook.com (2603:10a6:6:2d:cafe::cc) by DB6PR07CA0021.outlook.office365.com (2603:10a6:6:2d::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.8 via Frontend Transport; Thu, 23 Sep 2021 12:03:33 +0000 Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT019.mail.protection.outlook.com (10.152.20.163) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:03:32 +0000 Received: from AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2308.14; Thu, 23 Sep 2021 12:03:33 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Thu, 23 Sep 2021 12:03:31 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Thu, 23 Sep 2021 12:03:30 +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: 51a1c4be-1c66-11ec-ba2e-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Rv+ePpm3yVoMrcs6MF1PccZI0uYzJEbD1D1+NGjLnZY=; b=Anai8pLH5joOUnO6M+9wv1bFAgkUmXITxrBlIzNr2FQAJFNbJNwUk6SZVD9FaxlmMiXecqHF+8dVALOMAT4jRsEE1WVbJrAWOZVEFSIverbAKX1RS/SIRwUL3sSKE+AbqHmQPJD0fezhoD8ne5HTqpm88u9+g/EnHXBMn64hQYY= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; X-CheckRecipientChecked: true X-CR-MTA-CID: 5c9c0cfae6dac015 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=caz+a442gJEyjiBHQq/LjUEUYkTHZCKBOrNweA+RyRafJ0Nt3tRT2YLZyWlg+q/Ggfe8/+N6aeBsKInC0UFIJeqLK/Cqgd8p0af0mlE/6FetTY5+DEM2SG9s87K2tlziY8B9+41VggDlKwsYTaVGnaKQ2lY83aZSwDiZPZHMpkatiHuiPTIJ9bFbparH9vcGElwXW0eRc5eEGPE85rrEYzpGLbJc9C2524LCfnjUKTiU20lWKV7Gb0segajXw2vP+rWEwr1nrTcEvOzJ2JJELlY9Obx1by0Ne4D+Fp+eeaQwCdFS29YGf7ooZAaC4haU8M2krF3ki6yF2qy5Ez6nNA== 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; bh=Rv+ePpm3yVoMrcs6MF1PccZI0uYzJEbD1D1+NGjLnZY=; b=NrrE/cJ4Cja/BXbkht3VAPTzmNsykgoit364WxV6FfrvwD6jLy/VuehNjyPDMQln8SoDSC6NCY575yo2CquWVrneU2z8PO3rRTeUtje0DFqaHLEaGTwcxoBPX5UsIQJK+bTjccdhbCgHpHZuqwulE6L8ePzsm5gZiSJfnCmWkZ05bBx1FGqO44z5+3rHJYF2OTDmcH6pxGZjAuEH4PrMfK9qKKuo/WGcyGPQU1nAsLV7BtiuBhTstekI0CZl2WhF2U5/p4JoMJpq0U9OaLsHk91mZvKlqwixgIW7quVWeameZNpL63NR+jFHqiHmfq9SDcAFiUaAEkQlYI4MFqM1aQ== 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=Rv+ePpm3yVoMrcs6MF1PccZI0uYzJEbD1D1+NGjLnZY=; b=Anai8pLH5joOUnO6M+9wv1bFAgkUmXITxrBlIzNr2FQAJFNbJNwUk6SZVD9FaxlmMiXecqHF+8dVALOMAT4jRsEE1WVbJrAWOZVEFSIverbAKX1RS/SIRwUL3sSKE+AbqHmQPJD0fezhoD8ne5HTqpm88u9+g/EnHXBMn64hQYY= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; From: Wei Chen To: , , , CC: Subject: [PATCH 11/37] xen/x86: abstract neutral code from acpi_numa_memory_affinity_init Date: Thu, 23 Sep 2021 20:02:10 +0800 Message-ID: <20210923120236.3692135-12-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210923120236.3692135-1-wei.chen@arm.com> References: <20210923120236.3692135-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 89db300a-2116-4361-844c-08d97e8a3428 X-MS-TrafficTypeDiagnostic: AM0PR08MB4322:|AM9PR08MB6915: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:3276;OLM:3276; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 0BvzLm+wBVJPHsPB+W4VPN4D5VgiLLjEMy6E4snzslUHLMoaPiqc+YEVJwTqXiQXXgvswNJier6CZBSzUlhkHSiP00j3oxhxzL0BLuP1IiM9ul+gVWdDuA2nCyD3izu6Ci65Oh93oc5XsiBY0gUwQcQLwGcXD8PI1EXgjh/QWeQCSrA2wT69dJtK+cdehtisXfGqhQK0M5Otqgv2LeNUnEqDCzMIIO2ImyM+koYV9uZH8smc4lVIAsh2/+zAprwD92N+LSO6zCxtqdAoGHtp7WApNRsMQVvuYXdMoaGrbE3Zx1k41aEPmNdk+eFEXD38sPptRbcDE9BQul9oV3TxNPJdeCJhNIpF9wSqAkMPVE1v209R0LaBBLtUXkpo3lH1rfIrzgKLRXeD0kVjyNowkxfk6XEbKARFsmqONWtPpzPFlZLnMDn7x9MC5Kha76qzdR8Qiaf4xHCnbv2C4e9Swb6xhsteNPKywf5+h0dOsTSZ5t6pIMblOASt3/8o6FUaKtZu5NiA8D2xP3xqkxrltcycWatYgzbRjvlIJodT+REpepdIiEaafVN0Cm2nvPJiIGjq2sKI4nWa1VE3dHSpBdzG7ZYXDqBEAQgf1GbDKeuh0knMuNUJvdn4pzhgcsI66Dj/7WgY5DMwtHG3G9XublxzS8GqK0ot1Ag2+YXiboDM5M5cOOjG1geL4fOicWv1ShAsNk+4V4UVx6xbJvyLOuQ7Pc5twH3vB0EjE2dg6tw= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(4636009)(36840700001)(46966006)(426003)(47076005)(8676002)(44832011)(86362001)(186003)(4326008)(336012)(2616005)(83380400001)(508600001)(1076003)(70586007)(316002)(6666004)(5660300002)(36860700001)(356005)(70206006)(7696005)(81166007)(26005)(82310400003)(8936002)(110136005)(2906002)(36756003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB4322 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT064.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: fbca8517-66ee-4a60-4ffb-08d97e8a2a34 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /8u5CeDp/RMSFVHId4o0u3V9GZpWYthLVF2m3o6F2MpOwtfdOPYlG1xtI8iX7eo1CHhCjdzz3upyFkdIuwJKsZOg97YI2MYtgs816Vn2TCiyC0kPAbv3xWKMPXvBDJRKnBkHskcigphP/7+V23pGWjgEkaRkXCIlExnJCIpGROrpEZPgh+dxPXiVC8eZBGVEYCDgp8JhfcE9yGK0rUGjU2yo2tXvyw+uVTnFdEd8/q6O2kBzcsYmeZ4UUkQ0muimWROpdPkk2VlL3a6WLLlu4LtiXhRZWpnoH39DN/I6SbvgydFVVH51Fz5hQQWMsGyXF5Vhz/PB67OTmwWP3g2jPLDzXKNeous7DAK9rairq2GvcQ+e40Hix5Kx8xd3NFlKwH+eOMhkdJQuJhel656H2NK8b9H+TueAyA7cmN8A0FLk9MMY7WLbFf5/IsfE8gybXCmHrRrxhyuKF4b58t7eLAFalRdzSdL6qeuMfXR/mpwXWZJW0HA7Oa6ydksw9WWVWAvFCQCwgKAVT+L/KmSmYeAJ2684SquJ1L9tyilYElIY4ryuDkqRtxBKx00b1fOt0ki5yaa5GWu2vFx/NZrsHNklpYQlQpKQilSrWw5U6Y45idtHialTsvcRRaMu83jxgzDZWkguIyJ9xanzPYf+nYn1z7kjVBq7tRe6UImo43EIJsjB1GRw/aKZl9eHF36xs1rYRit2gpdefg5O6SfZzQ== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(4636009)(36840700001)(46966006)(2616005)(1076003)(26005)(44832011)(81166007)(86362001)(70586007)(4326008)(83380400001)(47076005)(6666004)(36860700001)(508600001)(336012)(82310400003)(110136005)(426003)(8676002)(8936002)(70206006)(186003)(316002)(5660300002)(36756003)(7696005)(2906002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2021 12:03:49.4274 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 89db300a-2116-4361-844c-08d97e8a3428 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR03FT064.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR08MB6915 There is some code in acpi_numa_memory_affinity_init to update node memory range and update node_memblk_range array. This code is not ACPI specific, it can be shared by other NUMA implementation, like device tree based NUMA implementation. So in this patch, we abstract this memory range and blocks relative code to a new function. This will avoid exporting static variables like node_memblk_range. And the PXM in neutral code print messages have been replaced by NODE, as PXM is ACPI specific. Signed-off-by: Wei Chen --- xen/arch/x86/srat.c | 131 +++++++++++++++++++++---------------- xen/include/asm-x86/numa.h | 3 + 2 files changed, 77 insertions(+), 57 deletions(-) diff --git a/xen/arch/x86/srat.c b/xen/arch/x86/srat.c index 3334ede7a5..18bc6b19bb 100644 --- a/xen/arch/x86/srat.c +++ b/xen/arch/x86/srat.c @@ -104,6 +104,14 @@ nodeid_t setup_node(unsigned pxm) return node; } +bool __init numa_memblks_available(void) +{ + if (num_node_memblks < NR_NODE_MEMBLKS) + return true; + + return false; +} + int valid_numa_range(paddr_t start, paddr_t end, nodeid_t node) { int i; @@ -301,69 +309,35 @@ static bool __init is_node_memory_continuous(nodeid_t nid, return true; } -/* Callback for parsing of the Proximity Domain <-> Memory Area mappings */ -void __init -acpi_numa_memory_affinity_init(const struct acpi_srat_mem_affinity *ma) +/* Neutral NUMA memory affinity init function for ACPI and DT */ +int __init numa_update_node_memblks(nodeid_t node, + paddr_t start, paddr_t size, bool hotplug) { - paddr_t start, end; - unsigned pxm; - nodeid_t node; + paddr_t end = start + size; int i; - if (srat_disabled()) - return; - if (ma->header.length != sizeof(struct acpi_srat_mem_affinity)) { - bad_srat(); - return; - } - if (!(ma->flags & ACPI_SRAT_MEM_ENABLED)) - return; - - start = ma->base_address; - end = start + ma->length; - /* Supplement the heuristics in l1tf_calculations(). */ - l1tf_safe_maddr = max(l1tf_safe_maddr, ROUNDUP(end, PAGE_SIZE)); - - if (num_node_memblks >= NR_NODE_MEMBLKS) - { - dprintk(XENLOG_WARNING, - "Too many numa entry, try bigger NR_NODE_MEMBLKS \n"); - bad_srat(); - return; - } - - pxm = ma->proximity_domain; - if (srat_rev < 2) - pxm &= 0xff; - node = setup_node(pxm); - if (node == NUMA_NO_NODE) { - bad_srat(); - return; - } - /* It is fine to add this area to the nodes data it will be used later*/ + /* 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); + bool mismatch = !hotplug != !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, + printk("%sSRAT: NODE %u (%"PRIpaddr"-%"PRIpaddr") overlaps with itself (%"PRIpaddr"-%"PRIpaddr")\n", + mismatch ? KERN_ERR : KERN_WARNING, node, start, end, node_memblk_range[i].start, node_memblk_range[i].end); if (mismatch) { - bad_srat(); - return; + return -1; } } else { printk(KERN_ERR - "SRAT: PXM %u (%"PRIpaddr"-%"PRIpaddr") overlaps with PXM %u (%"PRIpaddr"-%"PRIpaddr")\n", - pxm, start, end, node_to_pxm(memblk_nodeid[i]), + "SRAT: NODE %u (%"PRIpaddr"-%"PRIpaddr") overlaps with NODE %u (%"PRIpaddr"-%"PRIpaddr")\n", + node, start, end, memblk_nodeid[i], node_memblk_range[i].start, node_memblk_range[i].end); - bad_srat(); - return; + return -1; } - if (!(ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE)) { + + if (!hotplug) { struct node *nd = &nodes[node]; if (!node_test_and_set(node, memory_nodes_parsed)) { @@ -375,26 +349,69 @@ acpi_numa_memory_affinity_init(const struct acpi_srat_mem_affinity *ma) if (nd->end < end) nd->end = end; - /* Check whether this range contains memory for other nodes */ - if (!is_node_memory_continuous(node, nd->start, nd->end)) { - bad_srat(); - return; - } + if (!is_node_memory_continuous(node, nd->start, nd->end)) + return -1; } } - printk(KERN_INFO "SRAT: Node %u PXM %u %"PRIpaddr"-%"PRIpaddr"%s\n", - node, pxm, start, end, - ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE ? " (hotplug)" : ""); + + printk(KERN_INFO "SRAT: Node %u %"PRIpaddr"-%"PRIpaddr"%s\n", + node, start, end, hotplug ? " (hotplug)" : ""); node_memblk_range[num_node_memblks].start = start; node_memblk_range[num_node_memblks].end = end; memblk_nodeid[num_node_memblks] = node; - if (ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE) { + if (hotplug) { __set_bit(num_node_memblks, memblk_hotplug); if (end > mem_hotplug_boundary()) mem_hotplug_update_boundary(end); } num_node_memblks++; + + return 0; +} + +/* Callback for parsing of the Proximity Domain <-> Memory Area mappings */ +void __init +acpi_numa_memory_affinity_init(const struct acpi_srat_mem_affinity *ma) +{ + unsigned pxm; + nodeid_t node; + int ret; + + if (srat_disabled()) + return; + if (ma->header.length != sizeof(struct acpi_srat_mem_affinity)) { + bad_srat(); + return; + } + if (!(ma->flags & ACPI_SRAT_MEM_ENABLED)) + return; + + /* Supplement the heuristics in l1tf_calculations(). */ + l1tf_safe_maddr = max(l1tf_safe_maddr, + ROUNDUP((ma->base_address + ma->length), PAGE_SIZE)); + + if (!numa_memblks_available()) + { + dprintk(XENLOG_WARNING, + "Too many numa entry, try bigger NR_NODE_MEMBLKS \n"); + bad_srat(); + return; + } + + pxm = ma->proximity_domain; + if (srat_rev < 2) + pxm &= 0xff; + node = setup_node(pxm); + if (node == NUMA_NO_NODE) { + bad_srat(); + return; + } + + ret = numa_update_node_memblks(node, ma->base_address, ma->length, + ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE); + if (ret != 0) + bad_srat(); } /* Sanity check to catch more bad SRATs (they are amazingly common). diff --git a/xen/include/asm-x86/numa.h b/xen/include/asm-x86/numa.h index 50cfd8e7ef..5772a70665 100644 --- a/xen/include/asm-x86/numa.h +++ b/xen/include/asm-x86/numa.h @@ -74,6 +74,9 @@ static inline __attribute__((pure)) nodeid_t phys_to_nid(paddr_t addr) NODE_DATA(nid)->node_spanned_pages) extern int valid_numa_range(paddr_t start, paddr_t end, nodeid_t node); +extern bool numa_memblks_available(void); +extern int numa_update_node_memblks(nodeid_t node, + paddr_t start, paddr_t size, bool hotplug); void srat_parse_regions(paddr_t addr); extern u8 __node_distance(nodeid_t a, nodeid_t b); From patchwork Thu Sep 23 12:02:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 12512553 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 09A25C433F5 for ; Thu, 23 Sep 2021 12:04:22 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id B570760EE7 for ; Thu, 23 Sep 2021 12:04:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B570760EE7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.193829.345367 (Exim 4.92) (envelope-from ) id 1mTNSX-0001V9-OM; Thu, 23 Sep 2021 12:04:13 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 193829.345367; Thu, 23 Sep 2021 12:04:13 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNSX-0001Sr-Iq; Thu, 23 Sep 2021 12:04:13 +0000 Received: by outflank-mailman (input) for mailman id 193829; Thu, 23 Sep 2021 12:04:12 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNSV-0005KP-VY for xen-devel@lists.xenproject.org; Thu, 23 Sep 2021 12:04:12 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (unknown [2a01:111:f400:7d00::612]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id d394736b-4044-490a-81d9-6cb0a001eed6; Thu, 23 Sep 2021 12:03:50 +0000 (UTC) Received: from DU2PR04CA0312.eurprd04.prod.outlook.com (2603:10a6:10:2b5::17) by DB9PR08MB6444.eurprd08.prod.outlook.com (2603:10a6:10:23c::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.17; Thu, 23 Sep 2021 12:03:46 +0000 Received: from DB5EUR03FT049.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:2b5:cafe::79) by DU2PR04CA0312.outlook.office365.com (2603:10a6:10:2b5::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.16 via Frontend Transport; Thu, 23 Sep 2021 12:03:46 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT049.mail.protection.outlook.com (10.152.20.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:03:46 +0000 Received: ("Tessian outbound ab2dc3678fa9:v103"); Thu, 23 Sep 2021 12:03:45 +0000 Received: from b4c9112bdd82.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 2B438CB3-7A90-4A1A-8800-96D502AF91C5.1; Thu, 23 Sep 2021 12:03:38 +0000 Received: from EUR02-AM5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id b4c9112bdd82.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 23 Sep 2021 12:03:38 +0000 Received: from DB6P18901CA0018.EURP189.PROD.OUTLOOK.COM (2603:10a6:4:16::28) by PAXPR08MB7155.eurprd08.prod.outlook.com (2603:10a6:102:208::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.15; Thu, 23 Sep 2021 12:03:35 +0000 Received: from DB5EUR03FT048.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:16:cafe::b) by DB6P18901CA0018.outlook.office365.com (2603:10a6:4:16::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:03:35 +0000 Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT048.mail.protection.outlook.com (10.152.21.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:03:35 +0000 Received: from AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2308.14; Thu, 23 Sep 2021 12:03:35 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Thu, 23 Sep 2021 12:03:33 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Thu, 23 Sep 2021 12:03: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: d394736b-4044-490a-81d9-6cb0a001eed6 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=c+6OH5SULDNhvZukoMondUWr5/a4eP4oQVaqRYS7JR4=; b=fbTILkyCZL7qIulNFWBwMrxcGvVjZAIMRcmTcKRFTRtReussNbGbSsGm1JMUsTgOlXkeJr6dr792trAI65njeodFr7dnUOlZLHhCbL/zlvhAe56KLOxAjFNvHoWof24CVcTLO1Xto7QDqinfBppmB81CAr6SeBlObLMtsIx4hGw= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; X-CheckRecipientChecked: true X-CR-MTA-CID: 285d174cee0d49fe X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XcZUeDkPntqMvBzx0dIDmC9IZ1qiRAyQCpQoOIWpLh8SWkSV4nZCsRKgyheWfdfHbsXiJwFi+8O1Jdy4Nrrx3kDSvDeFtgKrqCcFRcNOxxivQXoZoiFj67gO+XiGVDVescKY8n4Cm43AhJUwe9PCvMPDk8sILfPOK662gPsqDRshI60YtP4lx2FeC3jfP95HJr/XdAPtf33S17o920uP/LsaSTlqmb5TzPErOvHfTCKomL7BEQfOZyactmfAPCSClJBRYKoFqQC1D8kzfQiy2jdazvY2yVl6YKtBexPcbDk6UnRpLME2do7u4GaDyk3Sr68NSgX/xbuoG67Dv0kNxw== 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; bh=c+6OH5SULDNhvZukoMondUWr5/a4eP4oQVaqRYS7JR4=; b=iVhlRH7sIToqiLy9ZMX16nhC63sb5bbhR+N9N5xO39OnH1nOqkyv29hgGKrkxTQe8ZU4ntray/Jdpy3EAqpYK3/VwDm37zzfZquKPNDHtc9qimafG63ONF7NQgMnXTIntdOv00iG+iWTXdi3H0eCMm1gUj8sXFr9hunl741m55tnwpUeKVwG5rD7Xg4pjQ3xcFuwUd2Uf7FU7ww8FD3NEb1B2cZa/nFNEmsybndnfgApZ0HYdl1EgiKMGEjRjXs0ZR3Nb5lN/6456Pj1wkjmGDPLTX41K+kFMpbsWZ3RARDNA86fbvplXSa2WPKKEtRUXMQBrIagpGZu4dUnWw2YBg== 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=c+6OH5SULDNhvZukoMondUWr5/a4eP4oQVaqRYS7JR4=; b=fbTILkyCZL7qIulNFWBwMrxcGvVjZAIMRcmTcKRFTRtReussNbGbSsGm1JMUsTgOlXkeJr6dr792trAI65njeodFr7dnUOlZLHhCbL/zlvhAe56KLOxAjFNvHoWof24CVcTLO1Xto7QDqinfBppmB81CAr6SeBlObLMtsIx4hGw= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; From: Wei Chen To: , , , CC: Subject: [PATCH 12/37] xen/x86: decouple nodes_cover_memory from E820 map Date: Thu, 23 Sep 2021 20:02:11 +0800 Message-ID: <20210923120236.3692135-13-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210923120236.3692135-1-wei.chen@arm.com> References: <20210923120236.3692135-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7d901cae-12cb-4f5a-b7a4-08d97e8a3225 X-MS-TrafficTypeDiagnostic: PAXPR08MB7155:|DB9PR08MB6444: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:4941;OLM:4941; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: Y/8E4fLFkv2vvubolkdZlZbupIXtLOZqH8jdRUw9zou9+e8KrxHLiY4maUMwvvlDHflLfW0rfFbi+5VIGYE0qOsTTKkdewxxYTeYOTHCM3pW7CHrAC0LoYSID5TAQNlW1kzMdOIugoLzYwfH0aCFqMAnj1LmGVVg0ogvJg9jd4PBoFvlBC9CQtW6NgROthYJJbmcydFIL/b/nhUpatuOq07eUmZhr0ffqBM78D4iQNhQzuxWxnmsh6MMwAPEKiQ+n0UzzBTY4sJyi39Vmqsr4RAdfONQCbIn+1PcajPj6tIxlM6fK0cLJ7end4oYwTy7x2IJp2KgbCEQq8oBn0ygtQG1U0tO87nqztTa2QYcXiWPjmEO7MtaH/aMS1t2OMU/quN0SYNUjd7tUTclvzIPVaBCwRlJHibWjA53f1GAOdubwlPPp8zGB5WCL1LbpsXVOdWZqbUqAhHVidtIIszrsQ4Di3t5zuRoiO3j6K3CQx7ZIWd7tpzuwPezobJCQJIm4iSQ7jDN12N5VB1hMqRhHck41OcCDDiHIXGCe2VcFXim6bXCLg7pe58iIpNsnhCKrYhRErNNgT1OGixLGx8mnhrydUHMcPyHe6byHDNBvOCAMHTGq1X60LJQehL8aalN4PFsDMLCD+5c3uJvA/QIFLlgd7bM+UZm5htEBxClgCdPkMOp4n95vXOV7dusfHLeYd1Jmb0B0UQ+3IxgWjcd6SdhJxMmy7GQ/3dy2xXhnIM= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(4636009)(46966006)(36840700001)(81166007)(36860700001)(356005)(8676002)(47076005)(316002)(5660300002)(8936002)(44832011)(86362001)(110136005)(6666004)(2616005)(4326008)(70206006)(336012)(426003)(82310400003)(1076003)(83380400001)(2906002)(186003)(70586007)(26005)(36756003)(7696005)(508600001)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB7155 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT049.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 6d3c7c15-4802-472f-917c-08d97e8a2ba8 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: c5Lu+AcCBJ8cKTEWK0C9eChhatlTtswOacl7oUAcJGHJtoeiHsm46SD6r20Jf5SQyEdqgzbbt43E7Fj9ZvaXc5T/pil16Pf8b4ohwUjNYO6KiKn6M1/6HGqZtQYC6b6H4Qk6vBHWkoG+8c6Uj542MgVsgKVfbyYi6JlHCZZ8TPqfeQR6/rR+K4f0lPVpURf+ljl85M6l7GtbcwM146uRWTXSGqPDoJ+fztjwzrGWo2Y0tcIRTdq8+seNdddQhbT8gQgG3wM4DazRDWNX6TaEKZHgsjOX3nqjQGrHk9xt1xWtaPzqmq8rM1jOrP6si6QEVlGe/AMQsiLRCXDBRGZgbjNHdRkcKsJRoyKAQcjV1/bh8N3yBtZ2dgPm6dsTfUM+qcjko5r/2zLDfG/0Xr4lrkQ2jiISqLeLmfkGfL0ewtIiJKoJjBNM6esvdj6UFLQRdRAqjqeZtjR5ihwXBDkPfJ7ajH7AMr4p6ZjphhPPuvNElRciTVpONiFdlpgBG078iSDYmfpKohhZKh2N9gPV97ITLxdXNub+y6LzmXCorUXRXK0FLVc0GG6tnbNmmQc5Gb5a8VtjBuQQgoQNoD2EmLMxQMMjtuLkHG2ktMPb03xPf7wwP2igDiWRcVPlDwltVSzU/NSFEiAY1eCNAzALbPXwlX5x5zT5C+OA+OtS4Ispd3GEU4udMZgFlMJjrhetvkKAR2yc8kdoIjPZ1kR5Xg== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(4636009)(36840700001)(46966006)(2906002)(316002)(2616005)(44832011)(508600001)(8936002)(36860700001)(70206006)(47076005)(4326008)(7696005)(6666004)(336012)(426003)(5660300002)(186003)(36756003)(26005)(8676002)(70586007)(1076003)(81166007)(83380400001)(86362001)(82310400003)(110136005);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2021 12:03:46.1480 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7d901cae-12cb-4f5a-b7a4-08d97e8a3225 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DB5EUR03FT049.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB6444 We will reuse nodes_cover_memory for Arm to check its bootmem info. So we introduce two arch helpers to get memory map's entry number and specified entry's range: arch_get_memory_bank_number arch_get_memory_bank_range Depends above two helpers, we make nodes_cover_memory become architecture independent. And the only change from an x86 perspective is the additional checks: !start || !end Signed-off-by: Wei Chen --- xen/arch/x86/numa.c | 18 ++++++++++++++++++ xen/arch/x86/srat.c | 11 ++++------- xen/include/asm-x86/numa.h | 3 +++ 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/xen/arch/x86/numa.c b/xen/arch/x86/numa.c index 6337bbdf31..6bc4ade411 100644 --- a/xen/arch/x86/numa.c +++ b/xen/arch/x86/numa.c @@ -378,6 +378,24 @@ unsigned int arch_have_default_dmazone(void) return ( num_online_nodes() > 1 ) ? 1 : 0; } +uint32_t __init arch_meminfo_get_nr_bank(void) +{ + return e820.nr_map; +} + +int __init arch_meminfo_get_ram_bank_range(uint32_t bank, + paddr_t *start, paddr_t *end) +{ + if (e820.map[bank].type != E820_RAM || !start || !end) { + return -1; + } + + *start = e820.map[bank].addr; + *end = e820.map[bank].addr + e820.map[bank].size; + + return 0; +} + static void dump_numa(unsigned char key) { s_time_t now = NOW(); diff --git a/xen/arch/x86/srat.c b/xen/arch/x86/srat.c index 18bc6b19bb..aa07a7e975 100644 --- a/xen/arch/x86/srat.c +++ b/xen/arch/x86/srat.c @@ -419,17 +419,14 @@ acpi_numa_memory_affinity_init(const struct acpi_srat_mem_affinity *ma) static int __init nodes_cover_memory(void) { int i; + uint32_t nr_banks = arch_meminfo_get_nr_bank(); - for (i = 0; i < e820.nr_map; i++) { + for (i = 0; i < nr_banks; i++) { int j, found; paddr_t start, end; - if (e820.map[i].type != E820_RAM) { + if (arch_meminfo_get_ram_bank_range(i, &start, &end)) continue; - } - - start = e820.map[i].addr; - end = e820.map[i].addr + e820.map[i].size; do { found = 0; @@ -448,7 +445,7 @@ static int __init nodes_cover_memory(void) } while (found && start < end); if (start < end) { - printk(KERN_ERR "SRAT: No PXM for e820 range: " + printk(KERN_ERR "SRAT: No NODE for memory map range: " "%"PRIpaddr" - %"PRIpaddr"\n", start, end); return 0; } diff --git a/xen/include/asm-x86/numa.h b/xen/include/asm-x86/numa.h index 5772a70665..78e044a390 100644 --- a/xen/include/asm-x86/numa.h +++ b/xen/include/asm-x86/numa.h @@ -82,5 +82,8 @@ void srat_parse_regions(paddr_t addr); extern u8 __node_distance(nodeid_t a, nodeid_t b); unsigned int arch_get_dma_bitsize(void); unsigned int arch_have_default_dmazone(void); +extern uint32_t arch_meminfo_get_nr_bank(void); +extern int arch_meminfo_get_ram_bank_range(uint32_t bank, + paddr_t *start, paddr_t *end); #endif From patchwork Thu Sep 23 12:02:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 12512555 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 98E46C433EF for ; Thu, 23 Sep 2021 12:04:25 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 51BDC60F4B for ; Thu, 23 Sep 2021 12:04:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 51BDC60F4B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.193831.345378 (Exim 4.92) (envelope-from ) id 1mTNSb-0001yO-Bo; Thu, 23 Sep 2021 12:04:17 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 193831.345378; Thu, 23 Sep 2021 12:04:17 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNSb-0001y6-6y; Thu, 23 Sep 2021 12:04:17 +0000 Received: by outflank-mailman (input) for mailman id 193831; Thu, 23 Sep 2021 12:04:15 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNSZ-0006xV-OJ for xen-devel@lists.xenproject.org; Thu, 23 Sep 2021 12:04:15 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (unknown [40.107.22.46]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 54ef45f6-1c66-11ec-ba2e-12813bfff9fa; Thu, 23 Sep 2021 12:03:58 +0000 (UTC) Received: from DB6PR0501CA0015.eurprd05.prod.outlook.com (2603:10a6:4:8f::25) by VI1PR0801MB1744.eurprd08.prod.outlook.com (2603:10a6:800:5c::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.17; Thu, 23 Sep 2021 12:03:53 +0000 Received: from DB5EUR03FT058.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:8f:cafe::ed) by DB6PR0501CA0015.outlook.office365.com (2603:10a6:4:8f::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.14 via Frontend Transport; Thu, 23 Sep 2021 12:03:53 +0000 Received: from 64aa7808-outbound-2.mta.getcheckrecipient.com (63.33.187.114) by DB5EUR03FT058.mail.protection.outlook.com (10.152.20.255) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:03:53 +0000 Received: ("Tessian outbound 173d710607ad:v103"); Thu, 23 Sep 2021 12:03:53 +0000 Received: from b65a2952c961.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id C7961B90-1680-4FBB-BC9A-94D410AC05B1.1; Thu, 23 Sep 2021 12:03:42 +0000 Received: from EUR01-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id b65a2952c961.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 23 Sep 2021 12:03:42 +0000 Received: from AM6PR05CA0028.eurprd05.prod.outlook.com (2603:10a6:20b:2e::41) by DBAPR08MB5846.eurprd08.prod.outlook.com (2603:10a6:10:1b0::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.14; Thu, 23 Sep 2021 12:03:40 +0000 Received: from AM5EUR03FT055.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:2e:cafe::6e) by AM6PR05CA0028.outlook.office365.com (2603:10a6:20b:2e::41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.14 via Frontend Transport; Thu, 23 Sep 2021 12:03:40 +0000 Received: from nebula.arm.com (40.67.248.234) by AM5EUR03FT055.mail.protection.outlook.com (10.152.17.214) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:03:40 +0000 Received: from AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2308.14; Thu, 23 Sep 2021 12:03:37 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Thu, 23 Sep 2021 12:03:36 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Thu, 23 Sep 2021 12:03:35 +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: 54ef45f6-1c66-11ec-ba2e-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=r4IUu2+SwohNK8zI3PdrUOxfoLsLYpgk2ynTlN2bdKg=; b=EjDf5zi/Z4tc5ADYbjfC0Ds++dmooCIotDopvA8DqDVXfFgCjNDmCuNbdF4pRSgGcG+ZLkMpUF5qKrKGJ9JcDibbjdUfS5k9Vu1V4c6w7DWg8ejK/8Y6nd9YZ3wazAx7UvpY9z0688EOQv4Y2J9d26xcZBFt30gdXXzbmIzUiTs= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.33.187.114) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.33.187.114 as permitted sender) receiver=protection.outlook.com; client-ip=63.33.187.114; helo=64aa7808-outbound-2.mta.getcheckrecipient.com; X-CheckRecipientChecked: true X-CR-MTA-CID: 91fc362807295dac X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MUPfU67MOThvum4MqrB4LDEr0CsJPB0GaNUHxOhO+iDY6ZoTFWLxhU30gL8OedBww41a8cjrIAdZj4/+H3hTaCl67PlWVSTtFMtD9MtTpVVgTBn8+VUjapjTERJNGvGN+nHkX/lqqwxnUiuVYfo5MfPupOI95Mm8gwyiUFQFn6Q5F+d4C2DyHSgKE22rUjavKYUqljjBgQ+9t349TqmRKr7jlAtk3EI6hqsNm7Cv9teicSfSifvNs3XgR3e/zD/LYQOJMx6m2omL7A0Y16MHYlFuzhpm32XNLmqRSoXZNuDbbuw8RHFdHN7v3UFbVYBmEfWopVTuPyAwARXHHwPDGA== 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; bh=r4IUu2+SwohNK8zI3PdrUOxfoLsLYpgk2ynTlN2bdKg=; b=fy6femylwVDfk4J9U7BlSfQguQgIKrJEN0GZ42AhquyzhmS0nNXoov35Ygl+hm2yAbOxkW7qqlW+7gcMu+QGRhnNmpVvrYmeaTXrlY4C4O2G0TR+BkdoYDMn21Bk1fonB59MZvFTrsZ2pv9AoXENAm5ZdRRty0BwA6EZXaBsqRFUjKYnRNAI8c3xcxYPvZpfgdEY7i6KdoM3Yaq8WpQRFGZK7SAS3pEPxnw08saS6ButYYufZkDnBDAggbfqIwO27bBdy2epbWKk3VqsFAiNX3zzY08X36NtabalxMLqZn6N7OvgPTItvnK3LttI99J3Xb2VxEqSpdfyl42R5hbLgQ== 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=r4IUu2+SwohNK8zI3PdrUOxfoLsLYpgk2ynTlN2bdKg=; b=EjDf5zi/Z4tc5ADYbjfC0Ds++dmooCIotDopvA8DqDVXfFgCjNDmCuNbdF4pRSgGcG+ZLkMpUF5qKrKGJ9JcDibbjdUfS5k9Vu1V4c6w7DWg8ejK/8Y6nd9YZ3wazAx7UvpY9z0688EOQv4Y2J9d26xcZBFt30gdXXzbmIzUiTs= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; From: Wei Chen To: , , , CC: Subject: [PATCH 13/37] xen/x86: decouple processor_nodes_parsed from acpi numa functions Date: Thu, 23 Sep 2021 20:02:12 +0800 Message-ID: <20210923120236.3692135-14-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210923120236.3692135-1-wei.chen@arm.com> References: <20210923120236.3692135-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a30b010c-b72f-4bff-d840-08d97e8a3689 X-MS-TrafficTypeDiagnostic: DBAPR08MB5846:|VI1PR0801MB1744: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:4125;OLM:4125; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: FO4jxbgM/yNpujNsJKRzt70AqOeRUqUE4m0Jcw4z8lMARTNioC6noYT9NE+jd4jCqiWg+y7Dru/pPOWlqVs+dXcDcTdfUL7xCQ3DTapMuD6a9J6/wVVkZP+XqtGF93fV3zbOsPKVygqOo4ClDgvg2sX816TRZN1ONSazwVqwrJniEKAj32Xu5jGGczwrJ4Fd1MUOa84zO1mQpjpZercexw8KO2Bjbmvg2zZIMeC3b/o/ix1aAlJAtZvKMjF70Ela3RS9VPZS8IaNNADrXsRuhQ9NGccKwMXpq3G1AW4hHTyxxEAHWO8i3cqnP1Aij5Xs/WJYloOOb6STwS7gIK3PoeJULJ4iEE2NGkSLxrumkyrzMDCR5ceGxr7aqyVDxULM5NLWGlhzBwuU1+CTGDP4/IJnEhhLhE9pTEqbWpYsr5VUDT3MdTspIAIic73NAgNnl8HIw5ILEWpuM16rTA4diijAKLTbwF2IAp33kzrziBbGQsA2IQC/4wwTMiXbafpmCBUSx7Pf4d/h3xZMnCnUuGRCU3FOm2mxlEmrG3K0hhWDMj3S12jGkLya2R/Fl3vn2Gr6uwhagUiq+7HXgnHfzERk44IR0I0zF/dSohKQor4y64gDOG2gSJhGhOpfR92yB2eIyDP3jLabW8an6h34QuWv0nJAfYKqEWQ8iq53ZEjIFpuG4YPofQqS9javgjrOqI7nMUDuFj+XIoGB42eEEw6FopIMc72dXkoGaBxe7hM= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(4636009)(46966006)(36840700001)(356005)(86362001)(44832011)(83380400001)(508600001)(36756003)(6666004)(8676002)(70586007)(81166007)(2616005)(70206006)(2906002)(336012)(8936002)(110136005)(5660300002)(1076003)(186003)(4326008)(47076005)(316002)(7696005)(36860700001)(82310400003)(26005)(426003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR08MB5846 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT058.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 022efe4a-3379-42b8-8a70-08d97e8a2e87 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TGlGaLLtZs8qe1Yf7d4+NDZYGhQjlc/ISMVqswE8If63wFUGrLZRZpWoydJX0U0mdzRHIxJLhPVNZ2NegQO56nPMqQTzWRIf2rWUwk/n3rCJlaz287yhAL9ouCi7OncrvL99C4R3EWm2BlLr0Z+lRaEJx+1Pu1llGJ1I2kXr3B87X8Hiqo2YqQD0I6tQba1Fug4vvtAX0EY/v8iFRWyE3blE6mOkHTd9TnMsSZI0Mfa5H/ikE7D/6yyUdHwdewFKPQLBMo0Ds3qFLHPxmwHlgASTIpn3e47Ro61N1z/dTAsFUt7vwOyeKth4qrn5qZJq+raYgj2O0Ul1xkTSJkZ/bmYBkaZqt2oGlxEUXe6ds57aefzNL+hSb6K+4EZLEYOZJkt+cAP+8emIcUnYAA1qmhYvMn/eSUk3HzVgAirET/9X21OBhXgzCh1vVjKgB1dKtwfARS90U37Fer9KdddNH8B6AnWcuMhxR41xAEKhiiG0OgOt4sGUQtWU+DZKlbMot8gbUmDDIYAOYNBPMNwIXA5yh2VufEbjN9TkSy/egEiysaTSF1R/lL+WJBHB+6Ybv5fOrjZxqsLWRa/buOrqFYXHmxIkTF6RaCyyXkJjHvfHUQc5RL5UQy5Cduvqbg0FGGL7f6am9yh+bN/eN+vrvotV2Lc73qJYPjVhij9V5TT2Gz07exA7zUxqOoxGuU1wGav7JojRm9aNi8KjT+8Fhw== X-Forefront-Antispam-Report: CIP:63.33.187.114;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-2.mta.getcheckrecipient.com;PTR:ec2-63-33-187-114.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(4636009)(46966006)(36840700001)(8936002)(2616005)(2906002)(36756003)(81166007)(82310400003)(7696005)(336012)(6666004)(8676002)(5660300002)(83380400001)(70586007)(70206006)(4326008)(426003)(44832011)(186003)(1076003)(26005)(508600001)(47076005)(316002)(110136005)(36860700001)(86362001);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2021 12:03:53.5136 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a30b010c-b72f-4bff-d840-08d97e8a3689 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.33.187.114];Helo=[64aa7808-outbound-2.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DB5EUR03FT058.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0801MB1744 Xen is using processor_nodes_parsed to record parsed processor nodes from ACPI table or other firmware provided resource table. This variable is used in ACPI numa functions directly. In follow-up patchs, neutral NUMA code will be abstracted and move to other files. So in this patch, we introduce numa_set_processor_nodes_parsed helper to decouple processor_nodes_parsed from acpi numa functions. Signed-off-by: Wei Chen --- xen/arch/x86/srat.c | 9 +++++++-- xen/include/asm-x86/numa.h | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/srat.c b/xen/arch/x86/srat.c index aa07a7e975..9276a52138 100644 --- a/xen/arch/x86/srat.c +++ b/xen/arch/x86/srat.c @@ -104,6 +104,11 @@ nodeid_t setup_node(unsigned pxm) return node; } +void __init numa_set_processor_nodes_parsed(nodeid_t node) +{ + node_set(node, processor_nodes_parsed); +} + bool __init numa_memblks_available(void) { if (num_node_memblks < NR_NODE_MEMBLKS) @@ -236,7 +241,7 @@ acpi_numa_x2apic_affinity_init(const struct acpi_srat_x2apic_cpu_affinity *pa) } apicid_to_node[pa->apic_id] = node; - node_set(node, processor_nodes_parsed); + numa_set_processor_nodes_parsed(node); acpi_numa = 1; if (opt_acpi_verbose) @@ -271,7 +276,7 @@ acpi_numa_processor_affinity_init(const struct acpi_srat_cpu_affinity *pa) return; } apicid_to_node[pa->apic_id] = node; - node_set(node, processor_nodes_parsed); + numa_set_processor_nodes_parsed(node); acpi_numa = 1; if (opt_acpi_verbose) diff --git a/xen/include/asm-x86/numa.h b/xen/include/asm-x86/numa.h index 78e044a390..295f875a51 100644 --- a/xen/include/asm-x86/numa.h +++ b/xen/include/asm-x86/numa.h @@ -77,6 +77,7 @@ extern int valid_numa_range(paddr_t start, paddr_t end, nodeid_t node); extern bool numa_memblks_available(void); extern int numa_update_node_memblks(nodeid_t node, paddr_t start, paddr_t size, bool hotplug); +extern void numa_set_processor_nodes_parsed(nodeid_t node); void srat_parse_regions(paddr_t addr); extern u8 __node_distance(nodeid_t a, nodeid_t b); From patchwork Thu Sep 23 12:02:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 12512571 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 00A4BC433FE for ; Thu, 23 Sep 2021 12:07:50 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id A09FE60FA0 for ; Thu, 23 Sep 2021 12:07:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A09FE60FA0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.193869.345455 (Exim 4.92) (envelope-from ) id 1mTNVr-000759-4k; Thu, 23 Sep 2021 12:07:39 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 193869.345455; Thu, 23 Sep 2021 12:07:39 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNVr-00074w-0M; Thu, 23 Sep 2021 12:07:39 +0000 Received: by outflank-mailman (input) for mailman id 193869; Thu, 23 Sep 2021 12:07:37 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNTA-0005KP-0g for xen-devel@lists.xenproject.org; Thu, 23 Sep 2021 12:04:52 +0000 Received: from EUR02-HE1-obe.outbound.protection.outlook.com (unknown [2a01:111:f400:fe05::604]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id bc4ca0cf-2426-441b-962a-1f49f29c75db; Thu, 23 Sep 2021 12:03:57 +0000 (UTC) Received: from DB3PR08CA0003.eurprd08.prod.outlook.com (2603:10a6:8::16) by AM6PR08MB3783.eurprd08.prod.outlook.com (2603:10a6:20b:8a::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.14; Thu, 23 Sep 2021 12:03:55 +0000 Received: from DB5EUR03FT028.eop-EUR03.prod.protection.outlook.com (2603:10a6:8:0:cafe::c7) by DB3PR08CA0003.outlook.office365.com (2603:10a6:8::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:03:55 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT028.mail.protection.outlook.com (10.152.20.99) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:03:55 +0000 Received: ("Tessian outbound a77cafe56b47:v103"); Thu, 23 Sep 2021 12:03:51 +0000 Received: from a0dd7d4ec432.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 391A3AAE-1392-41BE-8417-481DF8F46BA4.1; Thu, 23 Sep 2021 12:03:44 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id a0dd7d4ec432.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 23 Sep 2021 12:03:44 +0000 Received: from AM6PR05CA0020.eurprd05.prod.outlook.com (2603:10a6:20b:2e::33) by AS8PR08MB6853.eurprd08.prod.outlook.com (2603:10a6:20b:39e::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.15; Thu, 23 Sep 2021 12:03:43 +0000 Received: from AM5EUR03FT055.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:2e:cafe::fb) by AM6PR05CA0020.outlook.office365.com (2603:10a6:20b:2e::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.14 via Frontend Transport; Thu, 23 Sep 2021 12:03:43 +0000 Received: from nebula.arm.com (40.67.248.234) by AM5EUR03FT055.mail.protection.outlook.com (10.152.17.214) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:03:42 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.14; Thu, 23 Sep 2021 12:03:39 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Thu, 23 Sep 2021 12:03: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: bc4ca0cf-2426-441b-962a-1f49f29c75db 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=rxcQF/l2VBvSGxaJXCbidBt4Razr3FEN1UGpSS7VamU=; b=zJHNUwyB+8RXKpklFjxdwOuWnSsumjjycAfIW/1bJWf5VwowKZc1sre+OMSoW7tXPeB92hX+wgcuO6A4oW2PVL4FLOg1POsWIv08uYtADKXHkvn0Xsa1X5TdeKGTb6joTJu2fzvB+5hAp4y6MZjCxTtii0D7f7lgx2eOzYltT8s= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; X-CheckRecipientChecked: true X-CR-MTA-CID: 2d6f0d1f949a01f6 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R9RgDAIkQY4uwu4MiZEoxHL3nE17jV4bpg6QJmhKG2HP6XLk+fsdF5hyReIXyyCXGfZTZ9Mr9VPaNcer1ohiWJF6hQ9CWbaHt9wqx019/hPsXKru/y3Vg1iQOVcarFnSiCqQ/X9h/qIth6o0L5DiFAOVqTzv1cTk8b+TOEOWBa3oq1zMptDQZ1Isu39M7cqlTWlMaAqE8EH4DPVqcpNkD7gRC4uWaF5lKe0QbV4QOo4MfoS69kknxK2QyFO5nB+XixiR9JJJpcUHwj41aHmDCOavsbEbo4YYuudQVSKz3X+7bXAviTI3/Vp3N6QfEd7tGXtgeXuPFIrq3x4ZRQLEPw== 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; bh=rxcQF/l2VBvSGxaJXCbidBt4Razr3FEN1UGpSS7VamU=; b=jPs4euhsdxfWL5cqUbaMlYFzM+SEoJajXJ458W+ZEw7/INY3XxNsbOaZYO/9QHcAWXaV/0G06al1bni/8XPoOXUUHslRakjeRZFsAMaUWTCExTXtKo6tI357OwaOSRez0cDn+dPtDgpxlU6CC2CbPCVsk5KTWkHydxEkcogC324VAZtuRIp+zlvGb2QtAEXG53PoXo6xOVc4lPBdACqkYMrwGLX2FMq0QtZDUKTHMD5BVG307SIgbQHbwjjubUSlra18sThIWFsXoYcENx9ElfNfQbsfQbRnEm/uyDKuTerM3hPbnEu0PthHL7Q8hhewvArBQbZ5gGdUOJr+8l7gAA== 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=rxcQF/l2VBvSGxaJXCbidBt4Razr3FEN1UGpSS7VamU=; b=zJHNUwyB+8RXKpklFjxdwOuWnSsumjjycAfIW/1bJWf5VwowKZc1sre+OMSoW7tXPeB92hX+wgcuO6A4oW2PVL4FLOg1POsWIv08uYtADKXHkvn0Xsa1X5TdeKGTb6joTJu2fzvB+5hAp4y6MZjCxTtii0D7f7lgx2eOzYltT8s= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; From: Wei Chen To: , , , CC: Subject: [PATCH 14/37] xen/x86: use name fw_numa to replace acpi_numa Date: Thu, 23 Sep 2021 20:02:13 +0800 Message-ID: <20210923120236.3692135-15-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210923120236.3692135-1-wei.chen@arm.com> References: <20210923120236.3692135-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5389e76c-62cc-46b7-f6a9-08d97e8a37bd X-MS-TrafficTypeDiagnostic: AS8PR08MB6853:|AM6PR08MB3783: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:7691;OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: rLUR4/pCjIS9x7cNthiiO3Ar48SawJFdwCNSpWTHq2p+P8k0ipVUWIQMyH77YgZtW/J1X0pcVu/y8zF10t5TKxnkEex3Twscy5Kw2RJ+65t+Fhh1NNQj+Q5JGXIZR0h3Z+YyzFTc+BlyeKqf9mOhFii09LIyrlTLIuxX9D/HfxDwoJVhy4mUcuJtnhF9COUE7TOZXrJTJHX0R003/JHL1rtu27oLExGAo9JMnvEdZ29rI/VLn6EKFgcgzB3ynrpXTp6Ef4KJNbhPLXTraYNeUs0XiiUHRkCZayg8W3wFzV0gTkkKKRG5gYs9yvb9bEZhSw2BsIns334WbMe//HK2B5awmijEKTZyGZfr4fGiYj1OoOmnb22mGA/LOvAqS9gNrK5F/zihUAUwU7lS+75JHdMXzJOiG5Ngd7DQ9HGVmfJYUXiv3PhltlUGuu8APYXzc9OG4xlQwjqjqIhBhLIJ2qbGoOk2RzIkhqvJ6FVkTyFuvi58FXX3RMN0yXDi3DEeVjZvyvzi5/K4RFwqKede2VsLnBpW2/XZ962UwLZMlK2BS5jEKHZwCGWNW9LI+CccrmJZuQkss8jtSSqyUSdR1JC+CIo5DA0CLg3vKPkOMV8Tb1u/c4NXeJ0dMPOS6hpPYZYhdLLBPu99IH1/cpwtA9gxDVFytZVhjnEGpoXjI8T07g8Z5/OI/GiNPFM02jfSNZYHH8k12KYqlbT12vMih4KTfIRWt+pIKbua9dF2pKI= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(4636009)(36840700001)(46966006)(508600001)(83380400001)(86362001)(8936002)(426003)(5660300002)(2906002)(186003)(8676002)(7696005)(6666004)(81166007)(47076005)(1076003)(36756003)(110136005)(2616005)(82310400003)(316002)(336012)(356005)(36860700001)(26005)(70586007)(44832011)(70206006)(4326008)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6853 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT028.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: dc8688cf-ddaf-49b9-59ff-08d97e8a301a X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uATJXKJVpEIAFkO+YfGTAPPv1u+Lmz4zP3WUzFKDRs4W4ilVqwIB79Y3vEQ6CcVbwrKrfT6yemzj4pUJ6tQ4ZbWH4Vse6kctqjPaM/eP0aDv+dj+ywpSiNk4wR1GOnNBFn3qJamYf28kLQDA4MWi7a/0xq4pesDc9HxBTzjflN4KG7zbHXne/rwON13kG2lWmxcP7FeQ4RLn4r81ucj4eV2BeOIwKCK9EwpJAW0vEeQH1eLWkCc8pss0n72pWQjifCE+oAbbEcWZsfVqG/QFTHDysvufJrXhXxLkd7EH1iDllHzMyVOMfCXvSz5DSTF8cH+SibT8M1SFHPQScu8ZJZY3mJuw1wnjE1rgSpSTRTgCSo/LoZYpNtIzUYuk4dRbZ24kqKWbODe/WqanFZ/jJzx5srg4QhxbrTITGUIb+aaz3dc0/ntQtV3QvbbMmzzBYPyPQMdPlLMkC27vocw2zjngFBGpIEWYiyrDFIoBh3gT/VnZoW+Fg9q4SKyjcF6knyvUMk+gw7gKfmy2AqGSTNVurb6cXljfm53o1RdeGIguWymTN5P0T3OZsjcx+lO83dyv/f90Q1BrIR50ORdIXvBSa3PV5TZmaVq4J6JcpBum+Je0d7Ppy8LPpsQ8cdwts+GEKfEnhUUzEzGx45Q8n3RWUvpKLBPfX5HS64OmxKhRNgA0x5GkhGKdgDGGFFlbhc4MDyNP1d9Zv7SO4aL4ag== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(4636009)(36840700001)(46966006)(5660300002)(8936002)(110136005)(1076003)(2906002)(336012)(82310400003)(426003)(26005)(47076005)(4326008)(316002)(186003)(36860700001)(7696005)(508600001)(36756003)(6666004)(44832011)(83380400001)(86362001)(81166007)(2616005)(70206006)(70586007)(8676002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2021 12:03:55.5338 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5389e76c-62cc-46b7-f6a9-08d97e8a37bd 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: DB5EUR03FT028.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3783 Xen is using acpi_numa as a switch for ACPI based NUMA. We want to use this switch logic for other firmware based NUMA implementation, like device tree based NUMA in follow-up patches. As Xen will never use both ACPI and device tree based NUMA at runtime. So I rename acpi_numa to a more generic name fw_name. This will also allow to have the code mostly common. Signed-off-by: Wei Chen --- xen/arch/x86/numa.c | 6 +++--- xen/arch/x86/setup.c | 2 +- xen/arch/x86/srat.c | 10 +++++----- xen/include/asm-x86/acpi.h | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/xen/arch/x86/numa.c b/xen/arch/x86/numa.c index 6bc4ade411..2ef385ae3f 100644 --- a/xen/arch/x86/numa.c +++ b/xen/arch/x86/numa.c @@ -51,11 +51,11 @@ cpumask_t node_to_cpumask[MAX_NUMNODES] __read_mostly; nodemask_t __read_mostly node_online_map = { { [0] = 1UL } }; bool numa_off; -s8 acpi_numa = 0; +s8 fw_numa = 0; int srat_disabled(void) { - return numa_off || acpi_numa < 0; + return numa_off || fw_numa < 0; } /* @@ -315,7 +315,7 @@ static __init int numa_setup(const char *opt) else if ( !strncmp(opt,"noacpi",6) ) { numa_off = false; - acpi_numa = -1; + fw_numa = -1; } #endif else diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index b101565f14..1a2093b554 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -313,7 +313,7 @@ void srat_detect_node(int cpu) node_set_online(node); numa_set_node(cpu, node); - if ( opt_cpu_info && acpi_numa > 0 ) + if ( opt_cpu_info && fw_numa > 0 ) printk("CPU %d APIC %d -> Node %d\n", cpu, apicid, node); } diff --git a/xen/arch/x86/srat.c b/xen/arch/x86/srat.c index 9276a52138..4921830f94 100644 --- a/xen/arch/x86/srat.c +++ b/xen/arch/x86/srat.c @@ -167,7 +167,7 @@ static __init void bad_srat(void) { int i; printk(KERN_ERR "SRAT: SRAT not used.\n"); - acpi_numa = -1; + fw_numa = -1; for (i = 0; i < MAX_LOCAL_APIC; i++) apicid_to_node[i] = NUMA_NO_NODE; for (i = 0; i < ARRAY_SIZE(pxm2node); i++) @@ -242,7 +242,7 @@ acpi_numa_x2apic_affinity_init(const struct acpi_srat_x2apic_cpu_affinity *pa) apicid_to_node[pa->apic_id] = node; numa_set_processor_nodes_parsed(node); - acpi_numa = 1; + fw_numa = 1; if (opt_acpi_verbose) printk(KERN_INFO "SRAT: PXM %u -> APIC %08x -> Node %u\n", @@ -277,7 +277,7 @@ acpi_numa_processor_affinity_init(const struct acpi_srat_cpu_affinity *pa) } apicid_to_node[pa->apic_id] = node; numa_set_processor_nodes_parsed(node); - acpi_numa = 1; + fw_numa = 1; if (opt_acpi_verbose) printk(KERN_INFO "SRAT: PXM %u -> APIC %02x -> Node %u\n", @@ -492,7 +492,7 @@ void __init srat_parse_regions(paddr_t addr) u64 mask; unsigned int i; - if (acpi_disabled || acpi_numa < 0 || + if (acpi_disabled || fw_numa < 0 || acpi_table_parse(ACPI_SIG_SRAT, acpi_parse_srat)) return; @@ -521,7 +521,7 @@ int __init acpi_scan_nodes(paddr_t start, paddr_t end) for (i = 0; i < MAX_NUMNODES; i++) cutoff_node(i, start, end); - if (acpi_numa <= 0) + if (fw_numa <= 0) return -1; if (!nodes_cover_memory()) { diff --git a/xen/include/asm-x86/acpi.h b/xen/include/asm-x86/acpi.h index 7032f3a001..83be71fec3 100644 --- a/xen/include/asm-x86/acpi.h +++ b/xen/include/asm-x86/acpi.h @@ -101,7 +101,7 @@ extern unsigned long acpi_wakeup_address; #define ARCH_HAS_POWER_INIT 1 -extern s8 acpi_numa; +extern s8 fw_numa; extern int acpi_scan_nodes(u64 start, u64 end); #define NR_NODE_MEMBLKS (MAX_NUMNODES*2) From patchwork Thu Sep 23 12:02:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 12512557 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 12D72C433F5 for ; Thu, 23 Sep 2021 12:04:32 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id B97CC6115A for ; Thu, 23 Sep 2021 12:04:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B97CC6115A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.193834.345389 (Exim 4.92) (envelope-from ) id 1mTNSg-0002hO-Oe; Thu, 23 Sep 2021 12:04:22 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 193834.345389; Thu, 23 Sep 2021 12:04:22 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNSg-0002h9-Jx; Thu, 23 Sep 2021 12:04:22 +0000 Received: by outflank-mailman (input) for mailman id 193834; Thu, 23 Sep 2021 12:04:20 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNSe-0006xV-OV for xen-devel@lists.xenproject.org; Thu, 23 Sep 2021 12:04:20 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (unknown [40.107.7.70]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 5583a53f-1c66-11ec-ba2e-12813bfff9fa; Thu, 23 Sep 2021 12:03:59 +0000 (UTC) Received: from AS9PR06CA0065.eurprd06.prod.outlook.com (2603:10a6:20b:464::30) by AM0PR08MB3476.eurprd08.prod.outlook.com (2603:10a6:208:dd::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13; Thu, 23 Sep 2021 12:03:54 +0000 Received: from VE1EUR03FT038.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:464:cafe::83) by AS9PR06CA0065.outlook.office365.com (2603:10a6:20b:464::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:03:54 +0000 Received: from 64aa7808-outbound-2.mta.getcheckrecipient.com (63.33.187.114) by VE1EUR03FT038.mail.protection.outlook.com (10.152.19.112) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:03:54 +0000 Received: ("Tessian outbound 0e48c0de19a3:v103"); Thu, 23 Sep 2021 12:03:53 +0000 Received: from 12313445366e.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 3FCA74CE-884C-4689-80D6-F74825E26883.1; Thu, 23 Sep 2021 12:03:45 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 12313445366e.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 23 Sep 2021 12:03:45 +0000 Received: from AM6PR05CA0031.eurprd05.prod.outlook.com (2603:10a6:20b:2e::44) by DB9PR08MB6889.eurprd08.prod.outlook.com (2603:10a6:10:2a1::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.14; Thu, 23 Sep 2021 12:03:44 +0000 Received: from AM5EUR03FT055.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:2e:cafe::63) by AM6PR05CA0031.outlook.office365.com (2603:10a6:20b:2e::44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:03:44 +0000 Received: from nebula.arm.com (40.67.248.234) by AM5EUR03FT055.mail.protection.outlook.com (10.152.17.214) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:03:43 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.14; Thu, 23 Sep 2021 12:03:41 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Thu, 23 Sep 2021 12:03: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: 5583a53f-1c66-11ec-ba2e-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bHB3OIRxraBI99dHCnbQBTwh5FbIOCKQZXZ1E5VSHqs=; b=iAT2nzsxmP6X58+jMrjioleryYdFbsMP9rbS0X+6K6yjYBs6CYuCOTbjjzUjqwbojD/1CMlU2d3IK9KwwlPHvK9XKglsra7zkiRT93h4vPKmA6N2vWnJch0QZrOhShYS2I/Yqb98WNFQWiISx6MXyFNX0Nguvj0ZpypfuO+AS/I= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.33.187.114) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.33.187.114 as permitted sender) receiver=protection.outlook.com; client-ip=63.33.187.114; helo=64aa7808-outbound-2.mta.getcheckrecipient.com; X-CheckRecipientChecked: true X-CR-MTA-CID: d9f2c0d4b272f3ef X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f73aX07EY08DBRiQt9WhG5PBNrclcaCHk/aG6jHqvhqXEetNDVNVTRL2uQuzz0AJUuCD6djTC6Xi60SLMB4nMTbMDEi5I+5RO5VRi9c5486znTb4cC0F955FeNqXWpDD7wp2BrSYZbtn2x2HArHnnw7CM/GF65Zb18ta9sgWifDmvzh0el+YEyogFLmsmh0KPirTQbiZJFzZcaT0RkFdSIiydJljLQs9Nq7oOsj7hS7Qts9YvOSnuLYDC+DUL0AQeN9Ln9p2HlhyndwweFlIAKKviditU21WsGPCdx8Uxa/L0Km105EDL+5oA5IIMuigy3y+J1HIEYwkEkeTsIiY8A== 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; bh=bHB3OIRxraBI99dHCnbQBTwh5FbIOCKQZXZ1E5VSHqs=; b=IXr8/KOhipoXLnD4GOlPYbDCPIbbPodevluYN5i1me4KxYE432PlUmFEPL/E/sl+oYgfbTS2XshPdV6530M0MSJo32IWxiWBvcqtIltjwtCQ32L5oMXI7ee6miMXKU46t3P08e8+wdh5pt0lWQpkKtxbLaCv1WAepwrqyFdwSs2/72ZnvR+WpT1XRxYfWQ1km+Wjp0xRLCKxJY28kMiMyfoZU1A6ynRZ1eYZWTcHHo3LbhKXM4velYss30L19+kX1eaH2rbkiTCL8cLZvd83R1gCndgNcC4cG9Y4+NgjNGH76FQTU2jUB/dvsoBETrlWXF3oHnpsutasIR29G9FG8A== 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=bHB3OIRxraBI99dHCnbQBTwh5FbIOCKQZXZ1E5VSHqs=; b=iAT2nzsxmP6X58+jMrjioleryYdFbsMP9rbS0X+6K6yjYBs6CYuCOTbjjzUjqwbojD/1CMlU2d3IK9KwwlPHvK9XKglsra7zkiRT93h4vPKmA6N2vWnJch0QZrOhShYS2I/Yqb98WNFQWiISx6MXyFNX0Nguvj0ZpypfuO+AS/I= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; From: Wei Chen To: , , , CC: Subject: [PATCH 15/37] xen/x86: rename acpi_scan_nodes to numa_scan_nodes Date: Thu, 23 Sep 2021 20:02:14 +0800 Message-ID: <20210923120236.3692135-16-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210923120236.3692135-1-wei.chen@arm.com> References: <20210923120236.3692135-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 197158ef-8198-40e7-3780-08d97e8a36f1 X-MS-TrafficTypeDiagnostic: DB9PR08MB6889:|AM0PR08MB3476: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:4303;OLM:4303; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: NzGNuz8Y1xXknlT+8r0RnU1UtHo1PdP5WGHYvhOEcKq0uhsl8JNQyOldKxHp+eoLISCB1G/Xt/UpyM2sQ7ro5/fFad6wdtOEnUCPT7hYrBfdp+I7Q22oss1ZcoNIO8yqMjC4EPwoQNvFJfHiYRoFmtPEMK/r2JfE1rmmwvAOiDSZbbi82xJ533wBDIedOo166741Cltr1JFdiIo3UPJor1Ttbfpwlymsx8VG67Rj9+KZXp9OqO3B/pKBgCpm7idGISchC7tSMa+6vYvBGkMfIPDEdbKHzgK7g5/rHDKzC+L8Ro6TPDx7YeIDTz3gupE8B929Yijm5uT8nWa+wtMH2ExU4deroiesooYLGjbSV5bfQYy6GJTi3TO69zjuU2Dk9bTKaFVu5dQTvHgsKaNRryE6QbjoADyBHudJF5eIzW+JWW1wtTPcJLamC12NAyfgMP4nkh93wd8PTeL1UvFAqq4oLZAzfkUri6bY+GuYEQWf+pIQJlLDz/bGV3RV0pcl60fJrNWFSSUr7E2MhYjk1cXZ9QNPjK8uxW/31vgv/h6FD7uA1ZmELdgxTnu2TGOWmkPHl+oWWaDuVRUkaG4OVYNiurngQE0O3Em/I+Kmcbsqu5qCB3kSqCPnVL51M+ycem8Jh8BPtAzSXI3hrQ7AD55iDpnJFuG3VWSmQ1oHCHFwSGiAoeVhPrN8VFaygbA7YsanGGFpJSsA1qQgog5UZRSYBErF11FdXSk/Mxbhy0Q= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(4636009)(46966006)(36840700001)(5660300002)(8936002)(110136005)(1076003)(186003)(2906002)(336012)(82310400003)(426003)(26005)(47076005)(4326008)(316002)(7696005)(36860700001)(508600001)(36756003)(6666004)(356005)(44832011)(83380400001)(86362001)(81166007)(2616005)(70206006)(70586007)(8676002)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB6889 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT038.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 8faa9ec5-04b5-4c8e-65bc-08d97e8a30dd X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Cp3kYtAT3YABE2yJbPpKSixL52n4S1hRk5RWPzDmW+rPmpm4B7uTRM3kYvs0oTDlyZUPXG3BPQ5zG9iUuxIc9kASOqfpktLHfmK/AGfypHVVn8Z7s53KfPFWkGsEMImvG9KLCc6BkUzo1CxNSW+QgZwDMeeRBZRt6EpSkDmwzc3Nxsjsj7Pw8oCVcbx4TjH4X7YEpCA2Dv++mZSPzNtNpAWeHmSWno5InQDjdLQTLQOeg6BodnDFRkeNSCsGB5tukuzJiaB+F5JJqLLLsRL07UGroAKOgjXOAGBpbqkOP7I13XmFPT7ws4OflLE6hc55kx29H1CdgN6eidrLVKktdkt9ITjccZwqkJiIFZa6aZV5BYPpLo+rnTzP3cnaykSxGGmezdMEPR/x6hPw2jEgZ1X1mSASdUX8A3oqpYUC/vR1K50Ez76/y9fdt7uMmG4opadfUmpz57daz/NSVGgtyDCZ7Dt4EpkSZhnXjep8aQjxuBWQh7YCZLBxsp1Vb3oOEqsdzxp+RKR7ZxLYv1OjyuCSyHUODeI5toW/AmbhVuD1cvcIJcLSdGvxOUf9QG8BMtfcUK6P3er9PCBS+ZIDyIY3ZXmdboBUPzUltFmczbUWijPDiOR9HJ5xl1ieg2OXk9Pw82RfFgy1709DkYsJN30xMVnVNJIOjABGAWVlF6Z8WR1/CMVQQEK0r0Jjyhd/3dBxXPXT+oiPrV4TLMIjPQ== X-Forefront-Antispam-Report: CIP:63.33.187.114;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-2.mta.getcheckrecipient.com;PTR:ec2-63-33-187-114.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(4636009)(36840700001)(46966006)(83380400001)(36756003)(70206006)(6666004)(426003)(82310400003)(7696005)(81166007)(8676002)(2906002)(1076003)(508600001)(44832011)(86362001)(36860700001)(4326008)(26005)(47076005)(336012)(2616005)(5660300002)(316002)(110136005)(186003)(70586007)(8936002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2021 12:03:54.0941 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 197158ef-8198-40e7-3780-08d97e8a36f1 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.33.187.114];Helo=[64aa7808-outbound-2.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR03FT038.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB3476 The most code in acpi_scan_nodes can be reused by other NUMA implementation. Rename acpi_scan_nodes to a more generic name numa_scan_nodes, and replace BIOS to Firmware in print message, as BIOS is x86 specific name. Signed-off-by: Wei Chen --- xen/arch/x86/numa.c | 2 +- xen/arch/x86/srat.c | 4 ++-- xen/include/asm-x86/acpi.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/xen/arch/x86/numa.c b/xen/arch/x86/numa.c index 2ef385ae3f..8a4710df39 100644 --- a/xen/arch/x86/numa.c +++ b/xen/arch/x86/numa.c @@ -261,7 +261,7 @@ void __init numa_initmem_init(unsigned long start_pfn, unsigned long end_pfn) end = pfn_to_paddr(end_pfn); #ifdef CONFIG_ACPI_NUMA - if ( !numa_off && !acpi_scan_nodes(start, end) ) + if ( !numa_off && !numa_scan_nodes(start, end) ) return; #endif diff --git a/xen/arch/x86/srat.c b/xen/arch/x86/srat.c index 4921830f94..0b8b0b0c95 100644 --- a/xen/arch/x86/srat.c +++ b/xen/arch/x86/srat.c @@ -512,7 +512,7 @@ void __init srat_parse_regions(paddr_t addr) } /* Use the information discovered above to actually set up the nodes. */ -int __init acpi_scan_nodes(paddr_t start, paddr_t end) +int __init numa_scan_nodes(paddr_t start, paddr_t end) { int i; nodemask_t all_nodes_parsed; @@ -547,7 +547,7 @@ int __init acpi_scan_nodes(paddr_t start, paddr_t end) paddr_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); + "Firmware Bug or mis-configured hardware?\n", i); setup_node_bootmem(i, nodes[i].start, nodes[i].end); } diff --git a/xen/include/asm-x86/acpi.h b/xen/include/asm-x86/acpi.h index 83be71fec3..2add971072 100644 --- a/xen/include/asm-x86/acpi.h +++ b/xen/include/asm-x86/acpi.h @@ -102,7 +102,7 @@ extern unsigned long acpi_wakeup_address; #define ARCH_HAS_POWER_INIT 1 extern s8 fw_numa; -extern int acpi_scan_nodes(u64 start, u64 end); +extern int numa_scan_nodes(u64 start, u64 end); #define NR_NODE_MEMBLKS (MAX_NUMNODES*2) extern struct acpi_sleep_info acpi_sinfo; From patchwork Thu Sep 23 12:02:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 12512577 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 680ECC433F5 for ; Thu, 23 Sep 2021 12:08:14 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 2038860F6D for ; Thu, 23 Sep 2021 12:08:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2038860F6D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.193902.345499 (Exim 4.92) (envelope-from ) id 1mTNWG-0001Pb-5Y; Thu, 23 Sep 2021 12:08:04 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 193902.345499; Thu, 23 Sep 2021 12:08:04 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNWG-0001PJ-0r; Thu, 23 Sep 2021 12:08:04 +0000 Received: by outflank-mailman (input) for mailman id 193902; Thu, 23 Sep 2021 12:08:02 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNUV-0006xV-S3 for xen-devel@lists.xenproject.org; Thu, 23 Sep 2021 12:06:15 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (unknown [40.107.22.55]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 6aa254d0-1c66-11ec-ba2e-12813bfff9fa; Thu, 23 Sep 2021 12:04:35 +0000 (UTC) Received: from AS9PR06CA0215.eurprd06.prod.outlook.com (2603:10a6:20b:45e::22) by AM7PR08MB5512.eurprd08.prod.outlook.com (2603:10a6:20b:de::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.15; Thu, 23 Sep 2021 12:04:33 +0000 Received: from VE1EUR03FT004.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:45e:cafe::ee) by AS9PR06CA0215.outlook.office365.com (2603:10a6:20b:45e::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:33 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT004.mail.protection.outlook.com (10.152.18.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:33 +0000 Received: ("Tessian outbound c21c48fbc857:v103"); Thu, 23 Sep 2021 12:04:31 +0000 Received: from 8bbf188dc31c.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id DB224C83-4C73-46AF-AA37-8CA59E27886A.1; Thu, 23 Sep 2021 12:04:13 +0000 Received: from EUR02-AM5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 8bbf188dc31c.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 23 Sep 2021 12:04:13 +0000 Received: from AS9PR06CA0160.eurprd06.prod.outlook.com (2603:10a6:20b:45c::23) by AM6PR08MB3127.eurprd08.prod.outlook.com (2603:10a6:209:43::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.18; Thu, 23 Sep 2021 12:04:11 +0000 Received: from VE1EUR03FT023.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:45c:cafe::7b) by AS9PR06CA0160.outlook.office365.com (2603:10a6:20b:45c::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.15 via Frontend Transport; Thu, 23 Sep 2021 12:04:11 +0000 Received: from nebula.arm.com (40.67.248.234) by VE1EUR03FT023.mail.protection.outlook.com (10.152.18.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:11 +0000 Received: from AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2308.14; Thu, 23 Sep 2021 12:03:44 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Thu, 23 Sep 2021 12:03:42 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Thu, 23 Sep 2021 12:03: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: 6aa254d0-1c66-11ec-ba2e-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nRu3DqWp6Kxy08JOeoeKkmzqLqGRX3WyhcKxeUsjENI=; b=f3+QNwG5gv8tBCRPDeU/ScmG2COmblcHwAtLsafJ+qPRKDWUjI3iRZlSF8venrqt5YhMk9nw1vh5gWbtZTDZvF0LKPdNsgDL2asdhEZXH51SNw3/uHH2v3Lcnk8mDDjxGt2eJ4X2S1Y8L2NX0HmTugCf7nnbp1FeMBf5ldyjA0U= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; X-CheckRecipientChecked: true X-CR-MTA-CID: d27630bc127e496c X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZsWc91N7wotNCfQYJQSblyn5soI+l19yZcCcqtgbYNHZy7ujJeSUgm0ZKWXHpXafMB1Tu7xyUaduStWf3//FHKuMcZcV+5yaBvdnQJn1lj/a1yGdPF4KyuCXjk8RNI0yzJ5sCMbjmmwYwuT1MXubVwl7c3Xy/9Dbx+VW75/bCQcDe1MtMvRZ6bTFb96Bfy0HpKuzjbdqx/pHkcKVG2c/+NytDSbE531G8MvWhJBGMjm4B0PWXdyUEDjwkuFyjg99jd/kt8eb51dxJ1zT4CQeaXmVIPzVJwSTKL3zB/StCdxOSxdf8FqHA6XOlZqexMMBA8A2y/tYwXuVmRIlchGMSA== 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; bh=nRu3DqWp6Kxy08JOeoeKkmzqLqGRX3WyhcKxeUsjENI=; b=hPP2BO4ubKHJgr/aDkxkxUvexH59T69iEU+N03XeyeXoBtmkVCq1wAeemZS3cHgWy9jTcFy+Y2Z0jf4M3nmCSEPXYfd+aBBd6SJGgo3m/jWtjyCeCe6OclZZ03fkabyRkZ1+U0WnBS2adDVbNp8qX9jm3t2GLZh+fCrTFO1RRB98gXm4tvPCLan/l6o2gq3itGncsiYGGXHB/ZZyHFEHJV9tISvX8/at/cZ6HdJ2w11kHizz5hHMqrsBmaKrFs+jcf909ItK9E/nneneZPfYH9O4WjEm/g/Bxmj9quAMnksNnDUzK2fgxbwo/Zm7TjwrGS4tw6Zlog/dg7aiZfCG6A== 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=nRu3DqWp6Kxy08JOeoeKkmzqLqGRX3WyhcKxeUsjENI=; b=f3+QNwG5gv8tBCRPDeU/ScmG2COmblcHwAtLsafJ+qPRKDWUjI3iRZlSF8venrqt5YhMk9nw1vh5gWbtZTDZvF0LKPdNsgDL2asdhEZXH51SNw3/uHH2v3Lcnk8mDDjxGt2eJ4X2S1Y8L2NX0HmTugCf7nnbp1FeMBf5ldyjA0U= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; From: Wei Chen To: , , , CC: Subject: [PATCH 16/37] xen/x86: export srat_bad to external Date: Thu, 23 Sep 2021 20:02:15 +0800 Message-ID: <20210923120236.3692135-17-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210923120236.3692135-1-wei.chen@arm.com> References: <20210923120236.3692135-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b117b6a4-261e-42c5-cf10-08d97e8a4e22 X-MS-TrafficTypeDiagnostic: AM6PR08MB3127:|AM7PR08MB5512: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:4125;OLM:4125; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: Tl4oJhYkJoAEc85m2rxUHeB/01EDB3APB/lLhCx2y3V6pcew5lf6k6356OL/dsQbcAY6G1cPn0NqyOplt2qfiXNaRSS6NijqHyguBuZU3pc8ydjdm8/AIBtAPt42lw3B5vSlWFXD0GO+Rif9yxDqhAiFT44oAiX1zbdOsfUlzymq9rYLKTAUAGUkwmtZdbSVcNgM3G28xLGOKceHXgewpEpahoTW07xM/CIMaI+3RyUJ0QKDucauw2uGnHXQHm701Jll9vJFQyX+qmgf0YpPoISGWEDqErOssi2hXlPqqjna2ks8bhK1HqPPL8ZNVPoCHWKGNCMqZVYPyWFRGjUV5QLyiu5pG+r4efKPIUEpWCkXh69q7Sbsg1w2lGjmU4Cllmu6sZ6m3mD+sDeciK22aU3O2k7nR7ektzUjkINSkQEjQJ6epa3XroDVORtRXFSiNQVabbQtmSbN+jZdk1sQSiZ037or4b8o7vHWWgCPYHUwprU4mOzf9HcOsNK829AI87MNs2AclN6WQFz2PjjFU/uZvwHo622fhvLs9crbdr6SoRVuJtGT23xuPks/8BlO/mjkMCmH528WeyB5cOKKR9pG6m/vQ42wvZrZ4klonbWY8Og3yW+Fe4v9U9w/d04XKR6B9/TSmmPQK499QPcPmjl/zCmRRlqfxWw6Ou2Qla3fGwD8I+posZP5mS/+D3vitbybfiITUZraDRoFD9rj8jXNffcaKNPjJcUwRLEg0eQ= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(4636009)(36840700001)(46966006)(336012)(316002)(4326008)(1076003)(82310400003)(186003)(36860700001)(8936002)(86362001)(70586007)(26005)(5660300002)(70206006)(426003)(2616005)(44832011)(81166007)(7696005)(8676002)(110136005)(83380400001)(6666004)(36756003)(356005)(47076005)(2906002)(508600001)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3127 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT004.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 6bd857c0-879b-4429-e87f-08d97e8a4157 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rh1Z+JkeW468ZBycuiSBV6I+KFI68EmSkYxPYB5bHxA9Z6BqqspB61XQQRua1VDBb+sR+tEpI1ZeIh9rrgn4FDWm5QBK8H7/M2EKzhgC4Sp/oxxaaj5qqPo/3s6vkbPRIog2XIjOzhr1CoSK/ezecn+ZC52kplUa+TpbNluiKiRJuMIgm2DCL3A4qhmHhhr0qUeI4OnOD0sxzB/IELH9/fn0IOCLZcdTnWeq+zXGHcF3CeaTk3QzL5LAVDxYN+8tvR2IjwrBrouA3gObmo8HSRbc+pW8nz8tTar7vc8xyba9xNVtwQOuofzEbuh5zl6VkKSEnMl8dAHlCliP/x9oscFaXrndZ2+EA1dChesCCOdfh88uDijBNuzp8kuSXihgEK5x76LYYKYdL8g+en9I1lEr1wDoku8bgdtMhgB7uMUcPurrHNyTYJTqednIIDxL7HIChBVfN3AaLsFmJy6elCGmSIt7+WjvCVNTFIMBjsukjiYas/5MUFI/jhSEFgp+OzgIDpNMJTkwtqe8pidhDfMVctsYxER6G9iZdqKw5F9tcdKn+KZiKbz2RZLTEm3XtaNDS2o23sQ6EtdMHO4fUKaQtie5BoDIJPg3j438SwCuUUL/KfHHqUZ2RWvcJ5CoETPS8eoAo7HbVeI5hJhIf00RYpjjBxNygb6jUUIjnkyJeB2X69iPzQxbNKuHVYWDR1OoGfYMnExSFR+F5+BJdQ== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(4636009)(46966006)(36840700001)(82310400003)(1076003)(36860700001)(508600001)(8936002)(70586007)(7696005)(70206006)(426003)(316002)(5660300002)(86362001)(110136005)(4326008)(6666004)(336012)(2616005)(81166007)(2906002)(44832011)(26005)(186003)(83380400001)(8676002)(36756003)(47076005);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2021 12:04:33.0057 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b117b6a4-261e-42c5-cf10-08d97e8a4e22 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: VE1EUR03FT004.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR08MB5512 srat_bad is used when NUMA initialization code scan SRAT failed. It will turn fw_numa to disabled status. Its implementation depends on NUMA implementation. We want every NUMA implementation to provide this function for common initialization code. In this patch, we export srat_bad to external. This will allow to have the code mostly common. Signed-off-by: Wei Chen --- xen/arch/x86/srat.c | 2 +- xen/include/asm-x86/numa.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/srat.c b/xen/arch/x86/srat.c index 0b8b0b0c95..94bd5b34da 100644 --- a/xen/arch/x86/srat.c +++ b/xen/arch/x86/srat.c @@ -163,7 +163,7 @@ static __init void cutoff_node(int i, paddr_t start, paddr_t end) } } -static __init void bad_srat(void) +__init void bad_srat(void) { int i; printk(KERN_ERR "SRAT: SRAT not used.\n"); diff --git a/xen/include/asm-x86/numa.h b/xen/include/asm-x86/numa.h index 295f875a51..a5690a7098 100644 --- a/xen/include/asm-x86/numa.h +++ b/xen/include/asm-x86/numa.h @@ -32,6 +32,7 @@ extern bool numa_off; extern int srat_disabled(void); +extern void bad_srat(void); extern void numa_set_node(int cpu, nodeid_t node); extern nodeid_t setup_node(unsigned int pxm); extern void srat_detect_node(int cpu); From patchwork Thu Sep 23 12:02:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 12512657 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 145DDC433F5 for ; Thu, 23 Sep 2021 12:17:55 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id BCBD2610A0 for ; Thu, 23 Sep 2021 12:17:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org BCBD2610A0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.193981.345642 (Exim 4.92) (envelope-from ) id 1mTNfe-0001O9-PM; Thu, 23 Sep 2021 12:17:46 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 193981.345642; Thu, 23 Sep 2021 12:17:46 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNfe-0001Kw-Db; Thu, 23 Sep 2021 12:17:46 +0000 Received: by outflank-mailman (input) for mailman id 193981; Thu, 23 Sep 2021 12:17:44 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNVQ-0005KP-5Q for xen-devel@lists.xenproject.org; Thu, 23 Sep 2021 12:07:12 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (unknown [2a01:111:f400:fe0c::621]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id bc77ab59-227c-4d3e-b0a2-387a2c701b56; Thu, 23 Sep 2021 12:04:27 +0000 (UTC) Received: from DB3PR08CA0035.eurprd08.prod.outlook.com (2603:10a6:8::48) by DB9PR08MB6586.eurprd08.prod.outlook.com (2603:10a6:10:23f::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.15; Thu, 23 Sep 2021 12:04:25 +0000 Received: from DB5EUR03FT028.eop-EUR03.prod.protection.outlook.com (2603:10a6:8:0:cafe::e2) by DB3PR08CA0035.outlook.office365.com (2603:10a6:8::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:25 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT028.mail.protection.outlook.com (10.152.20.99) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:25 +0000 Received: ("Tessian outbound 45760a30af4a:v103"); Thu, 23 Sep 2021 12:04:25 +0000 Received: from c6c05db66536.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id AF2ED06C-7B7F-499C-8A2E-123668EAFBD0.1; Thu, 23 Sep 2021 12:04:13 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id c6c05db66536.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 23 Sep 2021 12:04:13 +0000 Received: from AS9PR06CA0116.eurprd06.prod.outlook.com (2603:10a6:20b:465::26) by PR2PR08MB4732.eurprd08.prod.outlook.com (2603:10a6:101:26::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13; Thu, 23 Sep 2021 12:04:11 +0000 Received: from AM5EUR03FT011.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:465:cafe::19) by AS9PR06CA0116.outlook.office365.com (2603:10a6:20b:465::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.14 via Frontend Transport; Thu, 23 Sep 2021 12:04:11 +0000 Received: from nebula.arm.com (40.67.248.234) by AM5EUR03FT011.mail.protection.outlook.com (10.152.16.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:11 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.14; Thu, 23 Sep 2021 12:03:45 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Thu, 23 Sep 2021 12:03:44 +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: bc77ab59-227c-4d3e-b0a2-387a2c701b56 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=gw2w6BJL6KcQ0ikVAlb5sou0Hf1qviJ3JlTLvaJdQt8=; b=RpJ9V+UMlBJjkPmu7iFrbzNjdCJrgADjbpCyW3WMef1SdV5r0ra69IqLQSOmAv7kg7OkfZgM0n2AA8hHPyeTx3GomAMV5dDM/9VCnm+N/FsqTiJ+L4rUZNBCXYQ1Waa0RKGN4SoUu28ccuA0oMdIZQ2Ls6c1nqDGQmr65V1vYS8= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; X-CheckRecipientChecked: true X-CR-MTA-CID: 91056ac04821cc0b X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JnRn8B9dodBh4cqw4ukaJ3bCWbZq90l0CkzsHmIyMAvQnGCnkeq6jt8Yme1o5XQJCv2W/2yRGGTgDq+deQYs3E5HlZ5uqWejdro3C4k0cNYNuDsSH/IQqTktrylJt8HJ0ReYOSe1u5SmSuVGuouFP6Xb92PxywBwslPDwDLp2K0IJjAYLzKP0kwrg1bLpjm+rTQR3LaMsIB7wgvSq+NQPCWu8Pv2jtKP4fbSOsgL8+iFVTUxeyrA6Kwro1phjNkNUgT6EcAvcLQ1rHbdpr2UR5XmzfMe1mmQth8jBbCxK20MMBkHFJGGnuQT3KrOPG13MpD01258vGQVbHw8eBr4FQ== 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; bh=gw2w6BJL6KcQ0ikVAlb5sou0Hf1qviJ3JlTLvaJdQt8=; b=OnIvQiHhcT9oXK5fj1cQYUb9SIuPH6vKjvmfAejCXebo3gfHH6tRisNwV+X2R/ChUJXuJoIfUJ7s+K2nR6PHQpn1yaoTcWknSDC/E9WjKyBKAP/iPQyn7JFp07+OoWHhlYNTa6sCT3CaSEnXp9TXrwTJNt/B6DXIuoLlaAPFLkHzesuqjMJ7HX1lPXPY71sV93GPVfdjwksfsZoJvrmQR/mEvszLgVJe/XO/DVknROnpJfPqcWXvdxZRtxHIk8FHPmxgIMzO4Yr7voDwSMBrGAWX4gv7uscpf9IywpjGZvOdwERjr+29DjTynGRd5c5QlI+2Aw+y0JwMyWLGZvo9zA== 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=gw2w6BJL6KcQ0ikVAlb5sou0Hf1qviJ3JlTLvaJdQt8=; b=RpJ9V+UMlBJjkPmu7iFrbzNjdCJrgADjbpCyW3WMef1SdV5r0ra69IqLQSOmAv7kg7OkfZgM0n2AA8hHPyeTx3GomAMV5dDM/9VCnm+N/FsqTiJ+L4rUZNBCXYQ1Waa0RKGN4SoUu28ccuA0oMdIZQ2Ls6c1nqDGQmr65V1vYS8= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; From: Wei Chen To: , , , CC: Subject: [PATCH 17/37] xen/x86: use CONFIG_NUMA to gate numa_scan_nodes Date: Thu, 23 Sep 2021 20:02:16 +0800 Message-ID: <20210923120236.3692135-18-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210923120236.3692135-1-wei.chen@arm.com> References: <20210923120236.3692135-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 17f098ad-3726-48cd-6724-08d97e8a49cc X-MS-TrafficTypeDiagnostic: PR2PR08MB4732:|DB9PR08MB6586: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:4502;OLM:4502; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: c79r8fl9QOgjUlIj0mZwd76tk/WxM3P4kH2L9gF8vHcSV+3S/AkYfmF+PrDM3FE5sgYCwNAD6jrTUrN49Sgds/tJdF1FF/JaNYP1hw75PPTcDYr2iezAcWp3qtxPx9ZalPe5U5FQnA2N0j6zigcicJ4GISw1RCh07+xfEn1xyCCb7TwZ33Gi0wX/U58LLCZ2shEMJbtPkORa5KKSFyft8QTMbgxjwIcVukIyalR5T1EPnyUSbXqeZPs8MaHVs/pgcgj2E9MBO6LJS8eA5QIjKacj9QZj56o8EFITjaFXF8jYH3dVY4Q22jUyohRImAlhYyXi2a7oBKkh4+hPAO2Z5O2JMjS9ImW5daMum34e/NFPVwxFa/8cKbXgbIfh7MRms4RlFmiIaCUqvegdDUh+mAbpfEbMRypb2eE/8Z/8srwM1bRfH2L6Oau81Eu4GLUITE9Kq3hkB7eFTm26bVnTk+lD+AQa8YWwOi5CIQOfa+MsyRwEHY9zK6eqzcKHdhRd4/ERmmvoHjwiNVkLlqfiQI3s3q6EBfUCDNM5TKU8mkwHSyopFv/p5sXXum33O7z9Bs3Z4gwd847mQLtcwlD86wKSaR+eNSb8lM1eOXmVXwZQwi1I0GllRB5xMy5/MWYBI4+XyxVggIOyzJf08jPhdSnm8jR7K4coS7bFgWdk9TaeYo68casj/9zOhjyYAhPAG9TS8lBspTWwN4i0Gu+CPnck9+8fNF5oVn6uzcN27eU= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(4636009)(46966006)(36840700001)(70586007)(8936002)(47076005)(316002)(6666004)(82310400003)(70206006)(356005)(36860700001)(36756003)(5660300002)(86362001)(26005)(4326008)(508600001)(186003)(2906002)(2616005)(1076003)(44832011)(336012)(426003)(81166007)(110136005)(7696005)(8676002)(83380400001)(4744005)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR2PR08MB4732 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT028.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: db5b9d9a-8ce0-4c2e-586e-08d97e8a4142 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: N/b2iDMfuLcLCpVegkCQ0u/q7s5jiZ4c77YbMM9QDXVPF5ghVtm7lDnvhADPsRionksnFl5rwYuroGK0XB7EexXsa6bh8ypkWIMdHM1/gIPo+LbIHWplx89Wlfmk5qL9XwWLoRl0V3AtoSy2/xem9CvpdrZZzrxHup5HqINf59a20gNOy4QiB2XlF0rX486OjZCoClgbHgzJ+zPchY+v7N6igA9iCFb6lusHpEZ0bwOHcQV6HjhX/h1yPZsm8EmQwj9/AiymflgeS8aGZ5G3zdj5Kb/P7EpClOJ7n5Kl1pw2SCG0c5q7B3+QZimSwJl4h1EMDgUfHNKTlhx/cRtSO+O5FSgll8dbkK4cuLhNaFsAXizhD9dNx7PrasbF3F8B3OpaxJVyYhbJd5BcJ+sZD8C5wzUzrO+Xn1UqlsWjO6NVWZNHkgnzBpiJC+XCYk/75DQ8dahS8z9f+hwbi+9pSIfPWw8HCpVhorMoXiK8XSUV1AJDaH4U4JcjZ2v1P0TamLQCAA5x7IVESCRWcNiZFNWMHnqG/aLV/KgcU8nvHvgnXbxfySSX8GwjXgCN0KypSNtfyBS+AW+/Z9faed4ozGKdNFWb3gWk90WYQN7eNfCf3GW6PpzzfIZ6RFf9IXrS2JdUHUw5mrVg+Ngb+wuVrZN41yBYGF4kNQWES/2/CLmPOnzgsLLhBmweLdXic0/WT98kWn9hY3AkKOXK3VHmiQ== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(4636009)(46966006)(36840700001)(70586007)(6666004)(2906002)(8936002)(70206006)(110136005)(83380400001)(4326008)(82310400003)(4744005)(44832011)(5660300002)(81166007)(316002)(8676002)(508600001)(36756003)(1076003)(7696005)(26005)(186003)(426003)(86362001)(2616005)(336012)(47076005)(36860700001);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2021 12:04:25.8275 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 17f098ad-3726-48cd-6724-08d97e8a49cc 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: DB5EUR03FT028.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB6586 As we have turned numa_scan_nodes to neutral function. If we still use CONFIG_ACPI_NUMA in numa_initmem_init to gate numa_scan_nodes that doesn't make sense. As CONFIG_ACPI_NUMA will be selected by CONFIG_NUMA for x86. So in this patch, we replace CONFIG_ACPI_NUMA by CONFIG_NUMA. Signed-off-by: Wei Chen --- xen/arch/x86/numa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/x86/numa.c b/xen/arch/x86/numa.c index 8a4710df39..509d2738c0 100644 --- a/xen/arch/x86/numa.c +++ b/xen/arch/x86/numa.c @@ -260,7 +260,7 @@ void __init numa_initmem_init(unsigned long start_pfn, unsigned long end_pfn) start = pfn_to_paddr(start_pfn); end = pfn_to_paddr(end_pfn); -#ifdef CONFIG_ACPI_NUMA +#ifdef CONFIG_NUMA if ( !numa_off && !numa_scan_nodes(start, end) ) return; #endif From patchwork Thu Sep 23 12:02:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 12512575 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, UNWANTED_LANGUAGE_BODY,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8A744C433EF for ; Thu, 23 Sep 2021 12:08:06 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 246786105A for ; Thu, 23 Sep 2021 12:08:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 246786105A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.193891.345477 (Exim 4.92) (envelope-from ) id 1mTNW7-0000KE-1K; Thu, 23 Sep 2021 12:07:55 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 193891.345477; Thu, 23 Sep 2021 12:07:54 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNW6-0000K3-U1; Thu, 23 Sep 2021 12:07:54 +0000 Received: by outflank-mailman (input) for mailman id 193891; Thu, 23 Sep 2021 12:07:53 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNUf-0006xV-SO for xen-devel@lists.xenproject.org; Thu, 23 Sep 2021 12:06:25 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (unknown [40.107.20.79]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 6921c873-1c66-11ec-ba2e-12813bfff9fa; Thu, 23 Sep 2021 12:04:32 +0000 (UTC) Received: from AM5PR0402CA0010.eurprd04.prod.outlook.com (2603:10a6:203:90::20) by PAXPR08MB6765.eurprd08.prod.outlook.com (2603:10a6:102:138::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13; Thu, 23 Sep 2021 12:04:30 +0000 Received: from AM5EUR03FT010.eop-EUR03.prod.protection.outlook.com (2603:10a6:203:90:cafe::6d) by AM5PR0402CA0010.outlook.office365.com (2603:10a6:203:90::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:30 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT010.mail.protection.outlook.com (10.152.16.134) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:30 +0000 Received: ("Tessian outbound 71ebfb754289:v103"); Thu, 23 Sep 2021 12:04:28 +0000 Received: from 84eaf1236402.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 65DBA426-175E-4FCC-8368-5804DC4F84D7.1; Thu, 23 Sep 2021 12:04:15 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 84eaf1236402.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 23 Sep 2021 12:04:15 +0000 Received: from AS9PR06CA0167.eurprd06.prod.outlook.com (2603:10a6:20b:45c::19) by DB7PR08MB3130.eurprd08.prod.outlook.com (2603:10a6:5:24::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.18; Thu, 23 Sep 2021 12:04:12 +0000 Received: from VE1EUR03FT023.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:45c:cafe::8c) by AS9PR06CA0167.outlook.office365.com (2603:10a6:20b:45c::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:12 +0000 Received: from nebula.arm.com (40.67.248.234) by VE1EUR03FT023.mail.protection.outlook.com (10.152.18.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:12 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.14; Thu, 23 Sep 2021 12:03:48 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Thu, 23 Sep 2021 12:03:46 +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: 6921c873-1c66-11ec-ba2e-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xrDysX/S2+52U1YehehJRI4UKMo45On8F4OkTenZGx4=; b=dPKEVqbVjLK+Dd73OjXKsf1IOfOKtm/C2gsGtefZfDG5EnuHAQv8XsgZPwgr8UDUuSZElpoej2JfimPrX1MUAVMD0yJdRUJeZrvdcZAARwQxqnG4LfnplVI3LNm5iWHdgcUEqHsJaBs3GTQQdxpbTUb4fgHxGCiK8kPkSCI9JaA= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; X-CheckRecipientChecked: true X-CR-MTA-CID: 55bcb7f56a94619d X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VnmvMjXtCiJiEa6bRueK6qNZ3qUfzae3nl3YhBZrOheIKbhI0mGws/iuDSj+hIxzahP0+yP63ltrtwvb2v5V8SYJ/82caHPULuWWINghYfsAiuLCb/dGlWR+kB+cIyCo321biOL/N5pWgTbXbLqnefEsDd8CAImGCczHSjuvnTl82nyrC6hf2HzY/th1d8XUl5yHaziQA8B3nX5fUVJP98sYEY2lm+naOwQ52kxjuImL81OmIeynmjo8HtdkzZCpSLkxXq2xSuxC/YtVGxtYmDaKM96tuRqyut1vd3ANJ7scLFZOC9NtexytN7H7uq/dN9BqPvrNDZD2ACFf7M3QXQ== 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; bh=xrDysX/S2+52U1YehehJRI4UKMo45On8F4OkTenZGx4=; b=YLerJfRyvOjaJ9r2bvTF9bFJbEuW8Ea8M0wCXszAErRP1YeXRz8rLJZWOiBlLHwiczGDKt7fD158VYsDTYKnlyV0yzoB6aa/fJuBzoNoym/nG8g7RPOI7LhJxtfecXIDIMvdLK3JV0+wxAw1/nSZulNEra5vUhCAMPJOsFlfsGFEV9KrVvacf8oznuTF8i/pYUV1POanmH1aSNpSSGCokZNPfYZYt2nfKabHno7bHoy9BB94XDZUkxSgo8JB9FYiuyC9xssbTMfmgainF5xHEFLq4CccdZW+yRTKPkv8YmRPmroWpa3SISdpVstI4RHuUY0Z9BbvN8hm/v+CqfHYMg== 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=xrDysX/S2+52U1YehehJRI4UKMo45On8F4OkTenZGx4=; b=dPKEVqbVjLK+Dd73OjXKsf1IOfOKtm/C2gsGtefZfDG5EnuHAQv8XsgZPwgr8UDUuSZElpoej2JfimPrX1MUAVMD0yJdRUJeZrvdcZAARwQxqnG4LfnplVI3LNm5iWHdgcUEqHsJaBs3GTQQdxpbTUb4fgHxGCiK8kPkSCI9JaA= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; From: Wei Chen To: , , , CC: Subject: [PATCH 18/37] xen: move NUMA common code from x86 to common Date: Thu, 23 Sep 2021 20:02:17 +0800 Message-ID: <20210923120236.3692135-19-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210923120236.3692135-1-wei.chen@arm.com> References: <20210923120236.3692135-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1e3a1952-bb9c-4e26-fccc-08d97e8a4c7a X-MS-TrafficTypeDiagnostic: DB7PR08MB3130:|PAXPR08MB6765: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:126;OLM:126; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: ZDoQXjTV40+pt3K4l/xC/9iOrphtf0+TOGro6MlpfwcQSN9yw/HUl0et6vsYJ2RO8TEhCKOAGxU7Tjsfk2F/unyuxUwj0Ykii8RGyzv8Z2X2Em0Xdur9ToORb0Bms2s/awyTFH2br3t/sT85TSNByfXrTHCFNF7dhy5F84XGcbLqDy+4DM9lM0h7w7VqvtMt/tsfwVOjuixQE/rP4TZ6d+8xKQSkkOxaRYLfe28RujCrVJAWhil0zXjkYoV7dtg7XlRcoaEKpHJuilH1d6vDC1onizNBJy2HXy6y6j0IvK6v4AV3G6K5oSF6woFFtgnzgYKH+49R3lR7ECuujCkveG6igtI3J/jQfPYQkN5OOrs0yEAnr+2aO+71HvVzOBRxvJOhTqStCP0o8syY7CTwZOP5BdWMvZApyLALCReMubuKM9cBEHCYkgnTq0ftkT3QLAXKdJJzLzpwvWorJWjf+4DwC7BeKsv+/+o5pf9w1lufZ4tn1acNROMd9zcIZGi1p6TlwlAq1B3nITfcq9cOzwPNE/7LsigJfccKk9c2y6xTWfPmY12gesqBjoMH/DwIk2QxwB67u2BbN7pHO5j4rg7cn5OkgIuHoJsdG7/dvrs5GpOvKxogXQflNoyX3jvJj5dagbBa02cxkjifmjyHNpZEw6/1H1dEpNPhwuaSE36mP9hDY9K0PHTQFxYilu43pbxVUGt4VHHbMuiojoRG8qKaNwBaiGzyzRYdXrv+QS4= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(4636009)(46966006)(36840700001)(508600001)(7696005)(36860700001)(82310400003)(6666004)(70206006)(5660300002)(8936002)(1076003)(2906002)(36756003)(47076005)(81166007)(336012)(316002)(186003)(26005)(426003)(110136005)(86362001)(83380400001)(356005)(2616005)(30864003)(70586007)(4326008)(44832011)(8676002)(36900700001)(579004)(559001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB3130 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT010.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 289611dc-1bea-4388-dcc4-08d97e8a419a X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0vIdfW/KIwPYK1h+64vLB5OVUBWc82zdBTzmjKBPZkSgWXAh55TDOP9wQxLB7simV0iyiTY/N2gJr1VlyCcAxgNVEkcKoDXexfjqrP0WCKF8a6VVrVNXh6a/aul60/Ah9v0IMa6YydLFfvrRgLUN+ybti9vjppKdOljJL6vp2e//LNVHmUPPursQizFxtYZp9eR+4IZiZdRemiW+BaLxyAafEGcH0070DrqhCtLe8+t0w+Op/vDsTDr7X/bC5r3axzPcFU3BZOFV3AdVTgVo2ljC/RCUx5JI1KWCokbgPCecdVlGr8x/7YjoguhmTC1niyD049zgSYEFmIe0n0mJ6WgawpZ1qdVZq+VfnZRPhlAWDgyXw4xQlkFVOZsueqPdKj1UAbvNpWzyQ9wJU8fxIY/3z5/SccnLqMaY4WG1NDgoasDFguEa+z1UUCLYtRnAk5gpq1MGs6DCi53J3soAhUZcfYNb6++FtfGxxJRQGCErD3764lgz/5qqBOyl7ooRyi2nIx9q0/utvHyn+71nUb7W1WBETzFcoRIHV3gIuGCi1krA5ed2aOcfnzzwdlPFMArf+Lvbk2p8Bbq7YUvSMXBuGkGVC5cM2+59QoupJSPm0UxbReEKJhg5Kd/41eXSBZVyDCDg4UDZ1zDV0HgL127s7tSbGEOqG8IoG9L7PhNDN2GY9nvwCd/MYyC/LpzLBDOGimWGzMm4M9UqTMCOrA== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(4636009)(46966006)(36840700001)(82310400003)(8936002)(81166007)(26005)(316002)(70206006)(47076005)(4326008)(508600001)(83380400001)(70586007)(36756003)(110136005)(6666004)(8676002)(336012)(7696005)(36860700001)(86362001)(30864003)(44832011)(186003)(1076003)(5660300002)(2906002)(2616005)(426003)(559001)(579004);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2021 12:04:30.2651 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1e3a1952-bb9c-4e26-fccc-08d97e8a4c7a 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: AM5EUR03FT010.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB6765 Some common code has been decoupled and abstracted from x86 ACPI based NUMA implementation. In order to make this code can be reused by other NUMA implementation, we move this code from x86 to common folder. And this code is gated by CONFIG_NUMA, it only can be used by those architectures that NUMA is enabled. For those architectures do not support NUMA, they still can implementation NUMA stub API in asm/numa.h to make NUMA-aware components happy. In this patch, we also remove some unused include headers. Signed-off-by: Wei Chen --- xen/arch/x86/numa.c | 446 +---------------------------------- xen/arch/x86/srat.c | 253 +------------------- xen/common/Makefile | 2 + xen/common/numa.c | 450 ++++++++++++++++++++++++++++++++++++ xen/common/numa_srat.c | 264 +++++++++++++++++++++ xen/include/asm-x86/acpi.h | 4 - xen/include/asm-x86/numa.h | 68 ------ xen/include/asm-x86/setup.h | 1 - xen/include/xen/numa.h | 82 +++++++ 9 files changed, 802 insertions(+), 768 deletions(-) create mode 100644 xen/common/numa.c create mode 100644 xen/common/numa_srat.c diff --git a/xen/arch/x86/numa.c b/xen/arch/x86/numa.c index 509d2738c0..92b6bdf7b9 100644 --- a/xen/arch/x86/numa.c +++ b/xen/arch/x86/numa.c @@ -3,24 +3,13 @@ * Copyright 2002,2003 Andi Kleen, SuSE Labs. * Adapted for Xen: Ryan Harper */ - -#include -#include #include -#include +#include #include #include -#include -#include -#include -#include -#include -#include #include -#include -static int numa_setup(const char *s); -custom_param("numa", numa_setup); +#include #ifndef Dprintk #define Dprintk(x...) @@ -29,300 +18,12 @@ custom_param("numa", numa_setup); /* from proto.h */ #define round_up(x,y) ((((x)+(y))-1) & (~((y)-1))) -struct node_data node_data[MAX_NUMNODES]; - -/* Mapping from pdx to node id */ -int memnode_shift; -static typeof(*memnodemap) _memnodemap[64]; -unsigned long memnodemapsize; -u8 *memnodemap; - -nodeid_t cpu_to_node[NR_CPUS] __read_mostly = { - [0 ... NR_CPUS-1] = NUMA_NO_NODE -}; /* * Keep BIOS's CPU2node information, should not be used for memory allocaion */ nodeid_t apicid_to_node[MAX_LOCAL_APIC] = { [0 ... MAX_LOCAL_APIC-1] = NUMA_NO_NODE }; -cpumask_t node_to_cpumask[MAX_NUMNODES] __read_mostly; - -nodemask_t __read_mostly node_online_map = { { [0] = 1UL } }; - -bool numa_off; -s8 fw_numa = 0; - -int srat_disabled(void) -{ - return numa_off || fw_numa < 0; -} - -/* - * Given a shift value, try to populate memnodemap[] - * Returns : - * 1 if OK - * 0 if memnodmap[] too small (of shift too small) - * -1 if node overlap or lost ram (shift too big) - */ -static int __init populate_memnodemap(const struct node *nodes, - int numnodes, int shift, nodeid_t *nodeids) -{ - unsigned long spdx, epdx; - int i, res = -1; - - memset(memnodemap, NUMA_NO_NODE, memnodemapsize * sizeof(*memnodemap)); - for ( i = 0; i < numnodes; i++ ) - { - spdx = paddr_to_pdx(nodes[i].start); - epdx = paddr_to_pdx(nodes[i].end - 1) + 1; - if ( spdx >= epdx ) - continue; - if ( (epdx >> shift) >= memnodemapsize ) - return 0; - do { - if ( memnodemap[spdx >> shift] != NUMA_NO_NODE ) - return -1; - - if ( !nodeids ) - memnodemap[spdx >> shift] = i; - else - memnodemap[spdx >> shift] = nodeids[i]; - - spdx += (1UL << shift); - } while ( spdx < epdx ); - res = 1; - } - - return res; -} - -static int __init allocate_cachealigned_memnodemap(void) -{ - unsigned long size = PFN_UP(memnodemapsize * sizeof(*memnodemap)); - unsigned long mfn = mfn_x(alloc_boot_pages(size, 1)); - - memnodemap = mfn_to_virt(mfn); - mfn <<= PAGE_SHIFT; - size <<= PAGE_SHIFT; - printk(KERN_DEBUG "NUMA: Allocated memnodemap from %lx - %lx\n", - mfn, mfn + size); - memnodemapsize = size / sizeof(*memnodemap); - - return 0; -} - -/* - * The LSB of all start and end addresses in the node map is the value of the - * maximum possible shift. - */ -static int __init extract_lsb_from_nodes(const struct node *nodes, - int numnodes) -{ - int i, nodes_used = 0; - unsigned long spdx, epdx; - unsigned long bitfield = 0, memtop = 0; - - for ( i = 0; i < numnodes; i++ ) - { - spdx = paddr_to_pdx(nodes[i].start); - epdx = paddr_to_pdx(nodes[i].end - 1) + 1; - if ( spdx >= epdx ) - continue; - bitfield |= spdx; - nodes_used++; - if ( epdx > memtop ) - memtop = epdx; - } - if ( nodes_used <= 1 ) - i = BITS_PER_LONG - 1; - else - i = find_first_bit(&bitfield, sizeof(unsigned long)*8); - memnodemapsize = (memtop >> i) + 1; - return i; -} - -int __init compute_hash_shift(struct node *nodes, int numnodes, - nodeid_t *nodeids) -{ - int shift; - - shift = extract_lsb_from_nodes(nodes, numnodes); - if ( memnodemapsize <= ARRAY_SIZE(_memnodemap) ) - memnodemap = _memnodemap; - else if ( allocate_cachealigned_memnodemap() ) - return -1; - printk(KERN_DEBUG "NUMA: Using %d for the hash shift.\n", shift); - - if ( populate_memnodemap(nodes, numnodes, shift, nodeids) != 1 ) - { - printk(KERN_INFO "Your memory is not aligned you need to " - "rebuild your hypervisor with a bigger NODEMAPSIZE " - "shift=%d\n", shift); - return -1; - } - - return shift; -} -/* initialize NODE_DATA given nodeid and start/end */ -void __init setup_node_bootmem(nodeid_t nodeid, paddr_t start, paddr_t end) -{ - unsigned long start_pfn, end_pfn; - - start_pfn = paddr_to_pfn(start); - end_pfn = paddr_to_pfn(end); - - NODE_DATA(nodeid)->node_start_pfn = start_pfn; - NODE_DATA(nodeid)->node_spanned_pages = end_pfn - start_pfn; - - node_set_online(nodeid); -} - -void __init numa_init_array(void) -{ - int rr, i; - - /* There are unfortunately some poorly designed mainboards around - that only connect memory to a single CPU. This breaks the 1:1 cpu->node - mapping. To avoid this fill in the mapping for all possible - CPUs, as the number of CPUs is not known yet. - We round robin the existing nodes. */ - rr = first_node(node_online_map); - for ( i = 0; i < nr_cpu_ids; i++ ) - { - if ( cpu_to_node[i] != NUMA_NO_NODE ) - continue; - numa_set_node(i, rr); - rr = cycle_node(rr, node_online_map); - } -} - -#ifdef CONFIG_NUMA_EMU -static int numa_fake __initdata = 0; - -/* Numa emulation */ -static int __init numa_emulation(unsigned long start_pfn, - unsigned long end_pfn) -{ - int i; - struct node nodes[MAX_NUMNODES]; - u64 sz = pfn_to_paddr(end_pfn - start_pfn) / numa_fake; - - /* Kludge needed for the hash function */ - if ( hweight64(sz) > 1 ) - { - u64 x = 1; - while ( (x << 1) < sz ) - x <<= 1; - if ( x < sz/2 ) - printk(KERN_ERR "Numa emulation unbalanced. Complain to maintainer\n"); - sz = x; - } - - memset(&nodes,0,sizeof(nodes)); - for ( i = 0; i < numa_fake; i++ ) - { - nodes[i].start = pfn_to_paddr(start_pfn) + i*sz; - if ( i == numa_fake - 1 ) - sz = pfn_to_paddr(end_pfn) - nodes[i].start; - nodes[i].end = nodes[i].start + sz; - printk(KERN_INFO "Faking node %d at %"PRIx64"-%"PRIx64" (%"PRIu64"MB)\n", - i, - nodes[i].start, nodes[i].end, - (nodes[i].end - nodes[i].start) >> 20); - node_set_online(i); - } - memnode_shift = compute_hash_shift(nodes, numa_fake, NULL); - if ( memnode_shift < 0 ) - { - memnode_shift = 0; - printk(KERN_ERR "No NUMA hash function found. Emulation disabled.\n"); - return -1; - } - for_each_online_node ( i ) - setup_node_bootmem(i, nodes[i].start, nodes[i].end); - numa_init_array(); - - return 0; -} -#endif - -void __init numa_initmem_init(unsigned long start_pfn, unsigned long end_pfn) -{ - int i; - paddr_t start, end; - -#ifdef CONFIG_NUMA_EMU - if ( numa_fake && !numa_emulation(start_pfn, end_pfn) ) - return; -#endif - - start = pfn_to_paddr(start_pfn); - end = pfn_to_paddr(end_pfn); - -#ifdef CONFIG_NUMA - if ( !numa_off && !numa_scan_nodes(start, end) ) - return; -#endif - - printk(KERN_INFO "%s\n", - numa_off ? "NUMA turned off" : "No NUMA configuration found"); - - printk(KERN_INFO "Faking a node at %016"PRIpaddr"-%016"PRIpaddr"\n", - start, end); - /* setup dummy node covering all memory */ - memnode_shift = BITS_PER_LONG - 1; - memnodemap = _memnodemap; - /* Dummy node only uses 1 slot in reality */ - memnodemap[0] = 0; - memnodemapsize = 1; - - nodes_clear(node_online_map); - node_set_online(0); - for ( i = 0; i < nr_cpu_ids; i++ ) - numa_set_node(i, 0); - cpumask_copy(&node_to_cpumask[0], cpumask_of(0)); - setup_node_bootmem(0, start, end); -} - -void numa_add_cpu(int cpu) -{ - cpumask_set_cpu(cpu, &node_to_cpumask[cpu_to_node(cpu)]); -} - -void numa_set_node(int cpu, nodeid_t node) -{ - cpu_to_node[cpu] = node; -} - -/* [numa=off] */ -static __init int numa_setup(const char *opt) -{ - if ( !strncmp(opt,"off",3) ) - numa_off = true; - else if ( !strncmp(opt,"on",2) ) - numa_off = false; -#ifdef CONFIG_NUMA_EMU - else if ( !strncmp(opt, "fake=", 5) ) - { - numa_off = false; - numa_fake = simple_strtoul(opt+5,NULL,0); - if ( numa_fake >= MAX_NUMNODES ) - numa_fake = MAX_NUMNODES; - } -#endif -#ifdef CONFIG_ACPI_NUMA - else if ( !strncmp(opt,"noacpi",6) ) - { - numa_off = false; - fw_numa = -1; - } -#endif - else - return -EINVAL; - - return 0; -} /* * Setup early cpu_to_node. @@ -395,146 +96,3 @@ int __init arch_meminfo_get_ram_bank_range(uint32_t bank, return 0; } - -static void dump_numa(unsigned char key) -{ - s_time_t now = NOW(); - unsigned int i, j, n; - struct domain *d; - struct page_info *page; - unsigned int page_num_node[MAX_NUMNODES]; - const struct vnuma_info *vnuma; - - printk("'%c' pressed -> dumping numa info (now = %"PRI_stime")\n", key, - now); - - for_each_online_node ( i ) - { - paddr_t pa = pfn_to_paddr(node_start_pfn(i) + 1); - - printk("NODE%u start->%lu size->%lu free->%lu\n", - i, node_start_pfn(i), node_spanned_pages(i), - avail_node_heap_pages(i)); - /* sanity check phys_to_nid() */ - if ( phys_to_nid(pa) != i ) - printk("phys_to_nid(%"PRIpaddr") -> %d should be %u\n", - pa, phys_to_nid(pa), i); - } - - j = cpumask_first(&cpu_online_map); - n = 0; - for_each_online_cpu ( i ) - { - if ( i != j + n || cpu_to_node[j] != cpu_to_node[i] ) - { - if ( n > 1 ) - printk("CPU%u...%u -> NODE%d\n", j, j + n - 1, cpu_to_node[j]); - else - printk("CPU%u -> NODE%d\n", j, cpu_to_node[j]); - j = i; - n = 1; - } - else - ++n; - } - if ( n > 1 ) - printk("CPU%u...%u -> NODE%d\n", j, j + n - 1, cpu_to_node[j]); - else - printk("CPU%u -> NODE%d\n", j, cpu_to_node[j]); - - rcu_read_lock(&domlist_read_lock); - - printk("Memory location of each domain:\n"); - for_each_domain ( d ) - { - process_pending_softirqs(); - - printk("Domain %u (total: %u):\n", d->domain_id, domain_tot_pages(d)); - - for_each_online_node ( i ) - page_num_node[i] = 0; - - spin_lock(&d->page_alloc_lock); - page_list_for_each(page, &d->page_list) - { - i = phys_to_nid(page_to_maddr(page)); - page_num_node[i]++; - } - spin_unlock(&d->page_alloc_lock); - - for_each_online_node ( i ) - printk(" Node %u: %u\n", i, page_num_node[i]); - - if ( !read_trylock(&d->vnuma_rwlock) ) - continue; - - if ( !d->vnuma ) - { - read_unlock(&d->vnuma_rwlock); - continue; - } - - vnuma = d->vnuma; - printk(" %u vnodes, %u vcpus, guest physical layout:\n", - vnuma->nr_vnodes, d->max_vcpus); - for ( i = 0; i < vnuma->nr_vnodes; i++ ) - { - unsigned int start_cpu = ~0U; - - if ( vnuma->vnode_to_pnode[i] == NUMA_NO_NODE ) - printk(" %3u: pnode ???,", i); - else - printk(" %3u: pnode %3u,", i, vnuma->vnode_to_pnode[i]); - - printk(" vcpus "); - - for ( j = 0; j < d->max_vcpus; j++ ) - { - if ( !(j & 0x3f) ) - process_pending_softirqs(); - - if ( vnuma->vcpu_to_vnode[j] == i ) - { - if ( start_cpu == ~0U ) - { - printk("%d", j); - start_cpu = j; - } - } - else if ( start_cpu != ~0U ) - { - if ( j - 1 != start_cpu ) - printk("-%d ", j - 1); - else - printk(" "); - start_cpu = ~0U; - } - } - - if ( start_cpu != ~0U && start_cpu != j - 1 ) - printk("-%d", j - 1); - - printk("\n"); - - for ( j = 0; j < vnuma->nr_vmemranges; j++ ) - { - if ( vnuma->vmemrange[j].nid == i ) - printk(" %016"PRIx64" - %016"PRIx64"\n", - vnuma->vmemrange[j].start, - vnuma->vmemrange[j].end); - } - } - - read_unlock(&d->vnuma_rwlock); - } - - rcu_read_unlock(&domlist_read_lock); -} - -static __init int register_numa_trigger(void) -{ - register_keyhandler('u', dump_numa, "dump NUMA info", 1); - return 0; -} -__initcall(register_numa_trigger); - diff --git a/xen/arch/x86/srat.c b/xen/arch/x86/srat.c index 94bd5b34da..44517c7b62 100644 --- a/xen/arch/x86/srat.c +++ b/xen/arch/x86/srat.c @@ -10,24 +10,19 @@ * * Adapted for Xen: Ryan Harper */ - +#include #include #include -#include #include -#include #include #include + #include #include #include static struct acpi_table_slit *__read_mostly acpi_slit; -static nodemask_t memory_nodes_parsed __initdata; -static nodemask_t processor_nodes_parsed __initdata; -static struct node nodes[MAX_NUMNODES] __initdata; - struct pxm2node { unsigned pxm; nodeid_t node; @@ -37,11 +32,6 @@ static struct pxm2node __read_mostly pxm2node[MAX_NUMNODES] = static unsigned node_to_pxm(nodeid_t n); -static int num_node_memblks; -static struct node node_memblk_range[NR_NODE_MEMBLKS]; -static nodeid_t memblk_nodeid[NR_NODE_MEMBLKS]; -static __initdata DECLARE_BITMAP(memblk_hotplug, NR_NODE_MEMBLKS); - static inline bool node_found(unsigned idx, unsigned pxm) { return ((pxm2node[idx].pxm == pxm) && @@ -104,65 +94,6 @@ nodeid_t setup_node(unsigned pxm) return node; } -void __init numa_set_processor_nodes_parsed(nodeid_t node) -{ - node_set(node, processor_nodes_parsed); -} - -bool __init numa_memblks_available(void) -{ - if (num_node_memblks < NR_NODE_MEMBLKS) - return true; - - return false; -} - -int valid_numa_range(paddr_t start, paddr_t end, nodeid_t node) -{ - int i; - - for (i = 0; i < num_node_memblks; i++) { - struct node *nd = &node_memblk_range[i]; - - if (nd->start <= start && nd->end >= end && - memblk_nodeid[i] == node) - return 1; - } - - return 0; -} - -static __init int conflicting_memblks(paddr_t start, paddr_t end) -{ - int i; - - for (i = 0; i < num_node_memblks; i++) { - struct node *nd = &node_memblk_range[i]; - if (nd->start == nd->end) - continue; - if (nd->end > start && nd->start < end) - return i; - if (nd->end == end && nd->start == start) - return i; - } - return -1; -} - -static __init void cutoff_node(int i, paddr_t start, paddr_t end) -{ - struct node *nd = &nodes[i]; - if (nd->start < start) { - nd->start = start; - if (nd->end < nd->start) - nd->start = nd->end; - } - if (nd->end > end) { - nd->end = end; - if (nd->start > nd->end) - nd->start = nd->end; - } -} - __init void bad_srat(void) { int i; @@ -284,97 +215,6 @@ acpi_numa_processor_affinity_init(const struct acpi_srat_cpu_affinity *pa) pxm, pa->apic_id, node); } -/* - * Check to see if there are other nodes within this node's range. - * We just need to check full contains situation. Because overlaps - * have been checked before by conflicting_memblks. - */ -static bool __init is_node_memory_continuous(nodeid_t nid, - paddr_t start, paddr_t end) -{ - nodeid_t i; - - struct node *nd = &nodes[nid]; - for_each_node_mask(i, memory_nodes_parsed) - { - /* Skip itself */ - if (i == nid) - continue; - - nd = &nodes[i]; - if (start < nd->start && nd->end < end) - { - printk(KERN_ERR - "NODE %u: (%"PRIpaddr"-%"PRIpaddr") intertwine with NODE %u (%"PRIpaddr"-%"PRIpaddr")\n", - nid, start, end, i, nd->start, nd->end); - return false; - } - } - - return true; -} - -/* Neutral NUMA memory affinity init function for ACPI and DT */ -int __init numa_update_node_memblks(nodeid_t node, - paddr_t start, paddr_t size, bool hotplug) -{ - paddr_t end = start + size; - int i; - - /* 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 = !hotplug != !test_bit(i, memblk_hotplug); - - printk("%sSRAT: NODE %u (%"PRIpaddr"-%"PRIpaddr") overlaps with itself (%"PRIpaddr"-%"PRIpaddr")\n", - mismatch ? KERN_ERR : KERN_WARNING, node, start, end, - node_memblk_range[i].start, node_memblk_range[i].end); - if (mismatch) { - return -1; - } - } else { - printk(KERN_ERR - "SRAT: NODE %u (%"PRIpaddr"-%"PRIpaddr") overlaps with NODE %u (%"PRIpaddr"-%"PRIpaddr")\n", - node, start, end, memblk_nodeid[i], - node_memblk_range[i].start, node_memblk_range[i].end); - return -1; - } - - if (!hotplug) { - 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; - - if (!is_node_memory_continuous(node, nd->start, nd->end)) - return -1; - } - } - - printk(KERN_INFO "SRAT: Node %u %"PRIpaddr"-%"PRIpaddr"%s\n", - node, start, end, hotplug ? " (hotplug)" : ""); - - node_memblk_range[num_node_memblks].start = start; - node_memblk_range[num_node_memblks].end = end; - memblk_nodeid[num_node_memblks] = node; - if (hotplug) { - __set_bit(num_node_memblks, memblk_hotplug); - if (end > mem_hotplug_boundary()) - mem_hotplug_update_boundary(end); - } - num_node_memblks++; - - return 0; -} - /* Callback for parsing of the Proximity Domain <-> Memory Area mappings */ void __init acpi_numa_memory_affinity_init(const struct acpi_srat_mem_affinity *ma) @@ -419,45 +259,6 @@ acpi_numa_memory_affinity_init(const struct acpi_srat_mem_affinity *ma) bad_srat(); } -/* Sanity check to catch more bad SRATs (they are amazingly common). - Make sure the PXMs cover all memory. */ -static int __init nodes_cover_memory(void) -{ - int i; - uint32_t nr_banks = arch_meminfo_get_nr_bank(); - - for (i = 0; i < nr_banks; i++) { - int j, found; - paddr_t start, end; - - if (arch_meminfo_get_ram_bank_range(i, &start, &end)) - continue; - - do { - found = 0; - for_each_node_mask(j, memory_nodes_parsed) - if (start < nodes[j].end - && end > nodes[j].start) { - if (start >= nodes[j].start) { - start = nodes[j].end; - found = 1; - } - if (end <= nodes[j].end) { - end = nodes[j].start; - found = 1; - } - } - } while (found && start < end); - - if (start < end) { - printk(KERN_ERR "SRAT: No NODE for memory map range: " - "%"PRIpaddr" - %"PRIpaddr"\n", start, end); - return 0; - } - } - return 1; -} - void __init acpi_numa_arch_fixup(void) {} static uint64_t __initdata srat_region_mask; @@ -511,56 +312,6 @@ void __init srat_parse_regions(paddr_t addr) pfn_pdx_hole_setup(mask >> PAGE_SHIFT); } -/* Use the information discovered above to actually set up the nodes. */ -int __init numa_scan_nodes(paddr_t start, paddr_t end) -{ - int i; - nodemask_t all_nodes_parsed; - - /* First clean up the node list */ - for (i = 0; i < MAX_NUMNODES; i++) - cutoff_node(i, start, end); - - if (fw_numa <= 0) - return -1; - - if (!nodes_cover_memory()) { - bad_srat(); - return -1; - } - - memnode_shift = compute_hash_shift(node_memblk_range, num_node_memblks, - memblk_nodeid); - - if (memnode_shift < 0) { - printk(KERN_ERR - "SRAT: No NUMA node hash function found. Contact maintainer\n"); - bad_srat(); - return -1; - } - - nodes_or(all_nodes_parsed, memory_nodes_parsed, processor_nodes_parsed); - - /* Finally register nodes */ - for_each_node_mask(i, all_nodes_parsed) - { - paddr_t size = nodes[i].end - nodes[i].start; - if ( size == 0 ) - printk(KERN_WARNING "SRAT: Node %u has no memory. " - "Firmware Bug or mis-configured hardware?\n", i); - - setup_node_bootmem(i, nodes[i].start, nodes[i].end); - } - for (i = 0; i < nr_cpu_ids; i++) { - if (cpu_to_node[i] == NUMA_NO_NODE) - continue; - if (!nodemask_test(cpu_to_node[i], &processor_nodes_parsed)) - numa_set_node(i, NUMA_NO_NODE); - } - numa_init_array(); - return 0; -} - static unsigned node_to_pxm(nodeid_t n) { unsigned i; diff --git a/xen/common/Makefile b/xen/common/Makefile index 54de70d422..90e5bf3efb 100644 --- a/xen/common/Makefile +++ b/xen/common/Makefile @@ -26,6 +26,8 @@ obj-$(CONFIG_MEM_ACCESS) += mem_access.o obj-y += memory.o obj-y += multicall.o obj-y += notifier.o +obj-$(CONFIG_NUMA) += numa.o +obj-$(CONFIG_NUMA) += numa_srat.o obj-y += page_alloc.o obj-$(CONFIG_HAS_PDX) += pdx.o obj-$(CONFIG_PERF_COUNTERS) += perfc.o diff --git a/xen/common/numa.c b/xen/common/numa.c new file mode 100644 index 0000000000..fc6bba3981 --- /dev/null +++ b/xen/common/numa.c @@ -0,0 +1,450 @@ +/* + * Generic VM initialization for NUMA setups. + * Copyright 2002,2003 Andi Kleen, SuSE Labs. + * Adapted for Xen: Ryan Harper + */ +#include +#include +#include +#include +#include +#include + +#include +#include + +static int numa_setup(const char *s); +custom_param("numa", numa_setup); + +struct node_data node_data[MAX_NUMNODES]; + +/* Mapping from pdx to node id */ +int memnode_shift; +static typeof(*memnodemap) _memnodemap[64]; +unsigned long memnodemapsize; +u8 *memnodemap; + +nodeid_t cpu_to_node[NR_CPUS] __read_mostly = { + [0 ... NR_CPUS-1] = NUMA_NO_NODE +}; + +cpumask_t node_to_cpumask[MAX_NUMNODES] __read_mostly; +nodemask_t __read_mostly node_online_map = { { [0] = 1UL } }; + +bool numa_off; +s8 fw_numa = 0; + +int srat_disabled(void) +{ + return numa_off || fw_numa < 0; +} + +/* + * Given a shift value, try to populate memnodemap[] + * Returns : + * 1 if OK + * 0 if memnodmap[] too small (of shift too small) + * -1 if node overlap or lost ram (shift too big) + */ +static int __init populate_memnodemap(const struct node *nodes, + int numnodes, int shift, nodeid_t *nodeids) +{ + unsigned long spdx, epdx; + int i, res = -1; + + memset(memnodemap, NUMA_NO_NODE, memnodemapsize * sizeof(*memnodemap)); + for ( i = 0; i < numnodes; i++ ) + { + spdx = paddr_to_pdx(nodes[i].start); + epdx = paddr_to_pdx(nodes[i].end - 1) + 1; + if ( spdx >= epdx ) + continue; + if ( (epdx >> shift) >= memnodemapsize ) + return 0; + do { + if ( memnodemap[spdx >> shift] != NUMA_NO_NODE ) + return -1; + + if ( !nodeids ) + memnodemap[spdx >> shift] = i; + else + memnodemap[spdx >> shift] = nodeids[i]; + + spdx += (1UL << shift); + } while ( spdx < epdx ); + res = 1; + } + + return res; +} + +static int __init allocate_cachealigned_memnodemap(void) +{ + unsigned long size = PFN_UP(memnodemapsize * sizeof(*memnodemap)); + unsigned long mfn = mfn_x(alloc_boot_pages(size, 1)); + + memnodemap = mfn_to_virt(mfn); + mfn <<= PAGE_SHIFT; + size <<= PAGE_SHIFT; + printk(KERN_DEBUG "NUMA: Allocated memnodemap from %lx - %lx\n", + mfn, mfn + size); + memnodemapsize = size / sizeof(*memnodemap); + + return 0; +} + +/* + * The LSB of all start and end addresses in the node map is the value of the + * maximum possible shift. + */ +static int __init extract_lsb_from_nodes(const struct node *nodes, + int numnodes) +{ + int i, nodes_used = 0; + unsigned long spdx, epdx; + unsigned long bitfield = 0, memtop = 0; + + for ( i = 0; i < numnodes; i++ ) + { + spdx = paddr_to_pdx(nodes[i].start); + epdx = paddr_to_pdx(nodes[i].end - 1) + 1; + if ( spdx >= epdx ) + continue; + bitfield |= spdx; + nodes_used++; + if ( epdx > memtop ) + memtop = epdx; + } + if ( nodes_used <= 1 ) + i = BITS_PER_LONG - 1; + else + i = find_first_bit(&bitfield, sizeof(unsigned long)*8); + memnodemapsize = (memtop >> i) + 1; + return i; +} + +int __init compute_hash_shift(struct node *nodes, int numnodes, + nodeid_t *nodeids) +{ + int shift; + + shift = extract_lsb_from_nodes(nodes, numnodes); + if ( memnodemapsize <= ARRAY_SIZE(_memnodemap) ) + memnodemap = _memnodemap; + else if ( allocate_cachealigned_memnodemap() ) + return -1; + printk(KERN_DEBUG "NUMA: Using %d for the hash shift.\n", shift); + + if ( populate_memnodemap(nodes, numnodes, shift, nodeids) != 1 ) + { + printk(KERN_INFO "Your memory is not aligned you need to " + "rebuild your hypervisor with a bigger NODEMAPSIZE " + "shift=%d\n", shift); + return -1; + } + + return shift; +} +/* initialize NODE_DATA given nodeid and start/end */ +void __init setup_node_bootmem(nodeid_t nodeid, paddr_t start, paddr_t end) +{ + unsigned long start_pfn, end_pfn; + + start_pfn = paddr_to_pfn(start); + end_pfn = paddr_to_pfn(end); + + NODE_DATA(nodeid)->node_start_pfn = start_pfn; + NODE_DATA(nodeid)->node_spanned_pages = end_pfn - start_pfn; + + node_set_online(nodeid); +} + +void __init numa_init_array(void) +{ + int rr, i; + + /* There are unfortunately some poorly designed mainboards around + that only connect memory to a single CPU. This breaks the 1:1 cpu->node + mapping. To avoid this fill in the mapping for all possible + CPUs, as the number of CPUs is not known yet. + We round robin the existing nodes. */ + rr = first_node(node_online_map); + for ( i = 0; i < nr_cpu_ids; i++ ) + { + if ( cpu_to_node[i] != NUMA_NO_NODE ) + continue; + numa_set_node(i, rr); + rr = cycle_node(rr, node_online_map); + } +} + +#ifdef CONFIG_NUMA_EMU +static int numa_fake __initdata = 0; + +/* Numa emulation */ +static int __init numa_emulation(unsigned long start_pfn, + unsigned long end_pfn) +{ + int i; + struct node nodes[MAX_NUMNODES]; + u64 sz = pfn_to_paddr(end_pfn - start_pfn) / numa_fake; + + /* Kludge needed for the hash function */ + if ( hweight64(sz) > 1 ) + { + u64 x = 1; + while ( (x << 1) < sz ) + x <<= 1; + if ( x < sz/2 ) + printk(KERN_ERR "Numa emulation unbalanced. Complain to maintainer\n"); + sz = x; + } + + memset(&nodes,0,sizeof(nodes)); + for ( i = 0; i < numa_fake; i++ ) + { + nodes[i].start = pfn_to_paddr(start_pfn) + i*sz; + if ( i == numa_fake - 1 ) + sz = pfn_to_paddr(end_pfn) - nodes[i].start; + nodes[i].end = nodes[i].start + sz; + printk(KERN_INFO "Faking node %d at %"PRIx64"-%"PRIx64" (%"PRIu64"MB)\n", + i, + nodes[i].start, nodes[i].end, + (nodes[i].end - nodes[i].start) >> 20); + node_set_online(i); + } + memnode_shift = compute_hash_shift(nodes, numa_fake, NULL); + if ( memnode_shift < 0 ) + { + memnode_shift = 0; + printk(KERN_ERR "No NUMA hash function found. Emulation disabled.\n"); + return -1; + } + for_each_online_node ( i ) + setup_node_bootmem(i, nodes[i].start, nodes[i].end); + numa_init_array(); + + return 0; +} +#endif + +void __init numa_initmem_init(unsigned long start_pfn, unsigned long end_pfn) +{ + int i; + paddr_t start, end; + +#ifdef CONFIG_NUMA_EMU + if ( numa_fake && !numa_emulation(start_pfn, end_pfn) ) + return; +#endif + + start = pfn_to_paddr(start_pfn); + end = pfn_to_paddr(end_pfn); + +#ifdef CONFIG_NUMA + if ( !numa_off && !numa_scan_nodes(start, end) ) + return; +#endif + + printk(KERN_INFO "%s\n", + numa_off ? "NUMA turned off" : "No NUMA configuration found"); + + printk(KERN_INFO "Faking a node at %016"PRIpaddr"-%016"PRIpaddr"\n", + start, end); + /* setup dummy node covering all memory */ + memnode_shift = BITS_PER_LONG - 1; + memnodemap = _memnodemap; + /* Dummy node only uses 1 slot in reality */ + memnodemap[0] = 0; + memnodemapsize = 1; + + nodes_clear(node_online_map); + node_set_online(0); + for ( i = 0; i < nr_cpu_ids; i++ ) + numa_set_node(i, 0); + cpumask_copy(&node_to_cpumask[0], cpumask_of(0)); + setup_node_bootmem(0, start, end); +} + +void numa_add_cpu(int cpu) +{ + cpumask_set_cpu(cpu, &node_to_cpumask[cpu_to_node(cpu)]); +} + +void numa_set_node(int cpu, nodeid_t node) +{ + cpu_to_node[cpu] = node; +} + + +/* [numa=off] */ +static __init int numa_setup(const char *opt) +{ + if ( !strncmp(opt,"off",3) ) + numa_off = true; + else if ( !strncmp(opt,"on",2) ) + numa_off = false; +#ifdef CONFIG_NUMA_EMU + else if ( !strncmp(opt, "fake=", 5) ) + { + numa_off = false; + numa_fake = simple_strtoul(opt+5,NULL,0); + if ( numa_fake >= MAX_NUMNODES ) + numa_fake = MAX_NUMNODES; + } +#endif +#ifdef CONFIG_ACPI_NUMA + else if ( !strncmp(opt,"noacpi",6) ) + { + numa_off = false; + fw_numa = -1; + } +#endif + else + return -EINVAL; + + return 0; +} + + +static void dump_numa(unsigned char key) +{ + s_time_t now = NOW(); + unsigned int i, j, n; + struct domain *d; + struct page_info *page; + unsigned int page_num_node[MAX_NUMNODES]; + const struct vnuma_info *vnuma; + + printk("'%c' pressed -> dumping numa info (now = %"PRI_stime")\n", key, + now); + + for_each_online_node ( i ) + { + paddr_t pa = pfn_to_paddr(node_start_pfn(i) + 1); + + printk("NODE%u start->%lu size->%lu free->%lu\n", + i, node_start_pfn(i), node_spanned_pages(i), + avail_node_heap_pages(i)); + /* sanity check phys_to_nid() */ + if ( phys_to_nid(pa) != i ) + printk("phys_to_nid(%"PRIpaddr") -> %d should be %u\n", + pa, phys_to_nid(pa), i); + } + + j = cpumask_first(&cpu_online_map); + n = 0; + for_each_online_cpu ( i ) + { + if ( i != j + n || cpu_to_node[j] != cpu_to_node[i] ) + { + if ( n > 1 ) + printk("CPU%u...%u -> NODE%d\n", j, j + n - 1, cpu_to_node[j]); + else + printk("CPU%u -> NODE%d\n", j, cpu_to_node[j]); + j = i; + n = 1; + } + else + ++n; + } + if ( n > 1 ) + printk("CPU%u...%u -> NODE%d\n", j, j + n - 1, cpu_to_node[j]); + else + printk("CPU%u -> NODE%d\n", j, cpu_to_node[j]); + + rcu_read_lock(&domlist_read_lock); + + printk("Memory location of each domain:\n"); + for_each_domain ( d ) + { + process_pending_softirqs(); + + printk("Domain %u (total: %u):\n", d->domain_id, domain_tot_pages(d)); + + for_each_online_node ( i ) + page_num_node[i] = 0; + + spin_lock(&d->page_alloc_lock); + page_list_for_each(page, &d->page_list) + { + i = phys_to_nid(page_to_maddr(page)); + page_num_node[i]++; + } + spin_unlock(&d->page_alloc_lock); + + for_each_online_node ( i ) + printk(" Node %u: %u\n", i, page_num_node[i]); + + if ( !read_trylock(&d->vnuma_rwlock) ) + continue; + + if ( !d->vnuma ) + { + read_unlock(&d->vnuma_rwlock); + continue; + } + + vnuma = d->vnuma; + printk(" %u vnodes, %u vcpus, guest physical layout:\n", + vnuma->nr_vnodes, d->max_vcpus); + for ( i = 0; i < vnuma->nr_vnodes; i++ ) + { + unsigned int start_cpu = ~0U; + + if ( vnuma->vnode_to_pnode[i] == NUMA_NO_NODE ) + printk(" %3u: pnode ???,", i); + else + printk(" %3u: pnode %3u,", i, vnuma->vnode_to_pnode[i]); + + printk(" vcpus "); + + for ( j = 0; j < d->max_vcpus; j++ ) + { + if ( !(j & 0x3f) ) + process_pending_softirqs(); + + if ( vnuma->vcpu_to_vnode[j] == i ) + { + if ( start_cpu == ~0U ) + { + printk("%d", j); + start_cpu = j; + } + } + else if ( start_cpu != ~0U ) + { + if ( j - 1 != start_cpu ) + printk("-%d ", j - 1); + else + printk(" "); + start_cpu = ~0U; + } + } + + if ( start_cpu != ~0U && start_cpu != j - 1 ) + printk("-%d", j - 1); + + printk("\n"); + + for ( j = 0; j < vnuma->nr_vmemranges; j++ ) + { + if ( vnuma->vmemrange[j].nid == i ) + printk(" %016"PRIx64" - %016"PRIx64"\n", + vnuma->vmemrange[j].start, + vnuma->vmemrange[j].end); + } + } + + read_unlock(&d->vnuma_rwlock); + } + + rcu_read_unlock(&domlist_read_lock); +} + +static __init int register_numa_trigger(void) +{ + register_keyhandler('u', dump_numa, "dump NUMA info", 1); + return 0; +} +__initcall(register_numa_trigger); diff --git a/xen/common/numa_srat.c b/xen/common/numa_srat.c new file mode 100644 index 0000000000..7bda2ecef6 --- /dev/null +++ b/xen/common/numa_srat.c @@ -0,0 +1,264 @@ +/* + * ACPI 3.0 based NUMA setup + * Copyright 2004 Andi Kleen, SuSE Labs. + * + * Reads the ACPI SRAT table to figure out what memory belongs to which CPUs. + * + * Called from acpi_numa_init while reading the SRAT and SLIT tables. + * Assumes all memory regions belonging to a single proximity domain + * are in one chunk. Holes between them will be included in the node. + * + * Adapted for Xen: Ryan Harper + */ +#include +#include +#include +#include + +static nodemask_t memory_nodes_parsed __initdata; +static nodemask_t processor_nodes_parsed __initdata; +static struct node nodes[MAX_NUMNODES] __initdata; + +static int num_node_memblks; +static struct node node_memblk_range[NR_NODE_MEMBLKS]; +static nodeid_t memblk_nodeid[NR_NODE_MEMBLKS]; +static __initdata DECLARE_BITMAP(memblk_hotplug, NR_NODE_MEMBLKS); + +void __init numa_set_processor_nodes_parsed(nodeid_t node) +{ + node_set(node, processor_nodes_parsed); +} + +bool __init numa_memblks_available(void) +{ + if (num_node_memblks < NR_NODE_MEMBLKS) + return true; + + return false; +} + +int valid_numa_range(paddr_t start, paddr_t end, nodeid_t node) +{ + int i; + + for (i = 0; i < num_node_memblks; i++) { + struct node *nd = &node_memblk_range[i]; + + if (nd->start <= start && nd->end >= end && + memblk_nodeid[i] == node) + return 1; + } + + return 0; +} + +static __init int conflicting_memblks(paddr_t start, paddr_t end) +{ + int i; + + for (i = 0; i < num_node_memblks; i++) { + struct node *nd = &node_memblk_range[i]; + if (nd->start == nd->end) + continue; + if (nd->end > start && nd->start < end) + return i; + if (nd->end == end && nd->start == start) + return i; + } + return -1; +} + +static __init void cutoff_node(int i, paddr_t start, paddr_t end) +{ + struct node *nd = &nodes[i]; + if (nd->start < start) { + nd->start = start; + if (nd->end < nd->start) + nd->start = nd->end; + } + if (nd->end > end) { + nd->end = end; + if (nd->start > nd->end) + nd->start = nd->end; + } +} + +/* + * Check to see if there are other nodes within this node's range. + * We just need to check full contains situation. Because overlaps + * have been checked before by conflicting_memblks. + */ +static bool __init is_node_memory_continuous(nodeid_t nid, + paddr_t start, paddr_t end) +{ + nodeid_t i; + + struct node *nd = &nodes[nid]; + for_each_node_mask(i, memory_nodes_parsed) + { + /* Skip itself */ + if (i == nid) + continue; + + nd = &nodes[i]; + if (start < nd->start && nd->end < end) + { + printk(KERN_ERR + "NODE %u: (%"PRIpaddr"-%"PRIpaddr") intertwine with NODE %u (%"PRIpaddr"-%"PRIpaddr")\n", + nid, start, end, i, nd->start, nd->end); + return false; + } + } + + return true; +} + +/* Neutral NUMA memory affinity init function for ACPI and DT */ +int __init numa_update_node_memblks(nodeid_t node, + paddr_t start, paddr_t size, bool hotplug) +{ + paddr_t end = start + size; + int i; + + /* 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 = !hotplug != !test_bit(i, memblk_hotplug); + + printk("%sSRAT: NODE %u (%"PRIpaddr"-%"PRIpaddr") overlaps with itself (%"PRIpaddr"-%"PRIpaddr")\n", + mismatch ? KERN_ERR : KERN_WARNING, node, start, end, + node_memblk_range[i].start, node_memblk_range[i].end); + if (mismatch) { + return -1; + } + } else { + printk(KERN_ERR + "SRAT: NODE %u (%"PRIpaddr"-%"PRIpaddr") overlaps with NODE %u (%"PRIpaddr"-%"PRIpaddr")\n", + node, start, end, memblk_nodeid[i], + node_memblk_range[i].start, node_memblk_range[i].end); + return -1; + } + + if (!hotplug) { + 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; + + if (!is_node_memory_continuous(node, nd->start, nd->end)) + return -1; + } + } + + printk(KERN_INFO "SRAT: Node %u %"PRIpaddr"-%"PRIpaddr"%s\n", + node, start, end, hotplug ? " (hotplug)" : ""); + + node_memblk_range[num_node_memblks].start = start; + node_memblk_range[num_node_memblks].end = end; + memblk_nodeid[num_node_memblks] = node; + if (hotplug) { + __set_bit(num_node_memblks, memblk_hotplug); + if (end > mem_hotplug_boundary()) + mem_hotplug_update_boundary(end); + } + num_node_memblks++; + + return 0; +} + +/* Sanity check to catch more bad SRATs (they are amazingly common). + Make sure the PXMs cover all memory. */ +static int __init nodes_cover_memory(void) +{ + int i; + uint32_t nr_banks = arch_meminfo_get_nr_bank(); + + for (i = 0; i < nr_banks; i++) { + int j, found; + paddr_t start, end; + + if (arch_meminfo_get_ram_bank_range(i, &start, &end)) + continue; + + do { + found = 0; + for_each_node_mask(j, memory_nodes_parsed) + if (start < nodes[j].end + && end > nodes[j].start) { + if (start >= nodes[j].start) { + start = nodes[j].end; + found = 1; + } + if (end <= nodes[j].end) { + end = nodes[j].start; + found = 1; + } + } + } while (found && start < end); + + if (start < end) { + printk(KERN_ERR "SRAT: No NODE for memory map range: " + "%"PRIpaddr" - %"PRIpaddr"\n", start, end); + return 0; + } + } + return 1; +} + +/* Use the information discovered above to actually set up the nodes. */ +int __init numa_scan_nodes(paddr_t start, paddr_t end) +{ + int i; + nodemask_t all_nodes_parsed; + + /* First clean up the node list */ + for (i = 0; i < MAX_NUMNODES; i++) + cutoff_node(i, start, end); + + if (fw_numa <= 0) + return -1; + + if (!nodes_cover_memory()) { + bad_srat(); + return -1; + } + + memnode_shift = compute_hash_shift(node_memblk_range, num_node_memblks, + memblk_nodeid); + + if (memnode_shift < 0) { + printk(KERN_ERR + "SRAT: No NUMA node hash function found. Contact maintainer\n"); + bad_srat(); + return -1; + } + + nodes_or(all_nodes_parsed, memory_nodes_parsed, processor_nodes_parsed); + + /* Finally register nodes */ + for_each_node_mask(i, all_nodes_parsed) + { + paddr_t size = nodes[i].end - nodes[i].start; + if ( size == 0 ) + printk(KERN_WARNING "SRAT: Node %u has no memory. " + "Firmware Bug or mis-configured hardware?\n", i); + + setup_node_bootmem(i, nodes[i].start, nodes[i].end); + } + for (i = 0; i < nr_cpu_ids; i++) { + if (cpu_to_node[i] == NUMA_NO_NODE) + continue; + if (!nodemask_test(cpu_to_node[i], &processor_nodes_parsed)) + numa_set_node(i, NUMA_NO_NODE); + } + numa_init_array(); + return 0; +} diff --git a/xen/include/asm-x86/acpi.h b/xen/include/asm-x86/acpi.h index 2add971072..2140461ff3 100644 --- a/xen/include/asm-x86/acpi.h +++ b/xen/include/asm-x86/acpi.h @@ -101,10 +101,6 @@ extern unsigned long acpi_wakeup_address; #define ARCH_HAS_POWER_INIT 1 -extern s8 fw_numa; -extern int numa_scan_nodes(u64 start, u64 end); -#define NR_NODE_MEMBLKS (MAX_NUMNODES*2) - extern struct acpi_sleep_info acpi_sinfo; #define acpi_video_flags bootsym(video_flags) struct xenpf_enter_acpi_sleep; diff --git a/xen/include/asm-x86/numa.h b/xen/include/asm-x86/numa.h index a5690a7098..cd407804c8 100644 --- a/xen/include/asm-x86/numa.h +++ b/xen/include/asm-x86/numa.h @@ -7,85 +7,17 @@ typedef u8 nodeid_t; extern int srat_rev; -extern nodeid_t cpu_to_node[NR_CPUS]; -extern cpumask_t node_to_cpumask[]; - -#define cpu_to_node(cpu) (cpu_to_node[cpu]) -#define parent_node(node) (node) -#define node_to_first_cpu(node) (__ffs(node_to_cpumask[node])) -#define node_to_cpumask(node) (node_to_cpumask[node]) - -struct node { - paddr_t start,end; -}; - -extern int compute_hash_shift(struct node *nodes, int numnodes, - nodeid_t *nodeids); extern nodeid_t pxm_to_node(unsigned int pxm); #define ZONE_ALIGN (1UL << (MAX_ORDER+PAGE_SHIFT)) -#define VIRTUAL_BUG_ON(x) - -extern void numa_add_cpu(int cpu); -extern void numa_init_array(void); -extern bool numa_off; - -extern int srat_disabled(void); -extern void bad_srat(void); -extern void numa_set_node(int cpu, nodeid_t node); extern nodeid_t setup_node(unsigned int pxm); -extern void srat_detect_node(int cpu); -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); -static inline void clear_node_cpumask(int cpu) -{ - cpumask_clear_cpu(cpu, &node_to_cpumask[cpu_to_node(cpu)]); -} - -/* Simple perfect hash to map pdx to node numbers */ -extern int memnode_shift; -extern unsigned long memnodemapsize; -extern u8 *memnodemap; - -struct node_data { - unsigned long node_start_pfn; - unsigned long node_spanned_pages; -}; - -extern struct node_data node_data[]; - -static inline __attribute__((pure)) nodeid_t phys_to_nid(paddr_t addr) -{ - nodeid_t nid; - VIRTUAL_BUG_ON((paddr_to_pdx(addr) >> memnode_shift) >= memnodemapsize); - nid = memnodemap[paddr_to_pdx(addr) >> memnode_shift]; - VIRTUAL_BUG_ON(nid >= MAX_NUMNODES || !node_data[nid]); - return nid; -} - -#define NODE_DATA(nid) (&(node_data[nid])) - -#define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn) -#define node_spanned_pages(nid) (NODE_DATA(nid)->node_spanned_pages) -#define node_end_pfn(nid) (NODE_DATA(nid)->node_start_pfn + \ - NODE_DATA(nid)->node_spanned_pages) - -extern int valid_numa_range(paddr_t start, paddr_t end, nodeid_t node); -extern bool numa_memblks_available(void); -extern int numa_update_node_memblks(nodeid_t node, - paddr_t start, paddr_t size, bool hotplug); -extern void numa_set_processor_nodes_parsed(nodeid_t node); - void srat_parse_regions(paddr_t addr); -extern u8 __node_distance(nodeid_t a, nodeid_t b); unsigned int arch_get_dma_bitsize(void); unsigned int arch_have_default_dmazone(void); -extern uint32_t arch_meminfo_get_nr_bank(void); -extern int arch_meminfo_get_ram_bank_range(uint32_t bank, - paddr_t *start, paddr_t *end); #endif diff --git a/xen/include/asm-x86/setup.h b/xen/include/asm-x86/setup.h index 24be46115d..63838ba2d1 100644 --- a/xen/include/asm-x86/setup.h +++ b/xen/include/asm-x86/setup.h @@ -17,7 +17,6 @@ void early_time_init(void); void set_nr_cpu_ids(unsigned int max_cpus); -void numa_initmem_init(unsigned long start_pfn, unsigned long end_pfn); void arch_init_memory(void); void subarch_init_memory(void); diff --git a/xen/include/xen/numa.h b/xen/include/xen/numa.h index 52950a3150..51391a2440 100644 --- a/xen/include/xen/numa.h +++ b/xen/include/xen/numa.h @@ -12,10 +12,92 @@ #define MAX_NUMNODES 1 #endif +#define NR_NODE_MEMBLKS (MAX_NUMNODES*2) + #define vcpu_to_node(v) (cpu_to_node((v)->processor)) #define domain_to_node(d) \ (((d)->vcpu != NULL && (d)->vcpu[0] != NULL) \ ? vcpu_to_node((d)->vcpu[0]) : NUMA_NO_NODE) +/* The following content can be used when NUMA feature is enabled */ +#ifdef CONFIG_NUMA + +extern nodeid_t cpu_to_node[NR_CPUS]; +extern cpumask_t node_to_cpumask[]; + +#define cpu_to_node(cpu) (cpu_to_node[cpu]) +#define parent_node(node) (node) +#define node_to_first_cpu(node) (__ffs(node_to_cpumask[node])) +#define node_to_cpumask(node) (node_to_cpumask[node]) + +struct node { + paddr_t start,end; +}; + +extern int compute_hash_shift(struct node *nodes, int numnodes, + nodeid_t *nodeids); + +#define VIRTUAL_BUG_ON(x) + +extern void numa_add_cpu(int cpu); +extern void numa_init_array(void); +extern bool numa_off; +extern s8 fw_numa; + +extern int srat_disabled(void); +extern void srat_detect_node(int cpu); +extern void bad_srat(void); + +extern void numa_initmem_init(unsigned long start_pfn, unsigned long end_pfn); +extern void numa_set_node(int cpu, nodeid_t node); +extern void setup_node_bootmem(nodeid_t nodeid, paddr_t start, paddr_t end); + +static inline void clear_node_cpumask(int cpu) +{ + cpumask_clear_cpu(cpu, &node_to_cpumask[cpu_to_node(cpu)]); +} + +/* Simple perfect hash to map pdx to node numbers */ +extern int memnode_shift; +extern unsigned long memnodemapsize; +extern u8 *memnodemap; + +struct node_data { + unsigned long node_start_pfn; + unsigned long node_spanned_pages; +}; + +extern struct node_data node_data[]; + +static inline __attribute__((pure)) nodeid_t phys_to_nid(paddr_t addr) +{ + nodeid_t nid; + VIRTUAL_BUG_ON((paddr_to_pdx(addr) >> memnode_shift) >= memnodemapsize); + nid = memnodemap[paddr_to_pdx(addr) >> memnode_shift]; + VIRTUAL_BUG_ON(nid >= MAX_NUMNODES || !node_data[nid]); + return nid; +} + +#define NODE_DATA(nid) (&(node_data[nid])) + +#define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn) +#define node_spanned_pages(nid) (NODE_DATA(nid)->node_spanned_pages) +#define node_end_pfn(nid) (NODE_DATA(nid)->node_start_pfn + \ + NODE_DATA(nid)->node_spanned_pages) + +extern int valid_numa_range(paddr_t start, paddr_t end, nodeid_t node); +extern bool numa_memblks_available(void); +extern int numa_update_node_memblks(nodeid_t node, + paddr_t start, paddr_t size, bool hotplug); +extern void numa_set_processor_nodes_parsed(nodeid_t node); +extern int numa_scan_nodes(u64 start, u64 end); + +extern u8 __node_distance(nodeid_t a, nodeid_t b); +extern uint32_t arch_meminfo_get_nr_bank(void); +extern int arch_meminfo_get_ram_bank_range(uint32_t bank, + paddr_t *start, paddr_t *end); + +#endif + #endif /* _XEN_NUMA_H */ From patchwork Thu Sep 23 12:02:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 12512573 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AAEE0C433F5 for ; Thu, 23 Sep 2021 12:08:05 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 654EC610A0 for ; Thu, 23 Sep 2021 12:08:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 654EC610A0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.193893.345481 (Exim 4.92) (envelope-from ) id 1mTNW7-0000Pk-DU; Thu, 23 Sep 2021 12:07:55 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 193893.345481; Thu, 23 Sep 2021 12:07: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 1mTNW7-0000Of-9x; Thu, 23 Sep 2021 12:07:55 +0000 Received: by outflank-mailman (input) for mailman id 193893; Thu, 23 Sep 2021 12:07:54 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNUa-0006xV-S6 for xen-devel@lists.xenproject.org; Thu, 23 Sep 2021 12:06:20 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (unknown [40.107.20.74]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 6adcd31b-1c66-11ec-ba2e-12813bfff9fa; Thu, 23 Sep 2021 12:04:36 +0000 (UTC) Received: from AM5PR0301CA0002.eurprd03.prod.outlook.com (2603:10a6:206:14::15) by HE1PR0802MB2315.eurprd08.prod.outlook.com (2603:10a6:3:ce::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.15; Thu, 23 Sep 2021 12:04:34 +0000 Received: from AM5EUR03FT003.eop-EUR03.prod.protection.outlook.com (2603:10a6:206:14:cafe::16) by AM5PR0301CA0002.outlook.office365.com (2603:10a6:206:14::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:34 +0000 Received: from 64aa7808-outbound-2.mta.getcheckrecipient.com (63.33.187.114) by AM5EUR03FT003.mail.protection.outlook.com (10.152.16.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:33 +0000 Received: ("Tessian outbound ac52c8afb262:v103"); Thu, 23 Sep 2021 12:04:32 +0000 Received: from 3124b1183ca6.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id E577C1D4-DFD8-4C86-913D-901855A7A0C2.1; Thu, 23 Sep 2021 12:04:14 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 3124b1183ca6.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 23 Sep 2021 12:04:14 +0000 Received: from AS9PR06CA0113.eurprd06.prod.outlook.com (2603:10a6:20b:465::30) by AM6PR08MB4982.eurprd08.prod.outlook.com (2603:10a6:20b:e9::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.15; Thu, 23 Sep 2021 12:04:13 +0000 Received: from AM5EUR03FT011.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:465:cafe::85) by AS9PR06CA0113.outlook.office365.com (2603:10a6:20b:465::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:13 +0000 Received: from nebula.arm.com (40.67.248.234) by AM5EUR03FT011.mail.protection.outlook.com (10.152.16.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:13 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.14; Thu, 23 Sep 2021 12:03:50 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Thu, 23 Sep 2021 12:03:49 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 6adcd31b-1c66-11ec-ba2e-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZFMSX7kfVCjWvqyxLu5Vopy2J4u9k63suSpDv1EU3iI=; b=mn8H/P0wlD9W4Jjhm6SuLAFA+LdS15mS+hUtfQigrl9Yts9BL3i7VQeqrW1eWizJFmvif0G3GboqudQGZ8YMUO27lZCcw84IdRkzis+24AEa4MBO8jEevjLdPTsbkYtRw0A940gObTlww3VUs4jnuap5469FyB6y8q6x1rjyQHg= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.33.187.114) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.33.187.114 as permitted sender) receiver=protection.outlook.com; client-ip=63.33.187.114; helo=64aa7808-outbound-2.mta.getcheckrecipient.com; X-CheckRecipientChecked: true X-CR-MTA-CID: bc0074091b2e4c39 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VAvzdiKhJ693OkRMHlVbdKjkCvpQqnRLT6umZKZl4gzY5GPJ4judYzgsEt87afVGs7iPOZFELC1EQgkbcsD/uUSdMZg62DL9fevfwijPi8bzmP6GKx7nTkytANjuo6T8MDbT74TcqKHlq4IQQZTj5lESsSiSXF8ZdiJDysR5X1QwPJvoeofZ+GcGhKNsFuDrbtZtL+ThNl/WibyY1DiCfa9LQ60xz/7na0dgkudxZBiVcWTuiLhcfuwJrh2IDaW1ieqTeZk5TxDvOy2gkPvgixGy5s9Ih1fjWydiiHujuSHJawJgfrJG5dqkqxVfnvHXsV6ZHtFBhMcFyRTVBPXPuQ== 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; bh=ZFMSX7kfVCjWvqyxLu5Vopy2J4u9k63suSpDv1EU3iI=; b=A3gipSIHHCKy+RvocsRbvcCiAKQ7Z3Fh4jfItJV+Osbx37N8YpzCedezpB8RXsKL2PY/J/CPLlNe2r/y8kF2sMiDXQ9PTDcXjlle2TumoYrkh6kOD5q32EhQ/WqVQqoVFHgH8P+HKP14kuFer+Pm8hiCHphmfNsp1IAU5lOsGhA2wJ2hkm3ljCy2o8JWAdD7K5YBNQ6shrpd2KcZmgjuc21PNvauvM7qP/GK28wLkvU2qsYhF7C5zbS1f1fNnFFrfW2rkn6z4Jx4YlIMyrUaflWtVTYpice/s9P27umo5KEo/qX9ZEGWrXLwbGDPd1PNiqcri7P6qPRhcoSMLBY96Q== 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=ZFMSX7kfVCjWvqyxLu5Vopy2J4u9k63suSpDv1EU3iI=; b=mn8H/P0wlD9W4Jjhm6SuLAFA+LdS15mS+hUtfQigrl9Yts9BL3i7VQeqrW1eWizJFmvif0G3GboqudQGZ8YMUO27lZCcw84IdRkzis+24AEa4MBO8jEevjLdPTsbkYtRw0A940gObTlww3VUs4jnuap5469FyB6y8q6x1rjyQHg= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; From: Wei Chen To: , , , CC: Subject: [PATCH 19/37] xen/x86: promote VIRTUAL_BUG_ON to ASSERT in Date: Thu, 23 Sep 2021 20:02:18 +0800 Message-ID: <20210923120236.3692135-20-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210923120236.3692135-1-wei.chen@arm.com> References: <20210923120236.3692135-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8764a4c3-746d-4754-faaa-08d97e8a4e6a X-MS-TrafficTypeDiagnostic: AM6PR08MB4982:|HE1PR0802MB2315: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:7691;OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: n8uxqib7f3ru9cUC2VMn0teeR+5V9e0wem/w0c57WFvwf1l/SyZJRIW0Dg/7zm53LaR/pcIZsn2Tnaff0C0cJ47u9d4MdTwPjH7H+nLY1LJ8r9gE0aZHouhvOMHJOEwSBFqXt7WjB++sdUPDhzS03liZ4V5XcrHVCLIO/1IAqmOxam1bTK6raMBcNTLQbtj6ocCi2aXfuFxdDWD6YFdhPMpY7Kt9K+dZNlpo1vGTYeLKtBVs6+d/2x8I3hLL4RGQWi4Hj4Nb6NPN11FnY6nxxD/ubQFNpDTHU6KWrqkSJXt+LHBnNtGs3Fuy7c0HhTrRIPKn9VimDTzNv/HsAjtZK+m1T3arofcjAuyjjDYLBWF06y0q160cCttwzNrWlX7/mptMwt75GcvdPlphDEq5x9XRcdr8qzLSifyRwd2T+bLBVYmY0mXcqe8bJ1x8MoWAkhg520TSVc0UjU15L53GY89g6aC8qxVFS1mhomC7T26tWEBLrpmglW/uqh948cseTv/scQso89ujPeLQPDwDGgfxZsv47Jj08kYwNIh3YqLt4IzImTJOGLSmA44yzSmMweQHRBh4vDV/CPt/NjQbLEkdrNp2FTZMQ5q+sn76gvjkoRIreYp/NTVvLy4Yyn6/w0hpDyvGUveBVJJM14euZulpflNu4X8pdVZxVlQvI4j+KjhokNSmIE0Mmm6aNvDnuJqofZKXfmOWZ0Kjky5h3QbYIPAJNftcBaZNb6fJ9CU= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(4636009)(36840700001)(46966006)(26005)(1076003)(7696005)(426003)(86362001)(186003)(508600001)(36756003)(36860700001)(336012)(2616005)(47076005)(83380400001)(4326008)(82310400003)(70206006)(110136005)(70586007)(6666004)(2906002)(8936002)(81166007)(356005)(5660300002)(316002)(8676002)(44832011)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB4982 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT003.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 95e6c592-b26b-4360-cead-08d97e8a4241 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6S0QU/gT8VHvkWiuYcfU76N1/0d2aYlyMVvOKqFKbPdwQBE6TpzSTYBTtklh1EIm19zFU4x5pjuC1m2rMTCxkjC8ZKL/bkdCaVkBKnAm7KF2+gBBqhg6VyfYCMxY0ncBjGrvWjbT21Y4A8gqsie/+dGsmybFAgmTy0Wc6aABgwOJhzwUdNYbn/cE6eyJBPILtuq/1I4zvLrWUO0DFqhovwyV8xoUdhTUor/0G2SoW3aSt/vKwK38WvCVZJfFx8kfspTv+68oGbt1Q7ROaggcg+R3PklA3+YrM3N1tCrleHHf8kJGF1+hTsfHhQrGC/xYt1lQB8y9yaRids/S/fX1Yq4xuBlVj2DoCnPxvSa/ukXVsHDW+paMWDav7wedjCNJHrie5Ta7TR7FoLxtV9XHUFqYxEvcNU2dh2pwgbwhgip9xFlfyNnfQqCm+cBBNuEYbc3tc6daBs6HVzUoem6M37mzY+TEeexY+rnOe+p9PfoS05EqOiZ5LD+7E2Y8yC8M/PIZqkbX0s9+z6oHCyh46jRKfSp6Bf5WWgMsOmWtkjs366KeSBPUo2I+5Onb46grMqaeeyvsZl9jiGabLVrj8tYuJ1oFqePhfzExHKWmOaBzMk6eD1j0CBrKxz2/NQ0K7I96wlVnPVfaWRqeYFGULIyLYohUzlHRHYdU9e0D/vp3uv4IQ4iRHXxgrS02tvwK9kpTE0Cxr++OBN0eamgpjA== X-Forefront-Antispam-Report: CIP:63.33.187.114;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-2.mta.getcheckrecipient.com;PTR:ec2-63-33-187-114.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(4636009)(36840700001)(46966006)(186003)(36756003)(7696005)(26005)(8676002)(6666004)(82310400003)(4326008)(44832011)(336012)(426003)(83380400001)(2906002)(86362001)(508600001)(81166007)(1076003)(70586007)(5660300002)(36860700001)(2616005)(8936002)(316002)(70206006)(47076005)(110136005);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2021 12:04:33.5327 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8764a4c3-746d-4754-faaa-08d97e8a4e6a X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.33.187.114];Helo=[64aa7808-outbound-2.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM5EUR03FT003.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0802MB2315 VIRTUAL_BUG_ON that is using in phys_to_nid is an empty macro. This results in two lines of error-checking code in phys_to_nid are not actually working. It also covers up two compilation errors: 1. error: ‘MAX_NUMNODES’ undeclared (first use in this function). This is because MAX_NUMNODES is defined in xen/numa.h. But asm/numa.h is a dependent file of xen/numa.h, we can't include xen/numa.h in asm/numa.h. This error has been fixed after we move phys_to_nid to xen/numa.h. 2. error: wrong type argument to unary exclamation mark. This is becuase, the error-checking code contains !node_data[nid]. But node_data is a data structure variable, it's not a pointer. So, in this patch, we use ASSERT in VIRTUAL_BUG_ON to enable the two lines of error-checking code. And fix the the left compilation errors by replacing !node_data[nid] to !node_data[nid].node_spanned_pages. Because when node_spanned_pages is 0, this node has no memory. numa_scan_node will print warning message for such kind of nodes: "Firmware Bug or mis-configured hardware?". Even Xen allows to online such kind of nodes. I still think it's impossible for phys_to_nid to return a no memory node for a physical address. Signed-off-by: Wei Chen --- xen/include/xen/numa.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/include/xen/numa.h b/xen/include/xen/numa.h index 51391a2440..1978e2be1b 100644 --- a/xen/include/xen/numa.h +++ b/xen/include/xen/numa.h @@ -38,7 +38,7 @@ struct node { extern int compute_hash_shift(struct node *nodes, int numnodes, nodeid_t *nodeids); -#define VIRTUAL_BUG_ON(x) +#define VIRTUAL_BUG_ON(x) ASSERT(!(x)) extern void numa_add_cpu(int cpu); extern void numa_init_array(void); @@ -75,7 +75,7 @@ static inline __attribute__((pure)) nodeid_t phys_to_nid(paddr_t addr) nodeid_t nid; VIRTUAL_BUG_ON((paddr_to_pdx(addr) >> memnode_shift) >= memnodemapsize); nid = memnodemap[paddr_to_pdx(addr) >> memnode_shift]; - VIRTUAL_BUG_ON(nid >= MAX_NUMNODES || !node_data[nid]); + VIRTUAL_BUG_ON(nid >= MAX_NUMNODES || !node_data[nid].node_spanned_pages); return nid; } From patchwork Thu Sep 23 12:02:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 12512651 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D3EB6C433F5 for ; Thu, 23 Sep 2021 12:17:51 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 6C4AA610A0 for ; Thu, 23 Sep 2021 12:17:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6C4AA610A0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.193974.345609 (Exim 4.92) (envelope-from ) id 1mTNfb-0000Yp-EQ; Thu, 23 Sep 2021 12:17:43 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 193974.345609; Thu, 23 Sep 2021 12:17:43 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNfb-0000YQ-8U; Thu, 23 Sep 2021 12:17:43 +0000 Received: by outflank-mailman (input) for mailman id 193974; Thu, 23 Sep 2021 12:17:41 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNVu-0005KP-6K for xen-devel@lists.xenproject.org; Thu, 23 Sep 2021 12:07:42 +0000 Received: from EUR02-VE1-obe.outbound.protection.outlook.com (unknown [40.107.2.57]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 688aa582-8a07-4358-9127-1a73f69cb49a; Thu, 23 Sep 2021 12:04:32 +0000 (UTC) Received: from DBBPR09CA0018.eurprd09.prod.outlook.com (2603:10a6:10:c0::30) by AM6PR08MB4423.eurprd08.prod.outlook.com (2603:10a6:20b:bf::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.14; Thu, 23 Sep 2021 12:04:30 +0000 Received: from DB5EUR03FT015.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:c0:cafe::cd) by DBBPR09CA0018.outlook.office365.com (2603:10a6:10:c0::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.14 via Frontend Transport; Thu, 23 Sep 2021 12:04:30 +0000 Received: from 64aa7808-outbound-2.mta.getcheckrecipient.com (63.33.187.114) by DB5EUR03FT015.mail.protection.outlook.com (10.152.20.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:30 +0000 Received: ("Tessian outbound 8b24208353e0:v103"); Thu, 23 Sep 2021 12:04:29 +0000 Received: from b3dfbd92560a.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id D55D4007-D26D-4147-A030-86248BA07E8C.1; Thu, 23 Sep 2021 12:04:15 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id b3dfbd92560a.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 23 Sep 2021 12:04:15 +0000 Received: from AS9PR06CA0110.eurprd06.prod.outlook.com (2603:10a6:20b:465::29) by DB8PR08MB5387.eurprd08.prod.outlook.com (2603:10a6:10:115::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13; Thu, 23 Sep 2021 12:04:14 +0000 Received: from AM5EUR03FT011.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:465:cafe::4e) by AS9PR06CA0110.outlook.office365.com (2603:10a6:20b:465::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:14 +0000 Received: from nebula.arm.com (40.67.248.234) by AM5EUR03FT011.mail.protection.outlook.com (10.152.16.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:13 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.14; Thu, 23 Sep 2021 12:03:53 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Thu, 23 Sep 2021 12:03:51 +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: 688aa582-8a07-4358-9127-1a73f69cb49a 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=LT0n1SFAvgK3Jv0H4JFQYnKlHEfutbmGqdGdC9djIAI=; b=b9ufI3LQ1/Tv+xEHMCAlr66hy75m+aULqpElhnB4AEO8yffhvCMz7ujCsBy6CLJIXyQHPwBnTuZ6H+UTfbW75k+90N8pEJ94jhcUMZvw0fTOeu2QjoSknNqvcj3ERwzMZ5hgvQbwxsfxLd5uW+rPfOnD2fcov3L79isTlse+Pm0= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.33.187.114) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.33.187.114 as permitted sender) receiver=protection.outlook.com; client-ip=63.33.187.114; helo=64aa7808-outbound-2.mta.getcheckrecipient.com; X-CheckRecipientChecked: true X-CR-MTA-CID: 842a8a7af6a85634 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WPm7kFPrkfvNHLp1jVs/Dj/yQpBqiTqy9fblwKyVzTjmqsbVrTvubZydMEq/uuXqHRqx+sHv9zrETxx2yhTweWWnU47bQ2RcbhX6lSVTpm8SPWzBR4fyIDMPVNSnAPaCMNV1yir7xSjejnlUhVeN43WYIyJkmLGNgl/BAWp+YErsQj8R9dSLPxh7QSPxDwh63oBiq0zAWKefu5XMYM1HJuKze5L9mqbgi9nq9lV/8b1sUYag4ccsdcjTpIgg03ntlGQKh9gt6Q0Nl084+v4XzxkbHbval9t4upktzCfTLq11FsEbOTzJSggCeYYiOIlSaSnVg4fX4Q0Vxk/gsI+xEw== 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; bh=LT0n1SFAvgK3Jv0H4JFQYnKlHEfutbmGqdGdC9djIAI=; b=PzH9vR8mxqXjux9n95YDETh9Kl8ilbDO+K/9Ewheqq4TVcx8u93my/OOvl8CnzvbNC+cRD5cPRVv8wRAJRlpHBe+SkBpuY1v1VxbZxmUHZiRRSfGY640tKTkVfDEbQQa8KcsCZC8enpiAHhVVNJNQFm/3O/qzz8dx0HJ0JVcYVSXeeT9JlOYHfSJxQNt77zlAQ5cEybz9j4DinmwU3c2LSrDFtTZKX52Iiz/dmZdY2sJZwYwVEscQ8blBdCOdhkr4JkxWC+BJgtrbS8M/0Meuloduw9SRpKonRmC2SCdAFF2v+zKpKdrL5r7gv7W7LKc1DZzRrxDgsx80K0hj/TBkQ== 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=LT0n1SFAvgK3Jv0H4JFQYnKlHEfutbmGqdGdC9djIAI=; b=b9ufI3LQ1/Tv+xEHMCAlr66hy75m+aULqpElhnB4AEO8yffhvCMz7ujCsBy6CLJIXyQHPwBnTuZ6H+UTfbW75k+90N8pEJ94jhcUMZvw0fTOeu2QjoSknNqvcj3ERwzMZ5hgvQbwxsfxLd5uW+rPfOnD2fcov3L79isTlse+Pm0= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; From: Wei Chen To: , , , CC: Subject: [PATCH 20/37] xen: introduce CONFIG_EFI to stub API for non-EFI architecture Date: Thu, 23 Sep 2021 20:02:19 +0800 Message-ID: <20210923120236.3692135-21-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210923120236.3692135-1-wei.chen@arm.com> References: <20210923120236.3692135-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 526ce2ac-6d4e-44f1-b7ab-08d97e8a4c98 X-MS-TrafficTypeDiagnostic: DB8PR08MB5387:|AM6PR08MB4423: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:8273;OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 9jObQxWYN9620scgtKFIYTHJuMrjm5Bk8hWQ2NRflQm3oojfiWWq5iJ5s4UxIU2uBDyHR7x3Lnytub4syAIXOJGJNgpAOx3YlsmC0LjziT3NnmZVgJyJYPNwInPv5Qq0hEFZGGo2vcdKPiuFNRq5OBG2aj34nhiPVgQ4aB3hZylLAEBGt5Tc9DuH2vSMxqZNcmP7wKiHkL/NY/BjCBqIlklXcTboFWFpoczU7a/ZxeaNNRVbSSQizwOaJu+LoDULtXH6FZUyYAieW3gpdCJFbb2U/ru9ZDs/jN/f5Y9XBlJxc3MENIjy64+Ee/5n/AXmcbYPaBj/LyxMk6m3bRNceuK5Wo5raeLcrxIbuNJBQyIpvkEgQCu1Io0wC7/fVxlop9QCjNdkRQFRLHa9zywvsmDpY8arwZ8/KANtw+TrahSCs4gIOOeGLFLxpgQ3GIpwjadhJCG5iSmfOarZqgx0Si6msjiGOIRJEDm+ySguglMAaDH/O3JBZVUdVNGk6klyGau/abfoOniteNwbFWfXX1GTIfjmtj/k9UBhnBfEfWReOxRXM+UxCHJGuE2cNJ8riMFodTibxfBPaW+VJB+HhfFBj0IgyXfRMmFHlIIvCvOkKnT/gL/8tzKEJ7MqkL7gALN7r/tzLHtGwk8iyaqHhMFl/K8yHAl6HbE7uB/nLjgq3Sz3HhH1ZpT133QBCaf94ZsFphFqqwb8ag+C0EEjDbJojqn9GCmb56Cxo1YJsVw= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(4636009)(46966006)(36840700001)(47076005)(8936002)(316002)(82310400003)(70206006)(70586007)(6666004)(36756003)(356005)(1076003)(36860700001)(8676002)(83380400001)(5660300002)(86362001)(26005)(508600001)(186003)(4326008)(2616005)(336012)(426003)(44832011)(2906002)(7696005)(110136005)(81166007)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB5387 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT015.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 5b603ccb-8d6c-4b1e-1089-08d97e8a428e X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NJWgKKGtYEBLDdw4o2hBj8Kqs5UeS1kwojL78S/J19Tw0xqIJqMBiy+1TAEPlctUhi5p4keGur6yXVeD1EYJojvtRtOyma/EuRwZjZlrGNw7lsV0mQjEPT3Q2ZrAdZJUCA9/4boBnH9UjxFcjj8/NhsFi0aTPAMlgjfGj9c215mcT9mhYc4mBq0RPc051gRSipaI6ej1iBx7MhNwnDFCdqiq1HVEWxUibA2tYmvqO/vB4RsXrxtbTipZfw9W//7sY5WdYUdQnsLtiMn+9Clr633CeFOEmkpcie9JhOAU1kR1Y2D1yJeH31K1VIumvLzSLx992fJqf4S/0MuXU+u7k5iAgGwjtM95RE5s5ApR4TnxYbzeMmtwI0+as/5Y2aMCRyvp8isXEvOph7jluOlezSX7/dKijxzKSxS4egKJKyiYWGEfjcHrxs/+MXE08BF0zui0JRG9QBjuoN1PlWZrkQ+ZL+fTHGASxhdlPG5oKA03LQNYf0W+TAKNEVM46DYajofKiGSGnL1NTe3zSlcUA6Rw1+EvAii+xC08KHP1cKuKGl1GF/yQwXYzQRBZn8yijcr//DzSH5gt8kfis+yH9Bh+J1lCjyQllcGU+VNfBVEh95ocbqaRMEDH10WkMC0lPvl12fpeeh5CIEOE42cSOT1uItXqukKyCyLltlEPELisSuuUcOu6nbaX/2xhLty45AZ6F9JS26FNgceP4z25gw== X-Forefront-Antispam-Report: CIP:63.33.187.114;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-2.mta.getcheckrecipient.com;PTR:ec2-63-33-187-114.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(4636009)(36840700001)(46966006)(508600001)(4326008)(110136005)(316002)(36756003)(5660300002)(81166007)(8676002)(8936002)(44832011)(2906002)(86362001)(26005)(83380400001)(186003)(1076003)(70206006)(2616005)(70586007)(47076005)(336012)(426003)(82310400003)(7696005)(36860700001)(6666004);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2021 12:04:30.5229 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 526ce2ac-6d4e-44f1-b7ab-08d97e8a4c98 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.33.187.114];Helo=[64aa7808-outbound-2.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DB5EUR03FT015.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB4423 Some architectures do not support EFI, but EFI API will be used in some common features. Instead of spreading #ifdef ARCH, we introduce this Kconfig option to give Xen the ability of stubing EFI API for non-EFI supported architectures. Signed-off-by: Wei Chen --- xen/arch/arm/Kconfig | 1 + xen/arch/arm/Makefile | 2 +- xen/arch/x86/Kconfig | 1 + xen/common/Kconfig | 11 +++++++++++ xen/include/xen/efi.h | 4 ++++ 5 files changed, 18 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig index ecfa6822e4..865ad83a89 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 EFI select HAS_FAST_MULTIPLY config ARM diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile index 3d3b97b5b4..ae4efbf76e 100644 --- a/xen/arch/arm/Makefile +++ b/xen/arch/arm/Makefile @@ -1,6 +1,6 @@ obj-$(CONFIG_ARM_32) += arm32/ obj-$(CONFIG_ARM_64) += arm64/ -obj-$(CONFIG_ARM_64) += efi/ +obj-$(CONFIG_EFI) += efi/ obj-$(CONFIG_ACPI) += acpi/ ifneq ($(CONFIG_NO_PLAT),y) obj-y += platforms/ diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig index 28d13b9705..b9ed187f6b 100644 --- a/xen/arch/x86/Kconfig +++ b/xen/arch/x86/Kconfig @@ -10,6 +10,7 @@ config X86 select ALTERNATIVE_CALL select ARCH_SUPPORTS_INT128 select CORE_PARKING + select EFI select HAS_ALTERNATIVE select HAS_COMPAT select HAS_CPUFREQ diff --git a/xen/common/Kconfig b/xen/common/Kconfig index 9ebb1c239b..f998746a1a 100644 --- a/xen/common/Kconfig +++ b/xen/common/Kconfig @@ -11,6 +11,16 @@ config COMPAT config CORE_PARKING bool +config EFI + bool + ---help--- + This option provides support for runtime services provided + by UEFI firmware (such as non-volatile variables, realtime + clock, and platform reset). A UEFI stub is also provided to + allow the kernel to be booted as an EFI application. This + is only useful for kernels that may run on systems that have + UEFI firmware. + config GRANT_TABLE bool "Grant table support" if EXPERT default y @@ -196,6 +206,7 @@ config KEXEC config EFI_SET_VIRTUAL_ADDRESS_MAP bool "EFI: call SetVirtualAddressMap()" if EXPERT + depends on EFI ---help--- Call EFI SetVirtualAddressMap() runtime service to setup memory map for further runtime services. According to UEFI spec, it isn't strictly diff --git a/xen/include/xen/efi.h b/xen/include/xen/efi.h index 94a7e547f9..661a48286a 100644 --- a/xen/include/xen/efi.h +++ b/xen/include/xen/efi.h @@ -25,6 +25,8 @@ extern struct efi efi; #ifndef __ASSEMBLY__ +#ifdef CONFIG_EFI + union xenpf_efi_info; union compat_pf_efi_info; @@ -45,6 +47,8 @@ int efi_runtime_call(struct xenpf_efi_runtime_call *); int efi_compat_get_info(uint32_t idx, union compat_pf_efi_info *); int efi_compat_runtime_call(struct compat_pf_efi_runtime_call *); +#endif /* CONFIG_EFI*/ + #endif /* !__ASSEMBLY__ */ #endif /* __XEN_EFI_H__ */ From patchwork Thu Sep 23 12:02:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 12512643 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B50B6C433EF for ; Thu, 23 Sep 2021 12:17:23 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 6CA13610A0 for ; Thu, 23 Sep 2021 12:17:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6CA13610A0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.193942.345565 (Exim 4.92) (envelope-from ) id 1mTNf8-0006E1-Nd; Thu, 23 Sep 2021 12:17:14 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 193942.345565; Thu, 23 Sep 2021 12:17:14 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNf8-0006CZ-G2; Thu, 23 Sep 2021 12:17:14 +0000 Received: by outflank-mailman (input) for mailman id 193942; Thu, 23 Sep 2021 12:17:12 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNVz-0005KP-6X for xen-devel@lists.xenproject.org; Thu, 23 Sep 2021 12:07:47 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (unknown [40.107.8.74]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 66900bfe-957e-47f2-97f4-2bcb54fed078; Thu, 23 Sep 2021 12:04:34 +0000 (UTC) Received: from AM7PR04CA0024.eurprd04.prod.outlook.com (2603:10a6:20b:110::34) by AM0PR08MB5171.eurprd08.prod.outlook.com (2603:10a6:208:159::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.16; Thu, 23 Sep 2021 12:04:32 +0000 Received: from AM5EUR03FT020.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:110:cafe::2e) by AM7PR04CA0024.outlook.office365.com (2603:10a6:20b:110::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.14 via Frontend Transport; Thu, 23 Sep 2021 12:04:32 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT020.mail.protection.outlook.com (10.152.16.116) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:32 +0000 Received: ("Tessian outbound 010023020eef:v103"); Thu, 23 Sep 2021 12:04:31 +0000 Received: from 19d49da73a86.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 8AF177E2-6968-4553-891E-0E442CC65920.1; Thu, 23 Sep 2021 12:04:18 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 19d49da73a86.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 23 Sep 2021 12:04:18 +0000 Received: from AS9PR06CA0093.eurprd06.prod.outlook.com (2603:10a6:20b:465::22) by DB6PR0802MB2581.eurprd08.prod.outlook.com (2603:10a6:4:a1::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.14; Thu, 23 Sep 2021 12:04:15 +0000 Received: from AM5EUR03FT011.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:465:cafe::2c) by AS9PR06CA0093.outlook.office365.com (2603:10a6:20b:465::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.15 via Frontend Transport; Thu, 23 Sep 2021 12:04:15 +0000 Received: from nebula.arm.com (40.67.248.234) by AM5EUR03FT011.mail.protection.outlook.com (10.152.16.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:14 +0000 Received: from AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2308.14; Thu, 23 Sep 2021 12:03:55 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Thu, 23 Sep 2021 12:03:54 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Thu, 23 Sep 2021 12:03:53 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 66900bfe-957e-47f2-97f4-2bcb54fed078 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=gvySSU4kIt7pfh5/hl+s44OlyMdIG3eGKnyLNiYLQmk=; b=U4tFnxshcx9DiEH5p7IZTk8JiaTvEw++j5U1xylexRQ7vuZqv8qSvfMxG9aP451kCw0ZCqRP1YSZcna49AKsHwjQA8df/wrBnwzH9hEFN+hnfFzqUqHB6EdlkgPYow1uspvjSGLqwsGXG7MkHHDO0ue7nCSN20FZAuikI5YZXko= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; X-CheckRecipientChecked: true X-CR-MTA-CID: b1669256a1151d9b X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VGXRIjy+dAMyO+wmLYAleLbc0RZZMY5JBTTdUU2HBiLBUmaDqIdU8gQtZPYQqQja/E8WDjPtUfPYmFdM+OBsgLspjtHZb0tYIwjqIczeb628BnkE4jnKxkXCMWHUrD1kR49anRryybyZlB9mPqe4HTeWLde5+W4j+P2MqOitUMBrPZGBcxe5GKd1ZYW0/BGwFCybXtqzQUs20J6dJafPjjT5tUmiR2w8IIpRBt7cGai30NvGPBSh9/zVgNYqFvq6DXuEC7RjyajhcHTPu+dodhXWfIXeWv68PV2rJU/jTMxGSwDvzCOolC1BM76OexTGBnY4vbj3Zx/8GvNot0yHVA== 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; bh=gvySSU4kIt7pfh5/hl+s44OlyMdIG3eGKnyLNiYLQmk=; b=WxFyGPY9U5PnjKc+W7AgpZ8OKEySi8lOWnjaY7Xze6Wjep7hw3K/As0/dL0YrBCR5fK6nE42P2k2g0BnBGr7H1gfpIdmLOH5aiJx9D+oW9258IyFALKGLPDSP70oG1pcIV5ymdlBKD+yHKi0C1Ea5h3NlbzrmeRf++e04qQ6zuNi12OGcU46Ki5C3P2LYODAOstEZuLqmeiLnw8cIKMxUUxLpXBoG3jGXNQd5j35priizbT2nIGSRjaDlrX7sfTDevIRD30pJgdsEmvdanSO8gkZ/oOdTcty6FqpPw3vpJbSPAIZOGBp9LLIu6bbKiMIEakjai51eJaGF45D+y3gdg== 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=gvySSU4kIt7pfh5/hl+s44OlyMdIG3eGKnyLNiYLQmk=; b=U4tFnxshcx9DiEH5p7IZTk8JiaTvEw++j5U1xylexRQ7vuZqv8qSvfMxG9aP451kCw0ZCqRP1YSZcna49AKsHwjQA8df/wrBnwzH9hEFN+hnfFzqUqHB6EdlkgPYow1uspvjSGLqwsGXG7MkHHDO0ue7nCSN20FZAuikI5YZXko= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; From: Wei Chen To: , , , CC: Subject: [PATCH 21/37] xen/arm: Keep memory nodes in dtb for NUMA when boot from EFI Date: Thu, 23 Sep 2021 20:02:20 +0800 Message-ID: <20210923120236.3692135-22-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210923120236.3692135-1-wei.chen@arm.com> References: <20210923120236.3692135-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1508f99f-b4a0-423e-0b75-08d97e8a4dc1 X-MS-TrafficTypeDiagnostic: DB6PR0802MB2581:|AM0PR08MB5171: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:8882;OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: CJxiuM498ucDO34ghQdgHgKwtFmEQ1Abp0CumzVXo+SJgi1WNS2WUBHAZLncCQcv2LiasLAmR/IqJB9EwTwIYMUJCkvqhJr5qUtfFGD6cF6LfV+j51JsKHBFWuGQM9GwSW0HSqZhQpDObeSanQWhtAmWRg39ESCkAkZsZV7eXOUWZnHITwrwcbo9ilAN5EuCAjAH8SHnCI8gi0wjnJavgpsKRqSM2jY4jiFe1uLjJgyuqIiMSU2p6siRcXyrY7R2+inTv+M1ob0lcMsZhr8gNKUpzcif2NkoatgKgQQ+ZXOD3xw0KobMoSNv1je1X4ZWaSRcNkRRdYv0RMC4WsWuKSqCFZn1yNRqKJQQuB4jRkrcFw2DmNsj6BbFq9T0YS1MV9EnAh3hBr1D5wpffi3HZOQV8YTqwmfyMAr6F9ayiK546b0vEdBI8mOm60hX/6RwwA6pFQ7tgK4i2AdCp8inGlWL5vDp3SseHDebwxwG+TeIh3OOo6AXDHYOp0/JZSMBUkA3KgbnQHJG7CH6RsN3LaNmpDqZFSxUA9b+PkpYcPoLGxD4GjGnZ3Fbdf4kfW2iqgVpc1DMREjvIk865BGbDkPlOoHJeCzc8C34aCo4WtThmAeXVmGoYFKq+kxsYqF+gclqH1qIg5dz+SP16GWYzC1BQvleF4C8dDX97sVpHZZo9zUx4HQaB31e7CqHYscxwuBRaRdoxMAmG3/XgRKPbtfLLygcIjeqTR7P8Ylv8A0= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(4636009)(46966006)(36840700001)(7696005)(2906002)(508600001)(5660300002)(8936002)(81166007)(356005)(36756003)(2616005)(36860700001)(1076003)(47076005)(316002)(8676002)(26005)(83380400001)(336012)(82310400003)(6666004)(110136005)(4326008)(186003)(86362001)(44832011)(70586007)(70206006)(426003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0802MB2581 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT020.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: a6e061a9-1254-48ef-188f-08d97e8a4355 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uZvkHcsXMCuHrxZVZnqr66DByS50wpa1AOs0b0r/ezMMWaturZJdpYEGoypyeSpoAEnxWDS4TonfEd54dt8GhbSmcBjU8ASm7P4dpDV2Z2KMVmctyzytq2520mSiE/jr88F4RiOUXJIRwbioxYHJfwAI3FesxnRX6juJnvJLWmMbqRjAf+usajYVZTiQtWmE9fZixkde0TU7HpVcqMRI9Bs5e7SKKx6g3+WU7Qcf75crVcyu+Gc+bCRJE4NXKbd+dyxt2d9odIhZHeA1owzdCsZ/vIhsjUUlAvnCcd3qeP2mKST++PGsfkMt1HPeV8lpxgBuEBRGAFIUXpr5ghL+PcMSphJAuE/tkUHl+FxNmkztPCoJie2utcGdXyzdkU9w1dfyGnQn9msHlRvzGey8r2TNpk9q6oAhgJzdxbncq+NOB233c90m/ktAhiB4WI+4kqaFza7OmwqkYBmwwd20nkVagRgwnuQ6FYIXeVhj1wkUIVCzZ8ooxdYwWbn01I+FcL1LGlmrY2RmkqR2PjG5SOQdJIg4S3GN4eT7762ok93I6iFPi192ymTYKm3mDiyzaR8nuMK+YrC08cevyIf3OmvRxF1CCSaJykWpBH3FBoDpcQ8cTOUUStzJ1bwNO/D/y74KQr3crx9ErZhoFCvMyNyhBPUtjt2su6qZn1xv+wDNenrCeG/a5taTGTARTd1LA9zhFBFTLV2OaXTExtZnuQ== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(4636009)(46966006)(36840700001)(70586007)(508600001)(81166007)(2906002)(426003)(70206006)(36756003)(110136005)(5660300002)(316002)(4326008)(83380400001)(82310400003)(7696005)(6666004)(1076003)(336012)(186003)(26005)(8936002)(8676002)(44832011)(47076005)(36860700001)(86362001)(2616005);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2021 12:04:32.4119 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1508f99f-b4a0-423e-0b75-08d97e8a4dc1 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM5EUR03FT020.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB5171 EFI can get memory map from EFI system table. But EFI system table doesn't contain memory NUMA information, EFI depends on ACPI SRAT or device tree memory node to parse memory blocks' NUMA mapping. But in current code, when Xen is booting from EFI, it will delete all memory nodes in device tree. So in UEFI + DTB boot, we don't have numa-node-id for memory blocks any more. So in this patch, we will keep memory nodes in device tree for NUMA code to parse memory numa-node-id later. As a side effect, if we still parse boot memory information in early_scan_node, bootmem.info will calculate memory ranges in memory nodes twice. So we have to prevent early_scan_node to parse memory nodes in EFI boot. As EFI APIs only can be used in Arm64, so we introduced a stub API for non-EFI supported Arm32. This will prevent Signed-off-by: Wei Chen --- xen/arch/arm/bootfdt.c | 8 +++++++- xen/arch/arm/efi/efi-boot.h | 25 ------------------------- xen/include/xen/efi.h | 7 +++++++ 3 files changed, 14 insertions(+), 26 deletions(-) diff --git a/xen/arch/arm/bootfdt.c b/xen/arch/arm/bootfdt.c index afaa0e249b..6bc5a465ec 100644 --- a/xen/arch/arm/bootfdt.c +++ b/xen/arch/arm/bootfdt.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -370,7 +371,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 will already + * be 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 cf9c37153f..d0a9987fa4 100644 --- a/xen/arch/arm/efi/efi-boot.h +++ b/xen/arch/arm/efi/efi-boot.h @@ -197,33 +197,8 @@ EFI_STATUS __init fdt_add_uefi_nodes(EFI_SYSTEM_TABLE *sys_table, int status; u32 fdt_val32; u64 fdt_val64; - int prev; int num_rsv; - /* - * 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. diff --git a/xen/include/xen/efi.h b/xen/include/xen/efi.h index 661a48286a..b52a4678e9 100644 --- a/xen/include/xen/efi.h +++ b/xen/include/xen/efi.h @@ -47,6 +47,13 @@ int efi_runtime_call(struct xenpf_efi_runtime_call *); int efi_compat_get_info(uint32_t idx, union compat_pf_efi_info *); int efi_compat_runtime_call(struct compat_pf_efi_runtime_call *); +#else + +static inline bool efi_enabled(unsigned int feature) +{ + return false; +} + #endif /* CONFIG_EFI*/ #endif /* !__ASSEMBLY__ */ From patchwork Thu Sep 23 12:02:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 12512639 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 03790C433FE for ; Thu, 23 Sep 2021 12:17:12 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id AEA3B61107 for ; Thu, 23 Sep 2021 12:17:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org AEA3B61107 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.193930.345543 (Exim 4.92) (envelope-from ) id 1mTNew-0005QL-Tf; Thu, 23 Sep 2021 12:17:02 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 193930.345543; Thu, 23 Sep 2021 12:17: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 1mTNew-0005QA-Pe; Thu, 23 Sep 2021 12:17:02 +0000 Received: by outflank-mailman (input) for mailman id 193930; Thu, 23 Sep 2021 12:17:01 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNVp-0005KP-6E for xen-devel@lists.xenproject.org; Thu, 23 Sep 2021 12:07:37 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (unknown [2a01:111:f400:7e1b::62b]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 491d468a-579d-47bb-8f4f-d7b0ca53fc34; Thu, 23 Sep 2021 12:04:30 +0000 (UTC) Received: from AM7PR04CA0021.eurprd04.prod.outlook.com (2603:10a6:20b:110::31) by DB8PR08MB3963.eurprd08.prod.outlook.com (2603:10a6:10:a8::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.14; Thu, 23 Sep 2021 12:04:28 +0000 Received: from AM5EUR03FT020.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:110:cafe::a4) by AM7PR04CA0021.outlook.office365.com (2603:10a6:20b:110::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:28 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT020.mail.protection.outlook.com (10.152.16.116) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:27 +0000 Received: ("Tessian outbound 010023020eef:v103"); Thu, 23 Sep 2021 12:04:26 +0000 Received: from a55985ad4ddb.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id EDD24E0F-1EF2-41BF-8A2E-E6A5D197A8FE.1; Thu, 23 Sep 2021 12:04:17 +0000 Received: from EUR03-AM5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id a55985ad4ddb.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 23 Sep 2021 12:04:17 +0000 Received: from AS9PR06CA0118.eurprd06.prod.outlook.com (2603:10a6:20b:465::20) by DB7PR08MB3756.eurprd08.prod.outlook.com (2603:10a6:10:79::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.18; Thu, 23 Sep 2021 12:04:16 +0000 Received: from AM5EUR03FT011.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:465:cafe::b9) by AS9PR06CA0118.outlook.office365.com (2603:10a6:20b:465::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:16 +0000 Received: from nebula.arm.com (40.67.248.234) by AM5EUR03FT011.mail.protection.outlook.com (10.152.16.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:15 +0000 Received: from AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2308.14; Thu, 23 Sep 2021 12:03:58 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Thu, 23 Sep 2021 12:03:56 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Thu, 23 Sep 2021 12:03:55 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 491d468a-579d-47bb-8f4f-d7b0ca53fc34 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=6dEtUaYVX87QwORy8SpB1QfVQ6OMtEh5+JCNvdfCby4=; b=EpUJJCYL5wAgOIM62xfO32tbLeMHjnUf4FVdUYhAKYwxCo8R0mFoPxT14t/AQ+0q/GyCPVH7MKEdQ+ItQEl6h3I88iJAhpIKDCS+XU7WlFqUuGSvTRTseszDCuuhGtXY5Vch+U7qrOr8FMKukV4/CkIs/cmqe4f1Sb500Hn/fAQ= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; X-CheckRecipientChecked: true X-CR-MTA-CID: 1f3622f63e5f6b3d X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QOegBsqLDJqcFf/9zDozwwhanjaRYg/F3zPM7mf8OYU/DByb/EcCK49aY2hbuVPh8UsGTDwf0PzYqrBVcnZFtajfJSiwV43JMQe48mxgS7MxGJ9lDMxonf9pP4hls5MR86kFen7/f6GqruOdO61CbnK8bPE7TD9bAKghh30edEcYJN/beeNHeWC9WF3an3o/2GdWVJPyQ6uvSRffyfavz8EnvitWbN6N0UfIMHDkj78Epxqc9WOw6KxND4Ghp9Ix9hezMqzWc9B3697dGCUOqKlTZP+RUQBfCN9Xnm+phJ3EZ8g67cmrNAT+3wseebXcCUMbmeR9hj1YMUq72vjwGw== 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; bh=6dEtUaYVX87QwORy8SpB1QfVQ6OMtEh5+JCNvdfCby4=; b=Sk9rN/s5Ms3xycath6IGwhSNy0e3i2rjAi8eNKihEqAZuRR1g0RPRAEy8gRbGLOuIfZhIt28x4s+OwksNvqR7DG02/DHl0d6CjrjsBFk/19nED3EH23VGnmhy08x4Rngl5kU8IvGsnYa4oJXOirS59xiHQf+fL+NujDNHOI0St8CyE/M5OcZMYH17ZMq2MhROjzLcdkuDfGa7/dpECGLrGUI8bijbHDP6hEWVDkNsdDFi01THY3CMc/Epdv4MVkzicfaBvH8pe9nhhxGY+2bgi8VLIfA8wsH814aGao92HQQp8ALnwD0FhoHQIad73wKBeeAByzcWloiaDdzt7cx6g== 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=6dEtUaYVX87QwORy8SpB1QfVQ6OMtEh5+JCNvdfCby4=; b=EpUJJCYL5wAgOIM62xfO32tbLeMHjnUf4FVdUYhAKYwxCo8R0mFoPxT14t/AQ+0q/GyCPVH7MKEdQ+ItQEl6h3I88iJAhpIKDCS+XU7WlFqUuGSvTRTseszDCuuhGtXY5Vch+U7qrOr8FMKukV4/CkIs/cmqe4f1Sb500Hn/fAQ= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; From: Wei Chen To: , , , CC: Subject: [PATCH 22/37] xen/arm: use NR_MEM_BANKS to override default NR_NODE_MEMBLKS Date: Thu, 23 Sep 2021 20:02:21 +0800 Message-ID: <20210923120236.3692135-23-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210923120236.3692135-1-wei.chen@arm.com> References: <20210923120236.3692135-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7e2f21ac-8e00-4fe5-dd8b-08d97e8a4ad9 X-MS-TrafficTypeDiagnostic: DB7PR08MB3756:|DB8PR08MB3963: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:3826;OLM:3826; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: dOv97TrR0v493lsXsyhbvgSbMmqbXfR+lNx3QLOXxO38q4KvfnI0aY6zl0mdBGBNJ3N55o270bA66G14aTkwMuEhbkxcsIgLQ6CyYz8oqiNqgDwpwi4jZ+DN5bzP861uTx/MSu3wpl9uIjYX8XYt076u+SE0iqXGG39rjhsKDCsY/o/UfqwINIa9hXApTwsLLhTUVjrphSOkDzfeDjuc8ICmLNsQIAAUt0F8+1L6O+A160dagclfMPsC6Vh+hSf+XAn29s01LhiKrLVLSfIcrOu8UG9j49P/f0Yg4I5haaTp7Kx6A6l3LOWH2sY3Y1T20asTAFzjEkGBljkruRuN0cNX9PVroYohSfaDdJSFoXVVD7ittg+2NaSCN/5PjP4IYxTLJ/rezrxN2vBHRiKmevLwoCovVyzKrpdqOLYDJwZidALHQUmHJ40h5a2dbTOrPST5bfbRZV+3OxWYGAYjuJy3P9L2qwNniiLc69aSlpZBZ2IMSOhcxQZPINruVD5Dh9gkoeBT/w+lDt4eMS+2PjFZXE+nht9XQ1uAHzONih/R9+Me/iAGZ+qtpKkH6knX0pCaC5WfU1enInKRgNpneC8Oj26rMyqhR3RlNJqCz/5g/OQJ0C9kjjL/EnB5EKt4aYyit1HyqpRXOPnWMDaKUvzgDvT5vTBWzAbUM/NFf3659awbFz3h6MbMkDdwp0ZSo3LbNqOo90PqsjvZ9s544jiT+cxLNTBrHxJ8fJyzHXI= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(4636009)(36840700001)(46966006)(426003)(356005)(83380400001)(86362001)(508600001)(81166007)(82310400003)(316002)(336012)(36860700001)(110136005)(1076003)(2906002)(70206006)(8676002)(2616005)(8936002)(36756003)(70586007)(4326008)(6666004)(7696005)(47076005)(44832011)(26005)(186003)(5660300002)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB3756 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT020.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 81e2f0ec-5f3c-46bd-e2cb-08d97e8a43d6 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sccVZf+mOTc6JXx7wbfxuS927Ys6Fx81eXOigU7tsClKnV+8wrumjN6KEpQkjtJBRPq+eftg3Z3lNajHAbERCr3GGrXZRsbUL81DmTks0G9MlpJZsKWe3y2XIdXtqsXoDGY3oEQG8NJgWmR2joXCYXh5q3ZJpO5hCCB3d2W8yM4uvNFd0iC3X0eZC1CImqyoWpNmXyhTBtjSIQ3JCpDKD7Ng22GDRk9phzV1kDa4zYgNLOuidIIu8kyUkO3csDY16Y2reg9s1ymlmiJGBsldaHF+dBSj6avS+bIqDx73LImx0zQrKptflJxa2tUb54okQre+9xRVgKmcxoZebg6F4tbuejygPyixsiRr/xXaCcZsYruAwefk+jK1UoXIw9MDO9QKRlHif2BKR+HCfXEBXGEVI0KA9erOo+YljsksaBUMM3KUZCP7scHZNm57l8s1Swm8J/zRj1QiQwge+LUJ0wN+7EZ2eM57QNhSFg5WPViffhBbZmlmcn3QZhRlUGoabN4tYPMyqSCGtdngZLKkQirG4w0LnjfavVnJSUD0ovnQGuG8VyU8W0BiCJPYrQzx52Q6IuCP7Z0wAwaLndlq14y6hH6EkfWofG7kURChhUSrqofiuNyTUY2Ssg8O9RdYUKiAQwnmh8FX/NsbZEbtgmRyhv/JZF9yUdyUvVnkRG1/J836cV6fqQN79nCSPilq0wH3rphSM4KY12Ir3dMePg== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(4636009)(46966006)(36840700001)(86362001)(36860700001)(316002)(5660300002)(508600001)(6666004)(83380400001)(47076005)(336012)(8936002)(44832011)(426003)(2616005)(186003)(70206006)(70586007)(8676002)(36756003)(1076003)(2906002)(26005)(4326008)(110136005)(7696005)(81166007)(82310400003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2021 12:04:27.5424 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7e2f21ac-8e00-4fe5-dd8b-08d97e8a4ad9 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM5EUR03FT020.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB3963 As a memory range described in device tree cannot be split across multiple nodes. So we define NR_NODE_MEMBLKS as NR_MEM_BANKS in arch header. And keep default NR_NODE_MEMBLKS in common header for those architectures NUMA is disabled. Signed-off-by: Wei Chen --- xen/include/asm-arm/numa.h | 8 +++++++- xen/include/xen/numa.h | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/xen/include/asm-arm/numa.h b/xen/include/asm-arm/numa.h index 8f1c67e3eb..21569e634b 100644 --- a/xen/include/asm-arm/numa.h +++ b/xen/include/asm-arm/numa.h @@ -3,9 +3,15 @@ #include +#include + typedef u8 nodeid_t; -#ifndef CONFIG_NUMA +#ifdef CONFIG_NUMA + +#define NR_NODE_MEMBLKS NR_MEM_BANKS + +#else /* Fake one node for now. See also node_online_map. */ #define cpu_to_node(cpu) 0 diff --git a/xen/include/xen/numa.h b/xen/include/xen/numa.h index 1978e2be1b..1731e1cc6b 100644 --- a/xen/include/xen/numa.h +++ b/xen/include/xen/numa.h @@ -12,7 +12,9 @@ #define MAX_NUMNODES 1 #endif +#ifndef NR_NODE_MEMBLKS #define NR_NODE_MEMBLKS (MAX_NUMNODES*2) +#endif #define vcpu_to_node(v) (cpu_to_node((v)->processor)) From patchwork Thu Sep 23 12:02:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 12512661 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 000EDC433EF for ; Thu, 23 Sep 2021 12:17:59 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 8B0C761107 for ; Thu, 23 Sep 2021 12:17:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8B0C761107 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.193989.345664 (Exim 4.92) (envelope-from ) id 1mTNfj-0002Ka-1v; Thu, 23 Sep 2021 12:17:51 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 193989.345664; Thu, 23 Sep 2021 12:17:51 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNfi-0002KF-TW; Thu, 23 Sep 2021 12:17:50 +0000 Received: by outflank-mailman (input) for mailman id 193989; Thu, 23 Sep 2021 12:17:49 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNW4-0005KP-6Z for xen-devel@lists.xenproject.org; Thu, 23 Sep 2021 12:07:52 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (unknown [2a01:111:f400:7e1a::626]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 49e9fde8-c21e-4a45-8924-0bf8b2f455a7; Thu, 23 Sep 2021 12:04:35 +0000 (UTC) Received: from AS9PR06CA0029.eurprd06.prod.outlook.com (2603:10a6:20b:462::18) by PAXPR08MB7280.eurprd08.prod.outlook.com (2603:10a6:102:217::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.15; Thu, 23 Sep 2021 12:04:33 +0000 Received: from AM5EUR03FT040.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:462:cafe::35) by AS9PR06CA0029.outlook.office365.com (2603:10a6:20b:462::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.14 via Frontend Transport; Thu, 23 Sep 2021 12:04:33 +0000 Received: from 64aa7808-outbound-2.mta.getcheckrecipient.com (63.33.187.114) by AM5EUR03FT040.mail.protection.outlook.com (10.152.17.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:32 +0000 Received: ("Tessian outbound 173d710607ad:v103"); Thu, 23 Sep 2021 12:04:30 +0000 Received: from f901f435cad7.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 8933737B-2358-405F-9221-EC3CA3AD749C.1; Thu, 23 Sep 2021 12:04:18 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id f901f435cad7.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 23 Sep 2021 12:04:18 +0000 Received: from AS9PR06CA0092.eurprd06.prod.outlook.com (2603:10a6:20b:465::10) by AM6PR08MB4818.eurprd08.prod.outlook.com (2603:10a6:20b:cb::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.16; Thu, 23 Sep 2021 12:04:16 +0000 Received: from AM5EUR03FT011.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:465:cafe::25) by AS9PR06CA0092.outlook.office365.com (2603:10a6:20b:465::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:16 +0000 Received: from nebula.arm.com (40.67.248.234) by AM5EUR03FT011.mail.protection.outlook.com (10.152.16.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:16 +0000 Received: from AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2308.14; Thu, 23 Sep 2021 12:04:00 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Thu, 23 Sep 2021 12:03:58 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Thu, 23 Sep 2021 12:03:58 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 49e9fde8-c21e-4a45-8924-0bf8b2f455a7 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=e3okijkGOEYgqB5JRr1n7+WErub1PozJvnVaCT3ZajM=; b=6bx6FARY9uEpKHTemojAM1hFDf4kcp4drbAEFa4bfZkLxzV2QjwVM3uBUguk2KOrEpnvLkiRuk8RqIgIBKiPqgJtXTxcVWEFHcnbe4nBnDTFn4A4CCocRCLY4ZssjKZLw1L0wfKzxN6rhjbtnPB9eKMSrco6Pa0sTpr4AxtQTmY= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.33.187.114) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.33.187.114 as permitted sender) receiver=protection.outlook.com; client-ip=63.33.187.114; helo=64aa7808-outbound-2.mta.getcheckrecipient.com; X-CheckRecipientChecked: true X-CR-MTA-CID: 04c7ee98cf8e44cd X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Kgpeq63N531U9H6zSg1o+6kAs0DLCAfVNiJlB7ByzsIqzWZdX2q8xjj3au+2mdkvw+XLCcKAxyPsjznb7wMiV4P3ofyqXQFrsYJ9yhdJAiqoV2MyAKh0CaEIk9G9zwKwLVaPDIaefMU2uwyoQ9JwAhyztpiiKuqu9ramQy3/H30bPpezcLEB1c8gI/0FXHoZMT2kF1qRBCLpnjU7AAppWenJmwNn4lNbGxkQ0hB2ueRJ2TnLBtpQ2ytQxpOzBwZg3ePvC3EDrQieb2P5BOZuq7IMKYYXBvtZmgVbXDK4Zk3G8W8SIFOUp/M5ZFUF9azVpWX503XcmysXJjtIghytIg== 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; bh=e3okijkGOEYgqB5JRr1n7+WErub1PozJvnVaCT3ZajM=; b=aBYHeIa3BrjiEvJ3rKSZFb3p3xkMgjSReZgAOW/2gtKVbj2us6/MkKR/opYEpioCxWGJxJhg+C2ecyjblZ34Wgr1gvah/CGlQ4BRppQQSQIFHFUsk8ANB2y/AvTCnHUcNPoUm5Uc8PWqKDb+m943o6IXBseduw3hF24Q/5dAVMEuxTMuXUDzqNbdntDa003uaLDK5w9ROlB7qB0EXGU/UGsaxTSyGjub9njzdIkcm5rKp7Vuib898FgsjOage5dxk1wliCUxVSiMU5jueAvvWqC035HACn1t+YPszOHcvj5ZCQm4hsAUBUkZ+SF5eqxXm1tVwCMZc7nM6nbUsgrvMw== 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=e3okijkGOEYgqB5JRr1n7+WErub1PozJvnVaCT3ZajM=; b=6bx6FARY9uEpKHTemojAM1hFDf4kcp4drbAEFa4bfZkLxzV2QjwVM3uBUguk2KOrEpnvLkiRuk8RqIgIBKiPqgJtXTxcVWEFHcnbe4nBnDTFn4A4CCocRCLY4ZssjKZLw1L0wfKzxN6rhjbtnPB9eKMSrco6Pa0sTpr4AxtQTmY= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; From: Wei Chen To: , , , CC: Subject: [PATCH 23/37] xen/arm: implement node distance helpers for Arm Date: Thu, 23 Sep 2021 20:02:22 +0800 Message-ID: <20210923120236.3692135-24-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210923120236.3692135-1-wei.chen@arm.com> References: <20210923120236.3692135-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 55e307fb-016a-436a-615c-08d97e8a4e13 X-MS-TrafficTypeDiagnostic: AM6PR08MB4818:|PAXPR08MB7280: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:9508;OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: MWHGhCXTPamOABmtcqxV7u5Ta0Si8iM3bgdnTb3dccK9jaC7mCO8dzrU6l95FKfEKHsnEflJ0UnUTyxQNV0z53krBjTZje3qUEhC0Hlr71shrzIfUgayXp0igRZYS4Kn3gM3SGG+qOZolOvzFXtRbQ/I15KR1Thg4t05E1NT5BXrjkR7U3W8yjBGVyXPDZRdkcp8JI1avrGsdSnJm48pd9Tfqy66GisEwh/CtyxlBOpSKzOSsC1jZSJmkfJ3jtXbUUIiseHs00VUhuo6Z9imn//rl4Lp78WeaWTqz3CGu1if8vEwb73RHFQXGse4XqPrdTrpIIvvTYxctDLUdr/mmmHS/kYzEWbVG+e0dR4SJDSzAeVj5HaQVNopIYXXQ+Ny5418EkbuvUyjvozzJ2M7QLPzYoX/f0vnYzmJDlBbebEmYSO8wyT+Nz2LZo2HEa9KO3NJxfwbitKZ2c57U7GFBrAcvW/0+vciE+Q+XhcYecaRsNv4BK6JP0XPF3/suSW/iSB3IvsqKxH7XcOvSqVBpFtoWGY4NH6NO0H9mklaN+YAr2wxJyjGXtW/3La9dVFUIpKApbSU17YbQBTfXVchu8VTVy4951kkKk0Re2pQYXT/BJV6ytu7ikxNSZkIGIK3FmXkKo8Usry5co5dUvidueHt73p2E9numolg5wW1wfKxdOBX2qc4vrK9DlGoTFnd9/oE9+ofozg9BCA0aI5V5+ljgx9fCK4emZRh5s0xOsX2Dh39VeSjkwIKSUfuHYkJnpOayz83baU78igf4M30+kzgwAhCW8dc996cb73/IHwp0jaGldBXjvSwsPjKQ3qlkNzn7r9CL3SxjS0XyhAy6w== X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(4636009)(36840700001)(46966006)(508600001)(356005)(7696005)(36756003)(6666004)(8676002)(2906002)(82310400003)(36860700001)(70586007)(26005)(186003)(81166007)(83380400001)(86362001)(316002)(70206006)(1076003)(426003)(336012)(4326008)(44832011)(110136005)(2616005)(47076005)(5660300002)(8936002)(2004002)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB4818 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT040.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: b3c6325e-33a2-4920-c6c2-08d97e8a445e X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tiwAfeZEJqwXlPkXv4xpTvpIhIhHXCQXyULjmMwLpy1EhlkpXRbguaEU/4eZZY2a+efLTigrj5Hlb5YIRAnjF41+1W2q/jH/X1JUKyZHhJWYhTACHHUO3aOrwjsLeSrzHRiuQVBeha++DcsUuZ0oOiAqJAj8mt+X1D/76fFDaHlOH83vVUgiu94XV056TRta2mibR8ISKqKvZbCEX5BZjOGezKpB+WCsMiETkdbAH0OFvx8uOG9geTGt264FnEcAUc2/qdCLOTbrnhaacuunMmtTsnG+dYoTAxGldagqXZz3GvDHqPWgK5rHu/pk6pULLGX80P5rjYe9v6jVAjmgT8q0V6LOxgvID312EqxJEuq4CZyY8tQDBUfTzeoorMYXJUPFV0KkkGfgWPDTnx+bF67nI2LAdo9yWWUL7kcpJ2Fu5Nb459iYZI5VZCZH5lYqYSBmQr7AYy8v41AjMcv0lWG15iXUsHlnyowmZXHepVoA/I7i/Ihs35yaJPslQ/ZSijLdl2XMFIuLBvoifKu8sqvpIvBNPtIZkUwvcH8wSZTvfHaRq5QXlC0bxLFpUVJFO8Ea99FHqzZT18sm1CspEhlMcw2VUQzG4d+krYdwUSt5eFE6IaaZuZXHlV/tn198465RCssUOPyCEy8UsnyP1wIAyg/rIQTwSIDfbvbaAcQ90cngdAb4OAzqh4/bKcs1eIwZIWB4LQ3U/nwh08A4O+PO/wWpzyhziJzGpDWssjM2iELEPoiTKidCuQbr2D5FppeeiaIrkN1dPzh7/r/SFBVlbZBoJ7ZqMovl3NC1/P1pHYaksry9W9UntyJ/Wj/7 X-Forefront-Antispam-Report: CIP:63.33.187.114;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-2.mta.getcheckrecipient.com;PTR:ec2-63-33-187-114.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(4636009)(46966006)(36840700001)(26005)(7696005)(186003)(86362001)(426003)(1076003)(508600001)(36756003)(36860700001)(336012)(2616005)(47076005)(4326008)(82310400003)(83380400001)(70206006)(110136005)(70586007)(6666004)(2906002)(8936002)(81166007)(316002)(8676002)(5660300002)(44832011)(2004002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2021 12:04:32.9535 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 55e307fb-016a-436a-615c-08d97e8a4e13 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.33.187.114];Helo=[64aa7808-outbound-2.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM5EUR03FT040.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB7280 We will parse NUMA nodes distances from device tree or ACPI table. So we need a matrix to record the distances between any two nodes we parsed. Accordingly, we provide this node_set_distance API for device tree or ACPI table parsers to set the distance for any two nodes in this patch. When NUMA initialization failed, __node_distance will return NUMA_REMOTE_DISTANCE, this will help us avoid doing rollback for distance maxtrix when NUMA initialization failed. Signed-off-by: Wei Chen --- xen/arch/arm/Makefile | 1 + xen/arch/arm/numa.c | 69 ++++++++++++++++++++++++++++++++++++++ xen/include/asm-arm/numa.h | 13 +++++++ 3 files changed, 83 insertions(+) create mode 100644 xen/arch/arm/numa.c diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile index ae4efbf76e..41ca311b6b 100644 --- a/xen/arch/arm/Makefile +++ b/xen/arch/arm/Makefile @@ -35,6 +35,7 @@ obj-$(CONFIG_LIVEPATCH) += livepatch.o obj-y += mem_access.o obj-y += mm.o obj-y += monitor.o +obj-$(CONFIG_NUMA) += numa.o obj-y += p2m.o obj-y += percpu.o obj-y += platform.o diff --git a/xen/arch/arm/numa.c b/xen/arch/arm/numa.c new file mode 100644 index 0000000000..3f08870d69 --- /dev/null +++ b/xen/arch/arm/numa.c @@ -0,0 +1,69 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Arm Architecture support layer for NUMA. + * + * Copyright (C) 2021 Arm Ltd + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#include +#include + +static uint8_t __read_mostly +node_distance_map[MAX_NUMNODES][MAX_NUMNODES] = { + { 0 } +}; + +void __init numa_set_distance(nodeid_t from, nodeid_t to, uint32_t distance) +{ + if ( from >= MAX_NUMNODES || to >= MAX_NUMNODES ) + { + printk(KERN_WARNING + "NUMA: invalid nodes: from=%"PRIu8" to=%"PRIu8" MAX=%"PRIu8"\n", + from, to, MAX_NUMNODES); + return; + } + + /* NUMA defines 0xff as an unreachable node and 0-9 are undefined */ + if ( distance >= NUMA_NO_DISTANCE || + (distance >= NUMA_DISTANCE_UDF_MIN && + distance <= NUMA_DISTANCE_UDF_MAX) || + (from == to && distance != NUMA_LOCAL_DISTANCE) ) + { + printk(KERN_WARNING + "NUMA: invalid distance: from=%"PRIu8" to=%"PRIu8" distance=%"PRIu32"\n", + from, to, distance); + return; + } + + node_distance_map[from][to] = distance; +} + +uint8_t __node_distance(nodeid_t from, nodeid_t to) +{ + /* When NUMA is off, any distance will be treated as remote. */ + if ( srat_disabled() ) + return NUMA_REMOTE_DISTANCE; + + /* + * Check whether the nodes are in the matrix range. + * When any node is out of range, except from and to nodes are the + * same, we treat them as unreachable (return 0xFF) + */ + if ( from >= MAX_NUMNODES || to >= MAX_NUMNODES ) + return from == to ? NUMA_LOCAL_DISTANCE : NUMA_NO_DISTANCE; + + return node_distance_map[from][to]; +} +EXPORT_SYMBOL(__node_distance); diff --git a/xen/include/asm-arm/numa.h b/xen/include/asm-arm/numa.h index 21569e634b..758eafeb05 100644 --- a/xen/include/asm-arm/numa.h +++ b/xen/include/asm-arm/numa.h @@ -9,8 +9,21 @@ typedef u8 nodeid_t; #ifdef CONFIG_NUMA +/* + * In ACPI spec, 0-9 are the reserved values for node distance, + * 10 indicates local node distance, 20 indicates remote node + * distance. Set node distance map in device tree will follow + * the ACPI's definition. + */ +#define NUMA_DISTANCE_UDF_MIN 0 +#define NUMA_DISTANCE_UDF_MAX 9 +#define NUMA_LOCAL_DISTANCE 10 +#define NUMA_REMOTE_DISTANCE 20 + #define NR_NODE_MEMBLKS NR_MEM_BANKS +extern void numa_set_distance(nodeid_t from, nodeid_t to, uint32_t distance); + #else /* Fake one node for now. See also node_online_map. */ From patchwork Thu Sep 23 12:02:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 12512653 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8FC9EC433EF for ; Thu, 23 Sep 2021 12:17:53 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 46D2861107 for ; Thu, 23 Sep 2021 12:17:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 46D2861107 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.193975.345614 (Exim 4.92) (envelope-from ) id 1mTNfb-0000bP-Sc; Thu, 23 Sep 2021 12:17:43 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 193975.345614; Thu, 23 Sep 2021 12:17:43 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNfb-0000a3-Ir; Thu, 23 Sep 2021 12:17:43 +0000 Received: by outflank-mailman (input) for mailman id 193975; Thu, 23 Sep 2021 12:17:42 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNWT-0005KP-7N for xen-devel@lists.xenproject.org; Thu, 23 Sep 2021 12:08:17 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (unknown [40.107.22.79]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 69d98c97-e649-444e-b6ac-6ce67b78bbac; Thu, 23 Sep 2021 12:04:49 +0000 (UTC) Received: from FR0P281CA0038.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:48::21) by VI1PR08MB3296.eurprd08.prod.outlook.com (2603:10a6:803:3e::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.14; Thu, 23 Sep 2021 12:04:43 +0000 Received: from VE1EUR03FT028.eop-EUR03.prod.protection.outlook.com (2603:10a6:d10:48:cafe::d) by FR0P281CA0038.outlook.office365.com (2603:10a6:d10:48::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.7 via Frontend Transport; Thu, 23 Sep 2021 12:04:43 +0000 Received: from 64aa7808-outbound-2.mta.getcheckrecipient.com (63.33.187.114) by VE1EUR03FT028.mail.protection.outlook.com (10.152.18.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:43 +0000 Received: ("Tessian outbound 0e48c0de19a3:v103"); Thu, 23 Sep 2021 12:04:42 +0000 Received: from 66052b498c8c.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 681A7DAD-D5D4-46CE-BE94-CA1844AD4D6B.1; Thu, 23 Sep 2021 12:04:17 +0000 Received: from EUR03-DB5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 66052b498c8c.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 23 Sep 2021 12:04:17 +0000 Received: from AS9PR06CA0103.eurprd06.prod.outlook.com (2603:10a6:20b:465::21) by PAXPR08MB7203.eurprd08.prod.outlook.com (2603:10a6:102:20a::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.16; Thu, 23 Sep 2021 12:04:17 +0000 Received: from AM5EUR03FT011.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:465:cafe::94) by AS9PR06CA0103.outlook.office365.com (2603:10a6:20b:465::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.15 via Frontend Transport; Thu, 23 Sep 2021 12:04:17 +0000 Received: from nebula.arm.com (40.67.248.234) by AM5EUR03FT011.mail.protection.outlook.com (10.152.16.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:17 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.14; Thu, 23 Sep 2021 12:04:01 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Thu, 23 Sep 2021 12:04:00 +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: 69d98c97-e649-444e-b6ac-6ce67b78bbac 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=wIObFkd9jRKDqLY57XelL0JAnNTNC5COXU4N00/2A38=; b=74aQ+7KDAnTF9+j6xpUlrEN85gY6syIWqjKk8JqB+0q9rHbM8o52OeChSlj3+AttjAp3KHzRFx5mFZcI+mGJ1jvmYg6vSKLMqxIkonYk+ZLMobkKDmt37IS+Eyoa0NhVTvE3Es4kg/AT+bLuLE64HBqRCVv8blPc+gqMFnrNV3c= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.33.187.114) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.33.187.114 as permitted sender) receiver=protection.outlook.com; client-ip=63.33.187.114; helo=64aa7808-outbound-2.mta.getcheckrecipient.com; X-CheckRecipientChecked: true X-CR-MTA-CID: 567f3102161f69e4 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WP/zNJPO5KyDYCe5/wxO9umB3FvU5vtY2wLmCYzdV/UVFJqM/AAJyrGoumys7NZ8YzVivc42yqbzJNn6QOhXBYvPj27TivQS2E/a2/uIxyXPxjyA2UIG+SgjGz2mf4+DONnMVU6I7L8MW+Sc8VgnOHpt1lArHnP2VfCSbcRfmFCFu+I4R+IaA92WCUNYfiL/GoT0BBOz5eHSrEs66d56SzOYWiHbulrVk4yWBPxYPjOT0TEqMC08EL+QQHKxklEor/UHxolsAvVnhnCdvvG1OXclca7LOXMvw0Nt8TsRE7gmOF6WNrN+BbtPimLF9kyxPmzloAOt/A2MU3QMUEJv7Q== 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; bh=wIObFkd9jRKDqLY57XelL0JAnNTNC5COXU4N00/2A38=; b=LBGWFaKxmXwylkWgvWOqpLhpoyn0jCAW8ZKB/7fLBKpZzawEdOAmjMqrsRdP/+reSNleIwRbFT+42PgeF7Wp+g6Wd5tJX/N7tfueqU7l7uVOLgMKiq+GTRH57MXcAkpImXvOH333uCNQ0apRroU1HIDBzyFvt0suwq5cyLrJnt/20OghCZ5IwWS1J7fyTcAyhIWcC3ZrFFIQxSC6qtjvJWzSSFyLC1eM8WsHVLJd92POKycWfnewJBJHt3QLPpZqQLDPWcotTQ4K/HeziSwyalOTmk3q8OyExlKVKelE93xLrTkLN4pMVi5KR+PMhhtL49tAC1sK4zLQjywMTzcIpA== 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=wIObFkd9jRKDqLY57XelL0JAnNTNC5COXU4N00/2A38=; b=74aQ+7KDAnTF9+j6xpUlrEN85gY6syIWqjKk8JqB+0q9rHbM8o52OeChSlj3+AttjAp3KHzRFx5mFZcI+mGJ1jvmYg6vSKLMqxIkonYk+ZLMobkKDmt37IS+Eyoa0NhVTvE3Es4kg/AT+bLuLE64HBqRCVv8blPc+gqMFnrNV3c= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; From: Wei Chen To: , , , CC: Subject: [PATCH 24/37] xen/arm: implement two arch helpers to get memory map info Date: Thu, 23 Sep 2021 20:02:23 +0800 Message-ID: <20210923120236.3692135-25-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210923120236.3692135-1-wei.chen@arm.com> References: <20210923120236.3692135-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9bac5a6e-2d53-4269-219b-08d97e8a545c X-MS-TrafficTypeDiagnostic: PAXPR08MB7203:|VI1PR08MB3296: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:411;OLM:411; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: XLLsowjDBurWKits5jk3cvABClzJgMkFxYytr5n51No/kq7tNPXVnCNL7+LzDWFFlaX7jewOWK9o8l0bWINhDmpaKdJUKQaMpZuDPJrq1+/EquKOH+ywFtZSrpoYbvwF/mE6RGW+ORNhnzh3XSwG+8NPcWNIe95MrgU2/zHGxKemfw6R8SA1xcibumFfTPxUEfbkHq7wKRg3euJ+PJvngxZ1vJisGh9meMlzxfXLd1WvVjzYYOg+i/XzZMnJCtIwHncMG+tbFXslHq8NzsDwRH6sc9j5YyAxliYzg1lWMrnwl0VujqD5thPtoub1peRanlGfwDoao53mYO+KSWVglHYiCFmaMprgNUS7ZLRYJDEJEOcGIbuSzlVVCGLNrdZr0EEACN/1YGnvD/6Z50TuO09JIf5xdoyjD7skT4f8GvYpI2/XLlkXtGxn+Q+WunffW3ACXtJ6rluaIX6/B2DpUK/7m9oh6QYBxnsPI7NgAYpxDDDIanDnI3Rl/h7N5lzf4GHZv1UI+xanCLSL5vZ7jaSMGExxrBzMJu9LanSsHsgZV0Jj/YS3jdJFCHKONmK5qpKFFIpH6Mw1KSCjzEMrYphBvOPrnoloRG5ICuXj069lFGSTnpCvyEDgkzb1px2Qdy6bRmBZXelcTlbGLil38DNfyE57ksjgRSDQh51mApK3W1py7EUFtW4sndnHYG5UD1k9F2Y5Jq5GP7YQl3weze3tW8nYR4F4BpUolp/6Nx4= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(4636009)(46966006)(36840700001)(426003)(2616005)(508600001)(26005)(7696005)(83380400001)(81166007)(356005)(186003)(336012)(4744005)(1076003)(70586007)(70206006)(5660300002)(82310400003)(47076005)(6666004)(110136005)(36860700001)(86362001)(4326008)(2906002)(8676002)(316002)(8936002)(36756003)(44832011)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB7203 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT028.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: b9d3b4a0-823a-4d7d-8bde-08d97e8a4493 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: I/qx8ut2212vOdMajIPRJ9jKTwNIQOJvng4oJTay4805szLCvoZa2vJFU2cPIRMReLdNavh+EN/09ibxp1GArmd5TL/f0hfhFxqofhQxqfyMnu7kBaZBPgfs+2RQc9px6hESekjI7gG4bpFVN8Svnkd8pCPVj71aaghpkkayD+g28hYFs+8+Xg40iNAxu1rvUmLnF+gezmuDc83NEpvT1+B57ItJy44Wca84+OrRLk79to00SCqSFiyTNyqhOhw3+CJyyCDOA177gzC6Z+pQP96THfsVsv8eMJ6qJDW359sBIfrX3DesaImwiyHI0S2LtvmJpcGHeyoU0Z/ifX8vojnXIcnwcAFUOCPlaKpmVNIz+jWQdH9mk7naIb/2WpwGlFl4SoOHo6L3AoulGavMX1Cx7gTYwCM62JAgmqJ3RqVf7pbjWLV0U43RGcBJl4Qeqms/livc3THymiRuwjPIRzjRsitORmHGJh/ieXpRodZmDei6ZX8IWXZ2jGXjC/6rVbZZG3b0GnJr4bXi1CYDp67XhkEFpVf0Jr7CPGdkDQL80yRH9+zD7ocSS5/3EGzXNuGPb0oVsb8UDLFtXARX3CC6kXjVd6fZuGijTvU6IlGVtNoKhRCphf0iG4UYrdsvexQBxOPCDs27dxO3DHP34pU6rwXZApdz53iynTOpBk1mQMRmxpwI+M52P/sR+Q6cAz0oMpEwFF2sdDZLBqHgkQ== X-Forefront-Antispam-Report: CIP:63.33.187.114;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-2.mta.getcheckrecipient.com;PTR:ec2-63-33-187-114.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(4636009)(46966006)(36840700001)(5660300002)(8936002)(110136005)(1076003)(186003)(2906002)(336012)(82310400003)(426003)(26005)(4744005)(47076005)(4326008)(316002)(7696005)(36860700001)(508600001)(36756003)(6666004)(44832011)(83380400001)(86362001)(81166007)(2616005)(70206006)(70586007)(8676002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2021 12:04:43.4497 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9bac5a6e-2d53-4269-219b-08d97e8a545c X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.33.187.114];Helo=[64aa7808-outbound-2.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR03FT028.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB3296 These two helpers are architecture APIs that are required by nodes_cover_memory. Signed-off-by: Wei Chen --- xen/arch/arm/numa.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/xen/arch/arm/numa.c b/xen/arch/arm/numa.c index 3f08870d69..3755b01ef4 100644 --- a/xen/arch/arm/numa.c +++ b/xen/arch/arm/numa.c @@ -67,3 +67,17 @@ uint8_t __node_distance(nodeid_t from, nodeid_t to) return node_distance_map[from][to]; } EXPORT_SYMBOL(__node_distance); + +uint32_t __init arch_meminfo_get_nr_bank(void) +{ + return bootinfo.mem.nr_banks; +} + +int __init arch_meminfo_get_ram_bank_range(uint32_t bank, + paddr_t *start, paddr_t *end) +{ + *start = bootinfo.mem.bank[bank].start; + *end = bootinfo.mem.bank[bank].start + bootinfo.mem.bank[bank].size; + + return 0; +} From patchwork Thu Sep 23 12:02:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 12512645 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 888D6C433F5 for ; Thu, 23 Sep 2021 12:17:29 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 3985361107 for ; Thu, 23 Sep 2021 12:17:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3985361107 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.193950.345576 (Exim 4.92) (envelope-from ) id 1mTNfF-0006tY-5V; Thu, 23 Sep 2021 12:17:21 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 193950.345576; Thu, 23 Sep 2021 12:17:21 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNfE-0006tB-W2; Thu, 23 Sep 2021 12:17:20 +0000 Received: by outflank-mailman (input) for mailman id 193950; Thu, 23 Sep 2021 12:17:19 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNW9-0005KP-6q for xen-devel@lists.xenproject.org; Thu, 23 Sep 2021 12:07:57 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (unknown [40.107.8.75]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 09719c9d-0cd5-4463-94da-71b36f3bfc83; Thu, 23 Sep 2021 12:04:35 +0000 (UTC) Received: from AS8PR04CA0191.eurprd04.prod.outlook.com (2603:10a6:20b:2f3::16) by DB6PR0801MB1800.eurprd08.prod.outlook.com (2603:10a6:4:38::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.18; Thu, 23 Sep 2021 12:04:33 +0000 Received: from AM5EUR03FT041.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:2f3:cafe::8a) by AS8PR04CA0191.outlook.office365.com (2603:10a6:20b:2f3::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:33 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT041.mail.protection.outlook.com (10.152.17.186) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:33 +0000 Received: ("Tessian outbound a77cafe56b47:v103"); Thu, 23 Sep 2021 12:04:33 +0000 Received: from ef915eeccf5d.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id AD7BA721-1AE9-4FA1-BC79-24EB200E25CE.1; Thu, 23 Sep 2021 12:04:20 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id ef915eeccf5d.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 23 Sep 2021 12:04:20 +0000 Received: from AS9PR06CA0094.eurprd06.prod.outlook.com (2603:10a6:20b:465::7) by AM6PR08MB5045.eurprd08.prod.outlook.com (2603:10a6:20b:e4::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13; Thu, 23 Sep 2021 12:04:17 +0000 Received: from AM5EUR03FT011.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:465:cafe::cf) by AS9PR06CA0094.outlook.office365.com (2603:10a6:20b:465::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:17 +0000 Received: from nebula.arm.com (40.67.248.234) by AM5EUR03FT011.mail.protection.outlook.com (10.152.16.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:17 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.14; Thu, 23 Sep 2021 12:04:04 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Thu, 23 Sep 2021 12:04:02 +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: 09719c9d-0cd5-4463-94da-71b36f3bfc83 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=bv/kyQCgDxJAB2ngKdqERIdGChRlUtb76o5kiaGFJyA=; b=8tVQGWrAjiDKX7u7KJroWaNvSMZkrVTT1RF7UmWLOvTMaMIACQW8nRvJNoTu7xhsngpM35RQ53wzsyGu8AiiMMHWQyxaxKxOrdMUs/lOSjT9BrqpvEjc/dc1PVmGjEdg60rE9Bi1jlQ6RPvre47Tq+aFae0PM7Spn2//ykCIPSs= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; X-CheckRecipientChecked: true X-CR-MTA-CID: fd2f19f131e286cb X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RgBOSq28pwyt6AIc/9cb/+Yiwc51u+QucM/hlhLHFzvwPBlukFtEwJ/j+Pw0M2OCILVOMfiT4oTL0tePlEIZQ9v2IiJFwnJkcWTXZW5oa7/MaOTbHhXboJQFSXoHUAicp4kcsqfJ25N2zAgdDI/bdTps9tSok907mH+iuhOKk2Q3QwEl3xA5sTTlRgZmPbMzXs8kskTfJyLUPmGSW5PrNyyigyqNPfwL/ANqF1rN4KN3pQm2Jqh0t1je0QRleKcKTgWnmvgyymO/wXjzZn5IWJJzu6PRJUseQP8+nEw7nk/oewhSPdd46Eq59P5/qChALveqejTm0+k1cFmOIc9v5A== 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; bh=bv/kyQCgDxJAB2ngKdqERIdGChRlUtb76o5kiaGFJyA=; b=A4zyZLqf8yfFmidpoKTLZwN8XlrxQQluSLGbaFY2q0bHNKjBsPSlp15UiM6bUi7dr35WRgd9Pssh4vGNE0v8cZuZ7vcKtitkw/z+vzhbE67BLxTWL8LBB0iQLa9+JsQVeAEYhOVksfZ1co2Vkh3GEcmfoY4t9GHZqCYp8NEDFESsYmVKvlURSsiRAJfC6Fxwc63qxL13Oe0xDoKvhoqdHQCjYi5RYoYPET+ZcJKwgEJAGtXTpbllBFlowBHyulpV07jmbmw/SbqrCO/fro1reItDJ9stRNKVO/eLtyUSQjj6p6kczQaysjOSFYRoXD9lcWGvnBZVs93TRjCg9MGDjA== 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=bv/kyQCgDxJAB2ngKdqERIdGChRlUtb76o5kiaGFJyA=; b=8tVQGWrAjiDKX7u7KJroWaNvSMZkrVTT1RF7UmWLOvTMaMIACQW8nRvJNoTu7xhsngpM35RQ53wzsyGu8AiiMMHWQyxaxKxOrdMUs/lOSjT9BrqpvEjc/dc1PVmGjEdg60rE9Bi1jlQ6RPvre47Tq+aFae0PM7Spn2//ykCIPSs= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; From: Wei Chen To: , , , CC: Subject: [PATCH 25/37] xen/arm: implement bad_srat for Arm NUMA initialization Date: Thu, 23 Sep 2021 20:02:24 +0800 Message-ID: <20210923120236.3692135-26-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210923120236.3692135-1-wei.chen@arm.com> References: <20210923120236.3692135-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 17e2335d-43fc-4a59-bb9e-08d97e8a4e8d X-MS-TrafficTypeDiagnostic: AM6PR08MB5045:|DB6PR0801MB1800: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:6430;OLM:6430; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: hH8Kge7MB/PPB0wKl7fKIbFtyh7/6prOeHhF6M7svzrk5jTO+EBNnhd5m7v0wFh88OpCOFpWDjduwg+r1AAjbWDHKFiGYyReT8JdPmtbJh1fMgDthqcERkGsbzz5UBhb8nO+7P8h771AiaAQ3cvULVzNmfcwKml1EOEjZ+ewBZjf3B+X3Gdyh60GD6EKETysQXPHwpnOfjl1/lTauVZ7xj9G+15MQwAx1d5QOFkQHJ1s4F/7psmToMk84zYlytYwASkpvjUChIZ+LeNCEcnClaRXbzv50nFLnYCGwpOHYiU69NPqZUpTguM5AZ452pjmYP2LWlfd1aIJHKJqhD0CFf56Brql/kO5f9YhUol2QEqNziVBMq9oPP5IaKJrWrVexbXZ14wREgYiytTE93Lh8DATi38VzVhwGSUoZbVv5hBaJA7QTSlo+ILhKTpIm1Azs4LhsZ0YIrlkUvU+aq4JD3Ap/p/77yDbdck3RM8cLGplpZQGnpcNBI0mRBxdqAm8bi6q2ZQo5kQXVkeajefIwD1U3cZW6Yh29YXPE7dp5sdyRlBu9biaz7qHoUPbXmUAHqx+7oLhU57yiXYIXxq9K9X+c5Hj440PKoEbD1nclBuWzcH5H34zgT93u9P399AFQ6MK7fNgdaeqC0iOfAMsV8TuuiFu721Gsr4Wp72JwD4CXiqqnNOYgaaZdjxnyTBOKanS9q8QWDI0KUHFqWjP5wuMO35TOE4yWp1Dye2Jvic= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(4636009)(36840700001)(46966006)(36860700001)(356005)(8936002)(70206006)(110136005)(2906002)(7696005)(86362001)(336012)(26005)(81166007)(6666004)(5660300002)(82310400003)(36756003)(2616005)(4326008)(70586007)(47076005)(426003)(44832011)(8676002)(1076003)(316002)(186003)(508600001)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB5045 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT041.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 767039c6-5a48-42f6-3a62-08d97e8a44db X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VHxLos1TlwEIj8PhHqYPfgpZeFNnJi8JiQtAnwJGB6T3afLb0CAgDhJYOfN23PVQU88cUGnCYr5xLSICbNjm0Y+BgDuLPG2tOE7nmHYolQ6B0t+haQEInCDrCYzl/CPYg0k2ZpQg5++MOmnX5NErrtAnIVPVUma+NxpxqwpvWCaXgztfz8yvPOXbSF58+xOgnyytuA59HHAWaXc67tuZbolJCWzDdjIldcOPrtJtAmicyyAD4mvhHChWt9kpYgWemAjJnKRYFXYZvEnAtI/brFgbsOrlbBp9BCccv+4THCUhOK2ZWANtzIUCOBF1jtmMh8hKgvhYvW3BK/UuX1RAu7bGJlJEBtAlt7Z2zVBUQUNN+aMsIGQQ9sKNirx4mZ61CxlO/yD73Ejdo91cBAKN+xG/KgsIQfxOx9T5A6BceihFK2ZmH9fHcUCOGoEHPF5BmDRr1+ldZEzOOA4W9YRvx3mjhInmzWLZvOMrdSVWIRk6ybn9aeZBzDEXPut/GYG3etUFCxqs2EJW1+prFUm5C5K/Sqf+YlmGAmye+CxCCj/PH6x6lMaj67Xvn8g0r1QCvCucNHq6Hvcn6Aw6gd7p74jdM+c8GWfwyMizejMFvRHZNmjen29SLSy2G0hIGAIw0JyF+P8znkUyP84UnhqUrCx6djOgJWdcigRs2w37PEMiM/wQT8TuCwxKjV+hVC2gYTqt90BNk9mQC8qLJSqgEw== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(4636009)(46966006)(36840700001)(44832011)(2616005)(4326008)(426003)(47076005)(8676002)(36860700001)(81166007)(86362001)(82310400003)(8936002)(110136005)(186003)(36756003)(5660300002)(1076003)(70206006)(70586007)(508600001)(336012)(6666004)(7696005)(316002)(2906002)(26005);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2021 12:04:33.7529 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 17e2335d-43fc-4a59-bb9e-08d97e8a4e8d 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: AM5EUR03FT041.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0801MB1800 NUMA initialization will parse information from firmware provided static resource affinity table (ACPI SRAT or DTB). bad_srat if a function that will be used when initialization code encounters some unexcepted errors. In this patch, we introduce Arm version bad_srat for NUMA common initialization code to invoke it. Signed-off-by: Wei Chen --- xen/arch/arm/numa.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/xen/arch/arm/numa.c b/xen/arch/arm/numa.c index 3755b01ef4..5209d3de4d 100644 --- a/xen/arch/arm/numa.c +++ b/xen/arch/arm/numa.c @@ -18,6 +18,7 @@ * */ #include +#include #include static uint8_t __read_mostly @@ -25,6 +26,12 @@ node_distance_map[MAX_NUMNODES][MAX_NUMNODES] = { { 0 } }; +__init void bad_srat(void) +{ + printk(KERN_ERR "NUMA: Firmware SRAT table not used.\n"); + fw_numa = -1; +} + void __init numa_set_distance(nodeid_t from, nodeid_t to, uint32_t distance) { if ( from >= MAX_NUMNODES || to >= MAX_NUMNODES ) From patchwork Thu Sep 23 12:02:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 12512563 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 44F77C433F5 for ; Thu, 23 Sep 2021 12:07:41 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id DC36460FA0 for ; Thu, 23 Sep 2021 12:07:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org DC36460FA0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.193865.345422 (Exim 4.92) (envelope-from ) id 1mTNVi-00064C-V2; Thu, 23 Sep 2021 12:07:30 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 193865.345422; Thu, 23 Sep 2021 12:07:30 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNVi-000645-Rr; Thu, 23 Sep 2021 12:07:30 +0000 Received: by outflank-mailman (input) for mailman id 193865; Thu, 23 Sep 2021 12:07:29 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNUQ-0006xV-Sl for xen-devel@lists.xenproject.org; Thu, 23 Sep 2021 12:06:10 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (unknown [40.107.20.67]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 6adcd31a-1c66-11ec-ba2e-12813bfff9fa; Thu, 23 Sep 2021 12:04:35 +0000 (UTC) Received: from DB6PR0601CA0027.eurprd06.prod.outlook.com (2603:10a6:4:17::13) by DBBPR08MB4252.eurprd08.prod.outlook.com (2603:10a6:10:c2::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.18; Thu, 23 Sep 2021 12:04:32 +0000 Received: from DB5EUR03FT011.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:17:cafe::25) by DB6PR0601CA0027.outlook.office365.com (2603:10a6:4:17::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:32 +0000 Received: from 64aa7808-outbound-2.mta.getcheckrecipient.com (63.33.187.114) by DB5EUR03FT011.mail.protection.outlook.com (10.152.20.95) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:32 +0000 Received: ("Tessian outbound c9f4ff96a6ad:v103"); Thu, 23 Sep 2021 12:04:31 +0000 Received: from e65c92c8e861.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id B81359B3-0BE5-450D-A9D8-FE51EB833D47.1; Thu, 23 Sep 2021 12:04:19 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id e65c92c8e861.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 23 Sep 2021 12:04:19 +0000 Received: from AS9PR06CA0105.eurprd06.prod.outlook.com (2603:10a6:20b:465::27) by AM4PR0802MB2177.eurprd08.prod.outlook.com (2603:10a6:200:5d::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13; Thu, 23 Sep 2021 12:04:18 +0000 Received: from AM5EUR03FT011.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:465:cafe::5a) by AS9PR06CA0105.outlook.office365.com (2603:10a6:20b:465::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.15 via Frontend Transport; Thu, 23 Sep 2021 12:04:18 +0000 Received: from nebula.arm.com (40.67.248.234) by AM5EUR03FT011.mail.protection.outlook.com (10.152.16.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:18 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.14; Thu, 23 Sep 2021 12:04:06 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Thu, 23 Sep 2021 12:04:04 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 6adcd31a-1c66-11ec-ba2e-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=24TzNeXkluknvjlUOjwTTRzo7llaAUU14RNeMwlWz6E=; b=Rle0oijAtTyX8gF6xwDUp77hGrbcGNjm/dLMTBs3Vd9UIlItm6OAyJOaNjNsoG7iZLv/R+BcLsK4uYGCbP5H75MAfR/LTR/UYBeN71RO4+xybFX5VVSVyoJpCUw/mwZuzaaUfp0gDp4flMzjWjiTgJUsRMSkXjgfiFQeMrYqk+I= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.33.187.114) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.33.187.114 as permitted sender) receiver=protection.outlook.com; client-ip=63.33.187.114; helo=64aa7808-outbound-2.mta.getcheckrecipient.com; X-CheckRecipientChecked: true X-CR-MTA-CID: a61ea4807183f0ca X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PwTcW4HxqTP+6Iz2oF+74jfTpOdpTyplmQtI0EBsyQV8Cj7eKIdNPkiQB+mMocXm95eGMcBKeLfZed+DWg+ESj0hhOVTUai92FWnHvRQtSH0HtnmzS/2Dt/ckFuyPCmT4neFD5kXhSaH9jnYp3m21i6m2SJByctudXP5wSethg8cRvXGPGZGWWnuBvpuw4Z9vI33RxhwygO5D44bKNCGJLnN/ppEUkPYWr3jDEkrGuVvD62o8bp0hvPe1SpGytczhodGQFgrR9cv2AiqvhHuj/amcqo3MRoUIjIE40+WkQdkgX37Bgw9bK078oTIPc7yWZa6eUwf/jgyGr7asdilxw== 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; bh=24TzNeXkluknvjlUOjwTTRzo7llaAUU14RNeMwlWz6E=; b=Bqi2qcBh2Su8jV2PFYwVsb4nv9e8+nBZ4JnXsJ8Bjda0SUfFS4yuWJfuuebcw2crHzp4V7+c95WfREi0kE3lnDDYjwcYdfoFAsI7nWiY+ctu1ndIjJSVOX8k/HCUzW/R46fpOtH50AcIMdBNnO7aRw6QskATQ3329SnHrI4sTntWdi1+HOOf2NfihE8fMXsMJHgnfRrHI0BQhd4ZUz61R0FHnFH7hNfz0pFckA/blPfKUGtb5DFE+qhtCCQzLlwn6H57uHt7TNqjrSXXRyRoAFv9spfpBDnFZunSTTJfXvrQouxwxzXwwp0UUWGyjRaL6FkgDDTEznhqTeDyhtNsIQ== 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=24TzNeXkluknvjlUOjwTTRzo7llaAUU14RNeMwlWz6E=; b=Rle0oijAtTyX8gF6xwDUp77hGrbcGNjm/dLMTBs3Vd9UIlItm6OAyJOaNjNsoG7iZLv/R+BcLsK4uYGCbP5H75MAfR/LTR/UYBeN71RO4+xybFX5VVSVyoJpCUw/mwZuzaaUfp0gDp4flMzjWjiTgJUsRMSkXjgfiFQeMrYqk+I= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; From: Wei Chen To: , , , CC: Subject: [PATCH 26/37] xen/arm: build NUMA cpu_to_node map in dt_smp_init_cpus Date: Thu, 23 Sep 2021 20:02:25 +0800 Message-ID: <20210923120236.3692135-27-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210923120236.3692135-1-wei.chen@arm.com> References: <20210923120236.3692135-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9e9b1f90-1cdc-4885-ebc2-08d97e8a4d81 X-MS-TrafficTypeDiagnostic: AM4PR0802MB2177:|DBBPR08MB4252: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:7219;OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: GStpNBt+BE9ZbmniAnLail5zd1teo6+J6nP1GQLsN76b4i7pu+rRRdWK3ePMZ1f/yY7PXJkXAjETVB+hfa/Xskg8DqW2H4CFV1YOz/a7TI3thGRzLSgZArncCBFE4jFMC/cGnh/3mMu2LomYlaUJuJaAgQ9RHuawmhkuRc2u+C2p9KbELTdRZdJ2DNohd5lxrye+uDQ7R2MFx4bqSlu/b/FkO2Dz177c8+jeCenac433BcubDr437T8MFt3XdfLrxBUSQhGeMGVrOyw6G8P4cyM7mgrxePTjWnbz3H15t+XNbaezZCbOkOU0/T8kKuodKLEH5TGmfJ/9PGc+jTFWJCyotQVSjRT4R4SOnnAlxxU9p5x4j9zytuiMRlpRCic6/yHZyWjh+HV3wAmOIPfbrmcBfugPzmy+8W1fUxQpJ7nkJKJE2+b9OFYlFToPUSMoXbS1WSQK0q7V8vephaWRARmT25+RFsnzT6LY6g1XytCvANZh0xCSyysI4lXM8h/96IeEetvnCvUnJ3U4Ita/CVz9mqQX+UqRTOmsIyzCgXuGHZSjGpLuJk3jKgMgIWcizXC8YyPf59SKQz+gDG7Kfs9nxWBHjtpatv6P3tmyjwdbTxIiuyHGyf9psHfnmEn9F22GzrD6CoC1J8LGbw0n/EtSKBs5eaSQ/Yb/EZ5ucWWKYXZ8agQ8mDDAtJRwxjwJZbLmsnq5f/H44/GhkTsEfp3y6b1MAdHYZATsbiuOzlU= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(4636009)(46966006)(36840700001)(5660300002)(356005)(508600001)(336012)(186003)(2616005)(81166007)(1076003)(36756003)(8936002)(8676002)(86362001)(426003)(4326008)(26005)(44832011)(36860700001)(70206006)(70586007)(7696005)(83380400001)(2906002)(110136005)(6666004)(82310400003)(316002)(47076005)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR0802MB2177 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT011.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: c3f9b71d-4c33-473c-5ddb-08d97e8a4584 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ozgF1EfbjuLDjlnQtcn6oISBztjGhmoXbiGaOtQexdXodaHTyqAqqPG34VnQSluOhz367JkkhwREjTqQPVMh3kUTu0HD8HW0uygYiK3d83izjIzHNWoZKxTvh5d/U7G0xtSYTSQhSBLEfDMe6XlhkK27pdN2zZ7/0S6/sx6qRenEg2zZgVDty/a0Jn8JB6zf5MZC7kaET6UOdl8zpdg9plhr4LOVOIPZ1zCGZ7jvAlUsjFUcGQG5ZHJQpahWr09Bl0DV1Vuw2zfL6UJV5dnPlHf6CRSJ79I+aC1QjnSCdE3RzEgQAQh42OoQG5cJimQ/XsXZhy1FkVbj+twk6/K6wODXnypWqmihfOrODVcohYQCliNwjCYZI6cWO/H+13oW6r++wq/Tt0d/sAhJ146WPMa9D9mhIqkEKtvIFE/QYHL5iT0TRmJltik1a5gDgu4c3ih2vHZXwAi1rrchJSW6bMDWIBDFCVoGRQrb0/lUjhy43saWUozGtBtgtwijK/iWFTv0USPSuArWLVxKjfQj4hukIQK1HMDVs1J5/Kk47p14+Vt8zoBwLpTk3aTrIQXXEemeyoPBHczLomofFOwXuR4FhJWSlMr7y6tcaDaIYfr4NpfNyrfZGf5mucm/aJ4c2PTY0eA9BhNwKC0AejVRLSm8PuUfz5tXA3eMPGlWHs+W+XV5G48JI+epnTVdgirs4PM/k7lSuqEgXifEWvVmew== X-Forefront-Antispam-Report: CIP:63.33.187.114;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-2.mta.getcheckrecipient.com;PTR:ec2-63-33-187-114.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(4636009)(46966006)(36840700001)(83380400001)(5660300002)(2906002)(6666004)(36860700001)(86362001)(44832011)(70586007)(316002)(81166007)(508600001)(8676002)(8936002)(4326008)(2616005)(110136005)(82310400003)(426003)(26005)(7696005)(186003)(70206006)(336012)(47076005)(36756003)(1076003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2021 12:04:32.0477 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9e9b1f90-1cdc-4885-ebc2-08d97e8a4d81 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.33.187.114];Helo=[64aa7808-outbound-2.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DB5EUR03FT011.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB4252 NUMA implementation has a cpu_to_node array to store CPU to NODE map. Xen is using CPU logical ID in runtime components, so we use CPU logical ID as CPU index in cpu_to_node. In device tree case, cpu_logical_map is created in dt_smp_init_cpus. So, when NUMA is enabled, dt_smp_init_cpus will fetch CPU NUMA id at the same time for cpu_to_node. Signed-off-by: Wei Chen --- xen/arch/arm/smpboot.c | 37 ++++++++++++++++++++++++++++++++++++- xen/include/asm-arm/numa.h | 5 +++++ 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c index 60c0e82fc5..6e3cc8d3cc 100644 --- a/xen/arch/arm/smpboot.c +++ b/xen/arch/arm/smpboot.c @@ -121,7 +121,12 @@ static void __init dt_smp_init_cpus(void) { [0 ... NR_CPUS - 1] = MPIDR_INVALID }; + static nodeid_t node_map[NR_CPUS] __initdata = + { + [0 ... NR_CPUS - 1] = NUMA_NO_NODE + }; bool bootcpu_valid = false; + uint32_t nid = 0; int rc; mpidr = system_cpuinfo.mpidr.bits & MPIDR_HWID_MASK; @@ -172,6 +177,28 @@ static void __init dt_smp_init_cpus(void) continue; } + if ( IS_ENABLED(CONFIG_NUMA) ) + { + /* + * When CONFIG_NUMA is set, try to fetch numa infomation + * from CPU dts node, otherwise the nid is always 0. + */ + if ( !dt_property_read_u32(cpu, "numa-node-id", &nid) ) + { + printk(XENLOG_WARNING + "cpu[%d] dts path: %s: doesn't have numa information!\n", + cpuidx, dt_node_full_name(cpu)); + /* + * During the early stage of NUMA initialization, when Xen + * found any CPU dts node doesn't have numa-node-id info, the + * NUMA will be treated as off, all CPU will be set to a FAKE + * node 0. So if we get numa-node-id failed here, we should + * set nid to 0. + */ + nid = 0; + } + } + /* * 8 MSBs must be set to 0 in the DT since the reg property * defines the MPIDR[23:0] @@ -231,9 +258,12 @@ static void __init dt_smp_init_cpus(void) { printk("cpu%d init failed (hwid %"PRIregister"): %d\n", i, hwid, rc); tmp_map[i] = MPIDR_INVALID; + node_map[i] = NUMA_NO_NODE; } - else + else { tmp_map[i] = hwid; + node_map[i] = nid; + } } if ( !bootcpu_valid ) @@ -249,6 +279,11 @@ static void __init dt_smp_init_cpus(void) continue; cpumask_set_cpu(i, &cpu_possible_map); cpu_logical_map(i) = tmp_map[i]; + + nid = node_map[i]; + if ( nid >= MAX_NUMNODES ) + nid = 0; + numa_set_node(i, nid); } } diff --git a/xen/include/asm-arm/numa.h b/xen/include/asm-arm/numa.h index 758eafeb05..8a4ad379e0 100644 --- a/xen/include/asm-arm/numa.h +++ b/xen/include/asm-arm/numa.h @@ -46,6 +46,11 @@ extern mfn_t first_valid_mfn; #define node_start_pfn(nid) (mfn_x(first_valid_mfn)) #define __node_distance(a, b) (20) +static inline void numa_set_node(int cpu, nodeid_t node) +{ + +} + #endif static inline unsigned int arch_have_default_dmazone(void) From patchwork Thu Sep 23 12:02:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 12512637 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1DA2C433F5 for ; Thu, 23 Sep 2021 12:17:11 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 6A08B610A0 for ; Thu, 23 Sep 2021 12:17:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6A08B610A0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.193928.345532 (Exim 4.92) (envelope-from ) id 1mTNev-000590-MK; Thu, 23 Sep 2021 12:17:01 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 193928.345532; Thu, 23 Sep 2021 12:17: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 1mTNev-00058c-HR; Thu, 23 Sep 2021 12:17:01 +0000 Received: by outflank-mailman (input) for mailman id 193928; Thu, 23 Sep 2021 12:17:01 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNWi-0005KP-7n for xen-devel@lists.xenproject.org; Thu, 23 Sep 2021 12:08:32 +0000 Received: from EUR02-HE1-obe.outbound.protection.outlook.com (unknown [2a01:111:f400:fe05::61a]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 1cb65bf7-a450-400a-91b1-1323ad587036; Thu, 23 Sep 2021 12:04:53 +0000 (UTC) Received: from DU2PR04CA0162.eurprd04.prod.outlook.com (2603:10a6:10:2b0::17) by VI1PR08MB4447.eurprd08.prod.outlook.com (2603:10a6:803:f3::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.15; Thu, 23 Sep 2021 12:04:49 +0000 Received: from DB5EUR03FT037.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:2b0:cafe::9c) by DU2PR04CA0162.outlook.office365.com (2603:10a6:10:2b0::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.15 via Frontend Transport; Thu, 23 Sep 2021 12:04:49 +0000 Received: from 64aa7808-outbound-2.mta.getcheckrecipient.com (63.33.187.114) by DB5EUR03FT037.mail.protection.outlook.com (10.152.20.215) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:49 +0000 Received: ("Tessian outbound 1fd2edb24cb2:v103"); Thu, 23 Sep 2021 12:04:49 +0000 Received: from 3548f08ec3d6.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 68D427ED-28CA-4AFD-BC4E-C23B61B42A9C.1; Thu, 23 Sep 2021 12:04:35 +0000 Received: from EUR01-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 3548f08ec3d6.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 23 Sep 2021 12:04:35 +0000 Received: from AS9PR06CA0096.eurprd06.prod.outlook.com (2603:10a6:20b:465::25) by AM0PR08MB5363.eurprd08.prod.outlook.com (2603:10a6:208:188::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.14; Thu, 23 Sep 2021 12:04:33 +0000 Received: from AM5EUR03FT011.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:465:cafe::4f) by AS9PR06CA0096.outlook.office365.com (2603:10a6:20b:465::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:33 +0000 Received: from nebula.arm.com (40.67.248.234) by AM5EUR03FT011.mail.protection.outlook.com (10.152.16.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:33 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.14; Thu, 23 Sep 2021 12:04:08 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Thu, 23 Sep 2021 12:04:06 +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: 1cb65bf7-a450-400a-91b1-1323ad587036 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=cQXv12XCrC0ornD3XLR6+SrgHIB9Pxv0AYpsZjKo72M=; b=a6cHRChBhtKx/YM2LKALl/qBfS6yG+vAqwnM6DuAj/5Qzf2tCpp/paD0XXktUEWO9ZnaJ7np4A5ZB5O3G28xm6Xr8lSCklBTE3l7a03hYA1jdp0koxEQ78g46IwwjvXo3MNoDJzy5GBzFbTIAUr8MA0DTBfmx7sqJIqD9TI1QIM= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.33.187.114) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.33.187.114 as permitted sender) receiver=protection.outlook.com; client-ip=63.33.187.114; helo=64aa7808-outbound-2.mta.getcheckrecipient.com; X-CheckRecipientChecked: true X-CR-MTA-CID: e6b074adeafe187f X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UxmubAxpGvAIsBj3jW5/TAqbSDAoE+BYSSbXcCaiJpCNqRp+GIHVmSm6mzd58y0ktGYzOiDeREQrvfyaHQEA/RM4qXhARyqSYcSGJv61VsfvD/Req4Tx5sr66iqNO3z/zR8xoFc0+mEobvHRyv9T7zDKZ/ev59kZFH3NU0ss5JrBSgiPzmAYWJY9OYYoqZUn5Qt/FBKPH17rd7mm1EzADuz/8BApzQP2Pg3BF2y6LzI8ylVeiQ8y2rTRMa8JwP1tDTZKdJYzak5g4o85EFNMkK82U+cSUTwKT442lsQbhT02vUeztHVHSEhCATbUSHpFjfE7ldJBOqR38CZPeWe4wg== 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; bh=cQXv12XCrC0ornD3XLR6+SrgHIB9Pxv0AYpsZjKo72M=; b=Gks5zDlFNm1dO2scoCgfCfycFecaKUXENm4ME4iqs552H6lu8DGD7TQTT8Q/5bPVn9CTXjxeH+RwHGdp3qdOHDz0gjZHBOq9a0Q7GqlIQaAV3bQOFuDF/C3/VEUbf1iLEO9HLzfkwEa72ePbFr3vs16k8oZk3XGlizZLhcE5Yd2nltnzE0auUVtUWdzSNkyKR7pqur2/fmWuSWNGs5Z1W+bcJh+ni+suMP77i0RBkDinsChGdtztBTmmPelWPuxmxFKdqU4xUvLV/Ot6NUubWl8mkUQCxOgkX8dxKfI0l4B3u0E/Q1qgmrnMFHpjQ7lMNV2WA0vx5ZgGX2cH5NqSWA== 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=cQXv12XCrC0ornD3XLR6+SrgHIB9Pxv0AYpsZjKo72M=; b=a6cHRChBhtKx/YM2LKALl/qBfS6yG+vAqwnM6DuAj/5Qzf2tCpp/paD0XXktUEWO9ZnaJ7np4A5ZB5O3G28xm6Xr8lSCklBTE3l7a03hYA1jdp0koxEQ78g46IwwjvXo3MNoDJzy5GBzFbTIAUr8MA0DTBfmx7sqJIqD9TI1QIM= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; From: Wei Chen To: , , , CC: Subject: [PATCH 27/37] xen/arm: Add boot and secondary CPU to NUMA system Date: Thu, 23 Sep 2021 20:02:26 +0800 Message-ID: <20210923120236.3692135-28-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210923120236.3692135-1-wei.chen@arm.com> References: <20210923120236.3692135-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 29c3aa62-b93a-4e6c-587f-08d97e8a57ec X-MS-TrafficTypeDiagnostic: AM0PR08MB5363:|VI1PR08MB4447: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:6790;OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 9OXy2VLFXhEAEPzN/ck0kCHr3GGPjpx0WKFBXgmMQzRC4uakapqD5/ls5Mx2EXNZwiDRLSHHqYArcNi6SOCdp0V3A0VK8fwtnAqzzf10QxS4mrl9rPV+0T++29aj7N2dg7Q36Km8IMYko/HaUWVBZ6zBiqdikgJoTjyaD6GSTleyyOFsCzoYXrVkIPY6xhAvSstMX2lQqmFBR5bHcBe0pReaVL/Xk1kKsxxH9pQxlQ4UiBAkgywx/k0MBfTv1M8ywPIhEybHuf/PpiA0EkiV9sveXIlYYm+R7rqgzPQPSqSIyrYLCe/T9Ht6Cz3wI45uCA9t/KaZJ3EMUNWxs/UAdmLHwYmIvU35viPyB0ydKdNiZ6af1DC8vyk91vt+/8uh+8bb/YdUwrGDTlGYwC7MKtiP0x+cHxYFcjgvj1wrvqb5a3cFeaNKZYyEH8IcLU5zd3ry5oqV0wafQWxyVxYSnq8U02jU2/HQh5O3IMwZlE7t51VMYTSoNwdo8YNENyARu6RdxbYK2zvpik7zU63kIx5r5vIQAyyZ5cXrxGXtftD++5+u6T8phwPEo95JNfKWbnzOxmo7iMGaJe4az7JYx3O2HJBuSSSbJuIssdaxlK9Edx/7uctbVYQxZc7x7rIcapSaCQCIcShUOyUoFlf19BwK33+/WtG2IKPGymnVciTVway4AT2hCE3l7MYGi62OqyxNTl6/fw+Pz5RukwTFCtBG83FihZQzTsnOqZ+wLDc= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(4636009)(36840700001)(46966006)(356005)(316002)(1076003)(5660300002)(83380400001)(8936002)(36756003)(82310400003)(110136005)(36860700001)(2616005)(2906002)(86362001)(70206006)(4326008)(508600001)(426003)(8676002)(7696005)(70586007)(6666004)(47076005)(81166007)(336012)(44832011)(186003)(26005)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB5363 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT037.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 5d9a9377-4a40-4df4-517d-08d97e8a4e85 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8TFpdkcx4EqOQng0e8tm1dUSqyWPpyQlk+ZJw+f9ZSqD2Qa5Tk3vxYHqT5uUuRjMjwmk1yuYzNomvcJGOMQ6CbIvpCAr2SKIRte2FHrCfm1ztkkjY6ZmhpNjfZdL4OzgsbSn+55GxQhILzYtjbnZ6H3Oyg8x1Ztn8RnNOz83GYjuSUvy/if+DUB1JJuU5Qbu/N6AF4Eo+sKxj7P/SY2glEuZCwPdHY7p8OKbaHFzqIuSjGpcQh1ukWBMs9NzrKpwhDcN2jBWgxyZC7dPxQoqItdjxBbzXta8dBLjPps5ncPYTfkZNiJ6hY+YzESMMbzUNpdCXtmzUFCEh9NnGITYEoLteaxpQjAy48JE8yw85UifJ/XnSlSCtt5SYmzTzNewXKaTp47oWHZmGTh1Q5tCCUKl1UM9p2lus3Z+FbQBFW+CsQ1t1dWg3SoE+5JaR0MRRI/XgxNSL2oXiLIlnTKJt2vEyiOQh43eogQEgrJb475qIsUqYLGE42zokZ49WARpF4Eyawk+n1X502RVvRVkgKOyzHUL+RJVhP6aDfxxNa7cjVwhGjrGvO2ee3EHFN/X66hSeWTa5GNATfuV3hRZXv7Dq36iG6QoFcfO1jO2vREm0wv0SdalI50x2m42zvHX53fpW8ALUOGY1JXxuUnnAdDz3RZS1uHS4U3pSO2cOF2vlFkQAviXFXEWepyzjDc48+6/rKWLsT2m0pJpfst0FA== X-Forefront-Antispam-Report: CIP:63.33.187.114;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-2.mta.getcheckrecipient.com;PTR:ec2-63-33-187-114.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(4636009)(46966006)(36840700001)(6666004)(336012)(2616005)(316002)(5660300002)(86362001)(110136005)(426003)(4326008)(36756003)(47076005)(186003)(81166007)(2906002)(44832011)(26005)(8676002)(83380400001)(8936002)(1076003)(82310400003)(36860700001)(7696005)(70586007)(70206006)(508600001);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2021 12:04:49.5269 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 29c3aa62-b93a-4e6c-587f-08d97e8a57ec X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.33.187.114];Helo=[64aa7808-outbound-2.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DB5EUR03FT037.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB4447 In this patch, we make NUMA node online and add cpu to its NUMA node. This will make NUMA-aware components have NUMA affinity data to support their work. To keep the mostly the same behavior of x86, we still use srat_detect_node to online node. The difference is that, we have prepared cpu_to_node in dt_smp_init_cpus, so we don't need to setup cpu_to_node in srat_detect_node. Signed-off-by: Wei Chen --- xen/arch/arm/numa.c | 10 ++++++++++ xen/arch/arm/setup.c | 5 +++++ xen/include/asm-arm/numa.h | 10 ++++++++++ 3 files changed, 25 insertions(+) diff --git a/xen/arch/arm/numa.c b/xen/arch/arm/numa.c index 5209d3de4d..7f05299b76 100644 --- a/xen/arch/arm/numa.c +++ b/xen/arch/arm/numa.c @@ -32,6 +32,16 @@ __init void bad_srat(void) fw_numa = -1; } +void srat_detect_node(int cpu) +{ + nodeid_t node = cpu_to_node[cpu]; + + if ( node == NUMA_NO_NODE ) + node = 0; + + node_set_online(node); +} + void __init numa_set_distance(nodeid_t from, nodeid_t to, uint32_t distance) { if ( from >= MAX_NUMNODES || to >= MAX_NUMNODES ) diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c index 49dc90d198..1f0fbc95b5 100644 --- a/xen/arch/arm/setup.c +++ b/xen/arch/arm/setup.c @@ -988,6 +988,11 @@ void __init start_xen(unsigned long boot_phys_offset, for_each_present_cpu ( i ) { + /* Detect and online node based on cpu_to_node[] */ + srat_detect_node(i); + /* Set up node_to_cpumask based on cpu_to_node[]. */ + numa_add_cpu(i); + if ( (num_online_cpus() < cpus) && !cpu_online(i) ) { int ret = cpu_up(i); diff --git a/xen/include/asm-arm/numa.h b/xen/include/asm-arm/numa.h index 8a4ad379e0..7675012cb7 100644 --- a/xen/include/asm-arm/numa.h +++ b/xen/include/asm-arm/numa.h @@ -46,11 +46,21 @@ extern mfn_t first_valid_mfn; #define node_start_pfn(nid) (mfn_x(first_valid_mfn)) #define __node_distance(a, b) (20) +static inline void numa_add_cpu(int cpu) +{ + +} + static inline void numa_set_node(int cpu, nodeid_t node) { } +static inline void srat_detect_node(int cpu) +{ + +} + #endif static inline unsigned int arch_have_default_dmazone(void) From patchwork Thu Sep 23 12:02:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 12512569 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8C24FC433F5 for ; Thu, 23 Sep 2021 12:07:48 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 3C6CD60FA0 for ; Thu, 23 Sep 2021 12:07:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3C6CD60FA0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.193871.345466 (Exim 4.92) (envelope-from ) id 1mTNVs-0007Mo-Ia; Thu, 23 Sep 2021 12:07:40 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 193871.345466; Thu, 23 Sep 2021 12:07:40 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNVs-0007Lt-DN; Thu, 23 Sep 2021 12:07:40 +0000 Received: by outflank-mailman (input) for mailman id 193871; Thu, 23 Sep 2021 12:07:38 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNUz-0006xV-Su for xen-devel@lists.xenproject.org; Thu, 23 Sep 2021 12:06:45 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (unknown [40.107.21.67]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 727f9472-1c66-11ec-ba2e-12813bfff9fa; Thu, 23 Sep 2021 12:04:48 +0000 (UTC) Received: from DB3PR08CA0014.eurprd08.prod.outlook.com (2603:10a6:8::27) by AM5PR0802MB2404.eurprd08.prod.outlook.com (2603:10a6:203:a0::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.18; Thu, 23 Sep 2021 12:04:43 +0000 Received: from DB5EUR03FT004.eop-EUR03.prod.protection.outlook.com (2603:10a6:8::4) by DB3PR08CA0014.outlook.office365.com (2603:10a6:8::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.15 via Frontend Transport; Thu, 23 Sep 2021 12:04:43 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT004.mail.protection.outlook.com (10.152.20.128) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:43 +0000 Received: ("Tessian outbound ab2dc3678fa9:v103"); Thu, 23 Sep 2021 12:04:43 +0000 Received: from e69a35bcc9b5.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id E0723BDA-A389-46C5-B2F4-4B4EABD18756.1; Thu, 23 Sep 2021 12:04:36 +0000 Received: from EUR02-VE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id e69a35bcc9b5.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 23 Sep 2021 12:04:36 +0000 Received: from AM6P191CA0095.EURP191.PROD.OUTLOOK.COM (2603:10a6:209:8a::36) by VI1PR08MB2830.eurprd08.prod.outlook.com (2603:10a6:802:24::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.18; Thu, 23 Sep 2021 12:04:34 +0000 Received: from AM5EUR03FT013.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:8a:cafe::76) by AM6P191CA0095.outlook.office365.com (2603:10a6:209:8a::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.14 via Frontend Transport; Thu, 23 Sep 2021 12:04:34 +0000 Received: from nebula.arm.com (40.67.248.234) by AM5EUR03FT013.mail.protection.outlook.com (10.152.16.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:34 +0000 Received: from AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2308.14; Thu, 23 Sep 2021 12:04:11 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Thu, 23 Sep 2021 12:04:10 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Thu, 23 Sep 2021 12:04:09 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 727f9472-1c66-11ec-ba2e-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dVwXh/yVQ83FhUNQPKNpGoOH7G0T0dTGV7cr7Z6KkRQ=; b=5a739+q5UVFwBvAzTxEfHdG2rFG2qWGyDigpcuvJcKI4Q69rQSbLUX0rXF/q/wGx//c5iSiM/Tfp7dWQUWh/Xl+JzDON93qXdgphrijxX4AV5y54cfpea9FXqycgN3o5QjjThz/KMJaxqqADqI8bt2B+3uF4Xq3frnkWgwraG8s= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; X-CheckRecipientChecked: true X-CR-MTA-CID: c23ec75439f285af X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=irnoecishdpmIJc8M6BMlHF9sa6NxYyCHX0Hwt3UtAj6LEtndEkwKnC7v0O1a4xzKcPmQR1pcjtKrGKIYIEzHfoH0LwF6iWVsnpYLZYWTBZEouUnlDdz17hsr1xq3Y0GeKQDDU2vqyJF0slcnLON6cVtqpnJVZ75HGT7AtOKNS95u+Y5OR6hUJTxFwDU2No/OaojsAWNN25aCFxPl+V6p0QoptrbDzVbi7/hJnihQJJrJnioRUA2ES6lDFMxqJ08fEb+GZuk2LjeUVP2StsafPuI1Qwlv2Nw9Rlf1LgHL5NE33Evqgr7sQeF26pzsvV8Pcg8OPIedrAQ3HUhlOXUFQ== 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; bh=dVwXh/yVQ83FhUNQPKNpGoOH7G0T0dTGV7cr7Z6KkRQ=; b=IcdXDnwp8guR14FCIRj2dr4gcChjdGbpX1xhJGEz6t2jA9jV7uyg5ZuLMauvaFwC4o/D93hF4P5x2QLPGXBgj9E+sDAWZognd2MKeCBLLso+D3NCgcUKRcfkwx5fYVbqwJrYebT1e45C7y3iVtDuHhbHk3XYd41ubBMgVILf5hCn4Hjkc2fzqFQlkyssQ9ghRo8YwEhLGIhBjkxt2GoN6ywq06nOEQrgi8YyBxOSzdsEz2KGEsBcD5NDlGEqUcme8+Z8dcYEvG0q3mJ5+eqeMH4I4u/092MmC3k5xQ15axRtl+GuPnq1rleM9D4ew0rRmRdOU1XgwjjHYuQjpZ4mHA== 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=dVwXh/yVQ83FhUNQPKNpGoOH7G0T0dTGV7cr7Z6KkRQ=; b=5a739+q5UVFwBvAzTxEfHdG2rFG2qWGyDigpcuvJcKI4Q69rQSbLUX0rXF/q/wGx//c5iSiM/Tfp7dWQUWh/Xl+JzDON93qXdgphrijxX4AV5y54cfpea9FXqycgN3o5QjjThz/KMJaxqqADqI8bt2B+3uF4Xq3frnkWgwraG8s= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; From: Wei Chen To: , , , CC: Subject: [PATCH 28/37] xen/arm: stub memory hotplug access helpers for Arm Date: Thu, 23 Sep 2021 20:02:27 +0800 Message-ID: <20210923120236.3692135-29-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210923120236.3692135-1-wei.chen@arm.com> References: <20210923120236.3692135-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e0c6df13-2ecf-4e08-189a-08d97e8a5456 X-MS-TrafficTypeDiagnostic: VI1PR08MB2830:|AM5PR0802MB2404: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:4502;OLM:4502; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: J6cxXrmwElyUZoCL+lkHU3hHmoFvkrRAnhl+dpNeB9BFEapfgUNekwQuyxZTGq5pV0Gpi0vkur4qX8GjIjuWs114Z/y/JZKnKqUfP9aNb301FX3h97ndtjGwDOhubby4ZyD/LzccSGOsqZ37oiaf4nMAJE9rKeJwM3Ls3VzHyseh0mHQmzZIRrJWhPcsZcxLGVtoN09aceM/H1n6OuT9nHchjANTllD5uqaoroTOih+Tem7dkUcvi/6R0qIHO2Wt9iGecOi72ZCUKjQEHIdsFct3XkqPOuyJ1HL9sF4bzijcdoZKcYnTFZcjBzI6E7xpi0rJDLp8l90Zx4f+Bo3gjDx1qxtapYmeAVnuGw16n7e3zuEACNA0mxKSR04KoeKYS+i4Ud+D3SmG0OpCD3uaYj1vPolNXFO1KAYyFmnCr8ETcw7Vd/7xvD8c4PrXck7NWIj9dzo9ojUL8Q7TISvIWUaVS8Zx5j3P1ZEShpvPmae5GIQWepH+ED7Wr6lC13mpzdhYMaMV2JVeaczCDT9yWHbPNxRN+sV0SY9cVb6wd3bLBGsP9C9rfA/j9/mfQMZn5FEiyNFhsGQ3hyMuDTGbKCU0oUzy8zMnobbYAjtp5qKhbiUVne7E49U/k8vLhd4/bE6EzrHsV8FpeFyuBO04/aTjwo5F6dGOEXiZSklvPB22bual6WW79e5cHe1G+imBFlxEmwLdbEWDD/O99jm+qD1MXYE+C/9Vq5f8MiF1cR4= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(4636009)(36840700001)(46966006)(426003)(6666004)(36756003)(70206006)(70586007)(110136005)(336012)(2906002)(83380400001)(4744005)(2616005)(8936002)(4326008)(356005)(26005)(47076005)(86362001)(36860700001)(5660300002)(82310400003)(186003)(44832011)(7696005)(316002)(1076003)(508600001)(81166007)(8676002)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB2830 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT004.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 2023d138-8e0b-4346-51ce-08d97e8a4eb7 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6y64pTjOq1IQ5mYHKHXlsD3asm1LquWhbeOC7MB6x3fsvyjvVhaiJwRTZXsQQgs+cI5h+I/mzrANZ2mfWHW5TOHDrrHkM1AibF1TzF3MxlNa1uG5hTfxhpQR/qVmJl80QDX+g63cThIjdSsuGM0Mh0C3Lvz9n8jQ4erQlML7NWGAHgoIKLpK6MyC8I8p/1bepZCt/lfZ6pOlV2VwhGlXqkaNlNvx4IH1dkdEuzjZJViWRUDXfhD/LMrxSndFWgFdU7vcKJ3TJvuQ4NrHoOhiVknGEVrb470Nftoo/+Kja+yoj/zsdZ3Esk9xFDYLW5i85sfkylzHrNzAIBSyGcVOojysWy4bgl7xwoPxc68t8UFxrJAYRaaJCioEOz3UuSR5eroaG8yzPN5FR1flHxnPutDrX7zRdLLz3Y/3z0QHI1GRhDXRN5TYLSZj9ShG9JQvNqiBcB51Rm9Drbmdx3DuU7whdi23YB1u7dhQLpvCO5midt+IKq4gyXy16meCwNFb7v1iW7o+0Ix8jzZKWTxVy59tx9DgQ9u0seVwhigYCWoXYkuLqMNmFLehDNvYI5PwckW5OT7Jts0rTUmFDGrK49Jfk44WIIj3Q6uUJzWBT7M+jXMWNv62f2QuJZLG6ErSHkZEV1vH8IrFWjRqVzoUHyHbEp5YIij1U52+B2J0vCywsQKJZQjTMjhV1HKJ19I+FzKaUUPSA6D+eNd3+sHpOQ== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(4636009)(46966006)(36840700001)(81166007)(36756003)(7696005)(508600001)(6666004)(36860700001)(2616005)(4744005)(1076003)(110136005)(316002)(8936002)(8676002)(47076005)(4326008)(86362001)(336012)(5660300002)(83380400001)(44832011)(70586007)(70206006)(426003)(2906002)(186003)(26005)(82310400003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2021 12:04:43.5081 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e0c6df13-2ecf-4e08-189a-08d97e8a5456 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: DB5EUR03FT004.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0802MB2404 Common code in NUMA need these two helpers to access/update memory hotplug end address. Arm has not support memory hotplug yet. So we stub these two helpers in this patch to make NUMA common code happy. Signed-off-by: Wei Chen --- xen/include/asm-arm/mm.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/xen/include/asm-arm/mm.h b/xen/include/asm-arm/mm.h index 7b5e7b7f69..fc9433165d 100644 --- a/xen/include/asm-arm/mm.h +++ b/xen/include/asm-arm/mm.h @@ -362,6 +362,16 @@ void clear_and_clean_page(struct page_info *page); unsigned int arch_get_dma_bitsize(void); +static inline void mem_hotplug_update_boundary(paddr_t end) +{ + +} + +static inline paddr_t mem_hotplug_boundary(void) +{ + return 0; +} + #endif /* __ARCH_ARM_MM__ */ /* * Local variables: From patchwork Thu Sep 23 12:02:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 12512659 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A59AAC433EF for ; Thu, 23 Sep 2021 12:17:55 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 60F4761107 for ; Thu, 23 Sep 2021 12:17:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 60F4761107 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.193980.345637 (Exim 4.92) (envelope-from ) id 1mTNfe-0001G1-5H; Thu, 23 Sep 2021 12:17:46 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 193980.345637; Thu, 23 Sep 2021 12:17:46 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNfd-0001EX-RY; Thu, 23 Sep 2021 12:17:45 +0000 Received: by outflank-mailman (input) for mailman id 193980; Thu, 23 Sep 2021 12:17:44 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNWd-0005KP-7i for xen-devel@lists.xenproject.org; Thu, 23 Sep 2021 12:08:27 +0000 Received: from EUR01-DB5-obe.outbound.protection.outlook.com (unknown [40.107.15.77]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 117f061d-c305-4d4d-b62c-bcfa36765019; Thu, 23 Sep 2021 12:04:53 +0000 (UTC) Received: from AS9PR06CA0340.eurprd06.prod.outlook.com (2603:10a6:20b:466::35) by AM0PR08MB3762.eurprd08.prod.outlook.com (2603:10a6:208:100::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.14; Thu, 23 Sep 2021 12:04:51 +0000 Received: from VE1EUR03FT014.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:466:cafe::aa) by AS9PR06CA0340.outlook.office365.com (2603:10a6:20b:466::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:51 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT014.mail.protection.outlook.com (10.152.19.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:51 +0000 Received: ("Tessian outbound 78bf72cc015a:v103"); Thu, 23 Sep 2021 12:04:49 +0000 Received: from 9a5a85aa1274.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id E0ADA806-D352-4668-A05A-41F79A4AF1E2.1; Thu, 23 Sep 2021 12:04:37 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 9a5a85aa1274.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 23 Sep 2021 12:04:37 +0000 Received: from AS9PR06CA0099.eurprd06.prod.outlook.com (2603:10a6:20b:465::34) by DB6PR08MB2837.eurprd08.prod.outlook.com (2603:10a6:6:19::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.16; Thu, 23 Sep 2021 12:04:35 +0000 Received: from AM5EUR03FT011.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:465:cafe::16) by AS9PR06CA0099.outlook.office365.com (2603:10a6:20b:465::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:35 +0000 Received: from nebula.arm.com (40.67.248.234) by AM5EUR03FT011.mail.protection.outlook.com (10.152.16.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:35 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.14; Thu, 23 Sep 2021 12:04:13 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Thu, 23 Sep 2021 12:04:11 +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: 117f061d-c305-4d4d-b62c-bcfa36765019 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=oSRPuHv3is6t7XfRKDtZ5lXIpe0r3zEXCQvXK2ZgwaU=; b=i+2MFZIKCPnC3jksxYDTfeUSsWSDDWs+TMTXiGQKJyx4PKDegyugKfBbqc63vT9cleJfr5r3rfAe1tGd9Ku5MqVIhwJCpJXfetJBxKb/SBbLWJq2PTHmKYqXbStvfuny++1/8v+bpdv9bQe0X/e6AwIzu2pYOUNjhZvPoDYfy0E= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; X-CheckRecipientChecked: true X-CR-MTA-CID: 35a3dcabb8d82fd6 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Umpeg/t8Y7NsxzwY1dW0o1HvlMne95z94TyxFZBfJ48dF56YeG2/Ktxi7gu1hhu1a3Uus4zsHIwiQHGh9tv+Zo5VEH9c6sNsSE62rtI1arV/pgHz/xwJ3HNiLKBLW42N4j8XJ54QtoPSUTL3vVaJFNtPIXiRn8IVQo0l96Ha6aPp47IzRlHP5dLlBlxRCQT+B2LnGofroPKCzjQ5Z9tyRWw9gEHqzaSNCoBbnkkOYoAJhl30uiRSusMb+0zwDsMQs1wTIpBb63Yt3iNaGpSh3enmYqml+9gmZWaiToQ9nlFkN0DRfEVpMRpYp/yTDFRopDsY4U5YLYDY935IcY8OfQ== 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; bh=oSRPuHv3is6t7XfRKDtZ5lXIpe0r3zEXCQvXK2ZgwaU=; b=NzPYeHr5zVoNvXoM10dqNFZlWt+fVSI/IBUEax6bEKvNXfUqjdUQL0RpFENnmFtlpmrT7eSg+/9NWopx+sjjn7XK57NfTgFhdUofJfqtaqDtV+F662nlvkOOLhHwJFpT3L8ejRIHW5K6q5iZLb+Zx/I8Sw3yisOQVOodlJt6k99Ogj8tq0uI4I0TLyN6oMrSbJVns7efHB1I10iwMD/v0eAgLp5N3Rxg3u/GyBuR8+RrZJnQP123ceXZkczQSmKqnZERJofdr/vjmBQOA3bR4rbAvBx234QNGFVFpmYI7TP4fm9njzrKSUH2BadKhCmKzdF9tm81Yv4V7NVfIvE7Jw== 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=oSRPuHv3is6t7XfRKDtZ5lXIpe0r3zEXCQvXK2ZgwaU=; b=i+2MFZIKCPnC3jksxYDTfeUSsWSDDWs+TMTXiGQKJyx4PKDegyugKfBbqc63vT9cleJfr5r3rfAe1tGd9Ku5MqVIhwJCpJXfetJBxKb/SBbLWJq2PTHmKYqXbStvfuny++1/8v+bpdv9bQe0X/e6AwIzu2pYOUNjhZvPoDYfy0E= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; From: Wei Chen To: , , , CC: Subject: [PATCH 29/37] xen/arm: introduce a helper to parse device tree processor node Date: Thu, 23 Sep 2021 20:02:28 +0800 Message-ID: <20210923120236.3692135-30-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210923120236.3692135-1-wei.chen@arm.com> References: <20210923120236.3692135-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f731d929-9509-4fd5-4de6-08d97e8a58e5 X-MS-TrafficTypeDiagnostic: DB6PR08MB2837:|AM0PR08MB3762: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:10000;OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 4XpKmFZYp9OJloY0jEYrHDi13BYRQOtMsSkFUIzRbyhq9kQtdLFd+M5F0kyKmkxMBFOqTYViCIeD7hG+6CGVYJJlrgMeFhQPg2pYo7LvX2fsN7RtAVWjnSj/bSlYKFMya1ZNqkQo0eJcgR/Br1veP8Ok/nXiPDnh3OrfYNHiryJ20sfwqOoue1NFz06/ForN7eZ8sXxnLPZdG6lYbJi2r7FBU5YBDa6rYnoPt6r4cNO7P7MdcXaYMWjh1MnR2u5JG5CY1GfygyM5YfmRNK8iemlzw87SxuIO/1R9GUBgke5DW77lnLNCCrCX7H5BooMbskP5pcb6NLoR7Y/GxdHnjU1fWrvm7ePPXKhDzZo+q06UzM9VNfKWwHDQGBpbdIo6Xvj50ciuPoz5BrtmkmDlfmVrgmehLAbOIUggRuJORhB7hT6yTZ6SHI0YbTuY+OKj3T77yBnsmQX4nJHmuVnGHhyE7EPCPQAO6XWra2LVQF90guX244oA7fmxkVAys5jeWmwYsXi/nkL0OxKlvheXekAuYHvVXNHED/fYUgL2u68a86plQCtVx263MdWElQ9CPo1rm7vI9jKz20IK1UT1YMYmRD9SkicOpXmoMR6dM6RXi5uEIwpER/4nvxaOIVaYpd3koJiIU1WQnwPeyfptf9VCASlIrTTUtYONOQ12YU1e4cRHQ57UWb2ghDMDJb1sYS8MSARIdShENLTKUQ6XtxL6MV6mm2fG+/8uL9QnJkmlyzmJB4O8gRaGhK7jUg1ZKIYBtAdOWoby1p5IiPcXc+Q1tS3PlzGs2/dJuyI1AVG+zw9BMcSuTkKZ1gPZtTh0bqu5kY8mySAm8I1dkxhlZg== X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(4636009)(46966006)(36840700001)(356005)(81166007)(1076003)(7696005)(6666004)(36860700001)(316002)(186003)(110136005)(336012)(86362001)(36756003)(82310400003)(2616005)(426003)(508600001)(2906002)(44832011)(8676002)(70586007)(47076005)(70206006)(26005)(4326008)(8936002)(5660300002)(83380400001)(2004002)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR08MB2837 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT014.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 97ae4213-0ad6-4049-1089-08d97e8a4f99 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LBgkHJCzstKdOkbo4DSaxD2ubk79BzuD51XflmWJAwySzt/tJ71WKLivETk7uBQVD5uhseaiRsNoiHWE1E1xQJc1de/l6xh088P4Asec+XLEldh6ODSyoRXdp23Jc5w5uvhjO3/NQ+E58odz5byogcOfRWqINHmKbXHC2BIfMg1gcpcJNkIBHiCSMVfPuJsPattf/DBTi6XebZXQND8Qyawx3+/lsXgMNV7oJRaf6zMX0m8x3+C2DpWzL/jt5AjTunHNJTFh4eFZ8Pr8rdeDCbZf4MyKohzMUKnL2RRhQ7l77oYNC6+qBXkE7jJ0zNSPr8SNOBP/TRqGxEy41QmeM1Q6Cx7UQ47BljXBQ4S7yOM4K6fYwcYBHz5oua2fQiydrhQzqAeplaUSePa078JwmC2suWQV08yIVOhtVuLovGBXLVSO6QWNLpnzm8s8Xdo/8rP1P/pcX7gg83t5x6kiKF/3wBoizJibBwMICFZqmFL5UVdydO6KLXrlzHxgawyx7of5/vE5T9C2XwhiO5M61EXwGpUeLf78eRt5uY7m51AEJBJXyDkSToLei0JVgDGqv9J1c0cdTNf8fmPHyH79jjiTYqZ19RP6YmzWUQKV9TWCrBgMtifwtH07bgadgQ5PnQcgDsT+FNxTocGRPEJ/HBLeoISPL/zKk/Mv2B20QBSazy6KSb3R+wyX6KjN9xx4EoLpMV6BUtNCNCoC3TQ1zK8g6OyDcMn+UdpoDl8pWtGD7QcN5/4TjjABz2h1fSYfh4Tvvoca/VCGPNuB98MHRIEbne0u6u9fINrLoudJYS3Pj7aHti3BTgtcrPpIgda+ X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(4636009)(36840700001)(46966006)(70206006)(70586007)(4326008)(316002)(82310400003)(7696005)(2906002)(110136005)(44832011)(508600001)(186003)(8936002)(86362001)(81166007)(1076003)(2616005)(36756003)(5660300002)(8676002)(26005)(6666004)(36860700001)(47076005)(336012)(83380400001)(426003)(2004002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2021 12:04:51.0565 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f731d929-9509-4fd5-4de6-08d97e8a58e5 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR03FT014.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB3762 Processor NUMA ID information is stored in device tree's processor node as "numa-node-id". We need a new helper to parse this ID from processor node. If we get this ID from processor node, this ID's validity still need to be checked. Once we got a invalid NUMA ID from any processor node, the device tree will be marked as NUMA information invalid. Signed-off-by: Wei Chen --- xen/arch/arm/Makefile | 1 + xen/arch/arm/numa_device_tree.c | 58 +++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 xen/arch/arm/numa_device_tree.c diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile index 41ca311b6b..c50df2c25d 100644 --- a/xen/arch/arm/Makefile +++ b/xen/arch/arm/Makefile @@ -36,6 +36,7 @@ obj-y += mem_access.o obj-y += mm.o obj-y += monitor.o obj-$(CONFIG_NUMA) += numa.o +obj-$(CONFIG_DEVICE_TREE_NUMA) += numa_device_tree.o obj-y += p2m.o obj-y += percpu.o obj-y += platform.o diff --git a/xen/arch/arm/numa_device_tree.c b/xen/arch/arm/numa_device_tree.c new file mode 100644 index 0000000000..2428fbae0b --- /dev/null +++ b/xen/arch/arm/numa_device_tree.c @@ -0,0 +1,58 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Arm Architecture support layer for NUMA. + * + * Copyright (C) 2021 Arm Ltd + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +#include +#include +#include +#include +#include + +/* Callback for device tree processor affinity */ +static int __init fdt_numa_processor_affinity_init(nodeid_t node) +{ + if ( srat_disabled() ) + return -EINVAL; + else if ( node == NUMA_NO_NODE || node >= MAX_NUMNODES ) + { + bad_srat(); + return -EINVAL; + } + + numa_set_processor_nodes_parsed(node); + fw_numa = 1; + + printk(KERN_INFO "DT: NUMA node %"PRIu8" processor parsed\n", node); + + return 0; +} + +/* Parse CPU NUMA node info */ +static int __init fdt_parse_numa_cpu_node(const void *fdt, int node) +{ + uint32_t nid; + + nid = device_tree_get_u32(fdt, node, "numa-node-id", MAX_NUMNODES); + if ( nid >= MAX_NUMNODES ) + { + printk(XENLOG_ERR "Node id %u exceeds maximum value\n", nid); + return -EINVAL; + } + + return fdt_numa_processor_affinity_init(nid); +} From patchwork Thu Sep 23 12:02:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 12512567 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6C4CDC433EF for ; Thu, 23 Sep 2021 12:07:47 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 128E560F6D for ; Thu, 23 Sep 2021 12:07:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 128E560F6D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.193868.345444 (Exim 4.92) (envelope-from ) id 1mTNVp-0006mR-Oy; Thu, 23 Sep 2021 12:07:37 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 193868.345444; Thu, 23 Sep 2021 12:07:37 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNVp-0006mC-Kp; Thu, 23 Sep 2021 12:07:37 +0000 Received: by outflank-mailman (input) for mailman id 193868; Thu, 23 Sep 2021 12:07:37 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNV4-0006xV-T9 for xen-devel@lists.xenproject.org; Thu, 23 Sep 2021 12:06:50 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (unknown [40.107.8.88]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 727f9474-1c66-11ec-ba2e-12813bfff9fa; Thu, 23 Sep 2021 12:04:49 +0000 (UTC) Received: from DB8P191CA0027.EURP191.PROD.OUTLOOK.COM (2603:10a6:10:130::37) by PAXPR08MB6541.eurprd08.prod.outlook.com (2603:10a6:102:15a::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.15; Thu, 23 Sep 2021 12:04:47 +0000 Received: from DB5EUR03FT061.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:130:cafe::5) by DB8P191CA0027.outlook.office365.com (2603:10a6:10:130::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:47 +0000 Received: from 64aa7808-outbound-2.mta.getcheckrecipient.com (63.33.187.114) by DB5EUR03FT061.mail.protection.outlook.com (10.152.21.234) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:47 +0000 Received: ("Tessian outbound c9f4ff96a6ad:v103"); Thu, 23 Sep 2021 12:04:46 +0000 Received: from 60a7a5fd6538.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id D06DFBD3-EACD-4321-8B02-FEDEB3E5EADC.1; Thu, 23 Sep 2021 12:04:37 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 60a7a5fd6538.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 23 Sep 2021 12:04:37 +0000 Received: from AS9PR06CA0100.eurprd06.prod.outlook.com (2603:10a6:20b:465::11) by AM0PR08MB4228.eurprd08.prod.outlook.com (2603:10a6:208:138::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.14; Thu, 23 Sep 2021 12:04:36 +0000 Received: from AM5EUR03FT011.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:465:cafe::c4) by AS9PR06CA0100.outlook.office365.com (2603:10a6:20b:465::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:36 +0000 Received: from nebula.arm.com (40.67.248.234) by AM5EUR03FT011.mail.protection.outlook.com (10.152.16.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:36 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.14; Thu, 23 Sep 2021 12:04:15 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Thu, 23 Sep 2021 12:04:13 +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: 727f9474-1c66-11ec-ba2e-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=V5dCi7RLHOGiZwjaffySQjpEEHSFmEIlzO2cAQzos3g=; b=l5Jsji4GLT7sCjHfjs2qGAYISvSiRQm7uheZnkHoMUFsd+bB5Cq3o5x7O15o/dlmVQjTJp1OOT0ErNKupDNvPvlWxiaAm2TghCWPtn0JCEVvGPlIzxDgb3QKUfjnRC4xqzkp1tGs3R170FBY6BmFgP3FShS5YuVz6xARDLEVCPo= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.33.187.114) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.33.187.114 as permitted sender) receiver=protection.outlook.com; client-ip=63.33.187.114; helo=64aa7808-outbound-2.mta.getcheckrecipient.com; X-CheckRecipientChecked: true X-CR-MTA-CID: ef6df92a1e0be266 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nWAScDte5A/sajD+TCyI8Ag9Ekykw0r5fbmaOkmDWjyRj7tuV105qi2Cx4HnlqPnpBovzMZb6N3U0IX9bRR0yXUJzFZ9zuV3lEQH97slkCeo04+KEfLrWQNRPDB94q8aZr5MBR5KohG9iGnSzM+lUVlPsafZjw9BPw7o3b3ZAzqjFHErHG3T8H2whVooAr02Yuhpw52PkIzahZjp6qJ8rh2jYCjaB0xso+42lIqsTS7QM5uoM3K4ZBuFo7sif1u3ej2VMpTRGlP0LI1ipeNAGL3HaXB7ga8lSL6OaC9D0jFWGSr3jxrBGeNeiWr3NOQDkmRXyJ56IavLMiMnBrKmQw== 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; bh=V5dCi7RLHOGiZwjaffySQjpEEHSFmEIlzO2cAQzos3g=; b=MjuN5ixREG24663ZzfVO4c2k1ZOJ78DUtTp/9CW1PgbwigKVqyB7FOUyxFgvqfKb73hDo/Wb3Poqz+a7kzKe57BUD5tmZhL2hIdA8axiIHL13f0N9F7Ete+20lYsanIqLoS+lwiphFWY9SuBRtWG4qFnfrXJV2VcVvGYRwtLtFNJ/JI/JQDb3to72jbbwbrx6VvaaODF5FzyRb84uL+33rY9CFGJVWg4m728nJtQcRpmFsLzwWAidga0PJr++7mP9lm8ixDYHwkGfOECVj4KQYlcw+QHUKd8hdDwS961xGWryiqin7KOe0rHGcZFsn7eMKo0gjivS8gkCcR+wOuWlg== 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=V5dCi7RLHOGiZwjaffySQjpEEHSFmEIlzO2cAQzos3g=; b=l5Jsji4GLT7sCjHfjs2qGAYISvSiRQm7uheZnkHoMUFsd+bB5Cq3o5x7O15o/dlmVQjTJp1OOT0ErNKupDNvPvlWxiaAm2TghCWPtn0JCEVvGPlIzxDgb3QKUfjnRC4xqzkp1tGs3R170FBY6BmFgP3FShS5YuVz6xARDLEVCPo= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; From: Wei Chen To: , , , CC: Subject: [PATCH 30/37] xen/arm: introduce a helper to parse device tree memory node Date: Thu, 23 Sep 2021 20:02:29 +0800 Message-ID: <20210923120236.3692135-31-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210923120236.3692135-1-wei.chen@arm.com> References: <20210923120236.3692135-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 40370d81-b797-4c86-e01b-08d97e8a5681 X-MS-TrafficTypeDiagnostic: AM0PR08MB4228:|PAXPR08MB6541: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:3826;OLM:3826; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: YcJKU/oOfBJYCoGuRGXQFHKmi1+4wu6ZWxCym+qF4vmJajknFztJ0P2Yu3Um15CVWqQ33vn/yO6zZrkMPiq5eRelzrpC6/GZoI5kf7Ny28LeUh4npbS08QKNtrtJAtasFlfzbeaQuOi+B4lBD3+/SKuKzGXjuuyaGr6FBDuWzw9Vq2rizMSfxk00vxyy8vtIkF+GuCg2/1S4q69bUmSwiSwMjlk2MHiqlj2Aqiug8G5xfQ7C3+Agc5kyZ5Yg4a0gQKnDBzN44jm3UoHbLiLnCYSR7QGQEghtqho6z6Jyz2RcL8cpTgGtOhzKAl07mM1kBXClEg+SRuPQ3F9qdkEuzj9YXmMsPpLoltpr5gcYh6/ORY7HEwVwFXp/N2ds3TS7vdWSR4WlAy7bGk1H4T89lSZiykJd+R10Ld/hDFrPQOf59S6CrdC74BryCedR8h/X8+oyrV0363RMhUP+RCCNs4fgecfrvohu9QoASWznW28VV84ZvQw7QJHdhqNSWv9yybCsain1iG6h3SPxRx+GX4S88kKw1sv1SmQla5t3F+ad+eLrH8ZGyj5B0iJUlE6/kARPKlUqDwpnbj0MWJtwm0a36uNP6/qe6YugtnJknjLiCzswMEmkMdgGO/H7Y5zuPo2IsUYDAX+Kee4gHCRjLuD5MdqPyJnImSWRaPI30UZ1a5hojaCbNLAlq4RpQmsCcQJychAzvX74Ov0YyTW0kYlX8+WtnPy+2PS61bMxLwQ= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(4636009)(36840700001)(46966006)(2616005)(36860700001)(508600001)(356005)(83380400001)(426003)(110136005)(6666004)(82310400003)(47076005)(70586007)(70206006)(316002)(5660300002)(86362001)(8676002)(8936002)(7696005)(2906002)(36756003)(26005)(1076003)(44832011)(186003)(81166007)(4326008)(336012)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB4228 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT061.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 268c5f9b-2163-4497-8f2d-08d97e8a4fe4 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yEd809IuaD1FS0Yo4ezVc1OxJU9ltWUh9NVeI5ovZfdXC/tugWMEMoKjrQReiH5alCo3ukITtfV9xLyRw6TuWSJhexn0J2x+Fjzd0in+SZA5hbTHEF4jiBi7FSExlhTkAQXxnYNHTC6Kb2owFxNcnAziEf2KMWZyEWfCeA4xN3ODNczdUlfboAgg9EyHSXK7BUHuxCBV+ziICv3X7uwY7JOBiP0mNK1QWb0NNXyeIunS8wAHuphYBaiZCgJD7HQbzQwVE4R/xmljcRa1OBvlSWrzvxJu1fir6pLwHUoPhUlYE6S8GbfIEJmoY+RUuzluuTHukG+bk8vAcJwnWOBqxmfFRDQrbQ2i/iCqEqhaG1rBY3qRYdkUOuu7bE0TRuSJQ3R/LnIMU27DyHNHYCaxmpqrfoR+v04Qb00dupKNWhJdRPS6j0/qQLGXtLOq0huX0VBY2M/1vJl7Un5AXh6gUVDalkkmA3mfSZljo5sjm65Xd9kjnMJLj/i914143xgshCaGq8BQ8zEsoCaCuuDOE/pCN+SDQhuxMtiv4NfQHDpgir3eJAutGTsZS+510gpIKp2PqCk7SFfPu5Zps2iCLEj6hLLGpIRRRaN41ZZ6tfd2Kil15W6yt9K5UDjorzWgQBbqIhEkAVeYfvllYhn3EH2vN95RPH+PIbgymG3icNsuKuDY9VpyOShCtNfo7g7pGg+oV3FUOsltmNB2wv1kYg== X-Forefront-Antispam-Report: CIP:63.33.187.114;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-2.mta.getcheckrecipient.com;PTR:ec2-63-33-187-114.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(4636009)(36840700001)(46966006)(4326008)(508600001)(426003)(86362001)(336012)(316002)(1076003)(36756003)(83380400001)(186003)(26005)(70206006)(2616005)(44832011)(70586007)(47076005)(36860700001)(110136005)(7696005)(8936002)(6666004)(2906002)(8676002)(81166007)(82310400003)(5660300002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2021 12:04:47.1514 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 40370d81-b797-4c86-e01b-08d97e8a5681 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.33.187.114];Helo=[64aa7808-outbound-2.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DB5EUR03FT061.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB6541 Memory blocks' NUMA ID information is stored in device tree's memory nodes as "numa-node-id". We need a new helper to parse and verify this ID from memory nodes. Signed-off-by: Wei Chen --- xen/arch/arm/numa_device_tree.c | 80 +++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/xen/arch/arm/numa_device_tree.c b/xen/arch/arm/numa_device_tree.c index 2428fbae0b..7918a397fa 100644 --- a/xen/arch/arm/numa_device_tree.c +++ b/xen/arch/arm/numa_device_tree.c @@ -42,6 +42,35 @@ static int __init fdt_numa_processor_affinity_init(nodeid_t node) return 0; } +/* Callback for parsing of the memory regions affinity */ +static int __init fdt_numa_memory_affinity_init(nodeid_t node, + paddr_t start, paddr_t size) +{ + int ret; + + if ( srat_disabled() ) + { + return -EINVAL; + } + + if ( !numa_memblks_available() ) + { + dprintk(XENLOG_WARNING, + "Too many numa entry, try bigger NR_NODE_MEMBLKS \n"); + bad_srat(); + return -EINVAL; + } + + ret = numa_update_node_memblks(node, start, size, false); + if ( ret != 0 ) + { + bad_srat(); + return -EINVAL; + } + + return 0; +} + /* Parse CPU NUMA node info */ static int __init fdt_parse_numa_cpu_node(const void *fdt, int node) { @@ -56,3 +85,54 @@ static int __init fdt_parse_numa_cpu_node(const void *fdt, int node) return fdt_numa_processor_affinity_init(nid); } + +/* Parse memory node NUMA info */ +static int __init fdt_parse_numa_memory_node(const void *fdt, int node, + const char *name, uint32_t addr_cells, uint32_t size_cells) +{ + uint32_t nid; + int ret = 0, len; + paddr_t addr, size; + const struct fdt_property *prop; + uint32_t idx, ranges; + const __be32 *addresses; + + nid = device_tree_get_u32(fdt, node, "numa-node-id", MAX_NUMNODES); + if ( nid >= MAX_NUMNODES ) + { + printk(XENLOG_WARNING "Node id %u exceeds maximum value\n", nid); + return -EINVAL; + } + + prop = fdt_get_property(fdt, node, "reg", &len); + if ( !prop ) + { + printk(XENLOG_WARNING + "fdt: node `%s': missing `reg' property\n", name); + return -EINVAL; + } + + addresses = (const __be32 *)prop->data; + ranges = len / (sizeof(__be32)* (addr_cells + size_cells)); + for ( idx = 0; idx < ranges; idx++ ) + { + device_tree_get_reg(&addresses, addr_cells, size_cells, &addr, &size); + /* Skip zero size ranges */ + if ( !size ) + continue; + + ret = fdt_numa_memory_affinity_init(nid, addr, size); + if ( ret ) { + return -EINVAL; + } + } + + if ( idx == 0 ) + { + printk(XENLOG_ERR + "bad property in memory node, idx=%d ret=%d\n", idx, ret); + return -EINVAL; + } + + return 0; +} From patchwork Thu Sep 23 12:02:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 12512641 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4F6AEC433F5 for ; Thu, 23 Sep 2021 12:17:23 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 000D861107 for ; Thu, 23 Sep 2021 12:17:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 000D861107 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.193941.345554 (Exim 4.92) (envelope-from ) id 1mTNf7-0005wR-Bd; Thu, 23 Sep 2021 12:17:13 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 193941.345554; Thu, 23 Sep 2021 12:17:13 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNf7-0005wI-77; Thu, 23 Sep 2021 12:17:13 +0000 Received: by outflank-mailman (input) for mailman id 193941; Thu, 23 Sep 2021 12:17:12 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNWn-0005KP-7z for xen-devel@lists.xenproject.org; Thu, 23 Sep 2021 12:08:37 +0000 Received: from EUR02-VE1-obe.outbound.protection.outlook.com (unknown [2a01:111:f400:fe06::600]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id a96bdc96-c20a-417c-a929-905a94858260; Thu, 23 Sep 2021 12:04:55 +0000 (UTC) Received: from DU2PR04CA0302.eurprd04.prod.outlook.com (2603:10a6:10:2b5::7) by PAXPR08MB6972.eurprd08.prod.outlook.com (2603:10a6:102:1dc::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.15; Thu, 23 Sep 2021 12:04:53 +0000 Received: from DB5EUR03FT006.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:2b5:cafe::e9) by DU2PR04CA0302.outlook.office365.com (2603:10a6:10:2b5::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.16 via Frontend Transport; Thu, 23 Sep 2021 12:04:53 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT006.mail.protection.outlook.com (10.152.20.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:53 +0000 Received: ("Tessian outbound a77cafe56b47:v103"); Thu, 23 Sep 2021 12:04:52 +0000 Received: from ab7004a01c82.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 3592E839-A002-464C-8159-FF9022817EE6.1; Thu, 23 Sep 2021 12:04:40 +0000 Received: from EUR03-AM5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id ab7004a01c82.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 23 Sep 2021 12:04:40 +0000 Received: from AM6P191CA0091.EURP191.PROD.OUTLOOK.COM (2603:10a6:209:8a::32) by PR3PR08MB5673.eurprd08.prod.outlook.com (2603:10a6:102:86::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.14; Thu, 23 Sep 2021 12:04:39 +0000 Received: from AM5EUR03FT013.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:8a:cafe::12) by AM6P191CA0091.outlook.office365.com (2603:10a6:209:8a::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:39 +0000 Received: from nebula.arm.com (40.67.248.234) by AM5EUR03FT013.mail.protection.outlook.com (10.152.16.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:38 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.14; Thu, 23 Sep 2021 12:04:17 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Thu, 23 Sep 2021 12:04:15 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: a96bdc96-c20a-417c-a929-905a94858260 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=2kwEsupYdQhcxT6kCZF4Bnp8YHcdU6oO4hBw9qhon1g=; b=CQ7Jq1j8gT8ZK7pXB3x91ubyuMcIOIRnhXX+yKhgtDStU6CH8CLJaTfRZE5SNHjj92B5jZfFtfJUaxHpJk/UY6OcjswrGfUv8oQNki/2L/qQxt8uuKdjNLW0ABaWmD2p197BEUJfAHNGLvDSvF0O5E+M+oK4H8TrboMP1GnJS3M= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; X-CheckRecipientChecked: true X-CR-MTA-CID: e27c485cd25f70f0 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QnZqa6OQT2k3vrlzKVEv7/To8p1VmmTxzOw8Wgwh6hSunYTmygsOKj67nj/q28CCuJIxzxfZeMhlVGhxX2QnJLbH25O3LtYw0a8ZwldtuWC3qguUOJbSNjKEPMtlv2rnaZM+Z+eec1OTtDT6LJUMq/7R2+OrAvSYeXR4p1fV26/68pCixOc6HpMuMhmd+LIHp3CCz4web+ZMuOesCILWZLwG1y2m6OpxbmS7alwLi0Caj23QdIxS+7Nkukck2wX7KrP4gwWb9fzGNstYVv0/1EbhKus98mfaQ6S/CMxdWz9t6hxogbL3CpX7eec+OLcbF+xcffj/yZON5FanRvibaw== 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; bh=2kwEsupYdQhcxT6kCZF4Bnp8YHcdU6oO4hBw9qhon1g=; b=kyK2/b3yxutn6cCOcOBP6ggt+VOVIrssm8bhfaaWXXsaN5HT3P4t8+ObcOcDlMPloM88FEUZE7sehpgV+Zo1YYfSWdLmROSOVNzWV2f5GXT6riYW/ahNjTw8bLQAHCzPiHkti+nUojN/2LexELtoe3BrY9/etG85XXtcYr5VA5Fen8iLtBJZkbg6fizeAODI3veXCf5+ScS7jqWU/K8HV8WLMI0dmIjjP4GXDQcRJ7JCCPIQEsdg9rU/OIDBsxhXsXbhXYA4dZo9wILyGYrLRLTknOGkylWGrKLyl6Z4rOG7G+JWVyDxgWzxj2j/e79Y2efT1qKb0nbwy8KU/V+rDQ== 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=2kwEsupYdQhcxT6kCZF4Bnp8YHcdU6oO4hBw9qhon1g=; b=CQ7Jq1j8gT8ZK7pXB3x91ubyuMcIOIRnhXX+yKhgtDStU6CH8CLJaTfRZE5SNHjj92B5jZfFtfJUaxHpJk/UY6OcjswrGfUv8oQNki/2L/qQxt8uuKdjNLW0ABaWmD2p197BEUJfAHNGLvDSvF0O5E+M+oK4H8TrboMP1GnJS3M= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; From: Wei Chen To: , , , CC: Subject: [PATCH 31/37] xen/arm: introduce a helper to parse device tree NUMA distance map Date: Thu, 23 Sep 2021 20:02:30 +0800 Message-ID: <20210923120236.3692135-32-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210923120236.3692135-1-wei.chen@arm.com> References: <20210923120236.3692135-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f60a024b-3763-4276-f705-08d97e8a5a1b X-MS-TrafficTypeDiagnostic: PR3PR08MB5673:|PAXPR08MB6972: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:4714;OLM:4714; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: I7HRuwLqb6rxp113nJfoi+GL1LRBKvxeVSVq/fZ1HxCVCTFy4aiFmHZGmrrsXr7D1g/KYvUi9sg/hiRpB41FKIL4l8Ka0M8a/tTwLS6kUggbcalrRnhOovfYWsVwItdjS1N0I7YlUpuNNVa1HdwOuAIVz6rPtzIjc5/I21SlswpaGeHZrjDsXRXhaFqMV6ZV7tISy3aBtdIZ2NKRSVF57b031sR/9l+ao1SEQdAkB++H1SmqoTuoIOHkWZB9qFFEE4dtf/uCdB7y14K/97uQN5mBrFmqdXhXIevf+Qv6uqBjzQreWjuX9mE05H5LkdmNJRxQpB/LXkJfSYuybGYsuCIz7P4Ef9LertVbUyWRg683Ek26M6t7dEKczXf1rfGu69blrNcQ9Ed4h4n/pQibU/Rqu79pZbrS7VogUxXzqKIEVY2YpnnhBsy53ws9sawUimWzrMSBbCOS4aLeVU5mG2/ZUOk/T2VthAL30bjY8QJ97f2T22ccnz385v+kWhhIBiwX7CRUFSlqXDE17+ALBVS9m2kd7ixL1TdDcNe/EDXtec+hq9/z7KpDteVd1xpMSJnRLVbZf51xlWFUSJJVlcLDqT1It0sYfVIQSjLdGo66/9wjKOP3M1zolzZEp8N97ub/9BrmE64UT20Q6EOZ25TCN9yQnrDjQTbY0kEB5XyIjyCE9DrmcAQYph0BfZ5Dnd/B3xU8p4n6JkANcFXTJ4/uFDqDL0hiP/E9CDNxdTAlCR9BONBtHHFUAirwBkxaWCOKTr2pwxzjEQIQCZLuIFKx2tjq+ujRmPH43uYp6m0hevcYM2PU0arlmyOeWEov X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(4636009)(46966006)(36840700001)(36756003)(5660300002)(316002)(110136005)(44832011)(1076003)(47076005)(508600001)(86362001)(81166007)(6666004)(82310400003)(7696005)(8936002)(26005)(70206006)(8676002)(966005)(70586007)(36860700001)(186003)(2616005)(356005)(83380400001)(336012)(426003)(4326008)(2906002)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR08MB5673 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT006.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 9d6f7704-002a-44c8-68cd-08d97e8a517f X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wrCUhuLO0lH7466nBb5yETRORbCbwEQvuoBGor/OFCRMkBZDcy1UIcUvSnRBJT5pYyTd+/XRiiqS2s7tX8xggjoA7gkjr/yWt8rzwZPmxWE0gCbItieodg+ToFdUZK1XtAKEHcqblGYfN3eIxsFdw1s5jD/NpxYO7cDL21DqfLT6QA3kfFjnnstw6hZN7joVL2cgJmelQibgwm2XH9W5+yeuKb8aOBc5nYkotvrk6/hjYe5qLgXAiT2u1jwNoHE+THFYXcsLJCs31itbX16qVrBuXyYlWEdUOmK/SojeJleUO+YWAFoW/Ec5Nicxzd/l9IHcVHzMHilSb6kXOobc4IPwnNZq0Jmg5vEX9nsCgkf8L+yssgPyARrPqvHgBr9dHMJLfsLUgKjADJ4yGQArkCjimmgOcDqT9/UocuMqqBtNyCtWI1xgtgRJvYPVk2eozYOIULdLxC/iNNswszWf9ATDgemYDOPi9Y+VpwgrJnzJqXPcndO9nc/s0f8ooELgAWLEPEGv+jOK55P+eelJeFDlb/JpDouaYxyRFBiPwBIXzABWBEO9SMy+fcdCmghvfLPt5jZsvUnDjgcwYvqT+9MJqpA8grjF4zJ/rSzzyRopClbCsPNRIhEyRbtEeBp/voYsBs4L78B87dn50By9dIQS/CJExxdCw/+NeI/9CXXFcolwZ8rWGwUMo6jj7lgHsQSldBxUSyU8PCGFGOw3l3+coAc7TTE1NKgHNA20/g4XqopBY/zUMoDleDNyo/AwL3G4mRP+oXPT/kV8dBeorirLK9gWbqsthEYXc5KXK8I= X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(4636009)(36840700001)(46966006)(110136005)(8676002)(426003)(508600001)(336012)(82310400003)(36756003)(5660300002)(7696005)(2906002)(8936002)(316002)(70206006)(186003)(2616005)(966005)(4326008)(83380400001)(44832011)(81166007)(86362001)(70586007)(6666004)(36860700001)(47076005)(1076003)(26005);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2021 12:04:53.1934 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f60a024b-3763-4276-f705-08d97e8a5a1b 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: DB5EUR03FT006.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB6972 A NUMA aware device tree will provide a "distance-map" node to describe distance between any two nodes. This patch introduce a new helper to parse this distance map. Signed-off-by: Wei Chen --- xen/arch/arm/numa_device_tree.c | 106 ++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) diff --git a/xen/arch/arm/numa_device_tree.c b/xen/arch/arm/numa_device_tree.c index 7918a397fa..e7fa84df4c 100644 --- a/xen/arch/arm/numa_device_tree.c +++ b/xen/arch/arm/numa_device_tree.c @@ -136,3 +136,109 @@ static int __init fdt_parse_numa_memory_node(const void *fdt, int node, return 0; } + + +/* Parse NUMA distance map v1 */ +static int __init fdt_parse_numa_distance_map_v1(const void *fdt, int node) +{ + const struct fdt_property *prop; + const __be32 *matrix; + uint32_t entry_count; + int len, i; + + printk(XENLOG_INFO "NUMA: parsing numa-distance-map\n"); + + prop = fdt_get_property(fdt, node, "distance-matrix", &len); + if ( !prop ) + { + printk(XENLOG_WARNING + "NUMA: No distance-matrix property in distance-map\n"); + + return -EINVAL; + } + + if ( len % sizeof(uint32_t) != 0 ) + { + printk(XENLOG_WARNING + "distance-matrix in node is not a multiple of u32\n"); + return -EINVAL; + } + + entry_count = len / sizeof(uint32_t); + if ( entry_count == 0 ) + { + printk(XENLOG_WARNING "NUMA: Invalid distance-matrix\n"); + + return -EINVAL; + } + + matrix = (const __be32 *)prop->data; + for ( i = 0; i + 2 < entry_count; i += 3 ) + { + uint32_t from, to, distance, opposite; + + from = dt_next_cell(1, &matrix); + to = dt_next_cell(1, &matrix); + distance = dt_next_cell(1, &matrix); + if ( (from == to && distance != NUMA_LOCAL_DISTANCE) || + (from != to && distance <= NUMA_LOCAL_DISTANCE) ) + { + printk(XENLOG_WARNING + "NUMA: Invalid distance: NODE#%u->NODE#%u:%u\n", + from, to, distance); + return -EINVAL; + } + + printk(XENLOG_INFO "NUMA: distance: NODE#%u->NODE#%u:%u\n", + from, to, distance); + + /* Get opposite way distance */ + opposite = __node_distance(from, to); + if ( opposite == 0 ) + { + /* Bi-directions are not set, set both */ + numa_set_distance(from, to, distance); + numa_set_distance(to, from, distance); + } + else + { + /* + * Opposite way distance has been set to a different value. + * It may be a firmware device tree bug? + */ + if ( opposite != distance ) + { + /* + * In device tree NUMA distance-matrix binding: + * https://www.kernel.org/doc/Documentation/devicetree/bindings/numa.txt + * There is a notes mentions: + * "Each entry represents distance from first node to + * second node. The distances are equal in either + * direction." + * + * That means device tree doesn't permit this case. + * But in ACPI spec, it cares to specifically permit this + * case: + * "Except for the relative distance from a System Locality + * to itself, each relative distance is stored twice in the + * matrix. This provides the capability to describe the + * scenario where the relative distances for the two + * directions between System Localities is different." + * + * That means a real machine allows such NUMA configuration. + * So, place a WARNING here to notice system administrators, + * is it the specail case that they hijack the device tree + * to support their rare machines? + */ + printk(XENLOG_WARNING + "Un-matched bi-direction! NODE#%u->NODE#%u:%u, NODE#%u->NODE#%u:%u\n", + from, to, distance, to, from, opposite); + } + + /* Opposite way distance has been set, just set this way */ + numa_set_distance(from, to, distance); + } + } + + return 0; +} From patchwork Thu Sep 23 12:02:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 12512647 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CC905C433FE for ; Thu, 23 Sep 2021 12:17:30 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 7C86961107 for ; Thu, 23 Sep 2021 12:17:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7C86961107 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.193959.345586 (Exim 4.92) (envelope-from ) id 1mTNfG-0007CS-G7; Thu, 23 Sep 2021 12:17:22 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 193959.345586; Thu, 23 Sep 2021 12:17:22 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNfG-0007C3-AK; Thu, 23 Sep 2021 12:17:22 +0000 Received: by outflank-mailman (input) for mailman id 193959; Thu, 23 Sep 2021 12:17:21 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNWY-0005KP-7Q for xen-devel@lists.xenproject.org; Thu, 23 Sep 2021 12:08:22 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (unknown [40.107.21.42]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 763e903f-e63c-4fdd-ad36-f687d916c203; Thu, 23 Sep 2021 12:04:52 +0000 (UTC) Received: from AM0PR07CA0006.eurprd07.prod.outlook.com (2603:10a6:208:ac::19) by DB7PR08MB4219.eurprd08.prod.outlook.com (2603:10a6:10:34::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13; Thu, 23 Sep 2021 12:04:50 +0000 Received: from VE1EUR03FT030.eop-EUR03.prod.protection.outlook.com (2603:10a6:208:ac:cafe::e6) by AM0PR07CA0006.outlook.office365.com (2603:10a6:208:ac::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.7 via Frontend Transport; Thu, 23 Sep 2021 12:04:50 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT030.mail.protection.outlook.com (10.152.18.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:50 +0000 Received: ("Tessian outbound 45760a30af4a:v103"); Thu, 23 Sep 2021 12:04:49 +0000 Received: from 6a4a37fc73d1.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id EAF65ACB-7FF1-43C9-93F8-7DF9683493FB.1; Thu, 23 Sep 2021 12:04:41 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 6a4a37fc73d1.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 23 Sep 2021 12:04:41 +0000 Received: from AM6P191CA0075.EURP191.PROD.OUTLOOK.COM (2603:10a6:209:8a::16) by PAXPR08MB7187.eurprd08.prod.outlook.com (2603:10a6:102:209::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.15; Thu, 23 Sep 2021 12:04:40 +0000 Received: from AM5EUR03FT013.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:8a:cafe::a9) by AM6P191CA0075.outlook.office365.com (2603:10a6:209:8a::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.14 via Frontend Transport; Thu, 23 Sep 2021 12:04:40 +0000 Received: from nebula.arm.com (40.67.248.234) by AM5EUR03FT013.mail.protection.outlook.com (10.152.16.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:40 +0000 Received: from AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2308.14; Thu, 23 Sep 2021 12:04:20 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Thu, 23 Sep 2021 12:04:18 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Thu, 23 Sep 2021 12:04:18 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 763e903f-e63c-4fdd-ad36-f687d916c203 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=/Uy52E7uZCYgh1DxgAv2AGcqP59JVjmgUIyI38scwW0=; b=boAtcNAaol8Owam3CPCcBG6TXy7Pdcnsct5SYv/1A9wDlPRGKM2txYwrEtZnm1TAI+RbDT/v1qwUMKZ9eUCUBYWs7rDua14VappPdVm+/n+RufBH+CYd0tLTnaf9kvRNuXBKuL8hOrB34jSsltBuRvCNZ7y4twBIag3hgTaHebU= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; X-CheckRecipientChecked: true X-CR-MTA-CID: 9018c8cdcaaecb1f X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JjcsaJdjsQluXeD75CTF/v8sr0LRGFljDEWIYaJ6+VHxpYnBxByxpa9AptaOpnjVocUt9i+5bJDVn+vFIgA56Tlr4uQzFOVuYLaZK0zZZKRlyTEkRlGr1ECRzZt4/3e68HgIwOkDvYNmHVSAE0XwGu7VueDUXjPnnkU2IBrcfzrRqa0zafcOi1Ihqx8xaSHlIFzTE5O030V+KKIz4yyp5DDf3kkC6CjfzOHxJUSMIHc+LQ6fdYHYE3e9+g1F8nzD/kd/dskFapcsWB14C6W+CTVLiIK3ZZzo0nMzxxND4m/HnBQM/q3HQhZARxy6Fd3AhsNeIdLVCM+aQ0IvoEf6kQ== 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; bh=/Uy52E7uZCYgh1DxgAv2AGcqP59JVjmgUIyI38scwW0=; b=gKPiSHe4B/QGe1oWddpxjfk4L7U4g/jMKtAhblCOf0l3oo6UV1rIQ+crjQfyjtNk/Jw+DpUnunTETYcdMpSNVzjVNGFzLVTdKBCbPu9Xl/uh35a8octOhVzHZyqbeJkajJmWBBagwEHpC+NvK8+UnBKjG7wUowf3tez6YYaILJxjjdiOera6rC87C2muTDveimR4yHDtb2iMPzXSlq0T9Hu2ag+sEVExJcMZt/6AqMlI0QYNIlc/QFZjBcIwT29giD9kT1qNMuPr7YaN+R98IIJG1COno1c9fALpwyoh3ES7rCHObAyIiyDJ/f4O/0I7plnD+AS7Uc15JOSNjXZNmA== 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=/Uy52E7uZCYgh1DxgAv2AGcqP59JVjmgUIyI38scwW0=; b=boAtcNAaol8Owam3CPCcBG6TXy7Pdcnsct5SYv/1A9wDlPRGKM2txYwrEtZnm1TAI+RbDT/v1qwUMKZ9eUCUBYWs7rDua14VappPdVm+/n+RufBH+CYd0tLTnaf9kvRNuXBKuL8hOrB34jSsltBuRvCNZ7y4twBIag3hgTaHebU= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; From: Wei Chen To: , , , CC: Subject: [PATCH 32/37] xen/arm: unified entry to parse all NUMA data from device tree Date: Thu, 23 Sep 2021 20:02:31 +0800 Message-ID: <20210923120236.3692135-33-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210923120236.3692135-1-wei.chen@arm.com> References: <20210923120236.3692135-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d0deb3f8-9145-4d00-f441-08d97e8a5896 X-MS-TrafficTypeDiagnostic: PAXPR08MB7187:|DB7PR08MB4219: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:4502;OLM:4502; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: /XyZspcenSR+Xfp/bqrbh8RJhaBTqQIxeIXfbOEXA18fWLrHld2s7bm6jQH85duPf3O7OTBe+VkabINbquY35zYYMpN4v1fz2RbfwzBusOC2a2VU+taIsNtPTIun9lgJHNirlrx/y+bFwmzeyrtbvQExnhZgwJMie+7H30NBveONWyveLy1J3tsEiezkwLNpgJeeQm2jN86emK8yzO6BqN6Xz+X7LRGczfEABK2WsOgJwuj4DyTzmzJ3hjgDSOU3EgJMRP+zyXzNuB1qjpRWJxppM9rlLfRnJZ/pXpyIM8jPDcPs2d53yjH8PmlRo1qXIBTO39e65fRaUz8IRzDIhVDihrIUQxXw8KHb6yhqOUhMYjBAA7DlIBj7LQpigu/BQZ2Ea/I5qSleXeBU7T9j8X8L2jU+hjwh5XzzVQWgAMz+vrVxLhPdaDp/NFGykfk/krAHVsP0iYOZ+/2Z/prz6WSYuCUkbKRQdr4YXokwoQJvGS8N6mk/l86moDCyTU4dvq0MIjo6WI5B6EBy4h4Lu3hdiHtpAJiGu7ddo4fm1LctjaHY2FugzuNoGkVVmWqaxptLw5gRBa9Jfs20gLc6oOvAiiEXFWJAa1w9yIUbAUbf4YoTWM1g6DNRCWtF+svpYERApK+Am94UpfQ6YC9GTutWmLUVDSQ59bh2cUTgXeRvLJYM6s4+qcLokQ6G2RwjwTuSw2uBGwpftGOqwyeB6be/Ttj6vIzhUR/OuF/NdEg= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(4636009)(36840700001)(46966006)(36756003)(110136005)(2616005)(1076003)(82310400003)(316002)(336012)(47076005)(81166007)(44832011)(70206006)(4326008)(70586007)(26005)(356005)(36860700001)(86362001)(8936002)(508600001)(83380400001)(5660300002)(2906002)(186003)(6666004)(8676002)(7696005)(426003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB7187 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT030.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: c8b70389-a79a-4536-ebe1-08d97e8a5281 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +nuLdw1t/NfZzBnKYdvlWqFmM4OA2Hw1HnD8/QIx+SMu9csE3LTwvKgL5uSBfr/QG8vbXaHXKh5b28l3gO0zb0NsVuncN42hxyWsziD5sIiZ0/CQrzGDRT2EoHR/OaJobBYL69uU3e1HRsysAdDuDzsePffD2tFfBbiJBQVkXl87oKeWwrkSzDbNSPHhJ6XI/SNJ3KOE0rBw5zU/xs5lcXFekGQADxABXxSd3KR9jrC5IJrDslmnMyfmnwIsUy+4rjAFmZb1sQY+tUifgvo2SopWYPuPs28Lk9XzOnIgBD3bFRvbVUN35b2I7UpgP+Qg6VtmkdSFUlfYTNHUaS7NUwJBeN62mVIVj4BAnr4fDvKWaavNAxKvxfLIRDO9RQCKjL4o5sq7aE0JQHPjMHw2MTmbrgUvPGfGbJYno0udx1YLskWTrUYctqxybleJmAWdq8FrkqY9AwGTnSuoZDIhWeN7NV66YS4Tx6rWMQhX+EM/yhS7o/G2R8bxAdBtjA70Z6Trx6+WZva6inGkHhB9+OWolTLejbqXF9/2NdT7sU2U/BYGZyZ4vG0qW7fKf6VRf4qc+w0++gKJcFLGDkPqdFMEt4PG0rQtRmi/WxfS3XDF2Ktbh8/jEZRUyopfKlCRI1A2KOvWBA0WYE+sk9/NpyMgtxXPDma0epDTWLSuLE45CVo9NDiJHTcnY/xHgD53JmPysW3niWzSqr0SMhBdTA== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(4636009)(46966006)(36840700001)(44832011)(86362001)(508600001)(1076003)(316002)(110136005)(2616005)(5660300002)(8936002)(186003)(70586007)(36860700001)(4326008)(26005)(47076005)(336012)(6666004)(426003)(82310400003)(70206006)(83380400001)(36756003)(8676002)(81166007)(2906002)(7696005);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2021 12:04:50.5091 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d0deb3f8-9145-4d00-f441-08d97e8a5896 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: VE1EUR03FT030.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB4219 In this API, we scan whole device tree to parse CPU node id, memory node id and distance-map. Though early_scan_node will invoke has a handler to process memory nodes. If we want to parse memory node id in this handler, we have to embeded NUMA parse code in this handler. But we still need to scan whole device tree to find CPU NUMA id and distance-map. In this case, we include memory NUMA id parse in this API too. Another benefit is that we have a unique entry for device tree NUMA data parse. Signed-off-by: Wei Chen --- xen/arch/arm/numa_device_tree.c | 30 ++++++++++++++++++++++++++++++ xen/include/asm-arm/numa.h | 1 + 2 files changed, 31 insertions(+) diff --git a/xen/arch/arm/numa_device_tree.c b/xen/arch/arm/numa_device_tree.c index e7fa84df4c..6a3fed0002 100644 --- a/xen/arch/arm/numa_device_tree.c +++ b/xen/arch/arm/numa_device_tree.c @@ -242,3 +242,33 @@ static int __init fdt_parse_numa_distance_map_v1(const void *fdt, int node) return 0; } + +static int __init fdt_scan_numa_nodes(const void *fdt, + int node, const char *uname, int depth, + u32 address_cells, u32 size_cells, void *data) +{ + int len, ret = 0; + const void *prop; + + prop = fdt_getprop(fdt, node, "device_type", &len); + if (prop) + { + len += 1; + if ( memcmp(prop, "cpu", len) == 0 ) + ret = fdt_parse_numa_cpu_node(fdt, node); + else if ( memcmp(prop, "memory", len) == 0 ) + ret = fdt_parse_numa_memory_node(fdt, node, uname, + address_cells, size_cells); + } + else if ( fdt_node_check_compatible(fdt, node, + "numa-distance-map-v1") == 0 ) + ret = fdt_parse_numa_distance_map_v1(fdt, node); + + return ret; +} + +/* Initialize NUMA from device tree */ +int __init numa_device_tree_init(const void *fdt) +{ + return device_tree_for_each_node(fdt, 0, fdt_scan_numa_nodes, NULL); +} diff --git a/xen/include/asm-arm/numa.h b/xen/include/asm-arm/numa.h index 7675012cb7..f46e8e2935 100644 --- a/xen/include/asm-arm/numa.h +++ b/xen/include/asm-arm/numa.h @@ -23,6 +23,7 @@ typedef u8 nodeid_t; #define NR_NODE_MEMBLKS NR_MEM_BANKS extern void numa_set_distance(nodeid_t from, nodeid_t to, uint32_t distance); +extern int numa_device_tree_init(const void *fdt); #else From patchwork Thu Sep 23 12:02:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 12512663 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E32DFC433FE for ; Thu, 23 Sep 2021 12:18:00 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 99E5B61107 for ; Thu, 23 Sep 2021 12:18:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 99E5B61107 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.193990.345669 (Exim 4.92) (envelope-from ) id 1mTNfj-0002PE-Jq; Thu, 23 Sep 2021 12:17:51 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 193990.345669; Thu, 23 Sep 2021 12:17:51 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNfj-0002O4-A1; Thu, 23 Sep 2021 12:17:51 +0000 Received: by outflank-mailman (input) for mailman id 193990; Thu, 23 Sep 2021 12:17:49 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNVE-0006xV-Tj for xen-devel@lists.xenproject.org; Thu, 23 Sep 2021 12:07:00 +0000 Received: from EUR02-HE1-obe.outbound.protection.outlook.com (unknown [40.107.1.86]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 79262836-1c66-11ec-ba2e-12813bfff9fa; Thu, 23 Sep 2021 12:04:59 +0000 (UTC) Received: from DU2PR04CA0307.eurprd04.prod.outlook.com (2603:10a6:10:2b5::12) by AM6PR08MB3399.eurprd08.prod.outlook.com (2603:10a6:20b:47::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13; Thu, 23 Sep 2021 12:04:57 +0000 Received: from DB5EUR03FT049.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:2b5:cafe::d) by DU2PR04CA0307.outlook.office365.com (2603:10a6:10:2b5::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.16 via Frontend Transport; Thu, 23 Sep 2021 12:04:57 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT049.mail.protection.outlook.com (10.152.20.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:57 +0000 Received: ("Tessian outbound c21c48fbc857:v103"); Thu, 23 Sep 2021 12:04:56 +0000 Received: from b12015d85945.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 88F0757A-4AA9-40EB-8B84-257C7DA7080B.1; Thu, 23 Sep 2021 12:04:45 +0000 Received: from EUR01-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id b12015d85945.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 23 Sep 2021 12:04:45 +0000 Received: from AM6P191CA0079.EURP191.PROD.OUTLOOK.COM (2603:10a6:209:8a::20) by DB8PR08MB3994.eurprd08.prod.outlook.com (2603:10a6:10:a6::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.17; Thu, 23 Sep 2021 12:04:43 +0000 Received: from AM5EUR03FT013.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:8a:cafe::24) by AM6P191CA0079.outlook.office365.com (2603:10a6:209:8a::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:43 +0000 Received: from nebula.arm.com (40.67.248.234) by AM5EUR03FT013.mail.protection.outlook.com (10.152.16.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:43 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.14; Thu, 23 Sep 2021 12:04:21 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Thu, 23 Sep 2021 12:04:20 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 79262836-1c66-11ec-ba2e-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vghFBlrVlMBMFKgAWPXBQGBuhDmWD5Y0b6JI6HLn9ps=; b=gN76vXhZxcBv5BscLifO8EYJDthjC2Ft+x3xWoNfXtF1IIuRTh/CaF4drz1j2axlQY9aDWkjul+pZBQxL3dkg0VfpFBK07fX3gf0znAhJWovzv/TUtuRu2ebi3zWTh3EI748J9xyO+kja8x1O5dArRxjN4bfb85da7kkvo5LWa0= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; X-CheckRecipientChecked: true X-CR-MTA-CID: 3eea9582ea44a5ec X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H7h8agbnXbNYy4zQeLPQoCUNaCZYwXUgZClp62C/AMHfzOFeZvETHFOBn5WuvSHCXFGZPXi5HTv6E3wHotq9gT6DkYqhUjIaXAvvxamcg93LSGA3zlCVU+eAHh0DscjI8feCGxyw1hl/922SGDjzaxyxcY+DaT3L5AWNDL4euLyqlCZD83/8GAW+h9VDevNHTGyieimDmeovQzWOkA3Nkq0frh8LHonWMjwWzTnqNeL1O0CugedArEMNzqc//DU0VJ25wLFZQbM79TbjhXzPbuvtle+dFRP9s0LEhT8cGu9ffFyJVcj8l0ip6OQrjGrIx+8+lIb7rSuvhKW21X5GyA== 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; bh=vghFBlrVlMBMFKgAWPXBQGBuhDmWD5Y0b6JI6HLn9ps=; b=Q8d+573xQL/GxJ8OICSS6kZpomg+vZUa2jtLrUNKLcZqpY142658sjFAwduYdYj/71GckBwFeOEevMQK2zX9BIndUwFSscHcFr9Q/um/xnkvCju8n2GIVIPSK9/QE9qzlWC9Yi3lvC5kjXP45ljAZKfLeLI3y70SOJoNTeahjAANvxQOBJ/FY5/yG6zpfpm+i2AtBTMMvlijLbnkYOwpPzDsZcr6a08TTJ8PjbZubcJ2gTJhQDcPqxxrQ2a2sMy6fH/zYYiyMqZGRQ7XGrrE+hyRawJKU1fth30ZqgbDHISBvHApSoKVeejuaUnqcY3cyg+qGqjH+VSbl4yiNgAbSg== 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=vghFBlrVlMBMFKgAWPXBQGBuhDmWD5Y0b6JI6HLn9ps=; b=gN76vXhZxcBv5BscLifO8EYJDthjC2Ft+x3xWoNfXtF1IIuRTh/CaF4drz1j2axlQY9aDWkjul+pZBQxL3dkg0VfpFBK07fX3gf0znAhJWovzv/TUtuRu2ebi3zWTh3EI748J9xyO+kja8x1O5dArRxjN4bfb85da7kkvo5LWa0= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; From: Wei Chen To: , , , CC: Subject: [PATCH 33/37] xen/arm: keep guest still be NUMA unware Date: Thu, 23 Sep 2021 20:02:32 +0800 Message-ID: <20210923120236.3692135-34-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210923120236.3692135-1-wei.chen@arm.com> References: <20210923120236.3692135-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 40fcc8c0-593e-48f1-b9c8-08d97e8a5c77 X-MS-TrafficTypeDiagnostic: DB8PR08MB3994:|AM6PR08MB3399: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:8882;OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: RRHmHsEYa6UrnyhJlKbWJ58VGEEodjNSu07OgYMtAz7uK78AhzDDR5WgEAT/6AS1nypEwoIZnmIgLfJsT26zQk5qe7Dewvg090gEwJzS7CAU76a9VKvm+XYN01LceWDRLZ2Qyxz4ImU76+qoHp7yqAA5XCo9ruR9mwm+MJOvyphMmrYUBjmFyT1HdMYYrDG7mLvutmxK3wCePMfV7439s4gmVrO06W8kv7X8x+svBkCkiYZDiB2Ye2Hk/m3w4S3ZX18VFSgl7Gwh9DSV1LDfVzGDwZldMEAgnYdrkRcqPeh9yVfnuquFCyimdVxoeJ4el4p2u37Ojm4Y3YzeumuTrCtDizQvxgRmOAJtFuGEmPqZLN7i1d1Y4AP5KeF7T87Ies8+sV29or8P+S/flpF0SO67V4YmKpCb/GJfuf4Cll3z26bflgw9PpcsDs3COkxRaZxUT8MbR49h7CwJ/zy2FjB2fN7FQov4ZxOVZIgMYwyDme8Tbyhbag3/fLvn6fYgD4CkGBLRQXQisKeMcudKIbF0+To50lxva4B+NWUbpdUNZnZaL8w1ea+5nz0LF4/u9VTdl7w31/vLgTsAXB1xWLfEZUePSEnSgkHSThL9AkXJKZyA14hByfGbBMRyi24q0xKaXqg+oZt/b0nMM0El3oW2RI/Q9CDQwTVNPG7h9wsMFNLrnlH5Wnb47pNlj9dLhvW8k231emtpGfIDIoovpZNvwukA8dfHu/un4Phq6+I= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(4636009)(36840700001)(46966006)(70206006)(86362001)(2906002)(81166007)(1076003)(6666004)(70586007)(7696005)(316002)(110136005)(356005)(36860700001)(4326008)(5660300002)(36756003)(8936002)(508600001)(426003)(82310400003)(47076005)(336012)(8676002)(44832011)(26005)(2616005)(186003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB3994 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT049.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 51cab88d-6ada-46d5-f08e-08d97e8a5449 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Nps67gIzyn2E66UC8brIMXkvgIsfkNn58WoFelcdM6K5GSA09KmdUdkiFLGFdRfh4CxxPoB9SXhgd2RIPENuN4iJ6s9lES2GYUf+QDosFPchygOdtrRO0PgdsPZsCnCnJWUYrxBnOP9e97j3xHM99Cz1rOtSQEISFex7YWfm8sUQeU5YRnVagVCdVAgMpLyBMaPnhOil8pEcXhO332oqdO5Gnv3cj9FfjFdGGCEhnktvQn0iSp2s6Ip/ggRvhuRbWJPz3Z1n0jEk7BKyJxHWZAJYQYqCENRTw6ct2ExB09h4PfmTHrU/2hdFckShHAG3dbpYABUIF478UuZqU1ymcucu6kSlZ+0wseP+dq1WH2Ns/oRxvQlWWp017u8sUEHIQzUvbpb49jQqjr3cgbSGkmyCtBwc3NJKHKMo55jK3ZOlgIuKcFMJxen1pmtekUMuVmJvzEsUFsmavH4t+ZkRkrg37RbeiWkVXRKZWEJ2ZxHGwGpTMgBlenIXPrhvCLSxMIkGPp3n0Dm2JLr5sDjUyjb6XujZPg+k3o5XKSo9pq5vxwn/resNnBckQ+GKNtHRBreHQY1pjce0Tldxlo5MJr7U0E/ku3a4navrVIexeIgEtcYV37Ai+AUHoyCClJBT/R+A3fk7UqqBVul5tXO+/8vLPeFmUT3mqo98hfQs4ZpQxOSShJYbkjUzzZrFbpMVtntbYqCXsLZOG4Rq9qZvUw== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(4636009)(46966006)(36840700001)(36756003)(110136005)(336012)(426003)(2616005)(186003)(82310400003)(8936002)(70586007)(7696005)(2906002)(81166007)(26005)(70206006)(8676002)(6666004)(5660300002)(508600001)(316002)(47076005)(44832011)(4326008)(86362001)(36860700001)(1076003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2021 12:04:57.1502 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 40fcc8c0-593e-48f1-b9c8-08d97e8a5c77 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DB5EUR03FT049.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3399 The NUMA information provided in the host Device-Tree are only for Xen. For dom0, we want to hide them as they may be different (for now, dom0 is still not aware of NUMA) The CPU and memory nodes are recreated from scratch for the domain. So we already skip the "numa-node-id" property for these two types of nodes. However, some devices like PCIe may have "numa-node-id" property too. We have to skip them as well. Signed-off-by: Wei Chen Reviewed-by: Stefano Stabellini --- xen/arch/arm/domain_build.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index d233d634c1..6e94922238 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -737,6 +737,10 @@ static int __init write_properties(struct domain *d, struct kernel_info *kinfo, continue; } + /* Guest is numa unaware in current stage */ + if ( dt_property_name_is_equal(prop, "numa-node-id") ) + continue; + res = fdt_property(kinfo->fdt, prop->name, prop_data, prop_len); if ( res ) @@ -1607,6 +1611,8 @@ static int __init handle_node(struct domain *d, struct kernel_info *kinfo, DT_MATCH_TYPE("memory"), /* The memory mapped timer is not supported by Xen. */ DT_MATCH_COMPATIBLE("arm,armv7-timer-mem"), + /* Numa info doesn't need to be exposed to Domain-0 */ + DT_MATCH_COMPATIBLE("numa-distance-map-v1"), { /* sentinel */ }, }; static const struct dt_device_match timer_matches[] __initconst = From patchwork Thu Sep 23 12:02:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 12512655 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 601CAC433FE for ; Thu, 23 Sep 2021 12:17:54 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 0ECA961107 for ; Thu, 23 Sep 2021 12:17:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0ECA961107 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.193978.345628 (Exim 4.92) (envelope-from ) id 1mTNfd-00011C-6K; Thu, 23 Sep 2021 12:17:45 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 193978.345628; Thu, 23 Sep 2021 12:17:45 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNfc-000105-Va; Thu, 23 Sep 2021 12:17:44 +0000 Received: by outflank-mailman (input) for mailman id 193978; Thu, 23 Sep 2021 12:17:43 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNX7-0005KP-8s for xen-devel@lists.xenproject.org; Thu, 23 Sep 2021 12:08:57 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (unknown [40.107.8.45]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id b15688bc-e809-4dae-a08b-8c83425a07b6; Thu, 23 Sep 2021 12:05:25 +0000 (UTC) Received: from PR0P264CA0181.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::25) by VE1PR08MB4783.eurprd08.prod.outlook.com (2603:10a6:802:a9::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13; Thu, 23 Sep 2021 12:05:20 +0000 Received: from VE1EUR03FT011.eop-EUR03.prod.protection.outlook.com (2603:10a6:100:1c:cafe::f2) by PR0P264CA0181.outlook.office365.com (2603:10a6:100:1c::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14 via Frontend Transport; Thu, 23 Sep 2021 12:05:20 +0000 Received: from 64aa7808-outbound-2.mta.getcheckrecipient.com (63.33.187.114) by VE1EUR03FT011.mail.protection.outlook.com (10.152.18.134) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:05:20 +0000 Received: ("Tessian outbound 8b24208353e0:v103"); Thu, 23 Sep 2021 12:05:18 +0000 Received: from 6415f6476d30.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id D94C7F36-7225-4215-B3AD-7B66E54708FF.1; Thu, 23 Sep 2021 12:04:48 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 6415f6476d30.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 23 Sep 2021 12:04:48 +0000 Received: from AM6P191CA0104.EURP191.PROD.OUTLOOK.COM (2603:10a6:209:8a::45) by AM9PR08MB6195.eurprd08.prod.outlook.com (2603:10a6:20b:284::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13; Thu, 23 Sep 2021 12:04:46 +0000 Received: from AM5EUR03FT013.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:8a:cafe::8b) by AM6P191CA0104.outlook.office365.com (2603:10a6:209:8a::45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:46 +0000 Received: from nebula.arm.com (40.67.248.234) by AM5EUR03FT013.mail.protection.outlook.com (10.152.16.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:46 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.14; Thu, 23 Sep 2021 12:04:24 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Thu, 23 Sep 2021 12:04: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: b15688bc-e809-4dae-a08b-8c83425a07b6 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=XPyMh8kRm237dXS4GzraOVjqXtVF9dvrj+OlofkeXZM=; b=R98OGe1zJLc+wYDSRAf9OcKgXO/XUJs+TOE2xBq6X4ipvBp6vqLnzmLt5p/1Y3QHTbtsqzWLLKbYTS/xUjWaYl2i7HxAfh3iNH6nYVCngAYJR9XzB37UvcG9ynQm7wTTa05byGHJ6zdGM3m4PXODNi74+c8al0R+AMLTEKl4TwM= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.33.187.114) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.33.187.114 as permitted sender) receiver=protection.outlook.com; client-ip=63.33.187.114; helo=64aa7808-outbound-2.mta.getcheckrecipient.com; X-CheckRecipientChecked: true X-CR-MTA-CID: 0c9621024c7910d2 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LCY5mjUjcTuUzD8QLUOTelv72R9wjbolCxbFuXZ+jjMlatXBZakjvHH0JRdPRU/3OTf2Q1Fk2n60UbGZFAYBPHp+5M2sudYuv+wtUINABvgQb3bXqyUfF4IkQ8jy+5KIn9NYLvdTHmSYJhucmp8vCo/VSNA3NRH5G8pIr6fWlpnw+lSdz2bkvw7eBYWF5fxBu4m+y4g0kMRC8ZqErfGDeir3itoaW2KEJCFgYskxmzjZUT7jJS85T/P31IBu49l/zSy9+GIUAKjmBPTKmJcWjzpsSU553HmSaHs9b/kYQReTaKGqm8ZWvDFGS1QqsckgXPgaGfJBA2kmbMuFT2yrOA== 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; bh=XPyMh8kRm237dXS4GzraOVjqXtVF9dvrj+OlofkeXZM=; b=kmO1HiqSCWFJKEtMN37vQMfcJuUEYfZ57Yl5U+0GMIpPxRaIuElEpFidVyqlWSIVwbGaSkWWaiO9wNTCsJ99S3HXOY3xA3iNVdIEHKLCRS472oAUzzafGaP7uwM8EeEfViyW6TPNjtN92VyA3KCbrTQ7P4uGd9k2tgmXzcA4Z1ycrrklqoKrtuusTRZZEYlHZIdtJsc8vBeFAuaQuvpGJvACLdkSClQT+ixvg4LG5UUJPCn+9Of/wBQ+sS/x8oKIVmKEkl+xin8uVelAzs/Sy9Yg6wez+2Ly84VVSo6Xvm81o8hoIJuDDFY+NUqPafwckzcnBTCFdsSiWKbNu60yvw== 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=XPyMh8kRm237dXS4GzraOVjqXtVF9dvrj+OlofkeXZM=; b=R98OGe1zJLc+wYDSRAf9OcKgXO/XUJs+TOE2xBq6X4ipvBp6vqLnzmLt5p/1Y3QHTbtsqzWLLKbYTS/xUjWaYl2i7HxAfh3iNH6nYVCngAYJR9XzB37UvcG9ynQm7wTTa05byGHJ6zdGM3m4PXODNi74+c8al0R+AMLTEKl4TwM= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; From: Wei Chen To: , , , CC: Subject: [PATCH 34/37] xen/arm: enable device tree based NUMA in system init Date: Thu, 23 Sep 2021 20:02:33 +0800 Message-ID: <20210923120236.3692135-35-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210923120236.3692135-1-wei.chen@arm.com> References: <20210923120236.3692135-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7524a0dc-3fde-42ba-3ca9-08d97e8a6a36 X-MS-TrafficTypeDiagnostic: AM9PR08MB6195:|VE1PR08MB4783: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:3173;OLM:3173; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 9nSKCTMaejQPMJJ+ZfEY7qDHpNBGYij1umBDDjqV+RVOaCyvJh66HoljiVU1dRVizGISfHk6Eizp9wavF7aPt1+1XV5PxsPhFko7SUH8ZRZk7F81as3i9bzNbIAUtGwZ3t7Tn6twkWRQKmUaqeerboNeBj5YCHlq68SvTlwYhMFHBZsJ1hdPq7ydWiNzYvSL6xqZI8lCjCk8s7VmXOOzG8beBJi04/+UIt/WM4TNNQ5DS9YeY1ao51khGuAGsEg0hLIVveV7nBqPmSaf8Yo+Wpb3zlfjnHIVtYCNcGk7ULzB0PUGYlflvEwAtXmKJYWngFJFgQG28/YpOcnYWnyyxazoNaH5OdqTQxVERcnC89OtFWYiElXGHzWQvZ5Xrs9mx+YrgpNQgM51R1rGogv+Ez8f5PGMRgulXqkhMsgMniaBzroDs99NRIeuYGQbukqJlfM6WXI4fPfSEpdRdKJK4YW8swMSaQVMI/B3Mo/pRrF+6Mdyk88IuFaUv0IEgvpCn1huKyg9oHJbpdHx/t5Lpbk7ko3IZp6OARDK8tnrQPQNmg4xSOTm+VmeZlU+6M5sV03OJKbtcqqVV4fDqslHhIYCMoAX7IpoBiQUwYTjCF945ypt0etZd6if8H7prIzBjwMb3wp/5ZamehRgwEVnPUywt/lnTnssCiHKkFn3+KZmH4OxNoGlTLRC47EaZhlqeDWZM+9DB9HclbsCCSGaWwlJLhpXvpo539XMx71rku8= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(4636009)(46966006)(36840700001)(44832011)(82310400003)(47076005)(2906002)(336012)(186003)(8676002)(8936002)(316002)(2616005)(1076003)(508600001)(83380400001)(356005)(36860700001)(86362001)(70206006)(5660300002)(81166007)(36756003)(110136005)(6666004)(70586007)(4326008)(426003)(26005)(7696005)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR08MB6195 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT011.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: d8d5cfd0-76b2-4e3c-fcc9-08d97e8a5628 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oGvCla2hn4nMMulmYaoufQDU01V5N5XzqSOHDfjXLLMGhx0ZbgRIEmDG9K0+7uDJgeMiQlYj6HX2chynuhwEk7RxdK7NeJeUENYGtXS0mvCrs7haj1qPIGUc646w0OFCJ/zgqB//U+QO5QKGb+t99uZyHH+cVORLF5lueAONLiRCrDcknCO5r1+WP/FXViVF/53bavSdb0B9EW4rbANwhT/KxhIlB7ibNSVhDfBFC/zaxSXeJ6ST7EX8dr1kQxCbHyoGlevjhZCgS1xbuCb6wkMMguBO1FicVX+n249PtFR3TSjcBzj/A0Piov5pviCEBX69cUNNk90ChFu9RX5D+Wrp3H72bK+yVbKLj5yG1jx/Ma/xghhuEZz+ZUhLer3Tx1TGXPI6UoYs8lox8WxHtvsX7BdVhmD5PDqPwpnukfeQhrGj6wPrT4z8lD5nz8d0ZUvWOOaaJA07E68YS9/g1VQWe1lm2BK2PM736cbpKX3kI0c24nCNhHCgF/EvxBsPhz6iRu0CP+a9NWNikmmYvyT9NGXInSBQ2LoTKk6ippCjHMNWI2L4BJWjaeAtprETR11Jun1azm9LbFuG9+sUrBH9vVTNUtX6Om1ykjHkAWryy9irFuI/ly+PNyUcqiKizeI6LppKFkS6GPu0VmqDqZomhbe9LAmMh+sB1Q4GtUFNFEh4eEO7HpD4Y2DUr92spd9tRC/V3uX4uvxxAax/JQ== X-Forefront-Antispam-Report: CIP:63.33.187.114;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-2.mta.getcheckrecipient.com;PTR:ec2-63-33-187-114.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(4636009)(46966006)(36840700001)(110136005)(36756003)(336012)(426003)(86362001)(83380400001)(36860700001)(186003)(47076005)(8936002)(1076003)(4326008)(70586007)(7696005)(2906002)(81166007)(26005)(70206006)(82310400003)(316002)(6666004)(508600001)(8676002)(5660300002)(2616005)(44832011);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2021 12:05:20.1072 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7524a0dc-3fde-42ba-3ca9-08d97e8a6a36 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.33.187.114];Helo=[64aa7808-outbound-2.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR03FT011.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB4783 In this patch, we can start to create NUMA system that is based on device tree. Signed-off-by: Wei Chen --- xen/arch/arm/numa.c | 55 ++++++++++++++++++++++++++++++++++++++ xen/arch/arm/setup.c | 7 +++++ xen/include/asm-arm/numa.h | 6 +++++ 3 files changed, 68 insertions(+) diff --git a/xen/arch/arm/numa.c b/xen/arch/arm/numa.c index 7f05299b76..d7a3d32d4b 100644 --- a/xen/arch/arm/numa.c +++ b/xen/arch/arm/numa.c @@ -18,8 +18,10 @@ * */ #include +#include #include #include +#include static uint8_t __read_mostly node_distance_map[MAX_NUMNODES][MAX_NUMNODES] = { @@ -85,6 +87,59 @@ uint8_t __node_distance(nodeid_t from, nodeid_t to) } EXPORT_SYMBOL(__node_distance); +void __init numa_init(bool acpi_off) +{ + uint32_t idx; + paddr_t ram_start = ~0; + paddr_t ram_size = 0; + paddr_t ram_end = 0; + + /* NUMA has been turned off through Xen parameters */ + if ( numa_off ) + goto mem_init; + + /* Initialize NUMA from device tree when system is not ACPI booted */ + if ( acpi_off ) + { + int ret = numa_device_tree_init(device_tree_flattened); + if ( ret ) + { + printk(XENLOG_WARNING + "Init NUMA from device tree failed, ret=%d\n", ret); + numa_off = true; + } + } + else + { + /* We don't support NUMA for ACPI boot currently */ + printk(XENLOG_WARNING + "ACPI NUMA has not been supported yet, NUMA off!\n"); + numa_off = true; + } + +mem_init: + /* + * Find the minimal and maximum address of RAM, NUMA will + * build a memory to node mapping table for the whole range. + */ + ram_start = bootinfo.mem.bank[0].start; + ram_size = bootinfo.mem.bank[0].size; + ram_end = ram_start + ram_size; + for ( idx = 1 ; idx < bootinfo.mem.nr_banks; idx++ ) + { + paddr_t bank_start = bootinfo.mem.bank[idx].start; + paddr_t bank_size = bootinfo.mem.bank[idx].size; + paddr_t bank_end = bank_start + bank_size; + + ram_size = ram_size + bank_size; + ram_start = min(ram_start, bank_start); + ram_end = max(ram_end, bank_end); + } + + numa_initmem_init(PFN_UP(ram_start), PFN_DOWN(ram_end)); + return; +} + uint32_t __init arch_meminfo_get_nr_bank(void) { return bootinfo.mem.nr_banks; diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c index 1f0fbc95b5..6097850682 100644 --- a/xen/arch/arm/setup.c +++ b/xen/arch/arm/setup.c @@ -905,6 +905,13 @@ void __init start_xen(unsigned long boot_phys_offset, /* Parse the ACPI tables for possible boot-time configuration */ acpi_boot_table_init(); + /* + * Try to initialize NUMA system, if failed, the system will + * fallback to uniform system which means system has only 1 + * NUMA node. + */ + numa_init(acpi_disabled); + end_boot_allocator(); /* diff --git a/xen/include/asm-arm/numa.h b/xen/include/asm-arm/numa.h index f46e8e2935..5b03dde87f 100644 --- a/xen/include/asm-arm/numa.h +++ b/xen/include/asm-arm/numa.h @@ -24,6 +24,7 @@ typedef u8 nodeid_t; extern void numa_set_distance(nodeid_t from, nodeid_t to, uint32_t distance); extern int numa_device_tree_init(const void *fdt); +extern void numa_init(bool acpi_off); #else @@ -47,6 +48,11 @@ extern mfn_t first_valid_mfn; #define node_start_pfn(nid) (mfn_x(first_valid_mfn)) #define __node_distance(a, b) (20) +static inline void numa_init(bool acpi_off) +{ + +} + static inline void numa_add_cpu(int cpu) { From patchwork Thu Sep 23 12:02:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 12512559 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 03B88C433EF for ; Thu, 23 Sep 2021 12:07:17 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 9B9A660FA0 for ; Thu, 23 Sep 2021 12:07:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 9B9A660FA0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.193844.345400 (Exim 4.92) (envelope-from ) id 1mTNVI-0004wz-Ao; Thu, 23 Sep 2021 12:07:04 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 193844.345400; Thu, 23 Sep 2021 12:07:04 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNVI-0004ws-65; Thu, 23 Sep 2021 12:07:04 +0000 Received: by outflank-mailman (input) for mailman id 193844; Thu, 23 Sep 2021 12:07:02 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNV9-0006xV-TT for xen-devel@lists.xenproject.org; Thu, 23 Sep 2021 12:06:55 +0000 Received: from EUR01-VE1-obe.outbound.protection.outlook.com (unknown [40.107.14.84]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 730b2713-1c66-11ec-ba2e-12813bfff9fa; Thu, 23 Sep 2021 12:04:50 +0000 (UTC) Received: from DB6PR0301CA0054.eurprd03.prod.outlook.com (2603:10a6:4:54::22) by AM6PR08MB4933.eurprd08.prod.outlook.com (2603:10a6:20b:e9::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13; Thu, 23 Sep 2021 12:04:48 +0000 Received: from DB5EUR03FT062.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:54:cafe::53) by DB6PR0301CA0054.outlook.office365.com (2603:10a6:4:54::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:48 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT062.mail.protection.outlook.com (10.152.20.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:48 +0000 Received: ("Tessian outbound 78bf72cc015a:v103"); Thu, 23 Sep 2021 12:04:48 +0000 Received: from 4960b0822148.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 71862B50-7BB2-490E-89DE-0DCDD0B4EB35.1; Thu, 23 Sep 2021 12:04:36 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 4960b0822148.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 23 Sep 2021 12:04:36 +0000 Received: from AM5PR0201CA0013.eurprd02.prod.outlook.com (2603:10a6:203:3d::23) by AM9PR08MB6981.eurprd08.prod.outlook.com (2603:10a6:20b:414::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.15; Thu, 23 Sep 2021 12:04:35 +0000 Received: from VE1EUR03FT047.eop-EUR03.prod.protection.outlook.com (2603:10a6:203:3d:cafe::65) by AM5PR0201CA0013.outlook.office365.com (2603:10a6:203:3d::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:35 +0000 Received: from nebula.arm.com (40.67.248.234) by VE1EUR03FT047.mail.protection.outlook.com (10.152.19.218) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:35 +0000 Received: from AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2308.14; Thu, 23 Sep 2021 12:04:27 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Thu, 23 Sep 2021 12:04:25 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Thu, 23 Sep 2021 12:04:24 +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: 730b2713-1c66-11ec-ba2e-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OBYQYm/pE+7ohJdCVC0uw11MJGdKCfmbO+hBvil1Eag=; b=rpVqVyZuBO29kZXODsd/4sEt5FNEPeNP7JyqAfWjH5etVBcQEETNMAU8HD/RYZpGY7wvhw3YlQoR/kaSucJvBdg0hyFGwzL3piATEu3TaZD8h/N8jCxiDip4GiJtDiltOuIjVZ5imUnlZTve9rS/w3BCsgKP69z9wBhiiLTF664= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; X-CheckRecipientChecked: true X-CR-MTA-CID: 12b7cd9313eb12ab X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bxmzv4vZ3Wo/M+nyvaghH+LMqBD6Spae6W87H77piFdNmP8ojXeERFHHBbdEmkh2/IWi9W5744C70g0YwzMme+YjsSIUdzm9fQj0McB4Hy0Ob9nK3vkGqxpOP1s0rFKAzCKeZ0zuqIpILL/elNVaMEDpTrZ6vsjLtl+5C1/Hr+Gdd/xZqiW/GGl/9mB2DhRG2/ziJhIi275xbQpuDCZ1hz7B7OsPr+gQtpq44HJfhQUPy/Jj7fz4AWl1MloPrwwFBQbzG1sv9ajPmeTulZ2CZjDyiB6E+g2lX66fI0HKQq/YQ+6p1LrKuh22zvFo99od1A8ZhgfDxUZ7dxjP7V1ghw== 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; bh=OBYQYm/pE+7ohJdCVC0uw11MJGdKCfmbO+hBvil1Eag=; b=LhrpmwfiJ3xmDxN/rpfowx0FJexczaBxPSBA48XHWxa+YxWk3mR4C/+3Agj5+pSLZgU2xqQZhfvSW97sy46X+XHjwqEpFF3HLgHdrceiiDIHZLgYT1iB6DssrKHa1yheSSLHGcle+3fVEE7F/3YnXKaCDaa117QVFGeJ5kRzp9ww8IS63igxp9lIu96rtlhHblTjTuTaboqvcrZYAj8cqA9J8cIa5apuFadnrEJdZBJEqytOhyiEko/8/w1l/TtWPTdvtmVpUbv7mTwy+nxyV8QxwRQBwGKfoa6JhTE9FotS2OzKNln3wRHB0eHAFr8JXPtCm2weYT91Gt6LMpATYw== 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=OBYQYm/pE+7ohJdCVC0uw11MJGdKCfmbO+hBvil1Eag=; b=rpVqVyZuBO29kZXODsd/4sEt5FNEPeNP7JyqAfWjH5etVBcQEETNMAU8HD/RYZpGY7wvhw3YlQoR/kaSucJvBdg0hyFGwzL3piATEu3TaZD8h/N8jCxiDip4GiJtDiltOuIjVZ5imUnlZTve9rS/w3BCsgKP69z9wBhiiLTF664= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; From: Wei Chen To: , , , CC: Subject: [PATCH 35/37] xen/arm: use CONFIG_NUMA to gate node_online_map in smpboot Date: Thu, 23 Sep 2021 20:02:34 +0800 Message-ID: <20210923120236.3692135-36-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210923120236.3692135-1-wei.chen@arm.com> References: <20210923120236.3692135-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f3aa601d-397a-4a47-32d0-08d97e8a5747 X-MS-TrafficTypeDiagnostic: AM9PR08MB6981:|AM6PR08MB4933: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:3044;OLM:3044; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: XILAatikNKG7Jx3du5S+YJSwp8CjhV3EaCa8GKFjUis5U37Wrt/wISUM9pRQoQEntVvWtb1EMl8tlOvCoFQUx66cj9BJriKt4zlOUInwg8ETOyraEZISxUAVbtP47X26V+9qpjcbSYD8OOi14Oz9aOr87SbV3MP+iQCoRUodlZN6K78UiXAiGsTE7Uv/BFZiPbnWNLBdapL99m3gibErOcLAjm4kF1CIefnbnaU1TUC7t53dR+/GFlqb+r+rSU0V7SjZD1x0EEAurYyXDGtwo4eLQhLll7FsDyuwhmtZkwjBzG4CkSQD90y1IisIeA0dMbe+A4C5ZdaufBjcK10MEMjM1c3WDFeO4MinL3ROiatkzDlhA8yfV+dshiOV61Uu5fIjIVeaMwttc5sZUiAkVfVeNYaptdauD9TGToM8ZYHthHwu1zppjMhj88SeiqUtmqPbG7yeF5DEP9QognPk2T4j1uxYsZY5KLbf1s3ixyx5EfukPK7VA7bsaEAFfqyfzD047URW4XSm3+dvvbQOeoj0G2sdx017bx5lNdRChL4jOkv+JpbqIXU9vR7Abd+v3+LNH3ERbQs+RosxE11gTyFUEmdaCSA7YgvxKYx4cVcqfrqtycl9S5zoIBSIMSrJ+3GyRgxPL8PE+7zHnl+M+B/VqEMyeR1rSKYymrko8E1VZIvsuT6YUjmr7+nEmf/y2w6FlRre+kATbb95TFgzsLlOhlFGEFQIrhUR6lzPqDU= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(4636009)(46966006)(36840700001)(86362001)(110136005)(316002)(7696005)(81166007)(70206006)(70586007)(47076005)(36860700001)(82310400003)(8936002)(5660300002)(356005)(4744005)(186003)(2616005)(83380400001)(426003)(8676002)(26005)(4326008)(508600001)(336012)(44832011)(2906002)(6666004)(1076003)(36756003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR08MB6981 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT062.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: c7dfaaf2-46fe-46f3-cbc9-08d97e8a4f94 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yRwMWa8HdFxAD+5Ms7cLrYXBpn2By4Eqa269XVT96x5UL8Yv9TuUNIIc6l+Iq3MrHkJJzyqH3cdwDv40rw8rh8ceQGo1Rvo+HU2/xcTHIxqavTCr8RP1OKx9APjrqMMkz76P0MY8eqDjhwlwfSZ4tYBCMQ/sxRznHElFJpiC+9kJoFnQcAc0gzVGcJpnlG9TURI45LG74w3LTbSOnna0EwJtsTKq7r6k4cLxW4jVHtsNHs4Rh8Hgr3K2SdgzniyMkR/4wKHUKW2UlrmtSEdXLWrK5enNRqauVYtJpKZE873vFhBmGBBVMpR6WSvtLJ83ym1c+4BQKzAAd5KU0s0CVVgzxsI7+yvigigxMlZVrZIUN32zTtWJlGPT2Lh8p6zIDHc3F2YiwgX+lxe3oLyP+ZpU1oCrVjFA5LCmovbmfkQKnwOoXb73BgF79MJgkfwYpvZoDd2ilQbGarZz7MKqDX+AcrpPjGn9pDewzu8Q2iCkHUH7IY5/KYEkv2UgSNaYiOCSRwXzH27GtrH/q/SUia3tToX52JNyzhfLt5OXH+WuiThfpl9zmGmShd9aEevNN5sqwgL8d3B54M+JDTQ1nEcHuYfyfYRZ1IHw9dd/kIKRzHLGsc+1CBvNa67gzp2mxjqh2Se0Fcq5WgB2CAofItuKaZR5j75CrIm44L0JnOjmuQ4pms4844l4tOW2DXoaDi/NFq2Mmqu1b79XQam0Fw== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(4636009)(36840700001)(46966006)(81166007)(83380400001)(508600001)(8936002)(2616005)(5660300002)(70206006)(336012)(47076005)(36860700001)(70586007)(426003)(8676002)(110136005)(86362001)(4744005)(6666004)(44832011)(2906002)(36756003)(26005)(4326008)(186003)(316002)(82310400003)(7696005)(1076003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2021 12:04:48.4426 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f3aa601d-397a-4a47-32d0-08d97e8a5747 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: DB5EUR03FT062.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB4933 node_online_map in smpboot still need for Arm when NUMA is turn off by Kconfig. Signed-off-by: Wei Chen --- xen/arch/arm/smpboot.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c index 6e3cc8d3cc..216c8144b4 100644 --- a/xen/arch/arm/smpboot.c +++ b/xen/arch/arm/smpboot.c @@ -46,8 +46,10 @@ struct cpuinfo_arm cpu_data[NR_CPUS]; /* CPU logical map: map xen cpuid to an MPIDR */ register_t __cpu_logical_map[NR_CPUS] = { [0 ... NR_CPUS-1] = MPIDR_INVALID }; +#ifndef CONFIG_NUMA /* Fake one node for now. See also include/asm-arm/numa.h */ nodemask_t __read_mostly node_online_map = { { [0] = 1UL } }; +#endif /* Xen stack for bringing up the first CPU. */ static unsigned char __initdata cpu0_boot_stack[STACK_SIZE] From patchwork Thu Sep 23 12:02:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 12512665 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8C97DC433EF for ; Thu, 23 Sep 2021 12:18:04 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 3E5F761216 for ; Thu, 23 Sep 2021 12:18:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3E5F761216 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.193997.345686 (Exim 4.92) (envelope-from ) id 1mTNfn-0003Gj-Gt; Thu, 23 Sep 2021 12:17:55 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 193997.345686; Thu, 23 Sep 2021 12:17: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 1mTNfn-0003Fe-79; Thu, 23 Sep 2021 12:17:55 +0000 Received: by outflank-mailman (input) for mailman id 193997; Thu, 23 Sep 2021 12:17:53 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNWx-0005KP-8f for xen-devel@lists.xenproject.org; Thu, 23 Sep 2021 12:08:47 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (unknown [2a01:111:f400:7d00::62a]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id bee594a9-9cb3-4904-b90c-9dc8498d15a9; Thu, 23 Sep 2021 12:05:05 +0000 (UTC) Received: from PR3P251CA0016.EURP251.PROD.OUTLOOK.COM (2603:10a6:102:b5::8) by PAXPR08MB7296.eurprd08.prod.outlook.com (2603:10a6:102:217::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13; Thu, 23 Sep 2021 12:05:03 +0000 Received: from VE1EUR03FT031.eop-EUR03.prod.protection.outlook.com (2603:10a6:102:b5:cafe::d4) by PR3P251CA0016.outlook.office365.com (2603:10a6:102:b5::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:05:03 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT031.mail.protection.outlook.com (10.152.18.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:05:02 +0000 Received: ("Tessian outbound 78bf72cc015a:v103"); Thu, 23 Sep 2021 12:05:01 +0000 Received: from 6b4712ded5e1.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id EBBC38B5-AEE2-4B0F-B1F1-0EBEA0BA195B.1; Thu, 23 Sep 2021 12:04:44 +0000 Received: from EUR02-VE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 6b4712ded5e1.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 23 Sep 2021 12:04:44 +0000 Received: from AM6P193CA0139.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:85::44) by PA4PR08MB6046.eurprd08.prod.outlook.com (2603:10a6:102:e4::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.15; Thu, 23 Sep 2021 12:04:42 +0000 Received: from VE1EUR03FT058.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:85:cafe::a9) by AM6P193CA0139.outlook.office365.com (2603:10a6:209:85::44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:42 +0000 Received: from nebula.arm.com (40.67.248.234) by VE1EUR03FT058.mail.protection.outlook.com (10.152.19.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:42 +0000 Received: from AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2308.14; Thu, 23 Sep 2021 12:04:29 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Thu, 23 Sep 2021 12:04:27 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Thu, 23 Sep 2021 12:04: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: bee594a9-9cb3-4904-b90c-9dc8498d15a9 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=m+rO+v6pBMqEKBz+SCDWANix+90+cnJn/n9KVtjiQo0=; b=2MOS5p1UyWvqnIuwlV79Ydp9CxmTOibh2arjPKx5k/B7ue5keJEiQeB6Mp9sKOWGSPR5Ac3WMem77r0WxY67YCUwTIrueh4DeN9yXgYCZB0Q2WOg0/X8ASZyU1AV773Hnf8XwHhWlQxSG4IZcB1ryoXAFgJsQt+R/kgJ8Nn+cO0= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; X-CheckRecipientChecked: true X-CR-MTA-CID: 9b7fb2e8a8847eb2 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=APOBonax8lrawm65/Zr9s2OdC15waGv8jn1G9Fpf94ySafllh3yw3fwYmZcucoFxoJeqpyWuOl0ln+4723I7aJWFUUIERxspuRw5S47tk1kAzUI3hqVy6zqv+YJNe7+ondutGUVpx+/SedaZi6gHfsOqCBtju0PuEdTrDTSYus+2zb+uZdM7MU0dzuj0ZNy1QI5FRe+QSDMvcbVPYRTd6AAZsCT1b0bxHsJwJPaS6Q1hBkaPcPtQ9ldaR0i8nD2hmH6TWSxHi7Xb0KeRbHvgZOESTC1WBYlWa18/LZh2wUdTtlauy+dYOFMF8xFluk0g7s2OP9dNswR1eyEf5Xsg4w== 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; bh=m+rO+v6pBMqEKBz+SCDWANix+90+cnJn/n9KVtjiQo0=; b=X4Ub9wlYfEAiyxgXGE6jEea0hMhLgm5UnB1WZw+gCRfl1XmkAZTVT8OgIbT8omuUtL24toBodBkxMYKhLr/c/ptsDY0btomrGIR55bjPIm87fbXam+QIxev/2o6OmsgFjFpSR2m3h7FIkEu2ODAoAMUsSymzFeb9h9rAzeIrjzWa130/3yR1D5Hw1bxOQPD17Kt/AFnteG1qDViA7AWQ7qNZIYfFgi2mebqZ/RNNUMY2+zE0dJaGH7DYG9VdcCIRPuRgX45JSU5OYo3Ruf9tmabi4h9WOY3+tryV2qnw2X6o0ziZoNIEDT3Zy1Nw3fLviiXjd9Hl9A7dsrOSpo7/ig== 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=m+rO+v6pBMqEKBz+SCDWANix+90+cnJn/n9KVtjiQo0=; b=2MOS5p1UyWvqnIuwlV79Ydp9CxmTOibh2arjPKx5k/B7ue5keJEiQeB6Mp9sKOWGSPR5Ac3WMem77r0WxY67YCUwTIrueh4DeN9yXgYCZB0Q2WOg0/X8ASZyU1AV773Hnf8XwHhWlQxSG4IZcB1ryoXAFgJsQt+R/kgJ8Nn+cO0= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; From: Wei Chen To: , , , CC: Subject: [PATCH 36/37] xen/arm: Provide Kconfig options for Arm to enable NUMA Date: Thu, 23 Sep 2021 20:02:35 +0800 Message-ID: <20210923120236.3692135-37-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210923120236.3692135-1-wei.chen@arm.com> References: <20210923120236.3692135-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2e9168a5-217d-4c96-fd69-08d97e8a5ff7 X-MS-TrafficTypeDiagnostic: PA4PR08MB6046:|PAXPR08MB7296: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:6108;OLM:6108; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: FWyQ/diQKU/Q8pt8an7uk40O23+6zpoDoIHpzG9wgrk26CgfBxnbGcBgpgdltepkMRpuHgRRfky7V3GF9qV8jZtWTXJJ4wsGbTITKx4g4gFtXAkJnJKWqSyGkjtHTdhI//Se9xaC4pDmRJBzyfww+iJgt6tqJ8HzZT7AowVIc7ZgX9hIJh/tDemF1z3jQFGcNgDV4KxxVFyU0wdpFK82Kr7ZE6FUo3Y0V6Iv4HqhHq4HWPo0i61HC/Y4+Mg9o+pUbNn7ToYTLrk2sse4rPsm2JClWzdlFuMvth57fqbxrb9tcos99nlZElOowfwUewiGHfDtXbkmeLnnHPtWS+k+IREs81O2mGSxczVcNfgzB3kwjf56hNZb7N/K4XxQXonX31A+mXJ5Rzw5Iqya0iXIAqzLqi5txLB2Ufl3Hg2W5ufmmY/0yMYbiXteM+fxqjR8ReAJO/Ld6ACEtWNGcICr8JlKl6ogKCojocG/cvCubcisZ78gjiYWTNDbqOsK9jcPvgw+3f/8Vh45o0atx7+zpIv1hQogRXh/2sAJQkQyj1JSNRcDpPyxL7RVLfPir5jDWtjpstYmeVwpDdXNn+yPaiXJO7yKpNnbEv17DDRQfTpw0J5u6YF4lATQQvODGX0pkiVjWLrvdPft2s5WhQt56ioyMfxkg183jYSO3YRhTHASv0Mw0a3s2AyKaYX7lsGsdEuJ+MzTNp7TYzU7bIEu6exNqk4ZDjgOmivkDc4MbrE= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(4636009)(36840700001)(46966006)(186003)(36756003)(4326008)(26005)(8676002)(7696005)(6666004)(82310400003)(44832011)(426003)(2906002)(336012)(83380400001)(86362001)(508600001)(81166007)(1076003)(5660300002)(70586007)(2616005)(36860700001)(8936002)(316002)(70206006)(356005)(47076005)(110136005)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB6046 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT031.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 7561502b-0e89-4ab2-bb09-08d97e8a53b6 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5sHuN9u5bXOmyvJOyj/s0kEhsUsin2fcEWhDSP6nbkmfCsLFJqlNqCPJ9bKGhZq23oWyEyUJjmli3u5/B7pgn+PmY8jf7ylkDVRb7SueK7La/y8lId3P5hTpkKwV7NumhD+SFJfxbXPz+jnIYc8i/iCJUPxf1fXY5SCiouxhQfCeXnyqaP9cO4mhPMJJWQiF7meG+aRFIxRwBY+mH2FIrMT5FMt3/rWNd4h0rileNLeldgFV629sYAKht1QR1oBHKQr94Sy0xLStx/UM5stgnRI8yNiAjCYFN682dVL8uUXWXVUKt2ZJrRJgJoG/+O5wjp8VkvF1UOxkeh9UCAZnDhS2S4PR7IWLJSTfLN1z7ngR1/HWAc8jI/6S14X6+NpIQV3gMpGprWD9BN8Tw4BZPs2XG6nhXL2dZZyWSbctRuav7bR9c7zVSBZy/YOxIEb6RZifQ/BufDhwaL8nx+TnRJoryv6boP8pklBP+6mKBqtNVjD8nBlRF6TfxIUwK3fqu921I580K/r9/FJLOMwwSggAf4Wnf5iYIUj78GXd4v/5cr2AMxIaLyBcA9ywdx29CvI8i3e7/Ha0iYwjzVvmLm1/4nytbw6StGDGHICFinmGj+JQK6o6cqTxHXFCKRJxkyrah4faHyNxWUHBbL1tQ3W5STY+vt9z96THr2rshkaVSUWewBAJM2NZcunEYmFeGRNCshI+MUndoreHqecXYw== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(4636009)(46966006)(36840700001)(1076003)(36756003)(2906002)(83380400001)(26005)(7696005)(6666004)(36860700001)(2616005)(316002)(81166007)(336012)(44832011)(70586007)(8676002)(47076005)(82310400003)(86362001)(426003)(508600001)(186003)(5660300002)(4326008)(70206006)(8936002)(110136005);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2021 12:05:02.9250 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2e9168a5-217d-4c96-fd69-08d97e8a5ff7 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: VE1EUR03FT031.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB7296 Arm platforms support both ACPI and device tree. We don't want users to select device tree NUMA or ACPI NUMA manually. We hope usrs can just enable NUMA for Arm, and device tree NUMA and ACPI NUMA can be selected depends on device tree feature and ACPI feature status automatically. In this case, these two kinds of NUMA support code can be co-exist in one Xen binary. Xen can check feature flags to decide using device tree or ACPI as NUMA based firmware. So in this patch, we introduce a generic option: CONFIG_ARM_NUMA for user to enable NUMA for Arm. And one CONFIG_DEVICE_TREE_NUMA option for ARM_NUMA to select when HAS_DEVICE_TREE option is enabled. Once when ACPI NUMA for Arm is supported, ACPI_NUMA can be selected here too. Signed-off-by: Wei Chen --- xen/arch/arm/Kconfig | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig index 865ad83a89..ded94ebd37 100644 --- a/xen/arch/arm/Kconfig +++ b/xen/arch/arm/Kconfig @@ -34,6 +34,17 @@ config ACPI Advanced Configuration and Power Interface (ACPI) support for Xen is an alternative to device tree on ARM64. + config DEVICE_TREE_NUMA + def_bool n + select NUMA + +config ARM_NUMA + bool "Arm NUMA (Non-Uniform Memory Access) Support (UNSUPPORTED)" if UNSUPPORTED + select DEVICE_TREE_NUMA if HAS_DEVICE_TREE + ---help--- + + Enable Non-Uniform Memory Access (NUMA) for Arm architecutres + config GICV3 bool "GICv3 driver" depends on ARM_64 && !NEW_VGIC From patchwork Thu Sep 23 12:02:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 12512649 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E1F94C433F5 for ; Thu, 23 Sep 2021 12:17:43 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 9B4BC610A0 for ; Thu, 23 Sep 2021 12:17:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 9B4BC610A0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.193970.345598 (Exim 4.92) (envelope-from ) id 1mTNfS-0008I6-Us; Thu, 23 Sep 2021 12:17:34 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 193970.345598; Thu, 23 Sep 2021 12:17:34 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNfS-0008Hv-QZ; Thu, 23 Sep 2021 12:17:34 +0000 Received: by outflank-mailman (input) for mailman id 193970; Thu, 23 Sep 2021 12:17:34 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mTNX2-0005KP-8o for xen-devel@lists.xenproject.org; Thu, 23 Sep 2021 12:08:52 +0000 Received: from EUR02-HE1-obe.outbound.protection.outlook.com (unknown [40.107.1.44]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 8ca9c1d0-3899-468a-8635-c1a380dc1cd1; Thu, 23 Sep 2021 12:05:06 +0000 (UTC) Received: from AS8PR04CA0205.eurprd04.prod.outlook.com (2603:10a6:20b:2f3::30) by VE1PR08MB4990.eurprd08.prod.outlook.com (2603:10a6:803:112::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.15; Thu, 23 Sep 2021 12:05:04 +0000 Received: from AM5EUR03FT041.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:2f3:cafe::63) by AS8PR04CA0205.outlook.office365.com (2603:10a6:20b:2f3::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:05:04 +0000 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT041.mail.protection.outlook.com (10.152.17.186) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:05:04 +0000 Received: ("Tessian outbound a77cafe56b47:v103"); Thu, 23 Sep 2021 12:05:02 +0000 Received: from 03d3309475cf.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id D43E9940-4716-47EF-8348-3EBC63C515C1.1; Thu, 23 Sep 2021 12:04:50 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 03d3309475cf.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 23 Sep 2021 12:04:50 +0000 Received: from AM6P191CA0085.EURP191.PROD.OUTLOOK.COM (2603:10a6:209:8a::26) by PA4PR08MB6256.eurprd08.prod.outlook.com (2603:10a6:102:e6::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.15; Thu, 23 Sep 2021 12:04:48 +0000 Received: from AM5EUR03FT013.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:8a:cafe::b7) by AM6P191CA0085.outlook.office365.com (2603:10a6:209:8a::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:48 +0000 Received: from nebula.arm.com (40.67.248.234) by AM5EUR03FT013.mail.protection.outlook.com (10.152.16.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 12:04:47 +0000 Received: from AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2308.14; Thu, 23 Sep 2021 12:04:31 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Thu, 23 Sep 2021 12:04:30 +0000 Received: from ais-wip-ds.shanghai.arm.com (10.169.190.87) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2308.14 via Frontend Transport; Thu, 23 Sep 2021 12:04: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: 8ca9c1d0-3899-468a-8635-c1a380dc1cd1 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=ZVsq3Ppcw/iW83lpjuNFJbIFMRjYaGc0rT7Th+1FJeA=; b=ixk63QG1kWaz3bXLoDY6betbAhNtXdNLlRX8sE+M9juzzsGlDDuSpdyzEo+xnZ0JCI3La2xh2f/rPNvAxE7xMdodMKxpsfbkxbpmKTlxeqlvQqaXE/Y7HOLCcd7xD1tfUfhpd61EibdBWbAgvc+rAg6xFWYXghenk6ev5nhMvbA= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; X-CheckRecipientChecked: true X-CR-MTA-CID: 302f1b9d54d65633 X-CR-MTA-TID: 64aa7808 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SGA3SDr9uzmdia9ASGcsVX8tnaq00WIBwuTPkwakvbClze7wp2Dnq1d4mXMQWU3HBuht7AP+YNnkSIDzlqjneR9xyR44C1y885p3XMy2mB5fCxMhGKHe8oqne+68MqjhbBdiLfADaGIzrFcMIaw48WAvzJ3zPQqFbMHOqPO1M/OKG6Z4XhZHvEo32rIUmwYAS21tAg+KiWfcPmHw6MRw+8QONgyRlyaRj7zcwO8q28/XO7gwRQSR27oysHPKNEPPglJhVuIZss5e3E5VPZxGSFMIwGLf9VZiq8YHgcBOFX09RDtJKm7731vYojbvva3++X8TJENc34bg4HnNvNsEmw== 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; bh=ZVsq3Ppcw/iW83lpjuNFJbIFMRjYaGc0rT7Th+1FJeA=; b=b0108p3kECqYWhgw93J6e9EZ0DzYyKmhK5+qUjh7bCd/42AzpvyHwo/hInENPtwZoAKBxI6QmoXJPiwBIE2pBZbKe3v/OEaaymn0qoePTxXXZCiSvyjJYcm12I2fVcce78TdP03oahI/36hgMheHHJ6fRQZ95mlPdaPKhzne8dt4MNxeLLyqb3zYBzZ5Kma8euE+eIIREKuWrwhxb3VKLQcxJnydyaaPsxuhX5bxfsaEYWDmKXNdYzLGAZyaIOMcmSln8ckNkqsO0t7XBJJn66/s1Qx8F71NHFrmqjZ5K6JgFiUqSE/A6AXlxehdldEASTSolrzCuYqhGE3nQvPS6Q== 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=ZVsq3Ppcw/iW83lpjuNFJbIFMRjYaGc0rT7Th+1FJeA=; b=ixk63QG1kWaz3bXLoDY6betbAhNtXdNLlRX8sE+M9juzzsGlDDuSpdyzEo+xnZ0JCI3La2xh2f/rPNvAxE7xMdodMKxpsfbkxbpmKTlxeqlvQqaXE/Y7HOLCcd7xD1tfUfhpd61EibdBWbAgvc+rAg6xFWYXghenk6ev5nhMvbA= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; From: Wei Chen To: , , , CC: Subject: [PATCH 37/37] docs: update numa command line to support Arm Date: Thu, 23 Sep 2021 20:02:36 +0800 Message-ID: <20210923120236.3692135-38-wei.chen@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210923120236.3692135-1-wei.chen@arm.com> References: <20210923120236.3692135-1-wei.chen@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 501d9ee5-7f18-417a-1e0e-08d97e8a6097 X-MS-TrafficTypeDiagnostic: PA4PR08MB6256:|VE1PR08MB4990: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:1923;OLM:1923; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: NyB0pYDfej+Hc1Jtckj9ywjtSegCo4lZBbn+mZQNDgGZviVn3Q+lufG0cJwVJHXjCrlcz1Lq5qTUHGBgzqcnA/OcjcIGe9dNMfC86pxlcV6crfDIiXoFFwxZjJ9I9uumGvzwf4cBFdHQbf7F+tFg1YcafnPibU0ElWC4LNhzTkQvDGP6m39N/0e1V4WVbmHMvSL3i+LpJhlxe+BleVeYj8/98UrTStJTZsbKKE19Z8rUMlyyl7/zBaTjsserkeMvdsYIjHL1ZFUyIxuzedrLfZYEyI0OMkYKVHpgExmN2YWZ92yxoDpnmDb0tnymBwI2/xmxNdAtg7oQG8t43TjzeOQb1xdNHbJ7BW2e5QdeHA7f1q/xklf9nlhuawOFs6ocVH6BuJcp1cZl7uE+kFUl7Eom6/zyPG8ov0qeAQ42VOtwP0ssK+tSZWmZtx8UOAALRpHvluBhUxts0Fs6k/mXvH9X0C1BnTHvhvO4eVJ/2M5LPEeaycGksvL/mbYmP7W/vYWiXzO2XfzviphjjZPv0dytdyj7dWS9p9DE8vMGmDRzy818mudNHwS33/wMPI0aIB2QvJkQOFBq5bWODvA2CeSkjY/13oG1HqpjYZWFOXgrWK9wuvD7t5VvlkI1ifTJ5/Vv0AfMNse63Ln6xVbqXPeJoAIBn5FbBZhge1MvY+ktYRaqxCxjrwoql0ozr0x44IXcc2tHMBUmS/B8AQ+J8+DDX8FjLkJrcxtr/+gqvSU= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(4636009)(36840700001)(46966006)(81166007)(1076003)(70586007)(5660300002)(2906002)(86362001)(508600001)(356005)(47076005)(70206006)(110136005)(36860700001)(316002)(2616005)(8936002)(83380400001)(7696005)(8676002)(26005)(186003)(36756003)(6666004)(4744005)(336012)(426003)(82310400003)(4326008)(44832011)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB6256 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT041.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: a893dde5-7dbb-4cc5-1bd6-08d97e8a56d4 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xmnnYWr0A8FOmDIH440d/ddiZ1AcHHKqkoxL4qWI5Ax5req0SAefWu7+psjJIvWDkgaN7B9k0kajYDY8t/H+P3s+dTdQDBzMEq0PROM9IuHU35/GiheScg1htyE9B7BcpvkjeIxzT1FPY82eHWwhE6/adBee241R0XAPtTTHbeEZYsNQUDvLiJ7TtlN1tfIKTO8FLtoSYpin72SimSWYdwpRI7/dUut31fb9mqpOJU4mSWi96mIAQ9PaETu8SsG64IiiqzlZr3OAbc5q2J8xdhf8Cu2F09o5d3QA+fV/NpMJj+tXh/a2eG6w2aLiXsJy0CQGnLCMDz+yntumzgQkqSvyFuo/2XIB9Ra45MOr3huaMbVxaAFjl745Eqm2/t00xzY97MgUkvmytT3uOp+QLNn6SaqsCdL/Bt7s476UWaM4YecCxJybG+9rFuqED4VqShzjudNYWpszO837hfeVoAqIdjm8rnVts166Ik3uQuEKbd7qTW8QlGrblqgHftNewz9bKTiquKwVWHQpEyCi7RmnKQ0zJcywhEAcjUgjvlOWgf9DI8Gnt57rDj+eCyOQetag7LT5Vixsb4NVzLH28IjbzaMvl884ITDUU+LALPzXsuH4FjahDh6B+8pgDML+NUFDIFmfxqg44lr/3fIDFizFQHvLywJ0iD3Vt0Su3Cp+jpnTMmzmJNlPqNEe850dGsbkFhx/qtYuGg4F8/GGvQ== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(4636009)(46966006)(36840700001)(4326008)(508600001)(83380400001)(2616005)(186003)(26005)(426003)(8676002)(6666004)(44832011)(2906002)(36756003)(1076003)(336012)(70206006)(70586007)(7696005)(86362001)(110136005)(316002)(81166007)(8936002)(5660300002)(4744005)(47076005)(82310400003)(36860700001);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2021 12:05:04.0124 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 501d9ee5-7f18-417a-1e0e-08d97e8a6097 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: AM5EUR03FT041.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB4990 Current numa command in documentation is x86 only. Remove x86 from numa command's arch limitation in this patch. Signed-off-by: Wei Chen --- docs/misc/xen-command-line.pandoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc index 177e656f12..4f3f24eb9d 100644 --- a/docs/misc/xen-command-line.pandoc +++ b/docs/misc/xen-command-line.pandoc @@ -1785,7 +1785,7 @@ i.e. a limit on the number of guests it is possible to start each having assigned a device sharing a common interrupt line. Accepts values between 1 and 255. -### numa (x86) +### numa > `= on | off | fake= | noacpi` > Default: `on`