Skip to contentSkip to conversation

ensure 4kB page alignment for embedded powerpc when using kvm

PATCH New Christian Ehrhardt 1 participant 2 messages Jan 17, 2008 1 message not in the archive KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ensure 4kB page alignment for embedded powerpc when using kvm

Subject: [PATCH] ensure 4kB page alignment for embedded powerpc when using kvm
From: Hollis Blanchard <hollisb-r/[email protected]>
From: Christian Ehrhardt <[email protected]>

We need 4kB aligned pages when using qemu together with kvm for embedded powerpc. Qemu already had a similar issue when CONFIG_USER_ONLY was set so this patch adds just one more condition to the existing ifdef.

---
 cpu.h |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)
qemu/target-ppc/cpu.h +2 -1
@@ -50,9 +50,10 @@ typedef uint32_t ppc_gpr_t;
 /* Specific definitions for PowerPC embedded */
 /* BookE have 36 bits physical address space */
 #define TARGET_PHYS_ADDR_BITS 64
-#if defined(CONFIG_USER_ONLY)
+#if defined(CONFIG_USER_ONLY) || defined(USE_KVM)
 /* It looks like a lot of Linux programs assume page size
  * is 4kB long. This is evil, but we have to deal with it...
+ * Also kvm for embedded powerpc needs (atm) 4kB aligned pages
  */
 #define TARGET_PAGE_BITS 12
 #else /* defined(CONFIG_USER_ONLY) */

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

A message that is not in the archive (sent off-list or not yet received): 12005744123603-git-send-email-ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org

#2 lore raw

PATCH 1/1 add more regs to kvm_show_regs for powerpc

Subject: [PATCH] add more regs to kvm_show_regs for powerpc
From: Hollis Blanchard <hollisb-r/[email protected]>
From: Christian Ehrhardt <[email protected]>

This make "extra pages" allocation only apply to x86.
IA64 already had an exclusion and so does ppc. This patch switches the default to no extra pages and lets I386 and X86_64 get it's 3 extra pages as needed.

qemu/vl.c +3 -3
@@ -9313,10 +9313,10 @@ int main(int argc, char **argv)
 
 #if USE_KVM
     /* Initialize kvm */
-#ifdef TARGET_IA64
+#if defined(TARGET_I386) || defined(TARGET_X86_64)
+#define KVM_EXTRA_PAGES 3
+#else
 #define KVM_EXTRA_PAGES 0
-#else
-#define KVM_EXTRA_PAGES 3
 #endif
     if (kvm_allowed) {
 	    phys_ram_size += KVM_EXTRA_PAGES * TARGET_PAGE_SIZE;

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/