[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] hvmloader: tidy pci_mem_{start,end}


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 14 Dec 2021 09:24:16 +0100
  • 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
  • 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-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==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Tue, 14 Dec 2021 08:24:34 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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 <jbeulich@xxxxxxxx>

--- 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 <xen/hvm/hvm_xs_strings.h>
 #include <xen/hvm/e820.h>
 
-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);
         }




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.