[XenPPC] [xenppc-unstable] [XEN][POWERPC] compress all extents into a single LMB

2006-09-30 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis <[EMAIL PROTECTED]>
# Node ID 7de08aceff6de9569c6723c8283f6a653f1e90ea
# Parent  c7fa7c41b9e60cf90feddea8c15f015f436b
[XEN][POWERPC] compress all extents into a single LMB

Linux prom code has a static limit.

Signed-off-by: Jimi Xenidis <[EMAIL PROTECTED]>
---
 xen/arch/powerpc/ofd_fixup_memory.c |   18 ++
 1 files changed, 10 insertions(+), 8 deletions(-)

diff -r c7fa7c41b9e6 -r 7de08aceff6d xen/arch/powerpc/ofd_fixup_memory.c
--- a/xen/arch/powerpc/ofd_fixup_memory.c   Fri Sep 29 14:31:05 2006 -0400
+++ b/xen/arch/powerpc/ofd_fixup_memory.c   Fri Sep 29 19:09:26 2006 -0400
@@ -68,6 +68,8 @@ static ofdn_t ofd_memory_node_create(
 reg.sz = size;
 ofd_prop_add(m, n, "reg", ®, sizeof (reg));
 
+printk("Dom0: %s: %016lx, %016lx\n", path, start, size);
+
 return n;
 }
 
@@ -88,17 +90,17 @@ static void ofd_memory_extent_nodes(void
 struct page_extents *pe;
 ulong cur_pfn = 1UL << d->arch.rma_order;
 
+start = cur_pfn << PAGE_SHIFT;
+size = 0;
 list_for_each_entry (pe, &d->arch.extent_list, pe_list) {
 
-start = cur_pfn << PAGE_SHIFT;
-size = 1UL << (pe->order + PAGE_SHIFT);
-
-n = ofd_memory_node_create(m, OFD_ROOT, "", memory, memory,
-start, size);
-
-BUG_ON(n <= 0);
-cur_pfn += 1UL << pe->order;
+size += 1UL << (pe->order + PAGE_SHIFT);
+if (pe->order != cpu_extent_order())
+panic("we don't handle this yet\n");
 }
+n = ofd_memory_node_create(m, OFD_ROOT, "", memory, memory,
+   start, size);
+BUG_ON(n <= 0);
 }
 
 void ofd_memory_props(void *m, struct domain *d)

___
Xen-ppc-devel mailing list
Xen-ppc-devel@lists.xensource.com
http://lists.xensource.com/xen-ppc-devel


[XenPPC] [xenppc-unstable] [XEN][POWERPC] Allocate Xen memory area based on the amount of memory

2006-09-30 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis <[EMAIL PROTECTED]>
# Node ID c7fa7c41b9e60cf90feddea8c15f015f436b
# Parent  dbfb5fc0b9b2ccc2f481710da8cf419d91ae40d6
[XEN][POWERPC] Allocate Xen memory area based on the amount of memory

This will make sure that there is enough memory for large HTABs, as well as:
 - enables "xenheap_megabytes=" cmdline option
 - consistently reports on memory system
 - reduces noise in memory.c

Signed-off-by: Jimi Xenidis <[EMAIL PROTECTED]>
---
 xen/arch/powerpc/domain_build.c |3 
 xen/arch/powerpc/memory.c   |  308 ++--
 xen/arch/powerpc/setup.c|3 
 3 files changed, 172 insertions(+), 142 deletions(-)

diff -r dbfb5fc0b9b2 -r c7fa7c41b9e6 xen/arch/powerpc/domain_build.c
--- a/xen/arch/powerpc/domain_build.c   Fri Sep 29 11:29:32 2006 -0400
+++ b/xen/arch/powerpc/domain_build.c   Fri Sep 29 14:31:05 2006 -0400
@@ -178,8 +178,7 @@ int construct_dom0(struct domain *d,
 shadow_set_allocation(d, opt_dom0_shadow, &preempt);
 } while (preempt);
 if (shadow_get_allocation(d) == 0)
-panic("shadow allocation failed 0x%x < 0x%x\n",
-  shadow_get_allocation(d), opt_dom0_shadow);
+panic("shadow allocation failed: %dMib\n", opt_dom0_shadow);
 
 ASSERT( image_len < rma_sz );
 
diff -r dbfb5fc0b9b2 -r c7fa7c41b9e6 xen/arch/powerpc/memory.c
--- a/xen/arch/powerpc/memory.c Fri Sep 29 11:29:32 2006 -0400
+++ b/xen/arch/powerpc/memory.c Fri Sep 29 14:31:05 2006 -0400
@@ -24,7 +24,26 @@
 #include "oftree.h"
 #include "rtas.h"
 
+#undef DEBUG
+#ifdef DEBUG
+#define DBG(fmt...) printk(fmt)
+#else
+#define DBG(fmt...)
+#endif
+
+/*
+ * opt_xenheap_megabytes: Size of Xen heap in megabytes, excluding the
+ * page_info table and allocation bitmap.
+ */
+static unsigned int opt_xenheap_megabytes = XENHEAP_DEFAULT_MB;
+integer_param("xenheap_megabytes", opt_xenheap_megabytes);
+
 unsigned long xenheap_phys_end;
+static uint nr_pages;
+static ulong xenheap_size;
+static ulong save_start;
+static ulong save_end;
+
 struct membuf {
 ulong start;
 ulong size;
@@ -34,14 +53,143 @@ typedef void (*walk_mem_fn)(struct membu
 
 static ulong free_xenheap(ulong start, ulong end)
 {
-ulong save_start;
-ulong save_end;
-
 start = ALIGN_UP(start, PAGE_SIZE);
 end = ALIGN_DOWN(end, PAGE_SIZE);
 
-printk("%s: 0x%lx - 0x%lx\n", __func__, start, end);
-
+DBG("%s: 0x%lx - 0x%lx\n", __func__, start, end);
+
+/* need to do this better */
+if (save_start <= end && save_start >= start) {
+DBG("%s: Go around the saved area: 0x%lx - 0x%lx\n",
+   __func__, save_start, save_end);
+init_xenheap_pages(start, ALIGN_DOWN(save_start, PAGE_SIZE));
+xenheap_size += ALIGN_DOWN(save_start, PAGE_SIZE) - start;
+
+init_xenheap_pages(ALIGN_UP(save_end, PAGE_SIZE), end);
+xenheap_size += end - ALIGN_UP(save_end, PAGE_SIZE);
+} else {
+init_xenheap_pages(start, end);
+xenheap_size += end - start;
+}
+
+return ALIGN_UP(end, PAGE_SIZE);
+}
+
+static void set_max_page(struct membuf *mb, uint entries)
+{
+int i;
+
+for (i = 0; i < entries; i++) {
+ulong end_page;
+
+printk("  %016lx: %016lx\n", mb[i].start, mb[i].size);
+nr_pages += mb[i].size >> PAGE_SHIFT;
+
+end_page = (mb[i].start + mb[i].size) >> PAGE_SHIFT;
+if (end_page > max_page)
+max_page = end_page;
+}
+}
+
+/* mark all memory from modules onward as unused */
+static void heap_init(struct membuf *mb, uint entries)
+{
+int i;
+ulong start_blk;
+ulong end_blk = 0;
+
+   for (i = 0; i < entries; i++) {
+   start_blk = mb[i].start;
+   end_blk = start_blk + mb[i].size;
+
+   if (start_blk < xenheap_phys_end) {
+if (xenheap_phys_end > end_blk) {
+panic("xenheap spans LMB\n");
+}
+if (xenheap_phys_end == end_blk)
+continue;
+
+start_blk = xenheap_phys_end;
+}
+
+init_boot_pages(start_blk, end_blk);
+total_pages += (end_blk - start_blk) >> PAGE_SHIFT;
+   }
+}
+
+static void ofd_walk_mem(void *m, walk_mem_fn fn)
+{
+ofdn_t n;
+uint p_len;
+struct membuf mb[8];
+static char name[] = "memory";
+
+n = ofd_node_find_by_prop(m, OFD_ROOT, "device_type", name, sizeof(name));
+while (n > 0) {
+
+p_len = ofd_getprop(m, n, "reg", mb, sizeof (mb));
+if (p_len <= 0) {
+panic("ofd_getprop(): failed\n");
+}
+if (p_len > sizeof(mb))
+panic("%s: buffer is not big enuff for this firmware: "
+  "0x%lx < 0x%x\n", __func__, sizeof(mb), p_len);
+
+fn(mb, p_len / sizeof(mb[0]));
+n = ofd_node_find_next(m, n);
+}
+}
+
+static void setup_xenheap(module_t *mod, int mcount)
+{
+int i;
+ulong freemem;
+
+freemem = ALIGN_UP((ulong)_end, PAGE_SIZE);
+
+for (i

[XenPPC] [xenppc-unstable] [XEN][POWERPC] Conistence with log vs. order

2006-09-30 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis <[EMAIL PROTECTED]>
# Node ID 3bf1684f032ebf5ccabda8f0a7cc10757061b0bf
# Parent  2e219f06f9a407d13248ea7a389373a23028c426
[XEN][POWERPC] Conistence with log vs. order

We use "log" for a log2 value, "order" is the log2 of page size, so:
  order = log - PAGE_SHIFT

It is confusing, but more so if we are not consistent.

Signed-off-by: Jimi Xenidis <[EMAIL PROTECTED]>
---
 xen/arch/powerpc/domctl.c   |6 ++---
 xen/arch/powerpc/powerpc64/ppc970.c |   37 ++--
 xen/include/asm-powerpc/processor.h |2 -
 3 files changed, 23 insertions(+), 22 deletions(-)

diff -r 2e219f06f9a4 -r 3bf1684f032e xen/arch/powerpc/domctl.c
--- a/xen/arch/powerpc/domctl.c Thu Sep 28 22:31:23 2006 -0400
+++ b/xen/arch/powerpc/domctl.c Fri Sep 29 09:53:39 2006 -0400
@@ -96,14 +96,14 @@ long arch_do_domctl(struct xen_domctl *d
 case XEN_DOMCTL_real_mode_area:
 {
 struct domain *d;
-unsigned int log = domctl->u.real_mode_area.log;
+unsigned int order = domctl->u.real_mode_area.log - PAGE_SHIFT;
 
 ret = -ESRCH;
 d = find_domain_by_id(domctl->domain);
 if (d != NULL) {
 ret = -EINVAL;
-if (cpu_rma_valid(log))
-ret = allocate_rma(d, log - PAGE_SHIFT);
+if (cpu_rma_valid(order))
+ret = allocate_rma(d, order);
 put_domain(d);
 }
 }
diff -r 2e219f06f9a4 -r 3bf1684f032e xen/arch/powerpc/powerpc64/ppc970.c
--- a/xen/arch/powerpc/powerpc64/ppc970.c   Thu Sep 28 22:31:23 2006 -0400
+++ b/xen/arch/powerpc/powerpc64/ppc970.c   Fri Sep 29 09:53:39 2006 -0400
@@ -45,42 +45,43 @@ struct cpu_caches cpu_caches = {
 };
 
 struct rma_settings {
-int order;
+int log;
 int rmlr_0;
 int rmlr_1_2;
 };
 
-static struct rma_settings rma_orders[] = {
-{ .order = 26, .rmlr_0 = 0, .rmlr_1_2 = 3, }, /*  64 MB */
-{ .order = 27, .rmlr_0 = 1, .rmlr_1_2 = 3, }, /* 128 MB */
-{ .order = 28, .rmlr_0 = 1, .rmlr_1_2 = 0, }, /* 256 MB */
-{ .order = 30, .rmlr_0 = 0, .rmlr_1_2 = 2, }, /*   1 GB */
-{ .order = 34, .rmlr_0 = 0, .rmlr_1_2 = 1, }, /*  16 GB */
-{ .order = 38, .rmlr_0 = 0, .rmlr_1_2 = 0, }, /* 256 GB */
+static struct rma_settings rma_logs[] = {
+{ .log = 26, .rmlr_0 = 0, .rmlr_1_2 = 3, }, /*  64 MB */
+{ .log = 27, .rmlr_0 = 1, .rmlr_1_2 = 3, }, /* 128 MB */
+{ .log = 28, .rmlr_0 = 1, .rmlr_1_2 = 0, }, /* 256 MB */
+{ .log = 30, .rmlr_0 = 0, .rmlr_1_2 = 2, }, /*   1 GB */
+{ .log = 34, .rmlr_0 = 0, .rmlr_1_2 = 1, }, /*  16 GB */
+{ .log = 38, .rmlr_0 = 0, .rmlr_1_2 = 0, }, /* 256 GB */
 };
 
 static uint log_large_page_sizes[] = {
 4 + 20, /* (1 << 4) == 16M */
 };
 
-static struct rma_settings *cpu_find_rma(unsigned int order)
+static struct rma_settings *cpu_find_rma(unsigned int log)
 {
 int i;
-for (i = 0; i < ARRAY_SIZE(rma_orders); i++) {
-if (rma_orders[i].order == order)
-return &rma_orders[i];
+
+for (i = 0; i < ARRAY_SIZE(rma_logs); i++) {
+if (rma_logs[i].log == log)
+return &rma_logs[i];
 }
 return NULL;
 }
 
 unsigned int cpu_default_rma_order_pages(void)
 {
-return rma_orders[0].order - PAGE_SHIFT;
-}
-
-int cpu_rma_valid(unsigned int log)
-{
-return cpu_find_rma(log) != NULL;
+return rma_logs[0].log - PAGE_SHIFT;
+}
+
+int cpu_rma_valid(unsigned int order)
+{
+return cpu_find_rma(order + PAGE_SHIFT) != NULL;
 }
 
 unsigned int cpu_large_page_orders(uint *sizes, uint max)
diff -r 2e219f06f9a4 -r 3bf1684f032e xen/include/asm-powerpc/processor.h
--- a/xen/include/asm-powerpc/processor.h   Thu Sep 28 22:31:23 2006 -0400
+++ b/xen/include/asm-powerpc/processor.h   Fri Sep 29 09:53:39 2006 -0400
@@ -120,7 +120,7 @@ extern void show_registers(struct cpu_us
 extern void show_registers(struct cpu_user_regs *);
 extern unsigned int cpu_extent_order(void);
 extern unsigned int cpu_default_rma_order_pages(void);
-extern int cpu_rma_valid(unsigned int log);
+extern int cpu_rma_valid(unsigned int order);
 extern uint cpu_large_page_orders(uint *sizes, uint max);
 extern void cpu_initialize(int cpuid);
 extern void cpu_init_vcpu(struct vcpu *);

___
Xen-ppc-devel mailing list
Xen-ppc-devel@lists.xensource.com
http://lists.xensource.com/xen-ppc-devel


[XenPPC] [xenppc-unstable] shadowed paramter in prototype, SHEESH!

2006-09-30 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis <[EMAIL PROTECTED]>
# Node ID dbfb5fc0b9b2ccc2f481710da8cf419d91ae40d6
# Parent  3bf1684f032ebf5ccabda8f0a7cc10757061b0bf
shadowed paramter in prototype, SHEESH!

Signed-off-by: Jimi Xenidis <[EMAIL PROTECTED]>
---
 xen/arch/powerpc/rtas.h |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff -r 3bf1684f032e -r dbfb5fc0b9b2 xen/arch/powerpc/rtas.h
--- a/xen/arch/powerpc/rtas.h   Fri Sep 29 09:53:39 2006 -0400
+++ b/xen/arch/powerpc/rtas.h   Fri Sep 29 11:29:32 2006 -0400
@@ -26,7 +26,7 @@ extern unsigned long rtas_base;
 extern unsigned long rtas_base;
 extern unsigned long rtas_end;
 
-extern int prom_call(void *arg, unsigned rtas_base,
+extern int prom_call(void *arg, unsigned base,
  unsigned long func, unsigned long msr);
 extern int rtas_init(void *);
 extern int rtas_halt(void);

___
Xen-ppc-devel mailing list
Xen-ppc-devel@lists.xensource.com
http://lists.xensource.com/xen-ppc-devel


[XenPPC] [xenppc-unstable] [XEN][POWERPC] Remove limit on the page frame table

2006-09-30 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis <[EMAIL PROTECTED]>
# Node ID 2e219f06f9a407d13248ea7a389373a23028c426
# Parent  c9bf3af5624b6186e665e6d8d783ff92a5b3afce
[XEN][POWERPC] Remove limit on the page frame table

Dunno where the limit came from, but it is the reason we were
asserting in the page allocator.

Signed-off-by: Jimi Xenidis <[EMAIL PROTECTED]>
---
 xen/arch/powerpc/mm.c |2 --
 1 files changed, 2 deletions(-)

diff -r c9bf3af5624b -r 2e219f06f9a4 xen/arch/powerpc/mm.c
--- a/xen/arch/powerpc/mm.c Thu Sep 28 12:34:01 2006 -0400
+++ b/xen/arch/powerpc/mm.c Thu Sep 28 22:31:23 2006 -0400
@@ -164,8 +164,6 @@ void __init init_frametable(void)
 int i;
 
 nr_pages = PFN_UP(max_page * sizeof(struct page_info));
-nr_pages = min(nr_pages, (4UL << (20 - PAGE_SHIFT)));
-
 
 p = alloc_boot_pages(nr_pages, 1);
 if (p == 0)

___
Xen-ppc-devel mailing list
Xen-ppc-devel@lists.xensource.com
http://lists.xensource.com/xen-ppc-devel


[XenPPC] Recent changes for big domains

2006-09-30 Thread Jimi Xenidis

Recent changes have gone in to allow for domains to be rather large.
However, Dom0 is limited to 2GiB in size for the time being.
Here is the bug that describes the issue:
  http://bugzilla.xensource.com/bugzilla/show_bug.cgi?id=785

-JX

___
Xen-ppc-devel mailing list
Xen-ppc-devel@lists.xensource.com
http://lists.xensource.com/xen-ppc-devel


[XenPPC] xm save: adding couple domctl operations to access htab

2006-09-30 Thread poff
When saving a domain, its htab must be copied, real page numbers replaced with 
physical,
then written to disk. To copy the htab, I've tried for many hours to add a 
domctl operation,
#define XEN_DOMCTL_gethtab  29, using code and structures similar to 
XEN_DOMCTL_getmemlist.

This new command makes it through do_xen_hypercall(), however, always get 
ENOSYS returned...
On the Xen side, hcall_xen() I print all the command numbers for do_domctl ops, 
but this
new command never arrives. Of course, have added a 'case XEN_DOMCTL_gethtab' in 
domctl.c,
and also printk before ENOSYS, but this code is never run.

1) Is this a reasonable approach to copying the htab?

2) Any clues?



___
Xen-ppc-devel mailing list
Xen-ppc-devel@lists.xensource.com
http://lists.xensource.com/xen-ppc-devel


Re: [XenPPC] xm save: adding couple domctl operations to access htab

2006-09-30 Thread Tony Breeds
On Sat, Sep 30, 2006 at 05:29:40PM -0400, poff wrote:
> When saving a domain, its htab must be copied, real page numbers replaced 
> with physical,
> then written to disk. To copy the htab, I've tried for many hours to add a 
> domctl operation,
> #define XEN_DOMCTL_gethtab  29, using code and structures similar to 
> XEN_DOMCTL_getmemlist.
> 
> This new command makes it through do_xen_hypercall(), however, always get 
> ENOSYS returned...
> On the Xen side, hcall_xen() I print all the command numbers for do_domctl 
> ops, but this
> new command never arrives. Of course, have added a 'case XEN_DOMCTL_gethtab' 
> in domctl.c,
> and also printk before ENOSYS, but this code is never run.
> 
> 1) Is this a reasonable approach to copying the htab?
> 
> 2) Any clues?

I don't know if I'm off base but have you added appropriate code to 
linux? specifically arch/powerpc/platforms/xen/hcall.c ?

Yours Tony

   linux.conf.au   http://linux.conf.au/ || http://lca2007.linux.org.au/
   Jan 15-20 2007  The Australian Linux Technical Conference!


___
Xen-ppc-devel mailing list
Xen-ppc-devel@lists.xensource.com
http://lists.xensource.com/xen-ppc-devel


[XenPPC] Automated reliability report for Xen on JS21

2006-09-30 Thread Amos Waterland
An automated process boooted Xen on a JS21 blade 126 times, recording 5
failures and 109 passes, using the launch of the ssh daemon by dom0 as a
correctness criteria.

The version of Xen used was changeset 261c458e46af, which is tip of tree
changeset dbfb5fc0b9b2 plus the bootargs simplification patch.

---

changeset   : 261c458e46af
machine : cso92
pass: 109
fail: 5
transient   : 12
total   : 126
reliability : 96.0%

261c458e46af/cso92/xen.log.2006-09-29.204918

(XEN) Final offset: 5 (3/300)
(XEN) Synchronizing timebase
(XEN)

261c458e46af/cso92/xen.log.2006-09-29.214807

(XEN) Final offset: 4 (265/300)
(XEN) Synchronizing timebase
(XEN)

261c458e46af/cso92/xen.log.2006-09-30.123950

(XEN) Final offset: 5 (39/300)
(XEN) Synchronizing timebase
(XEN)

261c458e46af/cso92/xen.log.2006-09-30.130239

(XEN) Final offset: 6 (53/300)
(XEN) Synchronizing timebase
(XEN)

261c458e46af/cso92/xen.log.2006-09-30.135944

(XEN) Final offset: 5 (59/300)
(XEN) Synchronizing timebase
(XEN)


___
Xen-ppc-devel mailing list
Xen-ppc-devel@lists.xensource.com
http://lists.xensource.com/xen-ppc-devel


[XenPPC] Automated reliability report for Xen on JS20

2006-09-30 Thread Amos Waterland
An automated process boooted Xen on a JS20 blade 534 times, recording 0
failures and 534 passes, using the launch of the ssh daemon by dom0 as a
correctness criteria.

The version of Xen used was changeset 261c458e46af, which is tip of tree
changeset dbfb5fc0b9b2 plus the bootargs simplification patch.

---

changeset   : 261c458e46af
machine : kpblade1
pass: 534
fail: 0
transient   : 0
total   : 534
reliability : 100.0%


___
Xen-ppc-devel mailing list
Xen-ppc-devel@lists.xensource.com
http://lists.xensource.com/xen-ppc-devel


[XenPPC] [PATCH] Simplify bootargs processing

2006-09-30 Thread Amos Waterland
Set and document clear precedence rules for boot argument processing.
Support the same builtin command line format in the 32-bit xen binary as
the 32-bit zImage binary does.  Remove dead default_bootargs code.

This patch has been in use by an internal IBM project for some time.  It
enables two important things: allowing developers and cluster
administrators the option of overriding the bootargs supplied by
firmware, and the ability to take a single gold master xen binary and
customize its bootargs across a cluster with a simple and well-tested
post-processing tool.

Signed-off-by: Amos Waterland <[EMAIL PROTECTED]>

---

 b/xen/arch/powerpc/boot/arg32.c |   22 ++
 xen/arch/powerpc/Makefile   |5 -
 xen/arch/powerpc/boot/boot32.S  |5 +
 xen/arch/powerpc/boot_of.c  |   17 +
 xen/arch/powerpc/ofd_fixup.c|   19 ---
 xen/arch/powerpc/xen.lds.S  |4 
 6 files changed, 48 insertions(+), 24 deletions(-)

diff -r c9bf3af5624b xen/arch/powerpc/Makefile
--- a/xen/arch/powerpc/Makefile Thu Sep 28 12:34:01 2006 -0400
+++ b/xen/arch/powerpc/Makefile Thu Sep 28 14:41:54 2006 -0400
@@ -130,7 +130,10 @@ boot32.o: boot/boot32.S
$(CC) -m32 -Wa,-a32,-mppc64bridge \
-D__ASSEMBLY__ -D__BRIDGE64__ $(CFLAGS) -c $< -o $@
 
-$(TARGET): boot32.o $(TARGET).bin.o
+arg32.o: boot/arg32.c
+   $(CC) -m32 -DCMDLINE="\"$(IMAGENAME) $(CMDLINE)\"" -c $< -o $@
+
+$(TARGET): boot32.o arg32.o $(TARGET).bin.o
$(CC) -m32 -N -Wl,-melf32ppclinux -static -nostdlib \
-Wl,-Ttext,$(boot32_link_base)  -Wl,-Tdata,$(xen_link_base) \
$(CFLAGS) $^ -o $@
diff -r c9bf3af5624b xen/arch/powerpc/boot/boot32.S
--- a/xen/arch/powerpc/boot/boot32.SThu Sep 28 12:34:01 2006 -0400
+++ b/xen/arch/powerpc/boot/boot32.SThu Sep 28 14:41:54 2006 -0400
@@ -36,6 +36,11 @@ _start:
 ## 51 12  1000 ME   Machine Check Enable
 
 _real_start:   
+   # pass the builtin command line as argument to hype_init
+   li  7, 0
+   oris7, 7, [EMAIL PROTECTED]
+   ori 7, 7, [EMAIL PROTECTED]
+   
# pass the original msr as argument to hype_init
mfmsr   8
 
diff -r c9bf3af5624b xen/arch/powerpc/boot_of.c
--- a/xen/arch/powerpc/boot_of.cThu Sep 28 12:34:01 2006 -0400
+++ b/xen/arch/powerpc/boot_of.cThu Sep 28 14:41:54 2006 -0400
@@ -460,13 +460,22 @@ static void boot_of_probemem(multiboot_i
 }
 }
 
-static void boot_of_bootargs(multiboot_info_t *mbi)
+static void
+boot_of_bootargs(multiboot_info_t *mbi, char *wrapper_builtin_cmdline)
 {
 int rc;
 
-rc = of_getprop(bof_chosen, "bootargs", &bootargs, sizeof (bootargs));
-if (rc == OF_FAILURE || bootargs[0] == '\0') {
+/* Boot argument precedence rules:
+ *  1. Arguments from 32-bit wrapper override all else
+ *  2. Builtin arguments in 64-bit image override firmware
+ *  3. Firmware is used if neither of the above exist
+ */
+if (wrapper_builtin_cmdline[0] != 0) {
+strlcpy(bootargs, wrapper_builtin_cmdline, sizeof(bootargs));
+} else if (builtin_cmdline[0] != 0) {
 strlcpy(bootargs, builtin_cmdline, sizeof(bootargs));
+} else {
+rc = of_getprop(bof_chosen, "bootargs", &bootargs, sizeof (bootargs));
 }
 
 mbi->flags |= MBI_CMDLINE;
@@ -1197,7 +1206,7 @@ multiboot_info_t __init *boot_of_init(
 
 boot_of_fix_maple();
 boot_of_probemem(&mbi);
-boot_of_bootargs(&mbi);
+boot_of_bootargs(&mbi, (char *)r7);
 oft = boot_of_module(r3, r4, &mbi);
 boot_of_cpus();
 boot_of_serial(oft);
diff -r c9bf3af5624b xen/arch/powerpc/ofd_fixup.c
--- a/xen/arch/powerpc/ofd_fixup.c  Thu Sep 28 12:34:01 2006 -0400
+++ b/xen/arch/powerpc/ofd_fixup.c  Thu Sep 28 14:41:54 2006 -0400
@@ -244,12 +244,6 @@ static ofdn_t ofd_xics_props(void *m)
 }
 #endif
 
-/*
- * Good things you can stick here:
- *   init=/bin/bash ip=dhcp root=/dev/hda2 ide=nodma 
- */
-static char default_bootargs[] = ""; 
-
 static ofdn_t ofd_chosen_props(void *m, const char *cmdline)
 {
 ofdn_t n;
@@ -257,7 +251,6 @@ static ofdn_t ofd_chosen_props(void *m, 
 static const char path[] = "/chosen";
 char bootargs[256];
 int bsz;
-int sz;
 int rm;
 
 n = ofd_node_find(m, path);
@@ -270,18 +263,6 @@ static ofdn_t ofd_chosen_props(void *m, 
 strcpy(bootargs, cmdline);
 bsz = strlen(bootargs) + 1;
 rm = sizeof (bootargs) - bsz;
-
-if (default_bootargs != NULL) {
-sz = strlen(default_bootargs);
-if (sz > rm) {
-panic("default_bootargs is too big: 0x%x > 0x%x\n",
-  sz, rm);
-} else if (sz > 0) {
-memcpy(&bootargs[bsz - 1], default_bootargs, sz + 1);
-bsz += sz;
-rm -= sz;
-}
-}
 
 printk("DOM0 bootargs: %s\n", bootargs);
 ofd_prop_add(m, n, "bootargs", bootargs, bsz);
diff -r c9bf3af5624b xen/arch/powerpc

[XenPPC] [PATCH 4/6][TOOLS][XM-TEST] Update .hgignore to remove artifacts of ramdisk build

2006-09-30 Thread Tony Breeds
Update .hgignore to remove artifacts of ramdisk build.

Signed-off-by: Tony Breeds <[EMAIL PROTECTED]>
---

.hgignore |9 +
1 file changed, 9 insertions(+)


diff -r 76cd9324d142 -r 8fd3e1ce2f9f .hgignore
--- a/.hgignore Fri Sep 29 15:54:43 2006 +1000
+++ b/.hgignore Fri Sep 29 15:57:28 2006 +1000
@@ -181,6 +181,15 @@
 ^tools/xentrace/xenctx$
 ^tools/xentrace/xentrace$
 ^tools/xm-test/ramdisk/buildroot
+^tools/xm-test/aclocal.m4$
+^tools/xm-test/autom4te
+^tools/xm-test/install-sh$
+^tools/xm-test/missing$
+^tools/xm-test/config(ure|.log|.status)$
+^tools/xm-test/Makefile(.in)*$
+^tools/xm-test/.*/Makefile(.in)*$
+^tools/xm-test/lib/XmTestLib/config.py$
+^tools/xm-test/lib/XmTestReport/xmtest.py$
 ^xen/BLOG$
 ^xen/TAGS$
 ^xen/arch/x86/asm-offsets\.s$



___
Xen-ppc-devel mailing list
Xen-ppc-devel@lists.xensource.com
http://lists.xensource.com/xen-ppc-devel


[XenPPC] [PATCH 1/6][TOOLS][XM-TEST] Update to use uClib buildroot-snapshot

2006-09-30 Thread Tony Breeds
Update to use uClib buildroot-snapshot.

Dated file no longer exists on upstream server.

Signed-off-by: Tony Breeds <[EMAIL PROTECTED]>
---

tools/xm-test/ramdisk/Makefile.am |3 +--
1 file changed, 1 insertion(+), 2 deletions(-)


diff -r 500043f8ccff -r 3207a28bb29d tools/xm-test/ramdisk/Makefile.am
--- a/tools/xm-test/ramdisk/Makefile.am Thu Sep 28 12:47:45 2006 -0700
+++ b/tools/xm-test/ramdisk/Makefile.am Fri Sep 29 15:51:20 2006 +1000
@@ -2,9 +2,8 @@ INITRD ?= http://xm-test.xensource.com/r
 
 EXTRA_DIST = skel configs patches
 
-BR_TAR = buildroot-20060606.tar.bz2
+BR_TAR = buildroot-snapshot.tar.bz2
 BR_URL = http://buildroot.uclibc.org/downloads/snapshots/$(BR_TAR)
-#BR_URL = 
http://buildroot.uclibc.org/downloads/snapshots/buildroot-snapshot.tar.bz2
 BR_SRC = buildroot
 BR_IMG = $(BR_SRC)/rootfs.i386.ext2
 



___
Xen-ppc-devel mailing list
Xen-ppc-devel@lists.xensource.com
http://lists.xensource.com/xen-ppc-devel


[XenPPC] [PATCH 2/6][TOOLS][XM-TEST] Remove hard coded reference to i386

2006-09-30 Thread Tony Breeds
Remove hard coded reference to i386.

In preperation for other architectures.

Signed-off-by: Tony Breeds <[EMAIL PROTECTED]>
---

tools/xm-test/ramdisk/Makefile.am |6 --
1 file changed, 4 insertions(+), 2 deletions(-)

diff -r 3207a28bb29d -r 5017ce424246 tools/xm-test/ramdisk/Makefile.am
--- a/tools/xm-test/ramdisk/Makefile.am Fri Sep 29 15:51:20 2006 +1000
+++ b/tools/xm-test/ramdisk/Makefile.am Fri Sep 29 15:52:31 2006 +1000
@@ -2,12 +2,14 @@ INITRD ?= http://xm-test.xensource.com/r
 
 EXTRA_DIST = skel configs patches
 
+BR_ARCH = $(shell uname -m | sed -e s/i.86/i386/)
+
 BR_TAR = buildroot-snapshot.tar.bz2
 BR_URL = http://buildroot.uclibc.org/downloads/snapshots/$(BR_TAR)
 BR_SRC = buildroot
-BR_IMG = $(BR_SRC)/rootfs.i386.ext2
+BR_IMG = $(BR_SRC)/rootfs.$(BR_ARCH).ext2
 
-BR_ROOT = build_i386/root
+BR_ROOT = build_$(BR_ARCH)/root
 
 HVM_SCRIPT = bin/create_disk_image
 



___
Xen-ppc-devel mailing list
Xen-ppc-devel@lists.xensource.com
http://lists.xensource.com/xen-ppc-devel


[XenPPC] [PATCH 3/6][TOOLS][XM-TEST] rename buildroot -> buildroot-i386

2006-09-30 Thread Tony Breeds
rename buildroot -> buildroot-i386.

Also update Makefile.

Signed-off-by: Tony Breeds <[EMAIL PROTECTED]>
---
hg mv --after tools/xm-test/ramdisk/configs/buildroot{,-i386}

tools/xm-test/ramdisk/Makefile.am|2 
tools/xm-test/ramdisk/configs/buildroot  |  330 ---
tools/xm-test/ramdisk/configs/buildroot-i386 |  330 +++
3 files changed, 331 insertions(+), 331 deletions(-)

diff -r 5017ce424246 -r 76cd9324d142 tools/xm-test/ramdisk/Makefile.am
--- a/tools/xm-test/ramdisk/Makefile.am Fri Sep 29 15:52:31 2006 +1000
+++ b/tools/xm-test/ramdisk/Makefile.am Fri Sep 29 15:54:43 2006 +1000
@@ -31,7 +31,7 @@ endif
tar xjf $(BR_TAR)
 
 $(BR_IMG): $(BR_SRC)
-   cp configs/buildroot $(BR_SRC)/.config
+   cp configs/buildroot-$(BR_ARCH) $(BR_SRC)/.config
cp configs/busybox $(BR_SRC)/package/busybox/busybox.config
cp configs/uClibc $(BR_SRC)/toolchain/uClibc/uClibc.config
(for i in patches/buildroot/*.patch; do \
diff -r 5017ce424246 -r 76cd9324d142 
tools/xm-test/ramdisk/configs/buildroot-i386
--- /dev/null   Thu Jan 01 00:00:00 1970 +
+++ b/tools/xm-test/ramdisk/configs/buildroot-i386  Fri Sep 29 15:54:43 
2006 +1000
@@ -0,0 +1,330 @@
+#
+# Automatically generated make config: don't edit
+#
+BR2_HAVE_DOT_CONFIG=y
+# BR2_alpha is not set
+# BR2_arm is not set
+# BR2_armeb is not set
+# BR2_cris is not set
+BR2_i386=y
+# BR2_m68k is not set
+# BR2_mips is not set
+# BR2_mipsel is not set
+# BR2_nios2 is not set
+# BR2_powerpc is not set
+# BR2_sh is not set
+# BR2_sparc is not set
+# BR2_x86_64 is not set
+BR2_x86_i386=y
+# BR2_x86_i486 is not set
+# BR2_x86_i586 is not set
+# BR2_x86_i686 is not set
+BR2_ARCH="i386"
+BR2_ENDIAN="LITTLE"
+
+#
+# Build options
+#
+BR2_WGET="wget --passive-ftp"
+BR2_SVN="svn co"
+BR2_TAR_OPTIONS=""
+BR2_DL_DIR="$(BASE_DIR)/dl"
+BR2_SOURCEFORGE_MIRROR="easynews"
+BR2_STAGING_DIR="$(BUILD_DIR)/staging_dir"
+BR2_TOPDIR_PREFIX=""
+BR2_TOPDIR_SUFFIX=""
+BR2_GNU_BUILD_SUFFIX="pc-linux-gnu"
+BR2_JLEVEL=1
+
+#
+# Toolchain Options
+#
+
+#
+# Kernel Header Options
+#
+# BR2_KERNEL_HEADERS_2_4_25 is not set
+# BR2_KERNEL_HEADERS_2_4_27 is not set
+# BR2_KERNEL_HEADERS_2_4_29 is not set
+# BR2_KERNEL_HEADERS_2_4_31 is not set
+# BR2_KERNEL_HEADERS_2_6_9 is not set
+# BR2_KERNEL_HEADERS_2_6_11 is not set
+BR2_KERNEL_HEADERS_2_6_12=y
+BR2_DEFAULT_KERNEL_HEADERS="2.6.12"
+
+#
+# uClibc Options
+#
+# BR2_UCLIBC_VERSION_SNAPSHOT is not set
+# BR2_ENABLE_LOCALE is not set
+# BR2_PTHREADS_NONE is not set
+# BR2_PTHREADS is not set
+BR2_PTHREADS_OLD=y
+# BR2_PTHREADS_NATIVE is not set
+
+#
+# Binutils Options
+#
+# BR2_BINUTILS_VERSION_2_14_90_0_8 is not set
+# BR2_BINUTILS_VERSION_2_15 is not set
+# BR2_BINUTILS_VERSION_2_15_94_0_2_2 is not set
+# BR2_BINUTILS_VERSION_2_15_97 is not set
+# BR2_BINUTILS_VERSION_2_16_1 is not set
+# BR2_BINUTILS_VERSION_2_16_90_0_3 is not set
+# BR2_BINUTILS_VERSION_2_16_91_0_3 is not set
+# BR2_BINUTILS_VERSION_2_16_91_0_4 is not set
+# BR2_BINUTILS_VERSION_2_16_91_0_5 is not set
+# BR2_BINUTILS_VERSION_2_16_91_0_6 is not set
+BR2_BINUTILS_VERSION_2_16_91_0_7=y
+BR2_BINUTILS_VERSION="2.16.91.0.7"
+BR2_EXTRA_BINUTILS_CONFIG_OPTIONS=""
+
+#
+# Gcc Options
+#
+# BR2_GCC_VERSION_3_3_5 is not set
+# BR2_GCC_VERSION_3_3_6 is not set
+# BR2_GCC_VERSION_3_4_2 is not set
+# BR2_GCC_VERSION_3_4_3 is not set
+# BR2_GCC_VERSION_3_4_4 is not set
+# BR2_GCC_VERSION_3_4_5 is not set
+BR2_GCC_VERSION_3_4_6=y
+# BR2_GCC_VERSION_4_0_0 is not set
+# BR2_GCC_VERSION_4_0_1 is not set
+# BR2_GCC_VERSION_4_0_2 is not set
+# BR2_GCC_VERSION_4_0_3 is not set
+# BR2_GCC_VERSION_4_1_0 is not set
+# BR2_GCC_VERSION_4_2 is not set
+# BR2_GCC_IS_SNAP is not set
+BR2_GCC_VERSION="3.4.6"
+# BR2_GCC_USE_SJLJ_EXCEPTIONS is not set
+BR2_EXTRA_GCC_CONFIG_OPTIONS=""
+# BR2_INSTALL_LIBSTDCPP is not set
+# BR2_INSTALL_OBJC is not set
+
+#
+# Ccache Options
+#
+BR2_CCACHE=y
+
+#
+# Gdb Options
+#
+# BR2_PACKAGE_GDB is not set
+# BR2_PACKAGE_GDB_SERVER is not set
+# BR2_PACKAGE_GDB_HOST is not set
+
+#
+# elf2flt
+#
+# BR2_ELF2FLT is not set
+
+#
+# Common Toolchain Options
+#
+# BR2_PACKAGE_SSTRIP_TARGET is not set
+# BR2_PACKAGE_SSTRIP_HOST is not set
+BR2_ENABLE_MULTILIB=y
+BR2_LARGEFILE=y
+BR2_TARGET_OPTIMIZATION="-Os -pipe"
+BR2_CROSS_TOOLCHAIN_TARGET_UTILS=y
+
+#
+# Package Selection for the target
+#
+
+#
+# The default minimal system
+#
+BR2_PACKAGE_BUSYBOX=y
+# BR2_PACKAGE_BUSYBOX_SNAPSHOT is not set
+BR2_PACKAGE_BUSYBOX_INSTALL_SYMLINKS=y
+BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox.config"
+
+#
+# The minimum needed to build a uClibc development system
+#
+# BR2_PACKAGE_BASH is not set
+# BR2_PACKAGE_BZIP2 is not set
+# BR2_PACKAGE_COREUTILS is not set
+# BR2_PACKAGE_DIFFUTILS is not set
+# BR2_PACKAGE_ED is not set
+# BR2_PACKAGE_FINDUTILS is not set
+# BR2_PACKAGE_FLEX is not set
+# BR2_PACKAGE_GAWK is not set
+# BR2_PACKAGE_GCC_TARGET is not set
+# BR2_PACKAGE_CCACHE_TARGET is not set
+# BR2_PACKA

[XenPPC] [PATCH 6/6][TOOLS][XM-TEST] Add configuration data for powerpc

2006-09-30 Thread Tony Breeds
Add configuration data for powerpc.

Allows for building of initrd, and running of tests.

Signed-off-by: Tony Breeds <[EMAIL PROTECTED]>
---

tools/xm-test/lib/XmTestLib/arch.py |   30 +
tools/xm-test/lib/XmTestReport/arch.py  |6 
tools/xm-test/ramdisk/Makefile.am   |2 
tools/xm-test/ramdisk/configs/buildroot-powerpc |  334 
4 files changed, 371 insertions(+), 1 deletion(-)

diff -r 989b397808f8 -r 82402a95e380 tools/xm-test/lib/XmTestLib/arch.py
--- a/tools/xm-test/lib/XmTestLib/arch.py   Fri Sep 29 17:11:31 2006 +1000
+++ b/tools/xm-test/lib/XmTestLib/arch.py   Fri Sep 29 20:52:32 2006 +1000
@@ -80,6 +80,29 @@ ia_HVMDefaults =  {"memory"   : 
 }
 # End  : Intel ia32 and ia64 as well as AMD 32-bit and 64-bit processors
 
+# Begin: PowerPC
+def ppc_minSafeMem():
+return 64
+
+def ppc_getDeviceModel():
+return "/usr/lib64/xen/bin/qemu-dm"
+
+def ppc_getDefaultKernel():
+"""Get the path to the default DomU kernel"""
+dom0Ver = commands.getoutput("uname -r");
+domUVer = dom0Ver.replace("xen0", "xenU");
+
+return "/boot/vmlinux-" + domUVer;
+
+ppc_ParavirtDefaults = {"memory"  : 64,
+"vcpus"   : 1,
+"kernel"  : ppc_getDefaultKernel(),
+"root": "/dev/ram0",
+"ramdisk" : getRdPath() + "/initrd.img",
+"extra"   : "xencons=tty128 console=tty128",
+}
+# End  : PowerPC
+
 """Convert from uname specification to a more general platform."""
 _uanme_to_arch_map = {
 "i386"  : "x86",
@@ -87,6 +110,8 @@ _uanme_to_arch_map = {
 "i586"  : "x86",
 "i686"  : "x86",
 "ia64"  : "ia64",
+"ppc"   : "powerpc",
+"ppc64" : "powerpc",
 }
 
 # Lookup current platform.
@@ -99,5 +124,10 @@ if _arch == "x86" or _arch == "ia64":
 configDefaults = ia_HVMDefaults
 else:
 configDefaults = ia_ParavirtDefaults
+elif _arch == "powerpc":
+minSafeMem = ppc_minSafeMem
+getDeviceModel = ppc_getDeviceModel
+getDefaultKernel = ppc_getDefaultKernel
+configDefaults = ppc_ParavirtDefaults
 else:
 raise ValueError, "Unknown architecture!"
diff -r 989b397808f8 -r 82402a95e380 tools/xm-test/lib/XmTestReport/arch.py
--- a/tools/xm-test/lib/XmTestReport/arch.pyFri Sep 29 17:11:31 2006 +1000
+++ b/tools/xm-test/lib/XmTestReport/arch.pyFri Sep 29 20:52:32 2006 +1000
@@ -29,6 +29,8 @@ _uanme_to_arch_map = {
 "i586" : "x86",
 "i686" : "x86",
 "ia64" : "ia64",
+"ppc"   : "powerpc",
+"ppc64" : "powerpc",
 }
 
 _arch = _uanme_to_arch_map.get(os.uname()[4], "Unknown")
@@ -38,5 +40,9 @@ elif _arch == "ia64":
 elif _arch == "ia64":
 cpuValues = {"arch" : "Unknown",
  "features" : "Unknown"}
+elif _arch == "powerpc":
+cpuValues = {"cpu"  : "Unknown",
+ "platform" : "Unknown",
+ "revision" : "Unknown"}
 else:
 raise ValueError, "Unknown architecture!"
diff -r 989b397808f8 -r 82402a95e380 tools/xm-test/ramdisk/Makefile.am
--- a/tools/xm-test/ramdisk/Makefile.am Fri Sep 29 17:11:31 2006 +1000
+++ b/tools/xm-test/ramdisk/Makefile.am Fri Sep 29 20:52:32 2006 +1000
@@ -2,7 +2,7 @@ INITRD ?= http://xm-test.xensource.com/r
 
 EXTRA_DIST = skel configs patches
 
-BR_ARCH = $(shell uname -m | sed -e s/i.86/i386/)
+BR_ARCH = $(shell uname -m | sed -e s/i.86/i386/ -e 's/ppc\(64\)*/powerpc/')
 
 BR_TAR = buildroot-snapshot.tar.bz2
 BR_URL = http://buildroot.uclibc.org/downloads/snapshots/$(BR_TAR)
diff -r 989b397808f8 -r 82402a95e380 
tools/xm-test/ramdisk/configs/buildroot-powerpc
--- /dev/null   Thu Jan 01 00:00:00 1970 +
+++ b/tools/xm-test/ramdisk/configs/buildroot-powerpc   Fri Sep 29 20:52:32 
2006 +1000
@@ -0,0 +1,334 @@
+#
+# Automatically generated make config: don't edit
+#
+BR2_HAVE_DOT_CONFIG=y
+# BR2_alpha is not set
+# BR2_arm is not set
+# BR2_armeb is not set
+# BR2_cris is not set
+# BR2_i386 is not set
+# BR2_m68k is not set
+# BR2_mips is not set
+# BR2_mipsel is not set
+# BR2_nios2 is not set
+BR2_powerpc=y
+# BR2_sh is not set
+# BR2_sh64 is not set
+# BR2_sparc is not set
+# BR2_x86_64 is not set
+# BR2_x86_i386 is not set
+# BR2_x86_i486 is not set
+# BR2_x86_i586 is not set
+# BR2_x86_i686 is not set
+BR2_ARCH="powerpc"
+BR2_ENDIAN="BIG"
+
+#
+# Build options
+#
+BR2_WGET="wget --passive-ftp"
+BR2_SVN="svn co"
+BR2_TAR_OPTIONS=""
+BR2_DL_DIR="$(BASE_DIR)/dl"
+BR2_SOURCEFORGE_MIRROR="easynews"
+BR2_STAGING_DIR="$(BUILD_DIR)/staging_dir"
+BR2_TOPDIR_PREFIX=""
+BR2_TOPDIR_SUFFIX=""
+BR2_GNU_BUILD_SUFFIX="pc-linux-gnu"
+BR2_GNU_TARGET_SUFFIX="linux-uclibc"
+BR2_JLEVEL=1
+
+#
+# Toolchain Options
+#
+
+#
+# Kernel Header Options
+#
+# BR2_KERNEL_HEADERS_2_4_25 is not set
+# BR2_KERNEL_HEADERS_2_4_27 is not set
+# BR2_KERNEL_HEADERS_2_4_29 is not set
+# BR2_KERNEL_HEADERS_2_4_31 is not set
+# BR2_KERNEL_HEADERS_2_6_9 is not set
+# BR2_KERNEL_HEADERS_2_6_11 is not set
+BR2_KERNEL_HEADER

[XenPPC] [PATCH 5/6][TOOLS][XM-TEST] Refactor code to encapsulate architecture decisions in one place

2006-09-30 Thread Tony Breeds
Refactor code to encapsulate architecture decisions in one place.

Also includes some whitespace fixes.

Signed-off-by: Tony Breeds <[EMAIL PROTECTED]>
---

tools/xm-test/lib/XmTestLib/XenDomain.py   |   72 +++---
tools/xm-test/lib/XmTestLib/arch.py|  103 +
tools/xm-test/lib/XmTestReport/OSReport.py |   10 --
tools/xm-test/lib/XmTestReport/arch.py |   42 
4 files changed, 163 insertions(+), 64 deletions(-)


diff -r 8fd3e1ce2f9f -r 989b397808f8 tools/xm-test/lib/XmTestLib/XenDomain.py
--- a/tools/xm-test/lib/XmTestLib/XenDomain.py  Fri Sep 29 15:57:28 2006 +1000
+++ b/tools/xm-test/lib/XmTestLib/XenDomain.py  Fri Sep 29 17:11:31 2006 +1000
@@ -20,33 +20,25 @@
 
 import sys
 import commands
-import os
 import re
 import time
 
 from Xm import *
+from arch import *
 from Test import *
 from config import *
 from Console import *
 from XenDevice import *
 
-BLOCK_ROOT_DEV = "hda"
 
 def getDeviceModel():
-"""Get the path to the device model based on
-the architecture reported in uname"""
-arch = os.uname()[4]
-if re.search("64", arch):
-return "/usr/lib64/xen/bin/qemu-dm"
-else:
-return "/usr/lib/xen/bin/qemu-dm"
+return arch.getDeviceModel()
 
 def getDefaultKernel():
-"""Get the path to the default DomU kernel"""
-dom0Ver = commands.getoutput("uname -r");
-domUVer = dom0Ver.replace("xen0", "xenU");
-
-return "/boot/vmlinuz-" + domUVer;
+return arch.getDefaultKernel()
+
+def getRdPath():
+return arch.getRdPath()
 
 def getUniqueName():
 """Get a uniqueish name for use in a domain"""
@@ -55,43 +47,8 @@ def getUniqueName():
 test_name = re.sub("\.test", "", test_name)
 test_name = re.sub("[\/\.]", "", test_name)
 name = "%s-%i" % (test_name, unixtime)
-
+
 return name
-
-def getRdPath():
-rdpath = os.environ.get("RD_PATH")
-if not rdpath:
-rdpath = "../../ramdisk"
-rdpath = os.path.abspath(rdpath)
-
-return rdpath
-
-ParavirtDefaults = {"memory"   : 64,
-"vcpus": 1,
-"kernel"   : getDefaultKernel(),
-"root" : "/dev/ram0",
-"ramdisk"  : getRdPath() + "/initrd.img"
-}
-HVMDefaults =  {"memory"   : 64,
-"vcpus": 1,
-"acpi" : 0,
-"apic" : 0,
-"disk" : ["file:%s/disk.img,ioemu:%s,w!" %
-   (getRdPath(), BLOCK_ROOT_DEV)],
-"kernel"   : "/usr/lib/xen/boot/hvmloader",
-"builder"  : "hvm",
-"sdl"  : 0,
-"vnc"  : 0,
-"vncviewer": 0,
-"nographic": 1,
-"serial"   : "pty",
-"device_model" : getDeviceModel()
-}
-
-if ENABLE_HVM_SUPPORT:
-configDefaults = HVMDefaults
-else:
-configDefaults = ParavirtDefaults
 
 class XenConfig:
 """An object to help create a xen-compliant config file"""
@@ -140,7 +97,8 @@ class XenConfig:
 
 def setOpt(self, name, value):
 """Set an option in the config"""
-if name in self.opts.keys() and isinstance(self.opts[name], list) and 
not isinstance(value, list):
+if name in self.opts.keys() and isinstance(self.opts[name] ,
+list) and not isinstance(value, list):
 self.opts[name] = [value]
 else:
 self.opts[name] = value
@@ -177,7 +135,7 @@ class DomainError(Exception):
 self.errorcode = int(errorcode)
 except Exception, e:
 self.errorcode = -1
-
+
 def __str__(self):
 return str(self.msg)
 
@@ -199,7 +157,7 @@ class XenDomain:
 self.devices = {}
 self.netEnv = "bridge"
 
-# Set domain type, either PV for ParaVirt domU or HVM for 
+# Set domain type, either PV for ParaVirt domU or HVM for
 # FullVirt domain
 if ENABLE_HVM_SUPPORT:
 self.type = "HVM"
@@ -332,7 +290,8 @@ class XenDomain:
 
 class XmTestDomain(XenDomain):
 
-def __init__(self, name=None, extraConfig=None, baseConfig=configDefaults):
+def __init__(self, name=None, extraConfig=None,
+ baseConfig=arch.configDefaults):
 """Create a new xm-test domain
 @param name: The requested domain name
 @param extraConfig: Additional configuration options
@@ -351,11 +310,12 @@ class XmTestDomain(XenDomain):
 XenDomain.__init__(self, config.getOpt("name"), config=config)
 
 def minSafeMem(self):
-return 32
+return arch.minSafeMem
 
 class XmTestNetDomain(XmTestDomain):
 
-def __init__(self, name=None, extraConfig=None, baseConfig=configDefaults):
+def __init__(self, name=None, extraConfig=None,
+

[XenPPC] [PATCH 0/6][TOOLS][XM-TEST] Update xm-test to support new architectures

2006-09-30 Thread Tony Breeds
Hi All,
These patches update the xm-test code to be more easily portable
to new architecture. This focus od this endevour is PPC but I believe
that IA64 also benifits.

Patch summary:

 1: Instead of using a dated snapshot (which no longer exists)
use buildroot-snapshot.
 2: Remove hardcoded references to i386.
 3: Rename configs/buildroot -> configs/buildroot-i386
and update Makefiles.
 5: Update .hgignore to remove noise from the initrd building process
 5: Refactor the XmTestLib and XmTestReport code to encapsulate all
platform variations in one place.
 6: FYI: Add powerpc definiations.
This patch is for the xenppc tree but included here for comments and
completeness.

With these patches applied I'm still able to build an initrd and run the
xm-test on x86 with no regressions.

Feedback appreciated.

Signed-off-by: Tony Breeds <[EMAIL PROTECTED]>
---

.hgignore   |9 
tools/xm-test/lib/XmTestLib/XenDomain.py|   72 ---
tools/xm-test/lib/XmTestLib/arch.py |  133 ++
tools/xm-test/lib/XmTestReport/OSReport.py  |   10 
tools/xm-test/lib/XmTestReport/arch.py  |   48 ++
tools/xm-test/ramdisk/Makefile.am   |   13 
tools/xm-test/ramdisk/configs/buildroot |  330 ---
tools/xm-test/ramdisk/configs/buildroot-i386|  330 +++
tools/xm-test/ramdisk/configs/buildroot-powerpc |  334 
9 files changed, 879 insertions(+), 400 deletions(-)





___
Xen-ppc-devel mailing list
Xen-ppc-devel@lists.xensource.com
http://lists.xensource.com/xen-ppc-devel


[XenPPC] Document boot argument processing

2006-09-30 Thread Amos Waterland
Hollis requested that boot argument processing be documented.  I have
placed the following text on this wiki:

 http://wiki.xensource.com/xenwiki/XenPPC/BootArguments

---

The boot argument processing for powerpc Xen is much less complex than
it may appear.  Assuming that the 'Simplify bootargs processing' patch
is accepted in some form, the following rules apply:

  1. Arguments from 32-bit wrapper override all else
  2. Builtin arguments in 64-bit image override firmware
  3. Firmware is used if neither of the above exist

It is true that dom0 Linux has its own boot argument processing, but
there is a simple transitive relation between Xen's bootargs and Linux's
bootargs.  That is, Xen first applies the above three rules to decide
what to feed Linux.  Linux then applies its three rules (it orders their
precedence slightly differently) to decide what to feed the kernel proper.

The format of the builtin command line buffer is essentially just a
seperate ELF section, which makes it easy for post-processing tools to
locate it and edit it.  If you have a 2.6.17 or later zImage kernel
available, the following is illustrative:

 $ objdump -h arch/powerpc/boot/zImage | grep cmdline
 2 __builtin_cmdline 0200  00406274  00406274  00016274  2**2

The format of the builtin command line buffer is simple, so many tools
may one day understand it, but at present the most commonly-used 
tool is `bicl', which is shipped under the LGPL as part of the K42 source:

 http://www.cs.unm.edu/~k42/tools/bicl

The usage of the tool is simple:

 $ bicl
 `builtin-cmdline' manipulates builtin command line arguments
 
  Usage: builtin-cmdline FILE [ARGS]
   -?, --help Show this help statement.
   --version  Show version statement.
 
  Examples: builtin-cmdline zImage
builtin-cmdline zImage 'console=ttyS0'

The tool is used every day to edit the builtin command lines of Linux and
Xen binaries as part of an internal IBM project.


___
Xen-ppc-devel mailing list
Xen-ppc-devel@lists.xensource.com
http://lists.xensource.com/xen-ppc-devel


[XenPPC] Re: [Xen-devel] [PATCH 0/6][TOOLS][XM-TEST] Update xm-test to support new architectures

2006-09-30 Thread Tony Breeds
On Fri, Sep 29, 2006 at 08:56:54PM +1100, Tony Breeds wrote:
> Hi All,
>   These patches update the xm-test code to be more easily portable
> to new architecture. This focus od this endevour is PPC but I believe
> that IA64 also benifits.



By way of a quick status report.

With all thee patches applied to tip (7de08aceff6d) I ran:

I build xm-test:
cd xen.hg/tools/xm-test
./autogen
./configure
INITRD="http://ozlabs.au.ibm.com/~tony/xm-test/"; make existing

I created a grouptest/xenppc file which contains most[1] of the
potential tests and pushed the whole xm-test dir (yes it's wasteful but
it's also easy) to my JS20 blade.  Then:
./runtest.sh -d -e [EMAIL PROTECTED] -g xenppc xenppc

creates the following report.
---
Xm-test execution summary:
  PASS:  48
  FAIL:  17
  XPASS: 0
  XFAIL: 0


Details:

 FAIL: 01_block_attach_device_pos 
 block-attach failed device did not switch to Connected state

 FAIL: 02_block_attach_file_device_pos 
 block-attach failed device did not switch to Connected state

 FAIL: 04_block_attach_device_repeatedly_pos 
 Device is not actually attached to domU

 FAIL: 05_block_attach_and_dettach_device_repeatedly_pos 
 block-attach failed device did not switch to Connected state

 FAIL: 09_block_attach_and_dettach_device_check_data_pos 
 block-attach failed device did not switch to Connected state

 FAIL: 01_block-destroy_btblock_pos 
 block device isn't attached; can't detach!

 FAIL: 02_block-destroy_rtblock_pos 
 block-attach failed device did not switch to Connected state

 FAIL: 05_block-destroy_byname_pos 
 block device isn't attached; can't detach!

 FAIL: 06_block-destroy_check_list_pos 
 block-attach failed device did not switch to Connected state

 FAIL: 01_block_device_read_verify 
 block-attach failed device did not switch to Connected state

 FAIL: 02_block_device_write_verify 
 block-attach failed device did not switch to Connected state

 FAIL: 01_block-list_pos 
 Failed to verify that block dev is attached on DomainU

 FAIL: 02_block-list_attachbd_pos 
 block-attach failed device did not switch to Connected state

 FAIL: 03_block-list_anotherbd_pos 
 Failed to verify that block dev is attached on DomainU

 FAIL: 06_block-list_checkremove_pos 
 block-attach failed device did not switch to Connected state

 FAIL: 01_memset_basic_pos 
 Invalid domU meminfo line

 FAIL: 03_memset_random_pos 
 Invalid domU meminfo line

---

You'd certainly expect the block-* tests to fail.  I don't know why the
memset tests failed but I'll find out next week when I'm back at work.

[1] I omitted create/destroy, save/restore, network* and the scheduler
tests becuase I know some of them crash the machine, attached is the
xenppc file I used.


Yours Tony

   linux.conf.au   http://linux.conf.au/ || http://lca2007.linux.org.au/
   Jan 15-20 2007  The Australian Linux Technical Conference!

block-create
block-destroy
block-integrity
block-list
console
dmesg
domid
domname
help
info
list
memmax
memset
pause
unpause
reboot
shutdown
sysrq
vcpu-disable
vcpu-pin
vtpm
___
Xen-ppc-devel mailing list
Xen-ppc-devel@lists.xensource.com
http://lists.xensource.com/xen-ppc-devel