Skip to contentSkip to conversation

common code changes for PowerPC merge

PATCH New Hollis Blanchard 2 participants 10 messages Jul 12, 2006 – Jul 13, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 common code changes for PowerPC merge

As requested, here are the broken-out changes to common code for the PowerPC merge. These patches do not depend on each other.

Signature · 2 lines
Hollis Blanchard
IBM Linux Technology Center

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw

PATCH 1/1 add PowerPC files to .hgignore

# HG changeset patch
# User Hollis Blanchard <[email protected]> # Date 1152744165 18000
# Node ID f1fa1cc62c4c821f15fb530db8f5bb291bd77a4c # Parent a1c2cede77c78d2af99088d7dece8f74f2a27260 [powerpc] add PowerPC files to .hgignore

.hgignore +4 -0
diff -r a1c2cede77c7 -r f1fa1cc62c4c .hgignore
@@ -203,3 +203,7 @@
 ^xen/xen$
 ^xen/xen-syms$
 ^xen/xen\..*$
+^xen/arch/ppc/dom0\.bin$
+^xen/arch/ppc/asm-offsets\.s$
+^xen/arch/ppc/firmware
+^xen/arch/ppc/firmware_image
#2 lore raw

PATCH 1/1 add arch-powerpc.h to xen.h

In reply to Hollis Blanchard

# HG changeset patch
# User Hollis Blanchard <[email protected]> # Date 1152744165 18000
# Node ID f4654c1450a8c56bf9f439f09026c093cf3cb7d9 # Parent f1fa1cc62c4c821f15fb530db8f5bb291bd77a4c [powerpc] add arch-powerpc.h to xen.h

xen/include/public/xen.h +2 -0
diff -r f1fa1cc62c4c -r f4654c1450a8 xen/include/public/xen.h
@@ -15,6 +15,8 @@
 #include "arch-x86_64.h"
 #elif defined(__ia64__)
 #include "arch-ia64.h"
+#elif defined(__powerpc__)
+#include "arch-powerpc.h"
 #else
 #error "Unsupported architecture"
 #endif
#3 lore raw

PATCH 1/1 add PowerPC support to Makefiles

In reply to Hollis Blanchard

# HG changeset patch
# User Hollis Blanchard <[email protected]> # Date 1152744165 18000
# Node ID 49de99129bc4d762bc71b5559d0102c5691aa61e # Parent f4654c1450a8c56bf9f439f09026c093cf3cb7d9 [powerpc] add PowerPC support to Makefiles

Config.mk +2 -2
diff -r f4654c1450a8 -r 49de99129bc4 Config.mk
@@ -3,8 +3,8 @@
 # A debug build of Xen and tools?
 debug ?= n
 
-# Currently supported architectures: x86_32, x86_64
-XEN_COMPILE_ARCH    ?= $(shell uname -m | sed -e s/i.86/x86_32/)
+XEN_COMPILE_ARCH    ?= $(shell uname -m | sed -e s/i.86/x86_32/ \
+                                              -e s/ppc/powerpc/)
 XEN_TARGET_ARCH     ?= $(XEN_COMPILE_ARCH)
 XEN_TARGET_X86_PAE  ?= n
 
xen/Rules.mk +4 -2
diff -r f4654c1450a8 -r 49de99129bc4 xen/Rules.mk
@@ -23,8 +23,10 @@ include $(XEN_ROOT)/Config.mk
 # Set ARCH/SUBARCH appropriately.
 override COMPILE_SUBARCH := $(XEN_COMPILE_ARCH)
 override TARGET_SUBARCH  := $(XEN_TARGET_ARCH)
-override COMPILE_ARCH    := $(patsubst x86%,x86,$(XEN_COMPILE_ARCH))
-override TARGET_ARCH     := $(patsubst x86%,x86,$(XEN_TARGET_ARCH))
+override COMPILE_ARCH    := $(shell echo $(XEN_COMPILE_ARCH) | \
+                              sed -e 's/\(x86\|powerpc\).*/\1/')
+override TARGET_ARCH     := $(shell echo $(XEN_TARGET_ARCH) | \
+                              sed -e 's/\(x86\|powerpc\).*/\1/')
 
 TARGET := $(BASEDIR)/xen
#4 lore raw

PATCH 1/1 PPC doesn't support ballooning yet

In reply to Hollis Blanchard

# HG changeset patch
# User Hollis Blanchard <[email protected]> # Date 1152744165 18000
# Node ID 5a11149db4c2f30cd81689a5eefc370c7fc4c410 # Parent 49de99129bc4d762bc71b5559d0102c5691aa61e [powerpc] [xend] PPC doesn't support ballooning yet

tools/python/xen/xend/XendDomainInfo.py +3 -2
diff -r 49de99129bc4 -r 5a11149db4c2 tools/python/xen/xend/XendDomainInfo.py
@@ -1282,8 +1282,9 @@ class XendDomainInfo:
             xc.domain_setmaxmem(self.domid, m)
 
             init_reservation = self.info['memory'] * 1024
-            if os.uname()[4] == 'ia64':
-                # Workaround until ia64 properly supports ballooning.
+            if os.uname()[4] in ('ia64', 'ppc64'):
+                # Workaround for architectures that don't yet support
+                # ballooning.
                 init_reservation = m
 
             xc.domain_memory_increase_reservation(self.domid, init_reservation,
#5 lore raw

PATCH 1/1 print page->count_info as unsigned long

In reply to Hollis Blanchard

# HG changeset patch
# User Hollis Blanchard <[email protected]> # Date 1152744166 18000
# Node ID 9157cbc1793231f2c95a4bdbba4a8e70681b1c6d # Parent 5a11149db4c2f30cd81689a5eefc370c7fc4c410 [powerpc] print page->count_info as unsigned long

xen/common/memory.c +2 -2
diff -r 5a11149db4c2 -r 9157cbc17932 xen/common/memory.c
@@ -174,9 +174,9 @@ guest_remove_page(
     {
         /* We'll make this a guest-visible error in future, so take heed! */
         DPRINTK("Dom%d freeing in-use page %lx (pseudophys %lx):"
-                " count=%x type=%lx\n",
+                " count=%lx type=%lx\n",
                 d->domain_id, mfn, get_gpfn_from_mfn(mfn),
-                page->count_info, page->u.inuse.type_info);
+                (unsigned long)page->count_info, page->u.inuse.type_info);
     }
 
     guest_physmap_remove_page(d, gmfn, mfn);
#6 lore raw

PATCH 1/1 support additional interrupt controller types in xen/arch/x86/irq.c

In reply to Hollis Blanchard

# HG changeset patch
# User Hollis Blanchard <[email protected]>
# Date 1152744166 18000
# Node ID d3533a195a15902ad8b7bd0b9118118fae18e79c
# Parent 9157cbc1793231f2c95a4bdbba4a8e70681b1c6d
[powerpc] support additional interrupt controller types in xen/arch/x86/irq.c PowerPC #includes xen/arch/x86/irq.c, so we need to support MPIC and XT-PIC interrupt controllers here.

xen/arch/x86/irq.c +14 -0
diff -r 9157cbc17932 -r d3533a195a15 xen/arch/x86/irq.c
@@ -397,6 +397,20 @@ int pirq_acktype(int irq)
      */
     if ( !strcmp(desc->handler->typename, "IO-APIC-level") )
         return ioapic_ack_new ? ACKTYPE_EOI : ACKTYPE_UNMASK;
+
+    /* Legacy PIC interrupts can be acknowledged from any CPU. */
+    if ( !strcmp(desc->handler->typename, "XT-PIC") )
+        return ACKTYPE_UNMASK;
+
+    if ( strstr(desc->handler->typename, "MPIC") ) {
+        if (desc->status & IRQ_LEVEL) {
+            if (desc->status & IRQ_PER_CPU)
+                return ACKTYPE_EOI;
+            else
+                return ACKTYPE_UNMASK;
+        }
+        return ACKTYPE_NONE;
+    }
 
     BUG();
     return 0;
xen/include/xen/irq.h +1 -0
diff -r 9157cbc17932 -r d3533a195a15 xen/include/xen/irq.h
@@ -22,6 +22,7 @@ struct irqaction
 #define IRQ_PENDING	4	/* IRQ pending - replay on enable */
 #define IRQ_REPLAY	8	/* IRQ has been replayed but not acked yet */
 #define IRQ_GUEST       16      /* IRQ is handled by guest OS(es) */
+#define IRQ_LEVEL		64	/* IRQ level triggered */
 #define IRQ_PER_CPU     256     /* IRQ is per CPU */
 
 /*
#7 lore raw

PATCH 1/1 add PowerPC support to libxc

In reply to Hollis Blanchard

# HG changeset patch
# User Hollis Blanchard <[email protected]> # Date 1152744261 18000
# Node ID 8400d02096faf9fd566c9ea73a57811ac5d34acd # Parent d3533a195a15902ad8b7bd0b9118118fae18e79c [powerpc] add PowerPC support to libxc

tools/libxc/Makefile +4 -2
diff -r d3533a195a15 -r 8400d02096fa tools/libxc/Makefile
@@ -26,11 +26,13 @@ CTRL_SRCS-$(CONFIG_Linux) += xc_linux.c
 CTRL_SRCS-$(CONFIG_Linux) += xc_linux.c
 
 GUEST_SRCS-y :=
-GUEST_SRCS-y += xc_linux_build.c
 GUEST_SRCS-y += xc_load_bin.c
 GUEST_SRCS-y += xc_load_elf.c
 GUEST_SRCS-y += xg_private.c
-GUEST_SRCS-$(CONFIG_IA64) += xc_ia64_stubs.c
+GUEST_SRCS-$(CONFIG_POWERPC) += xc_ppc_linux_build.c
+GUEST_SRCS-$(CONFIG_X86) += xc_linux_build.c
+GUEST_SRCS-$(CONFIG_IA64) += xc_ia64_stubs.c xc_linux_build.c
+GUEST_SRCS-$(CONFIG_PLAN9) += xc_load_aout9.c
 GUEST_SRCS-$(CONFIG_MIGRATE) += xc_linux_restore.c xc_linux_save.c
 GUEST_SRCS-$(CONFIG_HVM) += xc_hvm_build.c
 
tools/libxc/xc_load_elf.c +4 -0
diff -r d3533a195a15 -r 8400d02096fa tools/libxc/xc_load_elf.c
@@ -38,6 +38,10 @@ loadelfsymtab(
 #define ELFCLASS   ELFCLASS64
 #define ELFDATA    ELFDATA2LSB
 #define ELFMACHINE EM_X86_64
+#elif defined(__powerpc__)
+#define ELFCLASS   ELFCLASS64
+#define ELFDATA    ELFDATA2MSB
+#define ELFMACHINE EM_PPC64
 #endif
 
 int probe_elf(const char *image,
tools/libxc/xenctrl.h +5 -0
diff -r d3533a195a15 -r 8400d02096fa tools/libxc/xenctrl.h
@@ -47,6 +47,11 @@
 #define mb()
 #define rmb()
 #define wmb()
+#elif defined(__powerpc__)
+/* XXX loosen these up later */
+#define mb()   __asm__ __volatile__ ("sync" : : : "memory")
+#define rmb()  __asm__ __volatile__ ("sync" : : : "memory") /* lwsync? */
+#define wmb()  __asm__ __volatile__ ("sync" : : : "memory") /* eieio? */
 #else
 #error "Define barriers"
 #endif
#8 lore raw

Re: [PATCH 7 of 8] [powerpc] add PowerPC support to libxc

In reply to Hollis Blanchard

Le Jeudi 13 Juillet 2006 00:55, Hollis Blanchard a écrit :
[...]

On ia64, we have created a tools/libxc/ia64 directory.
This is because we have a few ia64 specific files (at least 4). This hasn't been merged yet but the idea seems to have already been discussed and accepted.

Tristan.