aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2009-07-26 06:31:15 +0000
committerBlue Swirl <blauwirbel@gmail.com>2009-07-26 06:31:15 +0000
commita7b022e083a1ef03a72b8c5bd253a3c66cc4214a (patch)
tree56395ee6ab53077acb0a93edf591fcae0b2986ea /hw
parentaea867478ccfec4b7070d6b9ec11bd25de56625e (diff)
downloadqemu-a7b022e083a1ef03a72b8c5bd253a3c66cc4214a.zip
qemu-a7b022e083a1ef03a72b8c5bd253a3c66cc4214a.tar.gz
qemu-a7b022e083a1ef03a72b8c5bd253a3c66cc4214a.tar.bz2
PPC: Round VGA BIOS size to page boundary
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 <agraf@suse.de>
Diffstat (limited to 'hw')
-rw-r--r--hw/ppc_newworld.c4
-rw-r--r--hw/ppc_oldworld.c4
2 files changed, 8 insertions, 0 deletions
diff --git a/hw/ppc_newworld.c b/hw/ppc_newworld.c
index 4e5043c..1c512a2 100644
--- a/hw/ppc_newworld.c
+++ b/hw/ppc_newworld.c
@@ -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) {
diff --git a/hw/ppc_oldworld.c b/hw/ppc_oldworld.c
index b26e407..56b2876 100644
--- a/hw/ppc_oldworld.c
+++ b/hw/ppc_oldworld.c
@@ -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) {