From patchwork Tue Aug 8 10:47:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 13345960 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5D598C001DF for ; Tue, 8 Aug 2023 10:48:24 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.579613.907664 (Exim 4.92) (envelope-from ) id 1qTKFz-0001Ws-To; Tue, 08 Aug 2023 10:48:07 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 579613.907664; Tue, 08 Aug 2023 10:48:07 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qTKFz-0001Wl-R3; Tue, 08 Aug 2023 10:48:07 +0000 Received: by outflank-mailman (input) for mailman id 579613; Tue, 08 Aug 2023 10:48:06 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qTKFy-0001We-15 for xen-devel@lists.xenproject.org; Tue, 08 Aug 2023 10:48:06 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on20606.outbound.protection.outlook.com [2a01:111:f400:7e1b::606]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 0d7872f2-35d9-11ee-b280-6b7b168915f2; Tue, 08 Aug 2023 12:48:04 +0200 (CEST) Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23) by VI1PR04MB9979.eurprd04.prod.outlook.com (2603:10a6:800:1da::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.27; Tue, 8 Aug 2023 10:48:01 +0000 Received: from DU2PR04MB8790.eurprd04.prod.outlook.com ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6652.025; Tue, 8 Aug 2023 10:48:01 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 0d7872f2-35d9-11ee-b280-6b7b168915f2 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lg4eshNPK0BogUBqtukGSJpyZVE37nMdSp+E4hZ1ygQdDDEo+JSh8kVrPxU7hrgGX+l7aj8V8nLKZW6vsCE/26lA/crjNTSSa9rNQzB17wPFuUAR2HwlS9lIG42I0/Ab8RPIrw7RL4TNyocvrM264B1R1iZZS4i22Bbk2Q0pDymbGUBZNGLZoobCYozMRfGqx2tFHUkgTykaAs5eM81VutbffAKky7jNzhVGaKJjH/P+Cg8wPtRzO8g6lOdfnR1V49EvMcDVy1/Sp5vGcieI7hDQrWxwulFxwdV08vBpl/LSckNVX/kPQVUubvb36+TNWMmIRguIX9PzG2KKnWk7lQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=fcYszhiG3WDt8qVSsB1WgPxqNNs02w+HO3DLk2/wK20=; b=b7pbgCuUuLmBxDLP6dOT4Rnx3n0GMDvuZQIR+YqUi9t6ePzJuEmiR9LK14cq6Xf54VpBuftuemtzcZb1+RgpJvtubIYYRpJL2Tjyz1m9tM5bHv38eWxuqlI+PKT1m73z4b+7jVXOEalKfMl3uMJW/3i1W/nLm8m8uOPIeOB9UnIIj93q12ZT+ZrgJxfX4GhvpEeVdptuou7Kjoh7odtXpwchqZFwceYDXRNgOU9mcCcLg/sfcPxis8JClN7T17gPVV8f+1yYw59QIQUwpbONJzpPGEQTuPDlUBEutCZyqV8lv4Me1pE10SwJevdmKZW5k/D7P1Grlqo4On2AYLrmVA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fcYszhiG3WDt8qVSsB1WgPxqNNs02w+HO3DLk2/wK20=; b=311mBnHFR9oaMpqbVulG46Yzq8hLIHR2G9xnh5FLWmXLINAjf4vdkMk1gNIE2FZ74I82C39svkXkAAOFcXF2397GhbrlxCqywjAz9vOAmRfmebXnPFCiRn8AVBqkYesiuXNcG9ivCrE+JnqNvKOOwe40lNkMiRBqIghETELAJq4CGu3yZC7erEZF0S6Hb8Ee9rey4fxTpu9RFUGMdDZrVCRGRPqIWQvOnJGzav3UUx92dteq7DX6LxcJ5Rj5RP9AezqsZExHpl4gQhlVKc/y5U9kxclJYBCduW1dqUMBIY+WsMPYqBD/+eqJXu3tEAkqvK9bxDLmcinwJ7Osiz2gDA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Message-ID: Date: Tue, 8 Aug 2023 12:47:58 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 Content-Language: en-US To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , George Dunlap , Julien Grall , Stefano Stabellini , Wei Liu , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Bertrand Marquis , Volodymyr Babchuk , Shawn Anastasio From: Jan Beulich Subject: [PATCH] move max_page and total_pages to common code X-ClientProxiedBy: FR2P281CA0185.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:9f::18) To DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|VI1PR04MB9979:EE_ X-MS-Office365-Filtering-Correlation-Id: f1faa532-c1ce-4350-abf2-08db97fcef9b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LMHTQSs9uOy0LRrx142NjDh3RtarZxrOVUYaqrdLQax+dy+E4vsFturAPSEtfjAWsKJVUNlBodq6sDru7MAkfZiwmak8wAS2byzMATg+RV5J+1TiNnHuOL7NhtBkLwI0AnmVyd3vdzQsUHwOP/KiaUs9u802NOodTFVfVGhr6K7NjDvVniEZGaQ+pupG+Rp73TTSCcQsjKodIDOynXGrw4UtpQVPF8E+CFmjV9UsOtpvU2wN3SASY0AD3GlgR+YxqLFKKU848etKuGNwJtmlv5OwTA84Z7gcHuux0lBxHsZ5R1vZZhkqk2hpuBW2GH9f9xyCLvnmBbE+OOg1thbdz+SSaNoySnEuDeKuDEOwdgbovHhOBTf13z3NiuV7CuO/t2brM2zYTex4TBdVJkvbSDJpxpLWUYfHTGnYg4N8tcqRZk8tWTE9iiMjFE8Q+v09ELJ0xMt91oddALf5Vkc55z+UfQ+HlksxH79zseV04Krmq99XUmkNCW3izM0M9dAdpVguCQesY9fBNVyF6phh+OPbRRMhJxC5w4oJ4BANJxWLAwptIyQQ9wE/wN4mTeEXJl6e3jkYV4eomJraZPPh8spS+iMnS+4SnUJ8RQoYvXeS2mfVyN4Y5tz0xa8wvAv6pHQ2y2Zu4YdO3YF+r51gkbQk+4/EzFk5jpyPTvqyKCuCxyK6PXMY63i66JS+U882gPjq3cO6y1DWfjKGqJp8tA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(39860400002)(366004)(376002)(346002)(136003)(451199021)(186006)(1800799003)(7416002)(8936002)(8676002)(5660300002)(6916009)(4326008)(41300700001)(316002)(86362001)(31696002)(2906002)(6486002)(6512007)(6666004)(2616005)(26005)(6506007)(36756003)(66476007)(66556008)(66946007)(478600001)(31686004)(54906003)(38100700002)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?2tSGEPtLW8zVdZ9LoI260eZVPbLa?= =?utf-8?q?sAf1unO3XYMiR4ovclSefPlSB48S0+XED5s7mT2wCNG4UqUH9r/m4yAzxETGQnTEA?= =?utf-8?q?3mpvEgHvZFR9GF8jmYx2HBEdyLxR8bqdxD98CwbrBjs2tm1uZw4ELJFnKYBQ/J0BI?= =?utf-8?q?THt8q284nrP6SWk0e2QUIiy3axZ0qkh8toac/EUp0Q5WtN12zlx5s4s3IfYLkgJ81?= =?utf-8?q?/Uqh/6AzmrjidynozIb6WWjhWTOVj6DczJi3pZ8orJ52WyEFMJhssBqK7/SAdkWaL?= =?utf-8?q?YIcHHiBGtNgd5F1x6N4NdK6Q7tZb6LWuy5XUUWaO4vY0sEh/a8vhVsoMlAitkRG0J?= =?utf-8?q?cmj2h7y/v7k3ttLRqTWvLV8FtnCeil1NAzySTvG2eGVm7Bkm0Y098ZJ1/t855m985?= =?utf-8?q?20QhouemOrSB7ro4gjBAv3p6gpig6PLLE/rlw6ABX8Drj3qvPl4ZLCIpKFDuHIlOO?= =?utf-8?q?KQ0TFJOTCLvRC4m+reDsKpKM1bQwVuubV6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WjGdpXLofRJJS8wKS23Q+?= =?utf-8?q?ZnblXF5xQV+yaACilVEFRft6ObdiOK9LccvX/A/rvGNEclIk+sYkUwYJMLbKDY7bP?= =?utf-8?q?I6URgEn4HH4K/ITDG9lvGxMvTTbt7ABCDpUwP88eZDwFnC5//r6x0cziEcfa5FMFF?= =?utf-8?q?pJYfjf0HlOUW?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: f1faa532-c1ce-4350-abf2-08db97fcef9b X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Aug 2023 10:48:01.1603 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: lKu3gs1Bl77CCe0P+LIKkY96SUGETL25tZROw0/B9AxDd3AaUNz4rpPIKv2gB92fwINDV3EA2Etqv8jVsKSQzg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB9979 Common code references both, so the variables shouldn't need declaring and defining by every arch. While moving the definitions, add __read_mostly (__ro_after_init would only be appropriate when !mem_hotplug). Signed-off-by: Jan Beulich Acked-by: Andrew Cooper Acked-by: Julien Grall --- a/xen/arch/arm/include/asm/mm.h +++ b/xen/arch/arm/include/asm/mm.h @@ -198,9 +198,6 @@ extern unsigned long directmap_base_pdx; /* PDX of the first page in the frame table. */ extern unsigned long frametable_base_pdx; -extern unsigned long max_page; -extern unsigned long total_pages; - #define PDX_GROUP_SHIFT SECOND_SHIFT /* Boot-time pagetable setup */ --- a/xen/arch/arm/mm.c +++ b/xen/arch/arm/mm.c @@ -134,9 +134,6 @@ unsigned long directmap_base_pdx __read_ unsigned long frametable_base_pdx __read_mostly; unsigned long frametable_virt_end __read_mostly; -unsigned long max_page; -unsigned long total_pages; - extern char __init_begin[], __init_end[]; /* Checking VA memory layout alignment. */ --- a/xen/arch/x86/include/asm/mm.h +++ b/xen/arch/x86/include/asm/mm.h @@ -337,8 +337,6 @@ struct page_info #define maddr_get_owner(ma) (page_get_owner(maddr_to_page((ma)))) #define frame_table ((struct page_info *)FRAMETABLE_VIRT_START) -extern unsigned long max_page; -extern unsigned long total_pages; void init_frametable(void); #define PDX_GROUP_SHIFT L2_PAGETABLE_SHIFT --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -146,10 +146,6 @@ l1_pgentry_t __section(".bss.page_aligne l1_pgentry_t __section(".bss.page_aligned") __aligned(PAGE_SIZE) l1_fixmap_x[L1_PAGETABLE_ENTRIES]; -/* Frame table size in pages. */ -unsigned long max_page; -unsigned long total_pages; - bool __read_mostly machine_to_phys_mapping_valid; struct rangeset *__read_mostly mmio_ro_ranges; --- a/xen/common/page_alloc.c +++ b/xen/common/page_alloc.c @@ -162,6 +162,8 @@ #define PGT_TYPE_INFO_INITIALIZER 0 #endif +unsigned long __read_mostly max_page; +unsigned long __read_mostly total_pages; paddr_t __ro_after_init mem_hotplug; /* --- a/xen/include/xen/mm.h +++ b/xen/include/xen/mm.h @@ -159,6 +159,8 @@ int assign_page( /* Dump info to serial console */ void arch_dump_shared_mem_info(void); +extern unsigned long max_page; +extern unsigned long total_pages; extern paddr_t mem_hotplug; /*