From patchwork Tue Dec 14 08:24:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 12675617 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 6415CC433F5 for ; Tue, 14 Dec 2021 08:24:43 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.246429.424974 (Exim 4.92) (envelope-from ) id 1mx36m-0003cH-7x; Tue, 14 Dec 2021 08:24:24 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 246429.424974; Tue, 14 Dec 2021 08:24:24 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mx36m-0003cA-4t; Tue, 14 Dec 2021 08:24:24 +0000 Received: by outflank-mailman (input) for mailman id 246429; Tue, 14 Dec 2021 08:24:22 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mx36k-0003c4-I9 for xen-devel@lists.xenproject.org; Tue, 14 Dec 2021 08:24:22 +0000 Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [194.104.109.102]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 3c94ebbb-5cb7-11ec-85d3-df6b77346a89; Tue, 14 Dec 2021 09:24:21 +0100 (CET) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-am5eur02lp2057.outbound.protection.outlook.com [104.47.4.57]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id de-mta-31-ONdkV3cQO2CqBo63pGLUvw-1; Tue, 14 Dec 2021 09:24:19 +0100 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) by VI1PR04MB3118.eurprd04.prod.outlook.com (2603:10a6:802:a::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.17; Tue, 14 Dec 2021 08:24:18 +0000 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::5951:a489:1cf0:19fe]) by VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::5951:a489:1cf0:19fe%6]) with mapi id 15.20.4778.018; Tue, 14 Dec 2021 08:24: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: 3c94ebbb-5cb7-11ec-85d3-df6b77346a89 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1639470260; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tA3Ca+cdZ9g0cAmUaYfoMdLfNdpcUffa6dmArIzDPXg=; b=lnA/p7um4RraAlwObm09U0wb8P5pvSFS0jJ+Hx+E0yQXV/kXp/OvGDZ4tpk+QuE9gZCLkB CK2z69z7h7iiCHaVXpqjAe2KCV/aNZx43Ses9A1pXzEgdlvEQD3kvGrX14rxxZi6X//w6h n41EuwIYjVx84xl2AAKL4j5YPljW3GQ= X-MC-Unique: ONdkV3cQO2CqBo63pGLUvw-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JtEcz9NLhlZwNDqk/88G8OM+jAucnOU3EN9kW7JpAYiujiRANgRGE92ZUIe6hjvBmHk2hrYVuF8yN/0DBKQynT/j3bNnoSRstDdn1uz/ZSBKrixq5rDuwMQJc8zglY5e/5X4w4gOsALlMomd3EazLRxzbAB5uMAZQA56QBh+OviJVdA8Hq0ojRPdklPWbd/Hnf2Saor/9zEmfJ5MnrjRnvUFnMmn5uQMeWNDofhRbNIURmZFNmRSTirSRauh4bT5Vqos7FWwaonXra+cE1wV2swquwsvXdJvUI4Nj3JyvBF+lpwWZ/GWK455O0OE4+bI4xgaAaL6ftajl4KOQgnZFg== 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=tA3Ca+cdZ9g0cAmUaYfoMdLfNdpcUffa6dmArIzDPXg=; b=YpJ2uW03BygqdNQbcjM7tSFP1RWlx8ygQORlncGoi4/jtaSWcMmsxSkRKqGLZhuqqzalyGNwOoAwC2rKhw8x4Rn0tx3bkY1nw1TEUXKZiiasjFTx6IgUQ23IZqzUWwVXQtBmTf4bmk+F4lnroEVlZAxdZT9ceoyHpFrl0WJmsZLVInXkPJGjswxJxSjRoCOGr2sT1qVioptDsaNzEZh+d9VACTrBXPq71tre5At9SEbQa7OrvEdOdZf4bUAoKkPTOyjF9m49M17s8KHeDF+bSkLgaZb1DKqmC7tNoAnQ7g4cm0jCzLe263JvjkYIKNwr1nXXQoOf8whtakarJwTlBQ== 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 Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Message-ID: <35cc5395-f88e-f08a-cbaf-5938a508ff29@suse.com> Date: Tue, 14 Dec 2021 09:24:16 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 Content-Language: en-US To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , Wei Liu , =?utf-8?q?Roger_Pau_Monn=C3=A9?= From: Jan Beulich Subject: [PATCH] hvmloader: tidy pci_mem_{start,end} X-ClientProxiedBy: AS9PR05CA0050.eurprd05.prod.outlook.com (2603:10a6:20b:489::24) To VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3805d185-5212-4e6b-ff3b-08d9bedb1f00 X-MS-TrafficTypeDiagnostic: VI1PR04MB3118:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: o2T33qaVhW5s2Ee7fJ2o23U/G/XPXKjicDFki24wAl6nr+8BgK0Gyvayzc+EBYbHSXopAovAF7zALoqmCCcY4JsTdm7SRjUs6fI1aqblfTxdP48+Ehc13G5RhAaXZqwlywcogOqcaAf3IkZxTc08+Mm56Rgd34paC7Sxwrsnxr1xLWj//FHwmQ7CCu3hbQI/RflZVVzMoxv8cnHlvbDHLleBrZ9zS6chBEOex9EhG10sW/nlwP5prKXRurnpDgE7DZBzRD2cb5AOS/KQid/8jrt5s6xaMe9Kbw0jLIsvnTK+i896ycqTgwGpxCHvgRHCuKsk8wELdHmGGUiyKxN7C13qQLT754Z6B7pugBUcNJIuvjcNGYdAKR/DSq8mN9A72KeOgCy4sGsQ9y+TllxtUhKiMqukgg56yVXJRTyKDre2hUGghUr7733VoTuXCVOcR+JTsSyxfGqcp4H6w68icZlDDHXxXyU/Vt49nbjicrP83/QV6G92MUHHk0tL6/4QShlzK2LoGIBcphj6qjEHTfmcW/91e+mSQN/RjkuHiMix8Er+cA/B2v3m4nqeqATqefr1zjr3ps6PbH90PSn01HFGOsug2izM3vkxQnQVq2h4kFXNAfJLCWux7Hbtmqh7lnkIK8WyAHncHf8FQsRuKuMVXINL+G3wNopoFP1YKfKZkvPF5qNWRFK59lp5LsXS9kbtZedfh/iYtVevtgpYJDjQgXMKQGbSH73QsZSaBrmhvoTdFpLF7QADNdB7dUvs X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5600.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(316002)(54906003)(66556008)(26005)(31686004)(66476007)(186003)(66946007)(5660300002)(8936002)(4326008)(6916009)(8676002)(508600001)(6486002)(38100700002)(2616005)(36756003)(6506007)(2906002)(86362001)(31696002)(6512007)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?0YbFFzFqc/NBJyox3AzZhkX4TzQ+?= =?utf-8?q?a6s5ROCF21vbdhJtgjvgUKse7ZY95CvaUJ3uOiMmD3kcU5yUW1z1o/DrJdl3RCVYL?= =?utf-8?q?mMawsNQhMPuQbtyWq5H4KzEGzfERPuoJhBekAJ33GWJ1ssP0BObVmplXA8ZSu8kOJ?= =?utf-8?q?7ZP8KSm4zKINEuABSxY7opOK0UKBOM0+qtbuPwzvYxHj0P30p0gnX93YZgjlaT5XW?= =?utf-8?q?0lOkM6sxAQCTJ1eeTu+qubP440oOmn6r3PPJEcxBabvFzkT1JP/+YRKxNOjamnG68?= =?utf-8?q?lLdccZaJ+N1ZbtQuQnwcgXs5HpuLWKFopVp2dBI0vowDnRkrpzGeXQDreXMTVkj8k?= =?utf-8?q?xdKPIqRJSXQJxkFz/bFw9tbZMbGrjcg7kfZ2/TKxAGdtMW6Z9VV7XdbcSiYPWW4lc?= =?utf-8?q?bJaq27skgt4ptUgj172u2bK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1wd41nbXgS1ybg4dBPsknsw1mbKAhgNSw1kGEA+DUiBMInVaNaOlEJ?= =?utf-8?q?kFHQrDlor4IawMMcvtWnmZiaMffYdNA26cX34ixTU9O1D+qDZ/KmnBHFTQ0glhGI3?= =?utf-8?q?QCXGs6+Ixz3axPHgkcAjYlze5VamSAQhOJLBfMYZXwS3IvFcgC82Zu63V6JfoLIyP?= =?utf-8?q?waQN08KXtChATRWL9ujtpq+6RhjX7ffr+ZCNOkXlhKYZyAU8rK92EWlqrWnyhKQN4?= =?utf-8?q?5uTkt6BYpTgyIfuDqBe5Y/+cC2lurLOK4FPtFzuXAT0I2TYenns0+YI=3D?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3805d185-5212-4e6b-ff3b-08d9bedb1f00 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5600.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Dec 2021 08:24:17.8269 (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: KNJbJ80OI1iF8HiEQvCuzx0QSZYu3D4P0BIfzDSTKPFeKyxKHJCu01/pK9o/EBbf+vg0qjAaHCQgvSH3jaWl3g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB3118 For one at least pci_mem_start has to be precisely 32 bits wide, so use uint32_t for both. Otherwise expressions like "pci_mem_start <<= 1" won't have the intended effect (in their context). Further since its introduction pci_mem_end was never written to. Mark it const to make this explicit. Finally drop PCI_MEM_END: It is used just once and needlessly disconnected from the other constant (RESERVED_MEMBASE) it needs to match. Use RESERVED_MEMBASE as initializer of pci_mem_end instead. Signed-off-by: Jan Beulich Acked-by: Andrew Cooper --- a/tools/firmware/hvmloader/config.h +++ b/tools/firmware/hvmloader/config.h @@ -55,12 +55,10 @@ extern uint8_t ioapic_version; #define PCI_ISA_DEVFN 0x08 /* dev 1, fn 0 */ #define PCI_ISA_IRQ_MASK 0x0c20U /* ISA IRQs 5,10,11 are PCI connected */ -/* MMIO hole: Hardcoded defaults, which can be dynamically expanded. */ -#define PCI_MEM_END 0xfc000000 - #define ACPI_TIS_HDR_ADDRESS 0xFED40F00UL -extern unsigned long pci_mem_start, pci_mem_end; +extern uint32_t pci_mem_start; +extern const uint32_t pci_mem_end; extern uint64_t pci_hi_mem_start, pci_hi_mem_end; extern bool acpi_enabled; --- a/tools/firmware/hvmloader/pci.c +++ b/tools/firmware/hvmloader/pci.c @@ -29,8 +29,8 @@ #include #include -unsigned long pci_mem_start = HVM_BELOW_4G_MMIO_START; -unsigned long pci_mem_end = PCI_MEM_END; +uint32_t pci_mem_start = HVM_BELOW_4G_MMIO_START; +const uint32_t pci_mem_end = RESERVED_MEMBASE; uint64_t pci_hi_mem_start = 0, pci_hi_mem_end = 0; enum virtual_vga virtual_vga = VGA_none; @@ -329,7 +329,7 @@ void pci_setup(void) else { pci_mem_start = max_ram_below_4g; - printf("pci_mem_start=0x%lx (was 0x%x) for mmio_hole_size=%lu\n", + printf("pci_mem_start=0x%x (was 0x%x) for mmio_hole_size=0x%lx\n", pci_mem_start, HVM_BELOW_4G_MMIO_START, (long)mmio_hole_size); }