public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [KVM/qemu] check page size of qemu and host at intialization time
@ 2007-12-11 11:04 Zhang, Xiantao
       [not found] ` <42DFA526FC41B1429CE7279EF83C6BDCACF8EA-wq7ZOvIWXbMAbVU2wMM1CrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Zhang, Xiantao @ 2007-12-11 11:04 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

[-- Attachment #1: Type: text/plain, Size: 1285 bytes --]

From: Zhang Xiantao <xiantao.zhang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
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 <xiantao.zhang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 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

[-- Attachment #2: 0001-kvm-qemu-Check-page-size-at-initialization-time.patch --]
[-- Type: application/octet-stream, Size: 1252 bytes --]

From 54340b17eb042b484652b9f5292ad193bdb02e65 Mon Sep 17 00:00:00 2001
From: Zhang Xiantao <xiantao.zhang@intel.com>
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 <xiantao.zhang@intel.com>
---
 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


[-- Attachment #3: Type: text/plain, Size: 277 bytes --]

-------------------------------------------------------------------------
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

[-- Attachment #4: Type: text/plain, Size: 186 bytes --]

_______________________________________________
kvm-devel mailing list
kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/kvm-devel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [KVM/qemu] check page size of qemu and host at intialization time
       [not found] ` <42DFA526FC41B1429CE7279EF83C6BDCACF8EA-wq7ZOvIWXbMAbVU2wMM1CrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
@ 2007-12-11 12:45   ` Avi Kivity
  0 siblings, 0 replies; 2+ messages in thread
From: Avi Kivity @ 2007-12-11 12:45 UTC (permalink / raw)
  To: Zhang, Xiantao; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Zhang, Xiantao wrote:
> From: Zhang Xiantao <xiantao.zhang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> 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.
>   

Applied, thanks.

-- 
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-12-11 12:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-11 11:04 [KVM/qemu] check page size of qemu and host at intialization time Zhang, Xiantao
     [not found] ` <42DFA526FC41B1429CE7279EF83C6BDCACF8EA-wq7ZOvIWXbMAbVU2wMM1CrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2007-12-11 12:45   ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox