]> Git Repo - qemu.git/commitdiff
PPC: Round VGA BIOS size to page boundary
authorAlexander Graf <[email protected]>
Sun, 26 Jul 2009 06:31:15 +0000 (06:31 +0000)
committerBlue Swirl <[email protected]>
Sun, 26 Jul 2009 06:31:15 +0000 (06:31 +0000)
When giving KVM a slot of a size not on page boundary, it chokes. So let's
just round up the VGA BIOS size so nobody complains anymore and we don't need
to implement sub-page slots.

Required for booting a PPC guest in KVM.

Signed-off-by: Alexander Graf <[email protected]>
hw/ppc_newworld.c
hw/ppc_oldworld.c

index 4e5043cd6d3f441303ddcbe8760253b0373b8ed7..1c512a241727766eb41e0874db864334c982bc3f 100644 (file)
@@ -179,6 +179,10 @@ static void ppc_core99_init (ram_addr_t ram_size,
         vga_bios_ptr[3] = 'V';
         cpu_to_be32w((uint32_t *)(vga_bios_ptr + 4), vga_bios_size);
         vga_bios_size += 8;
+
+        /* Round to page boundary */
+        vga_bios_size = (vga_bios_size + TARGET_PAGE_SIZE - 1) &
+            TARGET_PAGE_MASK;
     }
 
     if (linux_boot) {
index b26e407c83e728a93309634fccff032face054b6..56b287668439388e036ce7645fb47613103ff91a 100644 (file)
@@ -212,6 +212,10 @@ static void ppc_heathrow_init (ram_addr_t ram_size,
         vga_bios_ptr[3] = 'V';
         cpu_to_be32w((uint32_t *)(vga_bios_ptr + 4), vga_bios_size);
         vga_bios_size += 8;
+
+        /* Round to page boundary */
+        vga_bios_size = (vga_bios_size + TARGET_PAGE_SIZE - 1) &
+            TARGET_PAGE_MASK;
     }
 
     if (linux_boot) {
This page took 0.03047 seconds and 4 git commands to generate.