From: Zhang Xiantao <[EMAIL PROTECTED]> Date: Tue, 11 Dec 2007 18:54:27 +0800 Subject: [PATCH] kvm: qemu: Check page size at initialization time.
Currently, we assume Qemu target page size = HOST page
size, this patch check them. if not equal, print error
info and exit.
Signed-off-by: Zhang Xiantao <[EMAIL PROTECTED]>
---
qemu/hw/ipf.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/qemu/hw/ipf.c b/qemu/hw/ipf.c
index 012073d..9466707 100644
--- a/qemu/hw/ipf.c
+++ b/qemu/hw/ipf.c
@@ -27,6 +27,8 @@
#include "vl.h"
#include "firmware.h"
#include "ia64intrin.h"
+#include <unistd.h>
+
#ifdef USE_KVM
#include "qemu-kvm.h"
extern int kvm_allowed;
@@ -143,6 +145,14 @@ static void ipf_init1(ram_addr_t ram_size, int
vga_ram_size, int boot_device,
NICInfo *nd;
qemu_irq *cpu_irq;
qemu_irq *i8259;
+ int page_size;
+
+ page_size = getpagesize();
+ if(page_size != TARGET_PAGE_SIZE) {
+ fprintf(stderr,"Error! Host page size != qemu target
page size,\
+ you may need to change TARGET_PAGE_BITS in
qemu!!\n");
+ exit(-1);
+ }
if (ram_size >= 0xc0000000 ) {
above_4g_mem_size = ram_size - 0xc0000000;
--
1.5.2
0001-kvm-qemu-Check-page-size-at-initialization-time.patch
Description: 0001-kvm-qemu-Check-page-size-at-initialization-time.patch
------------------------------------------------------------------------- SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php
_______________________________________________ kvm-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/kvm-devel
