mvadkert / rpms / qemu

Forked from rpms/qemu 6 years ago
Clone
af8c55b
From: Glauber Costa <glommer@redhat.com>
af8c55b
Subject: [PATCH] align vga rom to 4k boundary.
af8c55b
af8c55b
Instead of aligning to 2k boundary, as required by the bios,
af8c55b
align to 4k boundary, as required by kvm memory functions. Without
af8c55b
this patch, starting kvm with -vga std option fails with:
af8c55b
af8c55b
create_userspace_phys_mem: Invalid argument
af8c55b
kvm_cpu_register_physical_memory: failed
af8c55b
af8c55b
as described by: https://bugzilla.redhat.com/494376
af8c55b
af8c55b
It does not fail with cirrus vga, because it is naturally aligned.
af8c55b
This problem does not seem to affect upstream qemu.
af8c55b
af8c55b
Signed-off-by: Glauber Costa <glommer@redhat.com>
af8c55b
---
af8c55b
 qemu/hw/pc.c |    2 +-
af8c55b
 1 files changed, 1 insertions(+), 1 deletions(-)
af8c55b
af8c55b
diff --git a/qemu/hw/pc.c b/qemu/hw/pc.c
af8c55b
index cc84772..680d4a2 100644
af8c55b
--- a/qemu/hw/pc.c
af8c55b
+++ b/qemu/hw/pc.c
af8c55b
@@ -919,7 +919,7 @@ vga_bios_error:
af8c55b
             exit(1);
af8c55b
         }
af8c55b
 	/* Round up vga bios size to the next 2k boundary */
af8c55b
-	vga_bios_size = (vga_bios_size + 2047) & ~2047;
af8c55b
+	vga_bios_size = (vga_bios_size + 4095) & ~4095;
af8c55b
 	option_rom_start = 0xc0000 + vga_bios_size;
af8c55b
 
af8c55b
         /* setup basic memory access */
af8c55b
-- 
af8c55b
1.5.6.6