Commit a7b022e083a1ef03a72b8c5bd253a3c66cc4214a

Authored by Alexander Graf
Committed by Blue Swirl
1 parent aea86747

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>
hw/ppc_newworld.c
... ... @@ -179,6 +179,10 @@ static void ppc_core99_init (ram_addr_t ram_size,
179 179 vga_bios_ptr[3] = 'V';
180 180 cpu_to_be32w((uint32_t *)(vga_bios_ptr + 4), vga_bios_size);
181 181 vga_bios_size += 8;
  182 +
  183 + /* Round to page boundary */
  184 + vga_bios_size = (vga_bios_size + TARGET_PAGE_SIZE - 1) &
  185 + TARGET_PAGE_MASK;
182 186 }
183 187  
184 188 if (linux_boot) {
... ...
hw/ppc_oldworld.c
... ... @@ -212,6 +212,10 @@ static void ppc_heathrow_init (ram_addr_t ram_size,
212 212 vga_bios_ptr[3] = 'V';
213 213 cpu_to_be32w((uint32_t *)(vga_bios_ptr + 4), vga_bios_size);
214 214 vga_bios_size += 8;
  215 +
  216 + /* Round to page boundary */
  217 + vga_bios_size = (vga_bios_size + TARGET_PAGE_SIZE - 1) &
  218 + TARGET_PAGE_MASK;
215 219 }
216 220  
217 221 if (linux_boot) {
... ...