[XenPPC] [xenppc-unstable] [XEN][POWERPC] workaround for context_switch() bug

2007-03-22 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Date 1166189763 18000
# Node ID 156f2644eb062bc57e42747a745a8bac077e8d7b
# Parent  fdb3c96eba0f8d898dd5e734598ddc671114f1a1
[XEN][POWERPC] workaround for context_switch() bug
 We have a bug in that if we switch domains in schedule() we switch
 right away regardless of whatever else is pending.  This means that
 if the timer goes off while in schedule(), the next domain will be
 preempted by the interval defined below.  So until we fix our
 cotnext_switch(), the follow workaround will make sure that the
 domain we switch to does not run for to long so we can continue to
 service the other timers in the timer queue and that the value is
 long enough to escape this particular timer event.
Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
Signed-off-by: Hollis Blanchard [EMAIL PROTECTED]
---
 xen/arch/powerpc/exceptions.c |   19 +--
 1 files changed, 17 insertions(+), 2 deletions(-)

diff -r fdb3c96eba0f -r 156f2644eb06 xen/arch/powerpc/exceptions.c
--- a/xen/arch/powerpc/exceptions.c Thu Feb 08 07:05:26 2007 -0500
+++ b/xen/arch/powerpc/exceptions.c Fri Dec 15 08:36:03 2006 -0500
@@ -35,7 +35,9 @@ extern ulong ppc_do_softirq(ulong orig_m
 extern ulong ppc_do_softirq(ulong orig_msr);
 extern void do_timer(struct cpu_user_regs *regs);
 extern void do_dec(struct cpu_user_regs *regs);
-extern void program_exception(struct cpu_user_regs *regs, unsigned long 
cookie);
+extern void program_exception(struct cpu_user_regs *regs,
+  unsigned long cookie);
+extern int reprogram_timer(s_time_t timeout); 
 
 int hdec_sample = 0;
 
@@ -43,7 +45,20 @@ void do_timer(struct cpu_user_regs *regs
 {
 /* Set HDEC high so it stops firing and can be reprogrammed by
  * set_preempt() */
-mthdec(INT_MAX);
+/* FIXME! HACK ALERT!
+ *
+ * We have a bug in that if we switch domains in schedule() we
+ * switch right away regardless of whatever else is pending.  This
+ * means that if the timer goes off while in schedule(), the next
+ * domain will be preempted by the interval defined below.  So
+ * until we fix our cotnext_switch(), the follow workaround will
+ * make sure that the domain we switch to does not run for to long
+ * so we can continue to service the other timers in the timer
+ * queue and that the value is long enough to escape this
+ * particular timer event.
+ */
+reprogram_timer(NOW() + MILLISECS(1));
+
 raise_softirq(TIMER_SOFTIRQ);
 }
 

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


[XenPPC] [xenppc-unstable] [XEN][POWERPC] Normalize timbase_freq to a 64bit value

2007-03-22 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Date 1166188616 18000
# Node ID 5a2b3a1b1f632475c8abdce25132e9d3ea767f7f
# Parent  156f2644eb062bc57e42747a745a8bac077e8d7b
[XEN][POWERPC] Normalize timbase_freq to a 64bit value
Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
Signed-off-by: Hollis Blanchard [EMAIL PROTECTED]
---
 xen/arch/powerpc/boot_of.c |7 ---
 xen/arch/powerpc/time.c|2 +-
 xen/include/asm-powerpc/time.h |2 +-
 3 files changed, 6 insertions(+), 5 deletions(-)

diff -r 156f2644eb06 -r 5a2b3a1b1f63 xen/arch/powerpc/boot_of.c
--- a/xen/arch/powerpc/boot_of.cFri Dec 15 08:36:03 2006 -0500
+++ b/xen/arch/powerpc/boot_of.cFri Dec 15 08:16:56 2006 -0500
@@ -1206,6 +1206,7 @@ static int __init boot_of_cpus(void)
 s32 cpuid;
 u32 cpu_clock[2];
 extern uint cpu_hard_id[NR_CPUS];
+u32 tbf;
 
 /* Look up which CPU we are running on right now and get all info
  * from there */
@@ -1220,12 +1221,12 @@ static int __init boot_of_cpus(void)
 
 cpu_node = bootcpu_node;
 
-result = of_getprop(cpu_node, timebase-frequency, timebase_freq,
-sizeof(timebase_freq));
+result = of_getprop(cpu_node, timebase-frequency, tbf, sizeof(tbf));
+timebase_freq = tbf;
 if (result == OF_FAILURE) {
 of_panic(Couldn't get timebase frequency!\n);
 }
-of_printf(OF: timebase-frequency = %d Hz\n, timebase_freq);
+of_printf(OF: timebase-frequency = %ld Hz\n, timebase_freq);
 
 result = of_getprop(cpu_node, clock-frequency,
 cpu_clock, sizeof(cpu_clock));
diff -r 156f2644eb06 -r 5a2b3a1b1f63 xen/arch/powerpc/time.c
--- a/xen/arch/powerpc/time.c   Fri Dec 15 08:36:03 2006 -0500
+++ b/xen/arch/powerpc/time.c   Fri Dec 15 08:16:56 2006 -0500
@@ -32,7 +32,7 @@ static int cpu_has_hdec = 1;
 static int cpu_has_hdec = 1;
 ulong ticks_per_usec;
 unsigned long cpu_khz;
-unsigned int timebase_freq;
+s64 timebase_freq;
 
 s_time_t get_s_time(void)
 {
diff -r 156f2644eb06 -r 5a2b3a1b1f63 xen/include/asm-powerpc/time.h
--- a/xen/include/asm-powerpc/time.hFri Dec 15 08:36:03 2006 -0500
+++ b/xen/include/asm-powerpc/time.hFri Dec 15 08:16:56 2006 -0500
@@ -27,7 +27,7 @@
 #include xen/percpu.h
 #include asm/processor.h
 
-extern unsigned int timebase_freq;
+extern s64 timebase_freq;
 #define CLOCK_TICK_RATE timebase_freq
 
 #define watchdog_disable() ((void)0)

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


[XenPPC] [xenppc-unstable] [POWERPC][XEN] Quiet timebase synchronization at boot.

2007-03-22 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Hollis Blanchard [EMAIL PROTECTED]
# Date 1174514579 18000
# Node ID d5408cc3fba7802fc46d5364b5e9a059eeaa9520
# Parent  59305500d95da83447a11732d0ed758702c11c64
[POWERPC][XEN] Quiet timebase synchronization at boot.
Signed-off-by: Hollis Blanchard [EMAIL PROTECTED]
---
 xen/arch/powerpc/smp-tbsync.c |   17 -
 1 files changed, 12 insertions(+), 5 deletions(-)

diff -r 59305500d95d -r d5408cc3fba7 xen/arch/powerpc/smp-tbsync.c
--- a/xen/arch/powerpc/smp-tbsync.c Wed Mar 21 17:02:59 2007 -0500
+++ b/xen/arch/powerpc/smp-tbsync.c Wed Mar 21 17:02:59 2007 -0500
@@ -31,6 +31,13 @@
 #define local_irq_disable()
 
 #define NUM_ITER   300
+
+#undef DEBUG
+#ifdef DEBUG
+#define DBG(fmt...) printk(fmt)
+#else
+#define DBG(fmt...)
+#endif
 
 enum {
kExit=0, kSetAndTest, kTest
@@ -128,7 +135,7 @@ void __devinit smp_generic_give_timebase
 {
int i, score, score2, old, min=0, max=5000, offset=1000;
 
-   printk(Synchronizing timebase\n);
+   printk(Synchronizing timebase...\n);
 
/* if this fails then this kernel won't work anyway... */
tbsync = kmalloc( sizeof(*tbsync), GFP_KERNEL );
@@ -139,13 +146,13 @@ void __devinit smp_generic_give_timebase
while (!tbsync-ack)
barrier();
 
-   printk(Got ack\n);
+   DBG(Got ack\n);
 
/* binary search */
for (old = -1; old != offset ; offset = (min+max) / 2) {
score = start_contest(kSetAndTest, offset, NUM_ITER);
 
-   printk(score %d, offset %d\n, score, offset );
+   DBG(score %d, offset %d\n, score, offset );
 
if( score  0 )
max = offset;
@@ -156,7 +163,7 @@ void __devinit smp_generic_give_timebase
score = start_contest(kSetAndTest, min, NUM_ITER);
score2 = start_contest(kSetAndTest, max, NUM_ITER);
 
-   printk(Min %d (score %d), Max %d (score %d)\n,
+   DBG(Min %d (score %d), Max %d (score %d)\n,
   min, score, max, score2);
score = abs(score);
score2 = abs(score2);
@@ -171,7 +178,7 @@ void __devinit smp_generic_give_timebase
if (score2 = score || score2  20)
break;
}
-   printk(Final offset: %d (%d/%d)\n, offset, score2, NUM_ITER );
+   DBG(Final offset: %d (%d/%d)\n, offset, score2, NUM_ITER );
 
/* exiting */
tbsync-cmd = kExit;

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


[XenPPC] [xenppc-unstable] [POWERPC][XEN] Fix xc_core build break. Untested but might work.

2007-03-22 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Hollis Blanchard [EMAIL PROTECTED]
# Date 1174514579 18000
# Node ID 58e796d053cab3ccaf3eb42b7d504abae34c0c8b
# Parent  09a3bd14a4fa1fb01b344c0a5f690ac209c9b48e
[POWERPC][XEN] Fix xc_core build break. Untested but might work.
Signed-off-by: Hollis Blanchard [EMAIL PROTECTED]
---
 tools/libxc/Makefile  |1 
 tools/libxc/xc_core.h |2 +
 tools/libxc/xc_core_powerpc.c |   79 ++
 tools/libxc/xc_core_powerpc.h |   57 ++
 4 files changed, 139 insertions(+)

diff -r 09a3bd14a4fa -r 58e796d053ca tools/libxc/Makefile
--- a/tools/libxc/Makefile  Wed Mar 21 17:02:59 2007 -0500
+++ b/tools/libxc/Makefile  Wed Mar 21 17:02:59 2007 -0500
@@ -8,6 +8,7 @@ CTRL_SRCS-y   += xc_core.c
 CTRL_SRCS-y   += xc_core.c
 CTRL_SRCS-$(CONFIG_X86) += xc_core_x86.c
 CTRL_SRCS-$(CONFIG_IA64) += xc_core_ia64.c
+CTRL_SRCS-$(CONFIG_POWERPC) += xc_core_powerpc.c
 CTRL_SRCS-y   += xc_domain.c
 CTRL_SRCS-y   += xc_evtchn.c
 CTRL_SRCS-y   += xc_misc.c
diff -r 09a3bd14a4fa -r 58e796d053ca tools/libxc/xc_core.h
--- a/tools/libxc/xc_core.h Wed Mar 21 17:02:59 2007 -0500
+++ b/tools/libxc/xc_core.h Wed Mar 21 17:02:59 2007 -0500
@@ -144,6 +144,8 @@ int xc_core_arch_map_p2m(int xc_handle, 
 # include xc_core_x86.h
 #elif defined (__ia64__)
 # include xc_core_ia64.h
+#elif defined (__powerpc__)
+# include xc_core_powerpc.h
 #else
 # error unsupported architecture
 #endif
diff -r 09a3bd14a4fa -r 58e796d053ca tools/libxc/xc_core_powerpc.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +
+++ b/tools/libxc/xc_core_powerpc.c Wed Mar 21 17:02:59 2007 -0500
@@ -0,0 +1,79 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ * Copyright (c) 2007 Isaku Yamahata yamahata at valinux co jp
+ *VA Linux Systems Japan K.K.
+ * Copyright IBM Corp. 2007
+ *
+ * Authors: Isaku Yamahata yamahata at valinux co jp
+ *  Hollis Blanchard [EMAIL PROTECTED]
+ *
+ */
+
+#include xg_private.h
+#include xc_core.h
+
+int
+xc_core_arch_auto_translated_physmap(const xc_dominfo_t *info)
+{
+   /* All PowerPC domU are autotranslated. */
+   return 1;
+}
+
+int
+xc_core_arch_map_p2m(int xc_handle, xc_dominfo_t *info,
+ shared_info_t *live_shinfo, xen_pfn_t **live_p2m,
+ unsigned long *pfnp)
+{
+   /* All PowerPC domU are autotranslated. */
+errno = ENOSYS;
+return -1;
+}
+
+int
+xc_core_arch_memory_map_get(int xc_handle, xc_dominfo_t *info,
+shared_info_t *live_shinfo,
+xc_core_memory_map_t **mapp,
+unsigned int *nr_entries)
+{
+xc_core_memory_map_t *map = NULL;
+
+map = malloc(sizeof(*map));
+if (!map) {
+PERROR(Could not allocate memory);
+goto out;
+}
+
+map-addr = 0;
+map-size = info-max_memkb * 1024;
+
+*mapp = map;
+*nr_entries = 1;
+return 0;
+
+out:
+free(map);
+return -1;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-set-style: BSD
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff -r 09a3bd14a4fa -r 58e796d053ca tools/libxc/xc_core_powerpc.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +
+++ b/tools/libxc/xc_core_powerpc.h Wed Mar 21 17:02:59 2007 -0500
@@ -0,0 +1,57 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ * Copyright (c) 2007 Isaku Yamahata yamahata at valinux co jp
+ *VA Linux Systems Japan K.K.
+ *
+ */
+
+#ifndef XC_CORE_POWERPC_H
+#define XC_CORE_POWERPC_H
+
+#define 

[XenPPC] [xenppc-unstable] GNTTAB: PowerPC patch for dynamic grant tables.

2007-03-05 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Hollis Blanchard [EMAIL PROTECTED]
# Date 1171871352 -32400
# Node ID 7e9dc164b5720dbf60929333d33f8d94e981fe5b
# Parent  3ac19fda0bc256bac20a4decf7e13bb086162220
GNTTAB: PowerPC patch for dynamic grant tables.
Grant table expansion is disabled for now, since we currently make assumptions
about grant table MFNs being contiguous.
Signed-off-by: Isaku Yamahata [EMAIL PROTECTED]
Signed-off-by: Hollis Blanchard [EMAIL PROTECTED]
---
 xen/arch/powerpc/mm.c |   16 ++--
 xen/common/grant_table.c  |2 ++
 xen/include/asm-powerpc/config.h  |9 +
 xen/include/asm-powerpc/grant_table.h |4 ++--
 xen/include/xen/grant_table.h |4 
 5 files changed, 31 insertions(+), 4 deletions(-)

diff -r 3ac19fda0bc2 -r 7e9dc164b572 xen/arch/powerpc/mm.c
--- a/xen/arch/powerpc/mm.c Fri Mar 02 12:11:52 2007 +
+++ b/xen/arch/powerpc/mm.c Mon Feb 19 16:49:12 2007 +0900
@@ -416,7 +416,13 @@ ulong pfn2mfn(struct domain *d, ulong pf
 if (pfn  foreign_map_pfn) {
 t = PFN_TYPE_FOREIGN;
 mfn = foreign_to_mfn(d, pfn);
-} else if (pfn = max_page  pfn  (max_page + NR_GRANT_FRAMES)) {
+} else if (pfn = max_page  pfn 
+  (max_page + nr_grant_frames(d-grant_table))) {
+/* XXX access d-grant_table-nr_grant_frames without lock.
+ * Currently on powerpc dynamic expanding grant table is
+ * inhibited by setting max_nr_grant_frames = INITIAL_NR_GRANT_FRAMES
+ * so that this access is safe.
+ */
 /* Its a grant table access */
 t = PFN_TYPE_GNTTAB;
 mfn = gnttab_shared_mfn(d, d-grant_table, (pfn - max_page));
@@ -494,9 +500,15 @@ unsigned long mfn_to_gmfn(struct domain 
 ulong gnttab_mfn;
 ulong rma_mfn;
 
+/* XXX access d-grant_table-nr_grant_frames without lock.
+ * Currently on powerpc dynamic expanding grant table is
+ * inhibited by setting max_nr_grant_frames = INITIAL_NR_GRANT_FRAMES
+ * so that this access is safe.
+ */
 /* grant? */
 gnttab_mfn = gnttab_shared_mfn(d, d-grant_table, 0);
-if (mfn = gnttab_mfn  mfn  (gnttab_mfn + NR_GRANT_FRAMES))
+if (mfn = gnttab_mfn  mfn 
+   (gnttab_mfn + nr_grant_frames(d-grant_table)))
 return max_page + (mfn - gnttab_mfn);
 
 /* IO? */
diff -r 3ac19fda0bc2 -r 7e9dc164b572 xen/common/grant_table.c
--- a/xen/common/grant_table.c  Fri Mar 02 12:11:52 2007 +
+++ b/xen/common/grant_table.c  Mon Feb 19 16:49:12 2007 +0900
@@ -35,8 +35,10 @@
 #include xen/domain_page.h
 #include acm/acm_hooks.h
 
+#ifndef max_nr_grant_frames
 unsigned int max_nr_grant_frames = DEFAULT_MAX_NR_GRANT_FRAMES;
 integer_param(gnttab_max_nr_frames, max_nr_grant_frames);
+#endif
 
 /* The maximum number of grant mappings is defined as a multiplier of the
  * maximum number of grant table entries. This defines the multiplier used.
diff -r 3ac19fda0bc2 -r 7e9dc164b572 xen/include/asm-powerpc/config.h
--- a/xen/include/asm-powerpc/config.h  Fri Mar 02 12:11:52 2007 +
+++ b/xen/include/asm-powerpc/config.h  Mon Feb 19 16:49:12 2007 +0900
@@ -73,4 +73,13 @@ extern char __bss_start[];
 
 #include asm/powerpc64/config.h
 
+/*
+ * Disallow grant table growing tempralily because pfn2mfn() and
+ * mfn_to_gmfn() depends on the fact that grant table is machine-address
+ * contiguous. Grant table growing breaks the assumption.
+ */
+#ifndef max_nr_grant_frames
+#define max_nr_grant_frames INITIAL_NR_GRANT_FRAMES
 #endif
+
+#endif
diff -r 3ac19fda0bc2 -r 7e9dc164b572 xen/include/asm-powerpc/grant_table.h
--- a/xen/include/asm-powerpc/grant_table.h Fri Mar 02 12:11:52 2007 +
+++ b/xen/include/asm-powerpc/grant_table.h Mon Feb 19 16:49:12 2007 +0900
@@ -41,11 +41,11 @@ int destroy_grant_host_mapping(
 #define gnttab_create_shared_page(d, t, i)   \
 do { \
 share_xen_page_with_guest(   \
-virt_to_page((char *)(t)-shared + ((i) * PAGE_SIZE)),   \
+virt_to_page((t)-shared[(i)]),   \
 (d), XENSHARE_writable); \
 } while ( 0 )
 
-#define gnttab_shared_mfn(d, t, i) (((ulong)((t)-shared)  PAGE_SHIFT) + (i))
+#define gnttab_shared_mfn(d, t, i) (virt_to_mfn((t)-shared[(i)]))
 
 #define gnttab_shared_gmfn(d, t, i) \
 (mfn_to_gmfn(d, gnttab_shared_mfn(d, t, i)))
diff -r 3ac19fda0bc2 -r 7e9dc164b572 xen/include/xen/grant_table.h
--- a/xen/include/xen/grant_table.h Fri Mar 02 12:11:52 2007 +
+++ b/xen/include/xen/grant_table.h Mon Feb 19 16:49:12 2007 +0900
@@ -56,10 +56,14 @@ struct active_grant_entry {
 #define INITIAL_NR_GRANT_ENTRIES ((INITIAL_NR_GRANT_FRAMES  PAGE_SHIFT) / \
  sizeof(grant_entry_t))
 
+#ifndef DEFAULT_MAX_NR_GRANT_FRAMES /* to allow arch to 

[XenPPC] [xenppc-unstable] [XEN] Add arch hook for max_mem domctl.

2007-03-05 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Hollis Blanchard [EMAIL PROTECTED]
# Date 1172776731 21600
# Node ID 9f49a53fea30a031d3cc6315cfcbcc330b2464d1
# Parent  6b42b8c08731d7bc1abedac2239707e14ae8599d
[XEN] Add arch hook for max_mem domctl.

This patch introduces an arch hook in the MAX_MEM hcall. In particular, PowerPC
will use this hook to create/update a p2m mapping array. This patch introduces
the hook only and should compile away on all arches.

Signed-off-by: Ryan Harper [EMAIL PROTECTED]
Signed-off-by: Hollis Blanchard [EMAIL PROTECTED]
---
 xen/common/domctl.c  |4 
 xen/include/asm-ia64/shadow.h|2 ++
 xen/include/asm-powerpc/shadow.h |7 ++-
 xen/include/asm-x86/shadow.h |2 ++
 4 files changed, 14 insertions(+), 1 deletion(-)

diff -r 6b42b8c08731 -r 9f49a53fea30 xen/common/domctl.c
--- a/xen/common/domctl.c   Thu Mar 01 14:32:58 2007 -0600
+++ b/xen/common/domctl.c   Thu Mar 01 13:18:51 2007 -0600
@@ -20,6 +20,7 @@
 #include xen/rcupdate.h
 #include xen/guest_access.h
 #include xen/bitmap.h
+#include xen/shadow.h
 #include asm/current.h
 #include public/domctl.h
 #include acm/acm_hooks.h
@@ -608,6 +609,9 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domc
 spin_lock(d-page_alloc_lock);
 if ( new_max = d-tot_pages )
 {
+ret = guest_physmap_max_mem_pages(d, new_max);
+if ( ret != 0 )
+break;
 d-max_pages = new_max;
 ret = 0;
 }
diff -r 6b42b8c08731 -r 9f49a53fea30 xen/include/asm-ia64/shadow.h
--- a/xen/include/asm-ia64/shadow.h Thu Mar 01 14:32:58 2007 -0600
+++ b/xen/include/asm-ia64/shadow.h Thu Mar 01 13:18:51 2007 -0600
@@ -61,6 +61,8 @@ shadow_mark_page_dirty(struct domain *d,
 return 0;
 }
 
+#define guest_physmap_max_mem_pages(d, n) (0)
+
 #endif // _XEN_SHADOW_H
 
 /*
diff -r 6b42b8c08731 -r 9f49a53fea30 xen/include/asm-powerpc/shadow.h
--- a/xen/include/asm-powerpc/shadow.h  Thu Mar 01 14:32:58 2007 -0600
+++ b/xen/include/asm-powerpc/shadow.h  Thu Mar 01 13:18:51 2007 -0600
@@ -13,9 +13,10 @@
  * along with this program; if not, write to the Free Software
  * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  *
- * Copyright (C) IBM Corp. 2005, 2006
+ * Copyright IBM Corp. 2005, 2006, 2007
  *
  * Authors: Hollis Blanchard [EMAIL PROTECTED]
+ *  Ryan Harper [EMAIL PROTECTED]
  */
 
 #ifndef _ASM_SHADOW_H_
@@ -58,4 +59,8 @@ static inline unsigned int shadow_get_al
 {
 return (1ULL  (d-arch.htab.order + PAGE_SHIFT))  20;
 }
+
+#define guest_physmap_max_mem_pages(d, n) (0)
+
 #endif
+
diff -r 6b42b8c08731 -r 9f49a53fea30 xen/include/asm-x86/shadow.h
--- a/xen/include/asm-x86/shadow.h  Thu Mar 01 14:32:58 2007 -0600
+++ b/xen/include/asm-x86/shadow.h  Thu Mar 01 13:18:51 2007 -0600
@@ -121,6 +121,8 @@ static inline void shadow_remove_all_sha
 sh_remove_shadows(v, gmfn, 0 /* Be thorough */, 1 /* Must succeed */);
 }
 
+#define guest_physmap_max_mem_pages(d, n) (0)
+
 #endif /* _XEN_SHADOW_H */
 
 /*

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


[XenPPC] [xenppc-unstable] [POWERPC][XEN] Move dom0 memory allocation into construct_dom0().

2007-03-05 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Hollis Blanchard [EMAIL PROTECTED]
# Date 1172783085 21600
# Node ID 07066db94d89ad477b5baa16eeb76dd85575e80b
# Parent  9f49a53fea30a031d3cc6315cfcbcc330b2464d1
[POWERPC][XEN] Move dom0 memory allocation into construct_dom0().
General clean-up to prepare for initializing dom0's p2m array:
- Move rma allocation into construct_dom0()
- Move vcpu0 allocation into construct_dom0()
- Allow dom0_mem to set d-max_pages
- Be verbose when aligning dom0_mem with RMA check
Signed-off-by: Ryan Harper [EMAIL PROTECTED]
Signed-off-by: Hollis Blanchard [EMAIL PROTECTED]
---
 xen/arch/powerpc/domain_build.c |   56 
 xen/arch/powerpc/setup.c|7 -
 2 files changed, 35 insertions(+), 28 deletions(-)

diff -r 9f49a53fea30 -r 07066db94d89 xen/arch/powerpc/domain_build.c
--- a/xen/arch/powerpc/domain_build.c   Thu Mar 01 13:18:51 2007 -0600
+++ b/xen/arch/powerpc/domain_build.c   Thu Mar 01 15:04:45 2007 -0600
@@ -13,7 +13,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  *
- * Copyright (C) IBM Corp. 2005
+ * Copyright IBM Corp. 2005, 2007
  *
  * Authors: Jimi Xenidis [EMAIL PROTECTED]
  */
@@ -61,12 +61,12 @@ int construct_dom0(struct domain *d,
 struct elf_binary elf;
 struct elf_dom_parms parms;
 int rc;
-struct vcpu *v = d-vcpu[0];
+struct vcpu *v;
 ulong dst;
 u64 *ofh_tree;
-uint rma_nrpages = 1  d-arch.rma_order;
-ulong rma_sz = rma_size(d-arch.rma_order);
-ulong rma = page_to_maddr(d-arch.rma_page);
+uint rma_nrpages = 1  cpu_default_rma_order_pages();
+ulong rma_sz;
+ulong rma;
 ulong eomem;
 int preempt = 0;
 int vcpu;
@@ -76,12 +76,9 @@ int construct_dom0(struct domain *d,
 
 /* Sanity! */
 BUG_ON(d-domain_id != 0);
-BUG_ON(d-vcpu[0] == NULL);
 
 if (image_len == 0)
 panic(No Dom0 image supplied\n);
-
-cpu_init_vcpu(v);
 
 printk(*** LOADING DOMAIN 0 ***\n);
 
@@ -105,9 +102,6 @@ int construct_dom0(struct domain *d,
 parms.virt_kend = RM_MASK(parms.virt_kend, 42);
 parms.virt_entry = RM_MASK(parms.virt_entry, 42);
 
-/* By default DOM0 is allocated all available memory. */
-d-max_pages = ~0U;
-
 /* default is the max(1/16th of memory, CONFIG_MIN_DOM0_PAGES) */
 if (dom0_nrpages == 0) {
 dom0_nrpages = total_pages  4;
@@ -116,7 +110,21 @@ int construct_dom0(struct domain *d,
 dom0_nrpages = CONFIG_MIN_DOM0_PAGES;
 }
 
-/* make sure we are at least as big as the RMA */
+/* DOM0 has to be at least RMA size. */
+if (dom0_nrpages  rma_nrpages) {
+dom0_nrpages = rma_nrpages;
+printk(Forcing DOM0 memory size to %u MiB\n, 
+((rma_nrpages  PAGE_SHIFT)  20));
+}
+
+d-max_pages = dom0_nrpages;
+if (0  allocate_rma(d, cpu_default_rma_order_pages()))
+panic(Error allocating domain 0 RMA\n);
+
+rma_sz = rma_size(d-arch.rma_order);
+rma = page_to_maddr(d-arch.rma_page);
+
+/* If we are bigger than RMA, allocate extents. */
 if (dom0_nrpages  rma_nrpages)
 dom0_nrpages = allocate_extents(d, dom0_nrpages, rma_nrpages);
 
@@ -138,15 +146,6 @@ int construct_dom0(struct domain *d,
 
 eomem = ((ulong)d-shared_info) - rma;
 printk(shared_info: 0x%lx,%p\n, eomem, d-shared_info);
-
-/* OF usually sits here:
- *   - Linux needs it to be loaded before the vmlinux or initrd
- *   - AIX demands it to be @ 32M.
- */
-dst = (32  20);
-
-/* put stack below everything */
-v-arch.ctxt.gprs[1] = dst - STACK_FRAME_OVERHEAD;
 
 /* startup secondary processors */
 if ( opt_dom0_max_vcpus == 0 )
@@ -161,13 +160,26 @@ int construct_dom0(struct domain *d,
 #endif
 printk(Dom0 has maximum %u VCPUs\n, opt_dom0_max_vcpus);
 
-for (vcpu = 1; vcpu  opt_dom0_max_vcpus; vcpu++) {
+for (vcpu = 0; vcpu  opt_dom0_max_vcpus; vcpu++) {
 if (NULL == alloc_vcpu(dom0, vcpu, vcpu))
 panic(Error creating domain 0 vcpu %d\n, vcpu);
 /* for now we pin Dom0 VCPUs to their coresponding CPUs */
 if (cpu_isset(vcpu, cpu_online_map))
 dom0-vcpu[vcpu]-cpu_affinity = cpumask_of_cpu(vcpu);
 }
+
+/* Init VCPU0. */
+v = d-vcpu[0];
+cpu_init_vcpu(v);
+
+/* OF usually sits here:
+ *   - Linux needs it to be loaded before the vmlinux or initrd
+ *   - AIX demands it to be @ 32M.
+ */
+dst = (32  20);
+
+/* Put stack below everything. */
+v-arch.ctxt.gprs[1] = dst - STACK_FRAME_OVERHEAD;
 
 /* copy relative to Xen */
 dst += rma;
diff -r 9f49a53fea30 -r 07066db94d89 xen/arch/powerpc/setup.c
--- a/xen/arch/powerpc/setup.c  Thu Mar 01 13:18:51 2007 -0600
+++ b/xen/arch/powerpc/setup.c  Thu Mar 01 15:04:45 2007 -0600
@@ -13,7 +13,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, 51 Franklin 

[XenPPC] [xenppc-unstable] [POWERPC][XEN] Introduce platform abstraction to describe the IO hole.

2007-03-05 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Hollis Blanchard [EMAIL PROTECTED]
# Date 1172876810 21600
# Node ID eceb9ccd84a8de9e4e3c8ced4b68e60b335b8a95
# Parent  07066db94d89ad477b5baa16eeb76dd85575e80b
[POWERPC][XEN] Introduce platform abstraction to describe the IO hole.
Signed-off-by: Ryan Harper [EMAIL PROTECTED]
Signed-off-by: Hollis Blanchard [EMAIL PROTECTED]
---
 xen/arch/powerpc/Makefile   |1 
 xen/arch/powerpc/mm.c   |5 ++--
 xen/arch/powerpc/papr/xlate.c   |3 +-
 xen/arch/powerpc/platform.c |   43 
 xen/arch/powerpc/powerpc64/ppc970.c |   12 --
 xen/include/asm-powerpc/processor.h |1 
 xen/include/asm/platform.h  |   28 +++
 7 files changed, 77 insertions(+), 16 deletions(-)

diff -r 07066db94d89 -r eceb9ccd84a8 xen/arch/powerpc/Makefile
--- a/xen/arch/powerpc/Makefile Thu Mar 01 15:04:45 2007 -0600
+++ b/xen/arch/powerpc/Makefile Fri Mar 02 17:06:50 2007 -0600
@@ -33,6 +33,7 @@ obj-y += ofd_fixup.o
 obj-y += ofd_fixup.o
 obj-y += ofd_fixup_memory.o
 obj-y += physdev.o
+obj-y += platform.o
 obj-y += rtas.o
 obj-y += setup.o
 obj-y += shadow.o
diff -r 07066db94d89 -r eceb9ccd84a8 xen/arch/powerpc/mm.c
--- a/xen/arch/powerpc/mm.c Thu Mar 01 15:04:45 2007 -0600
+++ b/xen/arch/powerpc/mm.c Fri Mar 02 17:06:50 2007 -0600
@@ -27,6 +27,7 @@
 #include xen/perfc.h
 #include asm/init.h
 #include asm/page.h
+#include asm/platform.h
 #include asm/string.h
 #include public/arch-powerpc.h
 
@@ -426,7 +427,7 @@ ulong pfn2mfn(struct domain *d, ulong pf
 /* Its a grant table access */
 t = PFN_TYPE_GNTTAB;
 mfn = gnttab_shared_mfn(d, d-grant_table, (pfn - max_page));
-} else if (d-is_privileged  cpu_io_mfn(pfn)) {
+} else if (d-is_privileged  platform_io_mfn(pfn)) {
 t = PFN_TYPE_IO;
 mfn = pfn;
 } else {
@@ -512,7 +513,7 @@ unsigned long mfn_to_gmfn(struct domain 
 return max_page + (mfn - gnttab_mfn);
 
 /* IO? */
-if (d-is_privileged  cpu_io_mfn(mfn))
+if (d-is_privileged  platform_io_mfn(mfn))
 return mfn;
 
 rma_mfn = page_to_mfn(d-arch.rma_page);
diff -r 07066db94d89 -r eceb9ccd84a8 xen/arch/powerpc/papr/xlate.c
--- a/xen/arch/powerpc/papr/xlate.c Thu Mar 01 15:04:45 2007 -0600
+++ b/xen/arch/powerpc/papr/xlate.c Fri Mar 02 17:06:50 2007 -0600
@@ -29,6 +29,7 @@
 #include asm/current.h
 #include asm/papr.h
 #include asm/hcalls.h
+#include asm/platform.h
 
 #ifdef DEBUG
 #define DBG(fmt...) printk(fmt)
@@ -536,7 +537,7 @@ long pte_remove(ulong flags, ulong ptex,
 
 if (lpte.bits.v) {
 ulong mfn = lpte.bits.rpn;
-if (!cpu_io_mfn(mfn)) {
+if (!platform_io_mfn(mfn)) {
 struct page_info *pg = mfn_to_page(mfn);
 struct domain *f = page_get_owner(pg);
 
diff -r 07066db94d89 -r eceb9ccd84a8 xen/arch/powerpc/platform.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +
+++ b/xen/arch/powerpc/platform.c   Fri Mar 02 17:06:50 2007 -0600
@@ -0,0 +1,43 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ * Copyright IBM Corp. 2007
+ *
+ * Authors: Ryan Harper [EMAIL PROTECTED]
+ *  Hollis Blanchard [EMAIL PROTECTED]
+ */
+
+#include asm/page.h
+#include asm/platform.h
+
+#define IO_RANGE_START (2UL  30)
+#define IO_RANGE_END   (4UL  30)
+#define IO_SIZE(IO_RANGE_END - IO_RANGE_START)
+
+unsigned long platform_iohole_base(void)
+{
+return IO_RANGE_START;
+}
+
+unsigned long platform_iohole_size(void)
+{
+return IO_SIZE;
+}
+
+int platform_io_mfn(unsigned long mfn)
+{
+unsigned long maddr = mfn  PAGE_SHIFT;
+return maddr  IO_RANGE_START  maddr  IO_RANGE_END;
+}
diff -r 07066db94d89 -r eceb9ccd84a8 xen/arch/powerpc/powerpc64/ppc970.c
--- a/xen/arch/powerpc/powerpc64/ppc970.c   Thu Mar 01 15:04:45 2007 -0600
+++ b/xen/arch/powerpc/powerpc64/ppc970.c   Fri Mar 02 17:06:50 2007 -0600
@@ -129,18 +129,6 @@ unsigned int cpu_extent_order(void)
 return log_large_page_sizes[0] - PAGE_SHIFT;
 }
 
-/* This is more a platform thing than a CPU thing, but we only have
- * one platform now */
-int cpu_io_mfn(ulong mfn)
-{
-/* totally cheating */
-if (mfn = (2UL  (30 - PAGE_SHIFT))  /* 2GiB */
-mfn  (4UL  (30 - PAGE_SHIFT)))/* 4GiB */
-  

[XenPPC] [xenppc-unstable] [POWERPC][XEN] Implement guest_physmap_max_mem_pages().

2007-03-05 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Hollis Blanchard [EMAIL PROTECTED]
# Date 1172876821 21600
# Node ID f56981f78d731b60fdb9ce2ee1b78727e004f848
# Parent  eceb9ccd84a8de9e4e3c8ced4b68e60b335b8a95
[POWERPC][XEN] Implement guest_physmap_max_mem_pages().
- Create a p2m array large enough to cover d-max_pages.
- Free in domain_relinquish_resources().
Signed-off-by: Ryan Harper [EMAIL PROTECTED]
Signed-off-by: Hollis Blanchard [EMAIL PROTECTED]
---
 xen/arch/powerpc/domain.c|3 ++
 xen/arch/powerpc/mm.c|   41 +++
 xen/include/asm-powerpc/domain.h |5 +++-
 xen/include/asm-powerpc/mm.h |4 ++-
 xen/include/asm-powerpc/shadow.h |4 +--
 5 files changed, 53 insertions(+), 4 deletions(-)

diff -r eceb9ccd84a8 -r f56981f78d73 xen/arch/powerpc/domain.c
--- a/xen/arch/powerpc/domain.c Fri Mar 02 17:06:50 2007 -0600
+++ b/xen/arch/powerpc/domain.c Fri Mar 02 17:07:01 2007 -0600
@@ -16,6 +16,8 @@
  * Copyright IBM Corp. 2005, 2006, 2007
  *
  * Authors: Jimi Xenidis [EMAIL PROTECTED]
+ *  Ryan Harper [EMAIL PROTECTED]
+ *  Hollis Blanchard [EMAIL PROTECTED]
  */
 
 #include stdarg.h
@@ -311,6 +313,7 @@ void domain_relinquish_resources(struct 
 relinquish_memory(d, d-page_list);
 free_extents(d);
 xfree(d-arch.foreign_mfns);
+xfree(d-arch.p2m);
 return;
 }
 
diff -r eceb9ccd84a8 -r f56981f78d73 xen/arch/powerpc/mm.c
--- a/xen/arch/powerpc/mm.c Fri Mar 02 17:06:50 2007 -0600
+++ b/xen/arch/powerpc/mm.c Fri Mar 02 17:07:01 2007 -0600
@@ -536,6 +536,47 @@ unsigned long mfn_to_gmfn(struct domain 
 return INVALID_M2P_ENTRY;
 }
 
+/* NB: caller holds d-page_alloc lock, sets d-max_pages = new_max */
+int guest_physmap_max_mem_pages(struct domain *d, unsigned long new_max_pages)
+{
+u32 *p2m_array = NULL;
+u32 *p2m_old = NULL;
+ulong i;
+
+/* XXX We probably could, but right now we don't shrink the p2m array.
+ * NB: d-max_pages = d-arch.p2m_entries */
+if (new_max_pages  d-max_pages) {
+printk(Can't shrink DOM%d max memory pages\n, d-domain_id);
+return -EINVAL;
+}
+
+/* Allocate one u32 per page. */
+p2m_array = xmalloc_array(u32, new_max_pages);
+if (p2m_array == NULL)
+return -ENOMEM;
+
+/* Copy old mappings into new array. */
+if (d-arch.p2m != NULL) {
+/* XXX This could take a long time; we should use a continuation. */
+memcpy(p2m_array, d-arch.p2m, d-arch.p2m_entries * sizeof(u32));
+p2m_old = d-arch.p2m;
+}
+
+/* Mark new mfns as invalid. */
+for (i = d-arch.p2m_entries; i  new_max_pages; i++)
+p2m_array[i] = INVALID_MFN;
+
+/* Set new p2m pointer and size. */
+d-arch.p2m = p2m_array;
+d-arch.p2m_entries = new_max_pages;
+
+/* Free old p2m array if present. */
+if (p2m_old)
+xfree(p2m_old);
+
+return 0;
+}
+
 void guest_physmap_add_page(
 struct domain *d, unsigned long gpfn, unsigned long mfn)
 {
diff -r eceb9ccd84a8 -r f56981f78d73 xen/include/asm-powerpc/domain.h
--- a/xen/include/asm-powerpc/domain.h  Fri Mar 02 17:06:50 2007 -0600
+++ b/xen/include/asm-powerpc/domain.h  Fri Mar 02 17:07:01 2007 -0600
@@ -13,7 +13,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  *
- * Copyright (C) IBM Corp. 2005
+ * Copyright IBM Corp. 2005, 2007
  *
  * Authors: Hollis Blanchard [EMAIL PROTECTED]
  */
@@ -46,6 +46,9 @@ struct arch_domain {
 
 /* I/O-port access bitmap mask. */
 u8 *iobmp_mask;   /* Address of IO bitmap mask, or NULL.  */
+
+u32 *p2m; /* Array of 32-bit MFNs supports 44 bits of physical memory. */
+ulong p2m_entries;
 
 uint large_page_sizes;
 uint large_page_order[4];
diff -r eceb9ccd84a8 -r f56981f78d73 xen/include/asm-powerpc/mm.h
--- a/xen/include/asm-powerpc/mm.h  Fri Mar 02 17:06:50 2007 -0600
+++ b/xen/include/asm-powerpc/mm.h  Fri Mar 02 17:07:01 2007 -0600
@@ -239,7 +239,9 @@ extern unsigned long mfn_to_gmfn(struct 
 
 extern unsigned long paddr_to_maddr(unsigned long paddr);
 
-#define INVALID_MFN (~0UL)
+/* INVALID_MFN can be any value that fails mfn_valid(). */
+#define INVALID_MFN (~0U)
+
 #define PFN_TYPE_NONE 0
 #define PFN_TYPE_RMA 1
 #define PFN_TYPE_LOGICAL 2
diff -r eceb9ccd84a8 -r f56981f78d73 xen/include/asm-powerpc/shadow.h
--- a/xen/include/asm-powerpc/shadow.h  Fri Mar 02 17:06:50 2007 -0600
+++ b/xen/include/asm-powerpc/shadow.h  Fri Mar 02 17:07:01 2007 -0600
@@ -32,6 +32,8 @@
   ? machine_to_phys_mapping[(mfn)] \
   : (mfn) )
 
+extern int guest_physmap_max_mem_pages(struct domain *d, unsigned long 
new_max);
+
 extern void guest_physmap_add_page(
 struct domain *d, unsigned long gpfn, unsigned long mfn);
 
@@ -60,7 +62,5 @@ static inline unsigned int shadow_get_al
 return (1ULL  (d-arch.htab.order + PAGE_SHIFT))  20;
 }
 
-#define 

[XenPPC] [xenppc-unstable] [POWERPC][XEN] Implement guest_physmap_{add, remove}_page().

2007-03-05 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Hollis Blanchard [EMAIL PROTECTED]
# Date 1172876879 21600
# Node ID b75609e1fa81b5aba1f06f5b9c6bff6bf897a6de
# Parent  f56981f78d731b60fdb9ce2ee1b78727e004f848
[POWERPC][XEN] Implement guest_physmap_{add,remove}_page().
- Use p2m array in pfn2mfn() and DOMCTL_getmemlist.
- Remove domain extent list.
- Create and use an m2p array for mfn_to_gmfn().
Signed-off-by: Ryan Harper [EMAIL PROTECTED]
Signed-off-by: Hollis Blanchard [EMAIL PROTECTED]
---
 xen/arch/powerpc/domain.c   |3 
 xen/arch/powerpc/domain_build.c |   28 -
 xen/arch/powerpc/domctl.c   |   22 ++--
 xen/arch/powerpc/iommu.c|3 
 xen/arch/powerpc/memory.c   |1 
 xen/arch/powerpc/mm.c   |  189 ++--
 xen/arch/powerpc/ofd_fixup_memory.c |   37 +--
 xen/include/asm-powerpc/domain.h|3 
 xen/include/asm-powerpc/mm.h|   26 
 9 files changed, 168 insertions(+), 144 deletions(-)

diff -r f56981f78d73 -r b75609e1fa81 xen/arch/powerpc/domain.c
--- a/xen/arch/powerpc/domain.c Fri Mar 02 17:07:01 2007 -0600
+++ b/xen/arch/powerpc/domain.c Fri Mar 02 17:07:59 2007 -0600
@@ -88,8 +88,6 @@ int arch_domain_create(struct domain *d)
 d-arch.large_page_sizes = cpu_large_page_orders(
 d-arch.large_page_order, ARRAY_SIZE(d-arch.large_page_order));
 
-INIT_LIST_HEAD(d-arch.extent_list);
-
 d-arch.foreign_mfn_count = 1024;
 d-arch.foreign_mfns = xmalloc_array(uint, d-arch.foreign_mfn_count);
 BUG_ON(d-arch.foreign_mfns == NULL);
@@ -311,7 +309,6 @@ void domain_relinquish_resources(struct 
 {
 relinquish_memory(d, d-xenpage_list);
 relinquish_memory(d, d-page_list);
-free_extents(d);
 xfree(d-arch.foreign_mfns);
 xfree(d-arch.p2m);
 return;
diff -r f56981f78d73 -r b75609e1fa81 xen/arch/powerpc/domain_build.c
--- a/xen/arch/powerpc/domain_build.c   Fri Mar 02 17:07:01 2007 -0600
+++ b/xen/arch/powerpc/domain_build.c   Fri Mar 02 17:07:59 2007 -0600
@@ -16,6 +16,8 @@
  * Copyright IBM Corp. 2005, 2007
  *
  * Authors: Jimi Xenidis [EMAIL PROTECTED]
+ *  Ryan Harper [EMAIL PROTECTED]
+ *  Hollis Blanchard [EMAIL PROTECTED]
  */
 
 #include xen/config.h
@@ -27,7 +29,9 @@
 #include xen/shadow.h
 #include xen/domain.h
 #include xen/version.h
+#include xen/shadow.h
 #include asm/processor.h
+#include asm/platform.h
 #include asm/papr.h
 #include public/arch-powerpc.h
 #include public/libelf.h
@@ -73,6 +77,7 @@ int construct_dom0(struct domain *d,
 ulong mod_start = 0;
 ulong mod_len = 0;
 ulong shared_info_addr;
+uint extent_size = 1  cpu_extent_order();
 
 /* Sanity! */
 BUG_ON(d-domain_id != 0);
@@ -110,12 +115,31 @@ int construct_dom0(struct domain *d,
 dom0_nrpages = CONFIG_MIN_DOM0_PAGES;
 }
 
-/* DOM0 has to be at least RMA size. */
+/* Dom0 has to be at least RMA size. */
 if (dom0_nrpages  rma_nrpages) {
 dom0_nrpages = rma_nrpages;
-printk(Forcing DOM0 memory size to %u MiB\n, 
+printk(Increasing DOM0 memory size to %u MiB for RMA.\n, 
 ((rma_nrpages  PAGE_SHIFT)  20));
 }
+
+/* Ensure Dom0 is cpu_extent_order aligned. Round up if 
+   not and let user know we did so. */
+if (dom0_nrpages != ALIGN_UP(dom0_nrpages, extent_size)) {
+dom0_nrpages = ALIGN_UP(dom0_nrpages, extent_size);
+printk(Increasing DOM0 memory size to %u MiB for large pages.\n, 
+((dom0_nrpages  PAGE_SHIFT)  20));
+}
+
+/* XXX Dom0 currently can't extend past the IO hole. */
+if (dom0_nrpages  (platform_iohole_base()  PAGE_SHIFT)) {
+dom0_nrpages = (platform_iohole_base()  PAGE_SHIFT);
+printk(Limiting DOM0 memory size to %u MiB to avoid IO hole.\n, 
+((dom0_nrpages  PAGE_SHIFT)  20));
+}
+
+/* Set Dom0 max mem, triggering p2m table creation. */
+if ((guest_physmap_max_mem_pages(d, dom0_nrpages)) != 0)
+panic(Failed to set DOM0 max mem pages value\n);
 
 d-max_pages = dom0_nrpages;
 if (0  allocate_rma(d, cpu_default_rma_order_pages()))
diff -r f56981f78d73 -r b75609e1fa81 xen/arch/powerpc/domctl.c
--- a/xen/arch/powerpc/domctl.c Fri Mar 02 17:07:01 2007 -0600
+++ b/xen/arch/powerpc/domctl.c Fri Mar 02 17:07:59 2007 -0600
@@ -13,9 +13,10 @@
  * along with this program; if not, write to the Free Software
  * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  *
- * Copyright (C) IBM Corp. 2005
+ * Copyright IBM Corp. 2005, 2007
  *
  * Authors: Jimi Xenidis [EMAIL PROTECTED]
+ *  Ryan Harper [EMAIL PROTECTED]
  */
 
 #include xen/config.h
@@ -50,7 +51,6 @@ long arch_do_domctl(struct xen_domctl *d
 struct domain *d = get_domain_by_id(domctl-domain);
 unsigned long max_pfns = domctl-u.getmemlist.max_pfns;
 uint64_t mfn;
-struct list_head *list_ent;
 
 ret = -EINVAL;
 if ( d != NULL )
@@ -58,18 +58,20 

[XenPPC] [xenppc-unstable] [LIBXC][POWERPC] use O_CREAT on open call for DTB_FILE

2007-03-05 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Date 1170935173 18000
# Node ID 1b1d0a909abc4aebd24d4449694d1121e74427be
# Parent  38b700cca5ebdb59524a97e7311ff768a35c45fa
[LIBXC][POWERPC] use O_CREAT on open call for  DTB_FILE
This fixes a bug in the creating of the flat dev tree. If open is used
and O_CREAT not is specified, it will fail if the file has not already
been created. This patch will create the file if it does not exist
already. Which will allow for DomU creation.
Signed-off-by: Jerone Young [EMAIL PROTECTED]
Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
Signed-off-by: Hollis Blanchard [EMAIL PROTECTED]
---
 tools/libxc/powerpc64/mk_flatdevtree.c |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff -r 38b700cca5eb -r 1b1d0a909abc tools/libxc/powerpc64/mk_flatdevtree.c
--- a/tools/libxc/powerpc64/mk_flatdevtree.cFri Mar 02 18:01:17 2007 -0600
+++ b/tools/libxc/powerpc64/mk_flatdevtree.cThu Feb 08 06:46:13 2007 -0500
@@ -618,7 +618,7 @@ int make_devtree(struct ft_cxt *root,
 }
 
 /* write a copy of the tree to a file */
-if ((dtb_fd = open(DTB_FILE , O_RDWR)) == -1) {
+if ((dtb_fd = open(DTB_FILE , O_CREAT|O_RDWR)) == -1) {
 PERROR(%s: failed to open file %s, __func__, DTB_FILE);
 goto error;
 }

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


[XenPPC] [xenppc-unstable] [LIBXC][POWERPC] make sure DTB is truncated and has a decent mode

2007-03-05 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Date 1170936326 18000
# Node ID fdb3c96eba0f8d898dd5e734598ddc671114f1a1
# Parent  1b1d0a909abc4aebd24d4449694d1121e74427be
[LIBXC][POWERPC] make sure DTB is truncated and has a decent mode
Also, since we only write to this FD, we mau as well use creat(2)
Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
Signed-off-by: Hollis Blanchard [EMAIL PROTECTED]
---
 tools/libxc/powerpc64/mk_flatdevtree.c |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff -r 1b1d0a909abc -r fdb3c96eba0f tools/libxc/powerpc64/mk_flatdevtree.c
--- a/tools/libxc/powerpc64/mk_flatdevtree.cThu Feb 08 06:46:13 2007 -0500
+++ b/tools/libxc/powerpc64/mk_flatdevtree.cThu Feb 08 07:05:26 2007 -0500
@@ -618,7 +618,7 @@ int make_devtree(struct ft_cxt *root,
 }
 
 /* write a copy of the tree to a file */
-if ((dtb_fd = open(DTB_FILE , O_CREAT|O_RDWR)) == -1) {
+if ((dtb_fd = creat(DTB_FILE, S_IRUSR | S_IWUSR)) == -1) {
 PERROR(%s: failed to open file %s, __func__, DTB_FILE);
 goto error;
 }

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


[XenPPC] [xenppc-unstable] [POWERPC][XEN][LIBXC] Make xc_linux_build() use populate_physmap()

2007-03-05 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Hollis Blanchard [EMAIL PROTECTED]
# Date 1172876884 21600
# Node ID 4c08045ff57cdef3c85ac20d4aa12ea698c4ea48
# Parent  b75609e1fa81b5aba1f06f5b9c6bff6bf897a6de
[POWERPC][XEN][LIBXC] Make xc_linux_build() use populate_physmap()
- populate_physmap() is the only way to invoke
  guest_physmap_{add/remove}_page(), which populate our new p2m table.
- To use it, we must to specify an array of PFNs where the new MFNs will be
  mapped.
- Split out alloc_memory() from xc_linux_build().
- Fix memory free path in xc_linux_build().
Signed-off-by: Ryan Harper [EMAIL PROTECTED]
Signed-off-by: Hollis Blanchard [EMAIL PROTECTED]
---
 tools/libxc/powerpc64/xc_linux_build.c |   95 ++---
 1 files changed, 66 insertions(+), 29 deletions(-)

diff -r b75609e1fa81 -r 4c08045ff57c tools/libxc/powerpc64/xc_linux_build.c
--- a/tools/libxc/powerpc64/xc_linux_build.cFri Mar 02 17:07:59 2007 -0600
+++ b/tools/libxc/powerpc64/xc_linux_build.cFri Mar 02 17:08:04 2007 -0600
@@ -38,6 +38,10 @@
 #include flatdevtree.h
 #include utils.h
 #include mk_flatdevtree.h
+
+/* Use 16MB extents to match PowerPC's large page size. */
+#define EXTENT_SHIFT 24
+#define EXTENT_ORDER (EXTENT_SHIFT - PAGE_SHIFT)
 
 #define INITRD_ADDR (24UL  20)
 #define DEVTREE_ADDR (16UL  20)
@@ -150,6 +154,50 @@ static int check_memory_config(int rma_l
 return 1;
 }
 
+static int alloc_memory(int xc_handle, domid_t domid, ulong nr_pages,
+ulong rma_pages)
+{
+xen_pfn_t *extent_pfn_arry;
+ulong nr_extents;
+ulong start_pfn = rma_pages;
+int i;
+int j;
+int rc = 0;
+
+nr_extents = (nr_pages - rma_pages)  EXTENT_ORDER;
+DPRINTF(allocating memory in %lu chunks of %luMB\n, nr_extents,
+1UL  (20 - EXTENT_ORDER));
+
+/* populate_physmap requires an array of PFNs that determine where the
+ * guest mapping of the new MFNs. */
+extent_pfn_arry = malloc((1EXTENT_ORDER) * sizeof(xen_pfn_t));
+if (extent_pfn_arry == NULL) {
+PERROR(Couldn't allocate extent PFN array.\n);
+return -ENOMEM;
+}
+
+/* Now allocate the remaining memory as large-order extents. */
+for (i = 0; i  nr_extents; i++) {
+/* Initialize the extent PFN array. */
+for (j = 0; j  (1  EXTENT_ORDER); j++)
+extent_pfn_arry[j] = start_pfn++;
+
+DPRINTF(populate_physmap(Dom%u, order %u, starting_pfn %llx)\n,
+domid, EXTENT_ORDER, extent_pfn_arry[0]);
+
+if (xc_domain_memory_populate_physmap(xc_handle, domid, 1, 
EXTENT_ORDER,
+   0, extent_pfn_arry))
+{
+PERROR(Could not allocate extents\n);
+rc = -1;
+break;
+}
+}
+
+free(extent_pfn_arry);
+return rc;
+}
+
 int xc_linux_build(int xc_handle,
uint32_t domid,
unsigned int mem_mb,
@@ -175,9 +223,6 @@ int xc_linux_build(int xc_handle,
 u64 shared_info_paddr;
 u64 store_paddr;
 u64 console_paddr;
-u32 remaining_kb;
-u32 extent_order;
-u64 nr_extents;
 int rma_log = 26;  /* 64MB RMA */
 int rc = 0;
 int op;
@@ -200,36 +245,26 @@ int xc_linux_build(int xc_handle,
 goto out;
 }
 
-/* alloc RMA */
+/* Allocate the RMA. */
+DPRINTF(RMA: 0x%lx pages\n, rma_pages);
 if (xc_alloc_real_mode_area(xc_handle, domid, rma_log)) {
 rc = -1;
 goto out;
 }
 
-/* subtract already allocated RMA to determine remaining KB to alloc */
-remaining_kb = (nr_pages - rma_pages) * (PAGE_SIZE / 1024);
-DPRINTF(totalmem - RMA = %dKB\n, remaining_kb);
-
-/* to allocate in 16MB chunks, we need to determine the order of 
- * the number of PAGE_SIZE pages contained in 16MB. */
-extent_order = 24 - 12; /* extent_order = log2((1  24) - (1  12)) */
-nr_extents = (remaining_kb / (PAGE_SIZE/1024))  extent_order;
-DPRINTF(allocating memory in %llu chunks of %luMB\n, nr_extents,
-(((1  extent_order)  10) * PAGE_SIZE)  10);
-
-/* now allocate the remaining memory as large-order allocations */
-DPRINTF(increase_reservation(%u, %llu, %u)\n, domid, nr_extents, 
extent_order);
-if (xc_domain_memory_increase_reservation(xc_handle, domid, nr_extents, 
-  extent_order, 0, NULL)) {
-rc = -1;
-goto out;
-}
-
+/* Get the MFN mapping (for RMA only -- we only load data into the RMA). */
 if (get_rma_page_array(xc_handle, domid, page_array, rma_pages)) {
 rc = -1;
 goto out;
 }
 
+/* Allocate the non-RMA memory. */
+rc = alloc_memory(xc_handle, domid, nr_pages, rma_pages);
+if (rc) {
+goto out;
+}
+
+/* Load kernel. */
 DPRINTF(loading image '%s'\n, image_name);
 if (load_elf_kernel(xc_handle, domid, image_name, dsi, page_array)) {
 rc = -1;
@@ -237,6 +272,7 @@ int 

[XenPPC] [xenppc-unstable] [POWERPC][XEN] Commit missing file.

2007-03-05 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Hollis Blanchard [EMAIL PROTECTED]
# Date 1172880077 21600
# Node ID 38b700cca5ebdb59524a97e7311ff768a35c45fa
# Parent  4c08045ff57cdef3c85ac20d4aa12ea698c4ea48
[POWERPC][XEN] Commit missing file.
Signed-off-by: Hollis Blanchard [EMAIL PROTECTED]
---
 xen/include/asm-powerpc/platform.h |   28 
 1 files changed, 28 insertions(+)

diff -r 4c08045ff57c -r 38b700cca5eb xen/include/asm-powerpc/platform.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +
+++ b/xen/include/asm-powerpc/platform.hFri Mar 02 18:01:17 2007 -0600
@@ -0,0 +1,28 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ * Copyright IBM Corp. 2007
+ *
+ * Authors: Ryan Harper [EMAIL PROTECTED]
+ */
+
+#ifndef _ASM_PLATFORM_H_
+#define _ASM_PLATFORM_H_
+
+extern unsigned long platform_iohole_base(void);
+extern unsigned long platform_iohole_size(void);
+extern int platform_io_mfn(unsigned long mfn);
+
+#endif

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


[XenPPC] [xenppc-unstable] [POWERPC][XEN] Remove asm/platform.h (in favor of asm-powerpc/platform.h)

2007-03-05 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Hollis Blanchard [EMAIL PROTECTED]
# Date 1173120552 21600
# Node ID 41cdb08b901d1dfd13e7983a543390ace7bba902
# Parent  736f2d6d7b091b2cdfb36421644ac11008ae0a6b
[POWERPC][XEN] Remove asm/platform.h (in favor of asm-powerpc/platform.h)
Signed-off-by: Hollis Blanchard [EMAIL PROTECTED]
---
 xen/include/asm/platform.h |   28 
 1 files changed, 28 deletions(-)

diff -r 736f2d6d7b09 -r 41cdb08b901d xen/include/asm/platform.h
--- a/xen/include/asm/platform.hFri Mar 02 18:05:38 2007 -0600
+++ /dev/null   Thu Jan 01 00:00:00 1970 +
@@ -1,28 +0,0 @@
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- * Copyright IBM Corp. 2007
- *
- * Authors: Ryan Harper [EMAIL PROTECTED]
- */
-
-#ifndef _ASM_PLATFORM_H_
-#define _ASM_PLATFORM_H_
-
-extern unsigned long platform_iohole_base(void);
-extern unsigned long platform_iohole_size(void);
-extern int platform_io_mfn(unsigned long mfn);
-
-#endif

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


[XenPPC] [xenppc-unstable] [XEN] Add arch hook for max_mem domctl.

2007-03-02 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Hollis Blanchard [EMAIL PROTECTED]
# Date 1172776731 21600
# Node ID bd0b97a569fe9f5c99c2015380b6c0f0825f6ca3
# Parent  3629517371f005789b1b038efc93ea49b6d4fa78
[XEN] Add arch hook for max_mem domctl.

This patch introduces an arch hook in the MAX_MEM hcall. In particular, PowerPC
will use this hook to create/update a p2m mapping array. This patch introduces
the hook only and should compile away on all arches.

Signed-off-by: Ryan Harper [EMAIL PROTECTED]
Signed-off-by: Hollis Blanchard [EMAIL PROTECTED]
---
 xen/common/domctl.c  |4 
 xen/include/asm-ia64/shadow.h|2 ++
 xen/include/asm-powerpc/shadow.h |7 ++-
 xen/include/asm-x86/shadow.h |2 ++
 4 files changed, 14 insertions(+), 1 deletion(-)

diff -r 3629517371f0 -r bd0b97a569fe xen/common/domctl.c
--- a/xen/common/domctl.c   Thu Mar 01 14:32:58 2007 -0600
+++ b/xen/common/domctl.c   Thu Mar 01 13:18:51 2007 -0600
@@ -19,6 +19,7 @@
 #include xen/iocap.h
 #include xen/guest_access.h
 #include xen/bitmap.h
+#include xen/shadow.h
 #include asm/current.h
 #include public/domctl.h
 #include acm/acm_hooks.h
@@ -614,6 +615,9 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domc
 spin_lock(d-page_alloc_lock);
 if ( new_max = d-tot_pages )
 {
+ret = guest_physmap_max_mem_pages(d, new_max);
+if ( ret != 0 )
+break;
 d-max_pages = new_max;
 ret = 0;
 }
diff -r 3629517371f0 -r bd0b97a569fe xen/include/asm-ia64/shadow.h
--- a/xen/include/asm-ia64/shadow.h Thu Mar 01 14:32:58 2007 -0600
+++ b/xen/include/asm-ia64/shadow.h Thu Mar 01 13:18:51 2007 -0600
@@ -61,6 +61,8 @@ shadow_mark_page_dirty(struct domain *d,
 return 0;
 }
 
+#define guest_physmap_max_mem_pages(d, n) (0)
+
 #endif // _XEN_SHADOW_H
 
 /*
diff -r 3629517371f0 -r bd0b97a569fe xen/include/asm-powerpc/shadow.h
--- a/xen/include/asm-powerpc/shadow.h  Thu Mar 01 14:32:58 2007 -0600
+++ b/xen/include/asm-powerpc/shadow.h  Thu Mar 01 13:18:51 2007 -0600
@@ -13,9 +13,10 @@
  * along with this program; if not, write to the Free Software
  * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  *
- * Copyright (C) IBM Corp. 2005, 2006
+ * Copyright IBM Corp. 2005, 2006, 2007
  *
  * Authors: Hollis Blanchard [EMAIL PROTECTED]
+ *  Ryan Harper [EMAIL PROTECTED]
  */
 
 #ifndef _ASM_SHADOW_H_
@@ -58,4 +59,8 @@ static inline unsigned int shadow_get_al
 {
 return (1ULL  (d-arch.htab.order + PAGE_SHIFT))  20;
 }
+
+#define guest_physmap_max_mem_pages(d, n) (0)
+
 #endif
+
diff -r 3629517371f0 -r bd0b97a569fe xen/include/asm-x86/shadow.h
--- a/xen/include/asm-x86/shadow.h  Thu Mar 01 14:32:58 2007 -0600
+++ b/xen/include/asm-x86/shadow.h  Thu Mar 01 13:18:51 2007 -0600
@@ -460,6 +460,8 @@ gl1e_to_ml1e(struct domain *d, l1_pgentr
 return l1e;
 }
 
+#define guest_physmap_max_mem_pages(d, n) (0)
+
 #endif /* _XEN_SHADOW_H */
 
 /*

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


[XenPPC] [xenppc-unstable] [POWERPC][XEN] Introduce platform abstraction to describe the IO hole.

2007-03-02 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Hollis Blanchard [EMAIL PROTECTED]
# Date 1172876810 21600
# Node ID d13289d7e61b3359eae9d835495522ad29acc1b1
# Parent  c01731b8cc990ad394c5693002666260958cc4a5
[POWERPC][XEN] Introduce platform abstraction to describe the IO hole.
Signed-off-by: Ryan Harper [EMAIL PROTECTED]
Signed-off-by: Hollis Blanchard [EMAIL PROTECTED]
---
 xen/arch/powerpc/Makefile   |1 
 xen/arch/powerpc/mm.c   |5 ++--
 xen/arch/powerpc/papr/xlate.c   |3 +-
 xen/arch/powerpc/platform.c |   43 
 xen/arch/powerpc/powerpc64/ppc970.c |   12 --
 xen/include/asm-powerpc/processor.h |1 
 xen/include/asm/platform.h  |   28 +++
 7 files changed, 77 insertions(+), 16 deletions(-)

diff -r c01731b8cc99 -r d13289d7e61b xen/arch/powerpc/Makefile
--- a/xen/arch/powerpc/Makefile Thu Mar 01 15:04:45 2007 -0600
+++ b/xen/arch/powerpc/Makefile Fri Mar 02 17:06:50 2007 -0600
@@ -33,6 +33,7 @@ obj-y += ofd_fixup.o
 obj-y += ofd_fixup.o
 obj-y += ofd_fixup_memory.o
 obj-y += physdev.o
+obj-y += platform.o
 obj-y += rtas.o
 obj-y += setup.o
 obj-y += shadow.o
diff -r c01731b8cc99 -r d13289d7e61b xen/arch/powerpc/mm.c
--- a/xen/arch/powerpc/mm.c Thu Mar 01 15:04:45 2007 -0600
+++ b/xen/arch/powerpc/mm.c Fri Mar 02 17:06:50 2007 -0600
@@ -27,6 +27,7 @@
 #include xen/perfc.h
 #include asm/init.h
 #include asm/page.h
+#include asm/platform.h
 #include asm/string.h
 #include public/arch-powerpc.h
 
@@ -416,7 +417,7 @@ ulong pfn2mfn(struct domain *d, ulong pf
 /* Its a grant table access */
 t = PFN_TYPE_GNTTAB;
 mfn = gnttab_shared_mfn(d, d-grant_table, (pfn - max_page));
-} else if (d-is_privileged  cpu_io_mfn(pfn)) {
+} else if (d-is_privileged  platform_io_mfn(pfn)) {
 t = PFN_TYPE_IO;
 mfn = pfn;
 } else {
@@ -496,7 +497,7 @@ unsigned long mfn_to_gmfn(struct domain 
 return max_page + (mfn - gnttab_mfn);
 
 /* IO? */
-if (d-is_privileged  cpu_io_mfn(mfn))
+if (d-is_privileged  platform_io_mfn(mfn))
 return mfn;
 
 rma_mfn = page_to_mfn(d-arch.rma_page);
diff -r c01731b8cc99 -r d13289d7e61b xen/arch/powerpc/papr/xlate.c
--- a/xen/arch/powerpc/papr/xlate.c Thu Mar 01 15:04:45 2007 -0600
+++ b/xen/arch/powerpc/papr/xlate.c Fri Mar 02 17:06:50 2007 -0600
@@ -29,6 +29,7 @@
 #include asm/current.h
 #include asm/papr.h
 #include asm/hcalls.h
+#include asm/platform.h
 
 #ifdef DEBUG
 #define DBG(fmt...) printk(fmt)
@@ -536,7 +537,7 @@ long pte_remove(ulong flags, ulong ptex,
 
 if (lpte.bits.v) {
 ulong mfn = lpte.bits.rpn;
-if (!cpu_io_mfn(mfn)) {
+if (!platform_io_mfn(mfn)) {
 struct page_info *pg = mfn_to_page(mfn);
 struct domain *f = page_get_owner(pg);
 
diff -r c01731b8cc99 -r d13289d7e61b xen/arch/powerpc/platform.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +
+++ b/xen/arch/powerpc/platform.c   Fri Mar 02 17:06:50 2007 -0600
@@ -0,0 +1,43 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ * Copyright IBM Corp. 2007
+ *
+ * Authors: Ryan Harper [EMAIL PROTECTED]
+ *  Hollis Blanchard [EMAIL PROTECTED]
+ */
+
+#include asm/page.h
+#include asm/platform.h
+
+#define IO_RANGE_START (2UL  30)
+#define IO_RANGE_END   (4UL  30)
+#define IO_SIZE(IO_RANGE_END - IO_RANGE_START)
+
+unsigned long platform_iohole_base(void)
+{
+return IO_RANGE_START;
+}
+
+unsigned long platform_iohole_size(void)
+{
+return IO_SIZE;
+}
+
+int platform_io_mfn(unsigned long mfn)
+{
+unsigned long maddr = mfn  PAGE_SHIFT;
+return maddr  IO_RANGE_START  maddr  IO_RANGE_END;
+}
diff -r c01731b8cc99 -r d13289d7e61b xen/arch/powerpc/powerpc64/ppc970.c
--- a/xen/arch/powerpc/powerpc64/ppc970.c   Thu Mar 01 15:04:45 2007 -0600
+++ b/xen/arch/powerpc/powerpc64/ppc970.c   Fri Mar 02 17:06:50 2007 -0600
@@ -129,18 +129,6 @@ unsigned int cpu_extent_order(void)
 return log_large_page_sizes[0] - PAGE_SHIFT;
 }
 
-/* This is more a platform thing than a CPU thing, but we only have
- * one platform now */
-int cpu_io_mfn(ulong mfn)
-{
-/* totally cheating */
-if (mfn = (2UL  (30 - PAGE_SHIFT))  /* 2GiB */
-mfn  (4UL  (30 - PAGE_SHIFT)))/* 4GiB */
-  

[XenPPC] [xenppc-unstable] [POWERPC][XEN] Implement guest_physmap_max_mem_pages().

2007-03-02 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Hollis Blanchard [EMAIL PROTECTED]
# Date 1172876821 21600
# Node ID 94373d6dfb25f3b125ac0550df4f45d225f9e388
# Parent  d13289d7e61b3359eae9d835495522ad29acc1b1
[POWERPC][XEN] Implement guest_physmap_max_mem_pages().
- Create a p2m array large enough to cover d-max_pages.
- Free in domain_relinquish_resources().
Signed-off-by: Ryan Harper [EMAIL PROTECTED]
Signed-off-by: Hollis Blanchard [EMAIL PROTECTED]
---
 xen/arch/powerpc/domain.c|3 ++
 xen/arch/powerpc/mm.c|   41 +++
 xen/include/asm-powerpc/domain.h |5 +++-
 xen/include/asm-powerpc/mm.h |4 ++-
 xen/include/asm-powerpc/shadow.h |4 +--
 5 files changed, 53 insertions(+), 4 deletions(-)

diff -r d13289d7e61b -r 94373d6dfb25 xen/arch/powerpc/domain.c
--- a/xen/arch/powerpc/domain.c Fri Mar 02 17:06:50 2007 -0600
+++ b/xen/arch/powerpc/domain.c Fri Mar 02 17:07:01 2007 -0600
@@ -16,6 +16,8 @@
  * Copyright IBM Corp. 2005, 2006, 2007
  *
  * Authors: Jimi Xenidis [EMAIL PROTECTED]
+ *  Ryan Harper [EMAIL PROTECTED]
+ *  Hollis Blanchard [EMAIL PROTECTED]
  */
 
 #include stdarg.h
@@ -311,6 +313,7 @@ void domain_relinquish_resources(struct 
 relinquish_memory(d, d-page_list);
 free_extents(d);
 xfree(d-arch.foreign_mfns);
+xfree(d-arch.p2m);
 return;
 }
 
diff -r d13289d7e61b -r 94373d6dfb25 xen/arch/powerpc/mm.c
--- a/xen/arch/powerpc/mm.c Fri Mar 02 17:06:50 2007 -0600
+++ b/xen/arch/powerpc/mm.c Fri Mar 02 17:07:01 2007 -0600
@@ -520,6 +520,47 @@ unsigned long mfn_to_gmfn(struct domain 
 return INVALID_M2P_ENTRY;
 }
 
+/* NB: caller holds d-page_alloc lock, sets d-max_pages = new_max */
+int guest_physmap_max_mem_pages(struct domain *d, unsigned long new_max_pages)
+{
+u32 *p2m_array = NULL;
+u32 *p2m_old = NULL;
+ulong i;
+
+/* XXX We probably could, but right now we don't shrink the p2m array.
+ * NB: d-max_pages = d-arch.p2m_entries */
+if (new_max_pages  d-max_pages) {
+printk(Can't shrink DOM%d max memory pages\n, d-domain_id);
+return -EINVAL;
+}
+
+/* Allocate one u32 per page. */
+p2m_array = xmalloc_array(u32, new_max_pages);
+if (p2m_array == NULL)
+return -ENOMEM;
+
+/* Copy old mappings into new array. */
+if (d-arch.p2m != NULL) {
+/* XXX This could take a long time; we should use a continuation. */
+memcpy(p2m_array, d-arch.p2m, d-arch.p2m_entries * sizeof(u32));
+p2m_old = d-arch.p2m;
+}
+
+/* Mark new mfns as invalid. */
+for (i = d-arch.p2m_entries; i  new_max_pages; i++)
+p2m_array[i] = INVALID_MFN;
+
+/* Set new p2m pointer and size. */
+d-arch.p2m = p2m_array;
+d-arch.p2m_entries = new_max_pages;
+
+/* Free old p2m array if present. */
+if (p2m_old)
+xfree(p2m_old);
+
+return 0;
+}
+
 void guest_physmap_add_page(
 struct domain *d, unsigned long gpfn, unsigned long mfn)
 {
diff -r d13289d7e61b -r 94373d6dfb25 xen/include/asm-powerpc/domain.h
--- a/xen/include/asm-powerpc/domain.h  Fri Mar 02 17:06:50 2007 -0600
+++ b/xen/include/asm-powerpc/domain.h  Fri Mar 02 17:07:01 2007 -0600
@@ -13,7 +13,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  *
- * Copyright (C) IBM Corp. 2005
+ * Copyright IBM Corp. 2005, 2007
  *
  * Authors: Hollis Blanchard [EMAIL PROTECTED]
  */
@@ -46,6 +46,9 @@ struct arch_domain {
 
 /* I/O-port access bitmap mask. */
 u8 *iobmp_mask;   /* Address of IO bitmap mask, or NULL.  */
+
+u32 *p2m; /* Array of 32-bit MFNs supports 44 bits of physical memory. */
+ulong p2m_entries;
 
 uint large_page_sizes;
 uint large_page_order[4];
diff -r d13289d7e61b -r 94373d6dfb25 xen/include/asm-powerpc/mm.h
--- a/xen/include/asm-powerpc/mm.h  Fri Mar 02 17:06:50 2007 -0600
+++ b/xen/include/asm-powerpc/mm.h  Fri Mar 02 17:07:01 2007 -0600
@@ -239,7 +239,9 @@ extern unsigned long mfn_to_gmfn(struct 
 
 extern unsigned long paddr_to_maddr(unsigned long paddr);
 
-#define INVALID_MFN (~0UL)
+/* INVALID_MFN can be any value that fails mfn_valid(). */
+#define INVALID_MFN (~0U)
+
 #define PFN_TYPE_NONE 0
 #define PFN_TYPE_RMA 1
 #define PFN_TYPE_LOGICAL 2
diff -r d13289d7e61b -r 94373d6dfb25 xen/include/asm-powerpc/shadow.h
--- a/xen/include/asm-powerpc/shadow.h  Fri Mar 02 17:06:50 2007 -0600
+++ b/xen/include/asm-powerpc/shadow.h  Fri Mar 02 17:07:01 2007 -0600
@@ -32,6 +32,8 @@
   ? machine_to_phys_mapping[(mfn)] \
   : (mfn) )
 
+extern int guest_physmap_max_mem_pages(struct domain *d, unsigned long 
new_max);
+
 extern void guest_physmap_add_page(
 struct domain *d, unsigned long gpfn, unsigned long mfn);
 
@@ -60,7 +62,5 @@ static inline unsigned int shadow_get_al
 return (1ULL  (d-arch.htab.order + PAGE_SHIFT))  20;
 }
 
-#define 

[XenPPC] [xenppc-unstable] [POWERPC][XEN] Implement guest_physmap_{add, remove}_page().

2007-03-02 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Hollis Blanchard [EMAIL PROTECTED]
# Date 1172876879 21600
# Node ID 49b519c69421bf7ee7df36024815f21c7c21
# Parent  94373d6dfb25f3b125ac0550df4f45d225f9e388
[POWERPC][XEN] Implement guest_physmap_{add,remove}_page().
- Use p2m array in pfn2mfn() and DOMCTL_getmemlist.
- Remove domain extent list.
- Create and use an m2p array for mfn_to_gmfn().
Signed-off-by: Ryan Harper [EMAIL PROTECTED]
Signed-off-by: Hollis Blanchard [EMAIL PROTECTED]
---
 xen/arch/powerpc/domain.c   |3 
 xen/arch/powerpc/domain_build.c |   28 -
 xen/arch/powerpc/domctl.c   |   22 ++--
 xen/arch/powerpc/iommu.c|3 
 xen/arch/powerpc/memory.c   |1 
 xen/arch/powerpc/mm.c   |  189 ++--
 xen/arch/powerpc/ofd_fixup_memory.c |   37 +--
 xen/common/memory.c |3 
 xen/include/asm-powerpc/domain.h|3 
 xen/include/asm-powerpc/mm.h|   26 
 10 files changed, 168 insertions(+), 147 deletions(-)

diff -r 94373d6dfb25 -r 49b519c6 xen/arch/powerpc/domain.c
--- a/xen/arch/powerpc/domain.c Fri Mar 02 17:07:01 2007 -0600
+++ b/xen/arch/powerpc/domain.c Fri Mar 02 17:07:59 2007 -0600
@@ -88,8 +88,6 @@ int arch_domain_create(struct domain *d)
 d-arch.large_page_sizes = cpu_large_page_orders(
 d-arch.large_page_order, ARRAY_SIZE(d-arch.large_page_order));
 
-INIT_LIST_HEAD(d-arch.extent_list);
-
 d-arch.foreign_mfn_count = 1024;
 d-arch.foreign_mfns = xmalloc_array(uint, d-arch.foreign_mfn_count);
 BUG_ON(d-arch.foreign_mfns == NULL);
@@ -311,7 +309,6 @@ void domain_relinquish_resources(struct 
 {
 relinquish_memory(d, d-xenpage_list);
 relinquish_memory(d, d-page_list);
-free_extents(d);
 xfree(d-arch.foreign_mfns);
 xfree(d-arch.p2m);
 return;
diff -r 94373d6dfb25 -r 49b519c6 xen/arch/powerpc/domain_build.c
--- a/xen/arch/powerpc/domain_build.c   Fri Mar 02 17:07:01 2007 -0600
+++ b/xen/arch/powerpc/domain_build.c   Fri Mar 02 17:07:59 2007 -0600
@@ -16,6 +16,8 @@
  * Copyright IBM Corp. 2005, 2007
  *
  * Authors: Jimi Xenidis [EMAIL PROTECTED]
+ *  Ryan Harper [EMAIL PROTECTED]
+ *  Hollis Blanchard [EMAIL PROTECTED]
  */
 
 #include xen/config.h
@@ -27,7 +29,9 @@
 #include xen/shadow.h
 #include xen/domain.h
 #include xen/version.h
+#include xen/shadow.h
 #include asm/processor.h
+#include asm/platform.h
 #include asm/papr.h
 #include public/arch-powerpc.h
 #include public/libelf.h
@@ -73,6 +77,7 @@ int construct_dom0(struct domain *d,
 ulong mod_start = 0;
 ulong mod_len = 0;
 ulong shared_info_addr;
+uint extent_size = 1  cpu_extent_order();
 
 /* Sanity! */
 BUG_ON(d-domain_id != 0);
@@ -110,12 +115,31 @@ int construct_dom0(struct domain *d,
 dom0_nrpages = CONFIG_MIN_DOM0_PAGES;
 }
 
-/* DOM0 has to be at least RMA size. */
+/* Dom0 has to be at least RMA size. */
 if (dom0_nrpages  rma_nrpages) {
 dom0_nrpages = rma_nrpages;
-printk(Forcing DOM0 memory size to %u MiB\n, 
+printk(Increasing DOM0 memory size to %u MiB for RMA.\n, 
 ((rma_nrpages  PAGE_SHIFT)  20));
 }
+
+/* Ensure Dom0 is cpu_extent_order aligned. Round up if 
+   not and let user know we did so. */
+if (dom0_nrpages != ALIGN_UP(dom0_nrpages, extent_size)) {
+dom0_nrpages = ALIGN_UP(dom0_nrpages, extent_size);
+printk(Increasing DOM0 memory size to %u MiB for large pages.\n, 
+((dom0_nrpages  PAGE_SHIFT)  20));
+}
+
+/* XXX Dom0 currently can't extend past the IO hole. */
+if (dom0_nrpages  (platform_iohole_base()  PAGE_SHIFT)) {
+dom0_nrpages = (platform_iohole_base()  PAGE_SHIFT);
+printk(Limiting DOM0 memory size to %u MiB to avoid IO hole.\n, 
+((dom0_nrpages  PAGE_SHIFT)  20));
+}
+
+/* Set Dom0 max mem, triggering p2m table creation. */
+if ((guest_physmap_max_mem_pages(d, dom0_nrpages)) != 0)
+panic(Failed to set DOM0 max mem pages value\n);
 
 d-max_pages = dom0_nrpages;
 if (0  allocate_rma(d, cpu_default_rma_order_pages()))
diff -r 94373d6dfb25 -r 49b519c6 xen/arch/powerpc/domctl.c
--- a/xen/arch/powerpc/domctl.c Fri Mar 02 17:07:01 2007 -0600
+++ b/xen/arch/powerpc/domctl.c Fri Mar 02 17:07:59 2007 -0600
@@ -13,9 +13,10 @@
  * along with this program; if not, write to the Free Software
  * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  *
- * Copyright (C) IBM Corp. 2005
+ * Copyright IBM Corp. 2005, 2007
  *
  * Authors: Jimi Xenidis [EMAIL PROTECTED]
+ *  Ryan Harper [EMAIL PROTECTED]
  */
 
 #include xen/config.h
@@ -50,7 +51,6 @@ long arch_do_domctl(struct xen_domctl *d
 struct domain *d = get_domain_by_id(domctl-domain);
 unsigned long max_pfns = domctl-u.getmemlist.max_pfns;
 uint64_t mfn;
-struct list_head *list_ent;
 
 ret = 

[XenPPC] [xenppc-unstable] [LIBXC][POWERPC] use O_CREAT on open call for DTB_FILE

2007-02-08 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID 51ca40884ed825b0d7fdf81a1e078e32451b4d22
# Parent  20e5f508accc21f6aaf9ade60d9a5510512cb289
[LIBXC][POWERPC] use O_CREAT on open call for  DTB_FILE

This fixes a bug in the creating of the flat dev tree. If open is used
and O_CREAT not is specified, it will fail if the file has not already
been created. This patch will create the file if it does not exist
already. Which will allow for DomU creation.

Signed-off-by: Jerone Young [EMAIL PROTECTED]
Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 tools/libxc/powerpc64/mk_flatdevtree.c |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff -r 20e5f508accc -r 51ca40884ed8 tools/libxc/powerpc64/mk_flatdevtree.c
--- a/tools/libxc/powerpc64/mk_flatdevtree.cTue Feb 06 13:42:19 2007 -0600
+++ b/tools/libxc/powerpc64/mk_flatdevtree.cThu Feb 08 06:46:13 2007 -0500
@@ -618,7 +618,7 @@ int make_devtree(struct ft_cxt *root,
 }
 
 /* write a copy of the tree to a file */
-if ((dtb_fd = open(DTB_FILE , O_RDWR)) == -1) {
+if ((dtb_fd = open(DTB_FILE , O_CREAT|O_RDWR)) == -1) {
 PERROR(%s: failed to open file %s, __func__, DTB_FILE);
 goto error;
 }

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


[XenPPC] [xenppc-unstable] [LIBXC][POWERPC] make sure DTB is truncated and has a decent mode

2007-02-08 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID 059beff4129bc0fc44032a95a8756c6ca89f6b21
# Parent  51ca40884ed825b0d7fdf81a1e078e32451b4d22
[LIBXC][POWERPC] make sure DTB is truncated and has a decent mode

Also, since we only write to this FD, we mau as well use creat(2)

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 tools/libxc/powerpc64/mk_flatdevtree.c |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff -r 51ca40884ed8 -r 059beff4129b tools/libxc/powerpc64/mk_flatdevtree.c
--- a/tools/libxc/powerpc64/mk_flatdevtree.cThu Feb 08 06:46:13 2007 -0500
+++ b/tools/libxc/powerpc64/mk_flatdevtree.cThu Feb 08 07:05:26 2007 -0500
@@ -618,7 +618,7 @@ int make_devtree(struct ft_cxt *root,
 }
 
 /* write a copy of the tree to a file */
-if ((dtb_fd = open(DTB_FILE , O_CREAT|O_RDWR)) == -1) {
+if ((dtb_fd = creat(DTB_FILE, S_IRUSR | S_IWUSR)) == -1) {
 PERROR(%s: failed to open file %s, __func__, DTB_FILE);
 goto error;
 }

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


[XenPPC] [xenppc-unstable] [POWERPC][XEN] Move shared page location to public header to share with libxc.

2007-02-06 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Hollis Blanchard [EMAIL PROTECTED]
# Node ID af17e1f51d23b3b31c46b4acf484d3a473ebbbf4
# Parent  0980dfbae746805c51704e62a1bc4603cd815041
[POWERPC][XEN] Move shared page location to public header to share with libxc.
Signed-off-by: Ryan Harper [EMAIL PROTECTED]
Signed-off-by: Hollis Blanchard [EMAIL PROTECTED]
---
 xen/arch/powerpc/domain_build.c   |1 +
 xen/arch/powerpc/mm.c |1 +
 xen/include/asm-powerpc/domain.h  |7 ---
 xen/include/public/arch-powerpc.h |8 
 4 files changed, 10 insertions(+), 7 deletions(-)

diff -r 0980dfbae746 -r af17e1f51d23 xen/arch/powerpc/domain_build.c
--- a/xen/arch/powerpc/domain_build.c   Thu Jan 25 15:55:25 2007 -0500
+++ b/xen/arch/powerpc/domain_build.c   Tue Feb 06 13:42:19 2007 -0600
@@ -30,6 +30,7 @@
 #include xen/version.h
 #include asm/processor.h
 #include asm/papr.h
+#include public/arch-powerpc.h
 #include oftree.h
 
 extern int parseelfimage_32(struct domain_setup_info *dsi);
diff -r 0980dfbae746 -r af17e1f51d23 xen/arch/powerpc/mm.c
--- a/xen/arch/powerpc/mm.c Thu Jan 25 15:55:25 2007 -0500
+++ b/xen/arch/powerpc/mm.c Tue Feb 06 13:42:19 2007 -0600
@@ -28,6 +28,7 @@
 #include asm/init.h
 #include asm/page.h
 #include asm/string.h
+#include public/arch-powerpc.h
 
 #ifdef VERBOSE
 #define MEM_LOG(_f, _a...)  \
diff -r 0980dfbae746 -r af17e1f51d23 xen/include/asm-powerpc/domain.h
--- a/xen/include/asm-powerpc/domain.h  Thu Jan 25 15:55:25 2007 -0500
+++ b/xen/include/asm-powerpc/domain.h  Tue Feb 06 13:42:19 2007 -0600
@@ -107,13 +107,6 @@ extern void save_float(struct vcpu *);
 extern void save_float(struct vcpu *);
 extern void load_float(struct vcpu *);
 
-#define RMA_SHARED_INFO 1
-#define RMA_START_INFO 2
-#define RMA_LAST_DOM0 2
-/* these are not used for dom0 so they should be last */
-#define RMA_CONSOLE 3
-#define RMA_LAST_DOMU 3
-
 #define rma_size(rma_order) (1UL  ((rma_order) + PAGE_SHIFT))
 
 static inline ulong rma_addr(struct arch_domain *ad, int type)
diff -r 0980dfbae746 -r af17e1f51d23 xen/include/public/arch-powerpc.h
--- a/xen/include/public/arch-powerpc.h Thu Jan 25 15:55:25 2007 -0500
+++ b/xen/include/public/arch-powerpc.h Tue Feb 06 13:42:19 2007 -0600
@@ -117,6 +117,14 @@ struct arch_vcpu_info {
 struct arch_vcpu_info {
 };
 
+#define RMA_SHARED_INFO 1
+#define RMA_START_INFO 2
+#define RMA_LAST_DOM0 2
+/* these are not used for dom0 so they should be last */
+#define RMA_CONSOLE 3
+#define RMA_STORE 4
+#define RMA_LAST_DOMU 4
+
 /* Support for multi-processor guests. */
 #define MAX_VIRT_CPUS 32
 #endif

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


[XenPPC] [xenppc-unstable] [POWERPC][XEN] Revert struct start_info to match upstream.

2007-02-06 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Hollis Blanchard [EMAIL PROTECTED]
# Node ID 20e5f508accc21f6aaf9ade60d9a5510512cb289
# Parent  f21875e3dc0be8c4e0de9936973cb35558f6c4bd
[POWERPC][XEN] Revert struct start_info to match upstream.
Now that libxc is no longer creating a start_info_t, we don't have to worry
about 32/64 bit safeness of unsigned longs in the structure. Use 
xen-unstable.hg's version of start_info.
Signed-off-by: Ryan Harper [EMAIL PROTECTED]
Signed-off-by: Hollis Blanchard [EMAIL PROTECTED]
---
 xen/include/public/xen.h |   14 +++---
 1 files changed, 7 insertions(+), 7 deletions(-)

diff -r f21875e3dc0b -r 20e5f508accc xen/include/public/xen.h
--- a/xen/include/public/xen.h  Tue Feb 06 13:42:19 2007 -0600
+++ b/xen/include/public/xen.h  Tue Feb 06 13:42:19 2007 -0600
@@ -501,8 +501,8 @@ struct start_info {
 struct start_info {
 /* THE FOLLOWING ARE FILLED IN BOTH ON INITIAL BOOT AND ON RESUME.*/
 char magic[32]; /* xen-version-platform.*/
-xen_ulong_t nr_pages;   /* Total pages allocated to this domain.  */
-xen_ulong_t shared_info;/* MACHINE address of shared info struct. */
+unsigned long nr_pages; /* Total pages allocated to this domain.  */
+unsigned long shared_info;  /* MACHINE address of shared info struct. */
 uint32_t flags; /* SIF_xxx flags. */
 xen_pfn_t store_mfn;/* MACHINE page number of shared page.*/
 uint32_t store_evtchn;  /* Event channel for store communication. */
@@ -517,11 +517,11 @@ struct start_info {
 } dom0;
 } console;
 /* THE FOLLOWING ARE ONLY FILLED IN ON INITIAL BOOT (NOT RESUME). */
-xen_ulong_t pt_base;/* VIRTUAL address of page directory. */
-xen_ulong_t nr_pt_frames;   /* Number of bootstrap p.t. frames.   */
-xen_ulong_t mfn_list;   /* VIRTUAL address of page-frame list.*/
-xen_ulong_t mod_start;  /* VIRTUAL address of pre-loaded module.  */
-xen_ulong_t mod_len;/* Size (bytes) of pre-loaded module. */
+unsigned long pt_base;  /* VIRTUAL address of page directory. */
+unsigned long nr_pt_frames; /* Number of bootstrap p.t. frames.   */
+unsigned long mfn_list; /* VIRTUAL address of page-frame list.*/
+unsigned long mod_start;/* VIRTUAL address of pre-loaded module.  */
+unsigned long mod_len;  /* Size (bytes) of pre-loaded module. */
 int8_t cmd_line[MAX_GUEST_CMDLINE];
 };
 typedef struct start_info start_info_t;

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


[XenPPC] [xenppc-unstable] [POWERPC][XEN] Add information into flat devtree needed to create a start_info_t structure in linux.

2007-02-06 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Hollis Blanchard [EMAIL PROTECTED]
# Node ID f21875e3dc0be8c4e0de9936973cb35558f6c4bd
# Parent  af17e1f51d23b3b31c46b4acf484d3a473ebbbf4
[POWERPC][XEN] Add information into flat devtree needed to create a 
start_info_t structure in linux.
Signed-off-by: Ryan Harper [EMAIL PROTECTED]
Signed-off-by: Hollis Blanchard [EMAIL PROTECTED]
---
 tools/libxc/powerpc64/mk_flatdevtree.c |   89 -
 tools/libxc/powerpc64/mk_flatdevtree.h |7 ++
 tools/libxc/powerpc64/xc_linux_build.c |   63 +++
 3 files changed, 93 insertions(+), 66 deletions(-)

diff -r af17e1f51d23 -r f21875e3dc0b tools/libxc/powerpc64/mk_flatdevtree.c
--- a/tools/libxc/powerpc64/mk_flatdevtree.cTue Feb 06 13:42:19 2007 -0600
+++ b/tools/libxc/powerpc64/mk_flatdevtree.cTue Feb 06 13:42:19 2007 -0600
@@ -316,13 +316,17 @@ int make_devtree(struct ft_cxt *root,
  unsigned long shadow_mb,
  unsigned long initrd_base,
  unsigned long initrd_len,
- const char *bootargs)
+ const char *bootargs,
+ uint64_t shared_info_paddr,
+ unsigned long console_evtchn,
+ uint64_t console_paddr,
+ unsigned long store_evtchn,
+ uint64_t store_paddr)
 {
 struct boot_param_header *bph = NULL;
 uint64_t val[2];
 uint32_t val32[2];
 unsigned long remaining;
-unsigned long rma_reserve = 4 * PAGE_SIZE;
 unsigned long initrd_end = initrd_base + initrd_len;
 int64_t shadow_mb_log;
 uint64_t pft_size;
@@ -351,10 +355,26 @@ int make_devtree(struct ft_cxt *root,
 
 /* you MUST set reservations BEFORE _starting_the_tree_ */
 
-/* reserve some pages at the end of RMA */
-val[0] = cpu_to_be64((u64) (rma_bytes - rma_reserve));
-val[1] = cpu_to_be64((u64) rma_reserve);
-ft_add_rsvmap(root, val[0], val[1]);
+/* reserve shared_info_t page */
+if (shared_info_paddr) {
+val[0] = cpu_to_be64((u64) shared_info_paddr);
+val[1] = cpu_to_be64((u64) PAGE_SIZE);
+ft_add_rsvmap(root, val[0], val[1]);
+}
+
+/* reserve console page for domU */
+if (console_paddr) {
+val[0] = cpu_to_be64((u64) console_paddr);
+val[1] = cpu_to_be64((u64) PAGE_SIZE);
+ft_add_rsvmap(root, val[0], val[1]);
+}
+
+/* reserve xen store page for domU */
+if (store_paddr) {
+val[0] = cpu_to_be64((u64) store_paddr);
+val[1] = cpu_to_be64((u64) PAGE_SIZE);
+ft_add_rsvmap(root, val[0], val[1]);
+}
 
 /* reserve space for initrd if needed */
 if ( initrd_len  0 )  {
@@ -419,19 +439,19 @@ int make_devtree(struct ft_cxt *root,
 /* xen = root.addnode('xen') */
 ft_begin_node(root, xen);
 
-/* start-info is the first page in the RMA reserved area */
-val[0] = cpu_to_be64((u64) (rma_bytes - rma_reserve));
-val[1] = cpu_to_be64((u64) PAGE_SIZE);
-ft_prop(root, start-info, val, sizeof(val));
-
 /*  xen.addprop('version', 'Xen-3.0-unstable\0') */
-ft_prop_str(root, version, Xen-3.0-unstable);
+ft_prop_str(root, compatible, Xen-3.0-unstable);
 
 /* xen.addprop('reg', long(imghandler.vm.domid), long(0)) */
 val[0] = cpu_to_be64((u64) domid);
 val[1] = cpu_to_be64((u64) 0);
 ft_prop(root, reg, val, sizeof(val));
 
+/* point to shared_info_t page base addr */
+val[0] = cpu_to_be64((u64) shared_info_paddr);
+val[1] = cpu_to_be64((u64) PAGE_SIZE);
+ft_prop(root, shared-info, val, sizeof(val));
+
 /* xen.addprop('domain-name', imghandler.vm.getName() + '\0') */
 /* libxc doesn't know the domain name, that is purely a xend thing */
 /* ft_prop_str(root, domain-name, domain_name); */
@@ -439,16 +459,41 @@ int make_devtree(struct ft_cxt *root,
 /* add xen/linux,phandle for chosen/interrupt-controller */
 ft_prop_int(root, linux,phandle, xen_phandle);
 
-/* xencons = xen.addnode('console') */
-ft_begin_node(root, console);
-
-/* xencons.addprop('interrupts', 1, 0) */
-val32[0] = cpu_to_be32((u32) 1);
-val32[1] = cpu_to_be32((u32) 0);
-ft_prop(root, interrupts, val32, sizeof(val32));
-
-/* end of console */
-ft_end_node(root);
+if (console_paddr != 0) {
+/* xencons = xen.addnode('console') */
+ft_begin_node(root, console);
+
+/* console_paddr */
+val[0] = cpu_to_be64((u64) console_paddr);
+val[1] = cpu_to_be64((u64) PAGE_SIZE);
+ft_prop(root, reg, val, sizeof(val));
+
+/* xencons.addprop('interrupts', console_evtchn, 0) */
+val32[0] = cpu_to_be32((u32) console_evtchn);
+val32[1] = cpu_to_be32((u32) 0);
+ft_prop(root, interrupts, val32, sizeof(val32));
+
+/* end of console */
+ft_end_node(root);
+}
+
+if (store_paddr != 0) {
+/* start store node */
+ft_begin_node(root, store);
+
+/* store paddr 

[XenPPC] [xenppc-unstable] [XEN][XEND][POWERPC] Don't ignore shadow memory requirement

2007-01-26 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID 0980dfbae746805c51704e62a1bc4603cd815041
# Parent  ea0c006faab68d2c2a65750c90ec8881f0e0b003
[XEN][XEND][POWERPC] Don't ignore shadow memory requirement
We don't need a custom buildDomain() anymore but we do need to provide a
shadow memory calculation.

 - Create PPC_LinuxImageHandler class to implement
   getRequiredShadowMemory().
 - Derive prose builder from PPC_LinuxImageHandlerClass.
 - Drop configure() as it is not needed according to Jimi.

Signed-off-by: Ryan Harper [EMAIL PROTECTED]
Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 tools/python/xen/xend/image.py |   33 -
 1 files changed, 16 insertions(+), 17 deletions(-)

diff -r ea0c006faab6 -r 0980dfbae746 tools/python/xen/xend/image.py
--- a/tools/python/xen/xend/image.pyTue Jan 23 08:54:41 2007 -0600
+++ b/tools/python/xen/xend/image.pyThu Jan 25 15:55:25 2007 -0500
@@ -214,15 +214,23 @@ class LinuxImageHandler(ImageHandler):
   ramdisk= self.ramdisk,
   features   = self.vm.getFeatures())
 
-
-
-class PPC_ProseImageHandler(LinuxImageHandler):
+class PPC_LinuxImageHandler(LinuxImageHandler):
+
+ostype = linux
+
+def getRequiredShadowMemory(self, shadow_mem_kb, maxmem_kb):
+@param shadow_mem_kb The configured shadow memory, in KiB.
+@param maxmem_kb The configured maxmem, in KiB.
+@return The corresponding required amount of shadow memory, also in
+KiB.
+PowerPC currently uses shadow memory to refer to the hash table.
+return max(maxmem_kb / 64, shadow_mem_kb)
+
+
+
+class PPC_ProseImageHandler(PPC_LinuxImageHandler):
 
 ostype = prose
-
-def configure(self, vmConfig, imageConfig, deviceConfig):
-LinuxImageHandler.configure(self, vmConfig, imageConfig, deviceConfig)
-self.imageConfig = imageConfig
 
 def buildDomain(self):
 store_evtchn = self.vm.getStorePort()
@@ -248,15 +256,6 @@ class PPC_ProseImageHandler(LinuxImageHa
cmdline= self.cmdline,
ramdisk= self.ramdisk,
features   = self.vm.getFeatures())
-
-def getRequiredShadowMemory(self, shadow_mem_kb, maxmem_kb):
-@param shadow_mem_kb The configured shadow memory, in KiB.
-@param maxmem_kb The configured maxmem, in KiB.
-@return The corresponding required amount of shadow memory, also in
-KiB.
-PowerPC currently uses shadow memory to refer to the hash table.
-return max(maxmem_kb / 64, shadow_mem_kb)
-
 
 class HVMImageHandler(ImageHandler):
 
@@ -598,7 +597,7 @@ class X86_Linux_ImageHandler(LinuxImageH
 
 _handlers = {
 powerpc: {
-linux: LinuxImageHandler,
+linux: PPC_LinuxImageHandler,
 prose: PPC_ProseImageHandler,
 },
 ia64: {

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


[XenPPC] [xenppc-unstable] [XEN][POWERPC] Linker script simplification broke optimized builds.

2007-01-22 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID 8b7a8c2e0178f326cfef9fa01a5042a52503dacc
# Parent  d301edbf6ecec86d24573e4be3399fbf3a4bd463
[XEN][POWERPC] Linker script simplification broke optimized builds.

offending changeset was: changeset:   14126:c759c733f77d
So put it back and just update the symbols like a good little boy.

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 xen/arch/powerpc/xen.lds.S |  182 ++---
 1 files changed, 141 insertions(+), 41 deletions(-)

diff -r d301edbf6ece -r 8b7a8c2e0178 xen/arch/powerpc/xen.lds.S
--- a/xen/arch/powerpc/xen.lds.SMon Jan 22 13:01:31 2007 -0500
+++ b/xen/arch/powerpc/xen.lds.SMon Jan 22 15:52:46 2007 -0500
@@ -7,62 +7,113 @@ OUTPUT_FORMAT(elf64-powerpc, elf64-po
  elf64-powerpc)
 OUTPUT_ARCH(powerpc:common64)
 ENTRY(_start)
+SEARCH_DIR(=/usr/local/lib64); SEARCH_DIR(=/lib64); 
SEARCH_DIR(=/usr/lib64); SEARCH_DIR(=/usr/local/lib); SEARCH_DIR(=/lib); 
SEARCH_DIR(=/usr/lib);
+/* Do we need any of these for elf?
+   __DYNAMIC = 0;*/
 PHDRS
 {
   text PT_LOAD;
 }   
 SECTIONS
 {
-  /* This is the address that we are linking at */ 
   . = 0x0040;
   PROVIDE(_text = .);
   PROVIDE(_stext = .);
   /* Read-only sections, merged into text segment: */
+  .interp : { *(.interp) } :text
+  .hash   : { *(.hash) }
+  .dynsym : { *(.dynsym) }
+  .dynstr : { *(.dynstr) }
+  .gnu.version: { *(.gnu.version) }
+  .gnu.version_d  : { *(.gnu.version_d) }
+  .gnu.version_r  : { *(.gnu.version_r) }
+  .rel.dyn:
+{
+  *(.rel.init)
+  *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
+  *(.rel.fini)
+  *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
+  *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
+  *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
+  *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
+  *(.rel.ctors)
+  *(.rel.dtors)
+  *(.rel.got)
+  *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
+  *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
+  *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
+  *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
+  *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
+}
+  .rela.dyn   :
+{
+  *(.rela.init)
+  *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
+  *(.rela.fini)
+  *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
+  *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
+  *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
+  *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
+  *(.rela.ctors)
+  *(.rela.dtors)
+  *(.rela.got)
+  *(.rela.toc)
+  *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
+  *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
+  *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
+  *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
+  *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
+}
+  .rel.plt: { *(.rel.plt) }
+  .rela.plt   : { *(.rela.plt) }
+  .rela.tocbss   : { *(.rela.tocbss) }
+  .init   :
+  {
+KEEP (*(.init))
+  } =0x6000
   .text   :
   {
-*(.text)
+*(.text .stub .text.* .gnu.linkonce.t.*)
 /* .gnu.warning sections are handled specially by elf32.em.  */
 *(.gnu.warning)
-  } : text
-  /* end of text */
+*(.sfpr .glink)
+  } =0x6000
+  .fini   :
+  {
+KEEP (*(.fini))
+  } =0x6000
   PROVIDE (__etext = .);
   PROVIDE (_etext = .);
   PROVIDE (etext = .);
-
-  /* read only data */
-  .rodata : { *(.rodata .rodata.*) } : text
-  .rodata1: { *(.rodata1) } : text
-  .sdata2 : { *(.sdata2 .sdata2.*) } : text
-  .sbss2  : { *(.sbss2 .sbss2.*) } : text
-
-  . = ALIGN(64);
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) } : text
-  __stop___ex_table = .;
-  . = ALIGN(64);
-
+  .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+  .rodata1: { *(.rodata1) }
+  .sdata2 : { *(.sdata2 .sdata2.* .gnu.linkonce.s2.*) }
+  .sbss2  : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
+  .eh_frame_hdr : { *(.eh_frame_hdr) }
+  /* Adjust the address for the data segment.  We want to adjust up to
+ the same address within the page on the next page up.  */
+  . = ALIGN (0x1) - ((0x1 - .)  (0x1 - 1)); . = 
DATA_SEGMENT_ALIGN (0x1, 0x1000);
+  /* Ensure the __preinit_array_start label is properly aligned.  We
+ could instead move the label definition inside the section, but
+ the linker would then create the section even if it turns out to
+ be empty, which isn't pretty.  */
+  . = ALIGN(64 / 8);
+  PROVIDE (__preinit_array_start = .);
+  .preinit_array : { *(.preinit_array) }
+  PROVIDE (__preinit_array_end = .);
+  PROVIDE (__init_array_start = .);
+  .init_array : { *(.init_array) }
+  PROVIDE (__init_array_end = .);
+  PROVIDE 

[XenPPC] [xenppc-unstable] [XEN][POWERPC] remove redundant and confusing restart/halt messages

2007-01-21 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID d7a63be8595e3b7f435ba2fc3352d6089a84a85d
# Parent  40b707df348824b7df499fe79b98289affad2485
[XEN][POWERPC] remove redundant and confusing restart/halt messages

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 xen/arch/powerpc/domain.c |5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff -r 40b707df3488 -r d7a63be8595e xen/arch/powerpc/domain.c
--- a/xen/arch/powerpc/domain.c Sat Jan 20 19:13:44 2007 -0500
+++ b/xen/arch/powerpc/domain.c Sun Jan 21 07:47:35 2007 -0500
@@ -105,13 +105,13 @@ void arch_domain_destroy(struct domain *
 
 static void machine_fail(const char *s)
 {
-printk(%s failed, manual powercycle required!\n, s);
+printk(%s failed, manual powercycle required!\n
+ spinning\n, s);
 for (;;)
 sleep();
 }
 void machine_halt(void)
 {
-printk(machine_halt called: spinning\n);
 console_start_sync();
 printk(%s called\n, __func__);
 rtas_halt();
@@ -121,7 +121,6 @@ void machine_halt(void)
 
 void machine_restart(char * __unused)
 {
-printk(machine_restart called: spinning\n);
 console_start_sync();
 printk(%s called\n, __func__);
 rtas_reboot();

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


[XenPPC] [xenppc-unstable] [XEN][POWERPC] Allocate secondary VCPUs for Dom0

2007-01-21 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID 1b00e1288e8ca376d2674628b1bfff698443dbf2
# Parent  d7a63be8595e3b7f435ba2fc3352d6089a84a85d
[XEN][POWERPC] Allocate secondary VCPUs for Dom0

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 xen/arch/powerpc/domain_build.c |   23 +++
 1 files changed, 23 insertions(+)

diff -r d7a63be8595e -r 1b00e1288e8c xen/arch/powerpc/domain_build.c
--- a/xen/arch/powerpc/domain_build.c   Sun Jan 21 07:47:35 2007 -0500
+++ b/xen/arch/powerpc/domain_build.c   Sun Jan 21 07:49:50 2007 -0500
@@ -26,6 +26,7 @@
 #include xen/ctype.h
 #include xen/iocap.h
 #include xen/shadow.h
+#include xen/domain.h
 #include xen/version.h
 #include asm/processor.h
 #include asm/papr.h
@@ -120,6 +121,7 @@ int construct_dom0(struct domain *d,
 ulong msr;
 ulong pc;
 ulong r2;
+int vcpu;
 
 /* Sanity! */
 BUG_ON(d-domain_id != 0);
@@ -209,6 +211,27 @@ int construct_dom0(struct domain *d,
 
 /* put stack below everything */
 v-arch.ctxt.gprs[1] = dst - STACK_FRAME_OVERHEAD;
+
+/* startup secondary processors */
+if ( opt_dom0_max_vcpus == 0 )
+opt_dom0_max_vcpus = num_online_cpus();
+if ( opt_dom0_max_vcpus  num_online_cpus() )
+opt_dom0_max_vcpus = num_online_cpus();
+if ( opt_dom0_max_vcpus  MAX_VIRT_CPUS )
+opt_dom0_max_vcpus = MAX_VIRT_CPUS;
+#ifdef BITS_PER_GUEST_LONG
+if ( opt_dom0_max_vcpus  BITS_PER_GUEST_LONG(d) )
+opt_dom0_max_vcpus = BITS_PER_GUEST_LONG(d);
+#endif
+printk(Dom0 has maximum %u VCPUs\n, opt_dom0_max_vcpus);
+
+for (vcpu = 1; vcpu  opt_dom0_max_vcpus; vcpu++) {
+if (NULL == alloc_vcpu(dom0, vcpu, vcpu))
+panic(Error creating domain 0 vcpu %d\n, vcpu);
+/* for now we pin Dom0 VCPUs to their coresponding CPUs */
+if (cpu_isset(vcpu, cpu_online_map))
+dom0-vcpu[vcpu]-cpu_affinity = cpumask_of_cpu(vcpu);
+}
 
 /* copy relative to Xen */
 dst += rma;

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


[XenPPC] [xenppc-unstable] [XEND][POWERPC] Move flat device tree construction from python to libxc for xc_linux_build().

2007-01-21 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID 4e4de46465bb296d7021a8f6cc3c958d40243184
# Parent  1b00e1288e8ca376d2674628b1bfff698443dbf2
[XEND][POWERPC] Move flat device tree construction from python to libxc for 
xc_linux_build().

Signed-off-by: Ryan Harper [EMAIL PROTECTED]
Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 tools/libxc/powerpc64/Makefile |1 
 tools/libxc/powerpc64/mk_flatdevtree.c |  605 +
 tools/libxc/powerpc64/mk_flatdevtree.h |   42 ++
 tools/libxc/powerpc64/xc_linux_build.c |  147 ++--
 tools/libxc/xenguest.h |4 
 tools/python/xen/lowlevel/xc/xc.c  |   12 
 tools/python/xen/xend/image.py |5 
 7 files changed, 697 insertions(+), 119 deletions(-)

diff -r 1b00e1288e8c -r 4e4de46465bb tools/libxc/powerpc64/Makefile
--- a/tools/libxc/powerpc64/MakefileSun Jan 21 07:49:50 2007 -0500
+++ b/tools/libxc/powerpc64/MakefileSun Jan 21 08:14:27 2007 -0500
@@ -1,4 +1,5 @@ GUEST_SRCS-y += powerpc64/flatdevtree.c
 GUEST_SRCS-y += powerpc64/flatdevtree.c
+GUEST_SRCS-y += powerpc64/mk_flatdevtree.c
 GUEST_SRCS-y += powerpc64/xc_linux_build.c
 GUEST_SRCS-y += powerpc64/xc_prose_build.c
 GUEST_SRCS-y += powerpc64/utils.c
diff -r 1b00e1288e8c -r 4e4de46465bb tools/libxc/powerpc64/xc_linux_build.c
--- a/tools/libxc/powerpc64/xc_linux_build.cSun Jan 21 07:49:50 2007 -0500
+++ b/tools/libxc/powerpc64/xc_linux_build.cSun Jan 21 08:14:27 2007 -0500
@@ -13,9 +13,10 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  *
- * Copyright (C) IBM Corporation 2006
+ * Copyright IBM Corporation 2006, 2007
  *
  * Authors: Hollis Blanchard [EMAIL PROTECTED]
+ *  Ryan Harper [EMAIL PROTECTED]
  */
 
 #include stdio.h
@@ -36,6 +37,7 @@
 #include flatdevtree_env.h
 #include flatdevtree.h
 #include utils.h
+#include mk_flatdevtree.h
 
 #define INITRD_ADDR (24UL  20)
 #define DEVTREE_ADDR (16UL  20)
@@ -78,85 +80,6 @@ static int init_boot_vcpu(
 return rc;
 }
 
-static int load_devtree(
-int xc_handle,
-int domid,
-xen_pfn_t *page_array,
-void *devtree,
-unsigned long devtree_addr,
-uint64_t initrd_base,
-unsigned long initrd_len,
-start_info_t *start_info __attribute__((unused)),
-unsigned long start_info_addr)
-{
-uint32_t si[4] = {0, start_info_addr, 0, 0x1000};
-struct boot_param_header *header;
-void *chosen;
-void *xen;
-uint64_t initrd_end = initrd_base + initrd_len;
-unsigned int devtree_size;
-int rc = 0;
-
-DPRINTF(adding initrd props\n);
-
-chosen = ft_find_node(devtree, /chosen);
-if (chosen == NULL) {
-DPRINTF(couldn't find /chosen\n);
-return -1;
-}
-
-xen = ft_find_node(devtree, /xen);
-if (xen == NULL) {
-DPRINTF(couldn't find /xen\n);
-return -1;
-}
-
-/* initrd-start */
-rc = ft_set_prop(devtree, chosen, linux,initrd-start,
-initrd_base, sizeof(initrd_base));
-if (rc  0) {
-DPRINTF(couldn't set /chosen/linux,initrd-start\n);
-return rc;
-}
-
-/* initrd-end */
-rc = ft_set_prop(devtree, chosen, linux,initrd-end,
-initrd_end, sizeof(initrd_end));
-if (rc  0) {
-DPRINTF(couldn't set /chosen/linux,initrd-end\n);
-return rc;
-}
-
-rc = ft_set_rsvmap(devtree, 1, initrd_base, initrd_len);
-if (rc  0) {
-DPRINTF(couldn't set initrd reservation\n);
-return ~0UL;
-}
-
-/* start-info (XXX being removed soon) */
-rc = ft_set_prop(devtree, xen, start-info, si, sizeof(si));
-if (rc  0) {
-DPRINTF(couldn't set /xen/start-info\n);
-return rc;
-}
-
-header = devtree;
-devtree_size = header-totalsize;
-{
-static const char dtb[] = /tmp/xc_domU.dtb;
-int dfd = creat(dtb, 0666);
-if (dfd != -1) {
-write(dfd, devtree, devtree_size);
-close(dfd);
-} else
-DPRINTF(could not open(\%s\)\n, dtb);
-}
-
-DPRINTF(copying device tree to 0x%lx[0x%x]\n, DEVTREE_ADDR, 
devtree_size);
-return install_image(xc_handle, domid, page_array, devtree, DEVTREE_ADDR,
-   devtree_size);
-}
-
 static int load_initrd(
 int xc_handle,
 int domid,
@@ -187,13 +110,14 @@ out:
 }
 
 static unsigned long create_start_info(
-void *devtree, start_info_t *start_info,
-unsigned int console_evtchn, unsigned int store_evtchn,
-unsigned long nr_pages, unsigned long rma_pages)
+start_info_t *start_info,
+unsigned int console_evtchn,
+unsigned int store_evtchn,
+unsigned long nr_pages,
+unsigned long rma_pages)
 {
 unsigned long start_info_addr;
 uint64_t rma_top;
-int rc;
 
 memset(start_info, 0, sizeof(*start_info));
 snprintf(start_info-magic, sizeof(start_info-magic),
@@ 

[XenPPC] [xenppc-unstable] [XEND][POWERPC] Remove FlatDeviceTree.py, eliminate devtree from prose builder.

2007-01-21 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID ab95fc8a0dd98db918ef5d3efe7b4587f2522792
# Parent  4e4de46465bb296d7021a8f6cc3c958d40243184
[XEND][POWERPC] Remove FlatDeviceTree.py, eliminate devtree from prose builder.

Signed-off-by: Ryan Harper [EMAIL PROTECTED]
Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 tools/python/xen/xend/FlatDeviceTree.py |  359 
 tools/libxc/powerpc64/utils.c   |   25 --
 tools/libxc/powerpc64/utils.h   |3 
 tools/libxc/powerpc64/xc_prose_build.c  |  124 ---
 tools/libxc/xenguest.h  |   17 -
 tools/python/xen/lowlevel/xc/xc.c   |   12 -
 tools/python/xen/xend/image.py  |   54 
 7 files changed, 23 insertions(+), 571 deletions(-)

diff -r 4e4de46465bb -r ab95fc8a0dd9 tools/libxc/powerpc64/utils.c
--- a/tools/libxc/powerpc64/utils.c Sun Jan 21 08:14:27 2007 -0500
+++ b/tools/libxc/powerpc64/utils.c Sun Jan 21 08:15:39 2007 -0500
@@ -13,7 +13,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  *
- * Copyright (C) IBM Corporation 2006
+ * Copyright IBM Corporation 2006, 2007
  *
  * Authors: Hollis Blanchard [EMAIL PROTECTED]
  *  Jimi Xenidis [EMAIL PROTECTED]
@@ -36,29 +36,6 @@
 #include flatdevtree_env.h
 #include flatdevtree.h
 #include utils.h
-
-unsigned long get_rma_pages(void *devtree)
-{
-void *rma;
-uint64_t rma_reg[2];
-int rc;
-
-rma = ft_find_node(devtree, /[EMAIL PROTECTED]);
-if (rma == NULL) {
-DPRINTF(couldn't find /[EMAIL PROTECTED]);
-return 0;
-}
-rc = ft_get_prop(devtree, rma, reg, rma_reg, sizeof(rma_reg));
-if (rc  0) {
-DPRINTF(couldn't get /[EMAIL PROTECTED]/reg\n);
-return 0;
-}
-if (rma_reg[0] != 0) {
-DPRINTF(RMA did not start at 0\n);
-return 0;
-}
-return rma_reg[1]  PAGE_SHIFT;
-}
 
 int get_rma_page_array(int xc_handle, int domid, xen_pfn_t **page_array,
   unsigned long nr_pages)
diff -r 4e4de46465bb -r ab95fc8a0dd9 tools/libxc/powerpc64/utils.h
--- a/tools/libxc/powerpc64/utils.h Sun Jan 21 08:14:27 2007 -0500
+++ b/tools/libxc/powerpc64/utils.h Sun Jan 21 08:15:39 2007 -0500
@@ -13,13 +13,12 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  *
- * Copyright (C) IBM Corporation 2006
+ * Copyright IBM Corporation 2006, 2007
  *
  * Authors: Hollis Blanchard [EMAIL PROTECTED]
  *  Jimi Xenidis [EMAIL PROTECTED]
  */
 
-extern unsigned long get_rma_pages(void *devtree);
 extern int get_rma_page_array(int xc_handle, int domid, xen_pfn_t **page_array,
  unsigned long nr_pages);
 extern int install_image(int xc_handle, int domid, xen_pfn_t *page_array,
diff -r 4e4de46465bb -r ab95fc8a0dd9 tools/libxc/powerpc64/xc_prose_build.c
--- a/tools/libxc/powerpc64/xc_prose_build.cSun Jan 21 08:14:27 2007 -0500
+++ b/tools/libxc/powerpc64/xc_prose_build.cSun Jan 21 08:15:39 2007 -0500
@@ -13,7 +13,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  *
- * Copyright (C) IBM Corporation 2006
+ * Copyright IBM Corporation 2006, 2007
  *
  * Authors: Hollis Blanchard [EMAIL PROTECTED]
  *  Jonathan Appavoo [EMAIL PROTECTED]
@@ -34,18 +34,14 @@
 #include xg_private.h
 #include xenctrl.h
 
-#include flatdevtree_env.h
-#include flatdevtree.h
 #include utils.h
 
 #define INITRD_ADDR (24UL  20)
-#define DEVTREE_ADDR (16UL  20)
 
 static int init_boot_vcpu(
 int xc_handle,
 int domid,
 struct domain_setup_info *dsi,
-unsigned long devtree_addr,
 unsigned long kern_addr)
 {
 vcpu_guest_context_t ctxt;
@@ -55,7 +51,7 @@ static int init_boot_vcpu(
 ctxt.user_regs.pc = dsi-v_kernentry;
 ctxt.user_regs.msr = 0;
 ctxt.user_regs.gprs[1] = 0; /* Linux uses its own stack */
-ctxt.user_regs.gprs[3] = devtree_addr;
+ctxt.user_regs.gprs[3] = 0;
 ctxt.user_regs.gprs[4] = kern_addr;
 ctxt.user_regs.gprs[5] = 0; /* reserved for specifying OF handler */
 /* There is a buggy kernel that does not zero the local_paca, so
@@ -79,85 +75,6 @@ static int init_boot_vcpu(
 return rc;
 }
 
-static int load_devtree(
-int xc_handle,
-int domid,
-xen_pfn_t *page_array,
-void *devtree,
-unsigned long devtree_addr,
-uint64_t initrd_base,
-unsigned long initrd_len,
-start_info_t *start_info __attribute__((unused)),
-unsigned long start_info_addr)
-{
-uint32_t si[4] = {0, start_info_addr, 0, 0x1000};
-struct boot_param_header *header;
-void *chosen;
-void *xen;
-uint64_t initrd_end = initrd_base + initrd_len;
-unsigned int devtree_size;
-int rc = 0;
-
-DPRINTF(adding initrd props\n);
-
-

[XenPPC] [xenppc-unstable] [XEND][POWERPC] Sync tools/python/xen/lowlevel/xc/xc.c with xen-unstable.hg

2007-01-21 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID ed5ee9dde0bd18e4f0f4c4a055317ab2fb63197e
# Parent  5498644b55501c25a8f56b21396e823a299020f9
[XEND][POWERPC] Sync tools/python/xen/lowlevel/xc/xc.c with xen-unstable.hg

Signed-off-by: Ryan Harper [EMAIL PROTECTED]
Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 tools/python/xen/lowlevel/xc/xc.c |  163 +-
 1 files changed, 57 insertions(+), 106 deletions(-)

diff -r 5498644b5550 -r ed5ee9dde0bd tools/python/xen/lowlevel/xc/xc.c
--- a/tools/python/xen/lowlevel/xc/xc.c Sun Jan 21 08:17:02 2007 -0500
+++ b/tools/python/xen/lowlevel/xc/xc.c Sun Jan 21 08:17:46 2007 -0500
@@ -360,7 +360,6 @@ static PyObject *pyxc_linux_build(XcObje
 unsigned int mem_mb;
 unsigned long store_mfn = 0;
 unsigned long console_mfn = 0;
-int unused;
 
 static char *kwd_list[] = { domid, store_evtchn, memsize,
 console_evtchn, image,
@@ -368,12 +367,12 @@ static PyObject *pyxc_linux_build(XcObje
 ramdisk, cmdline, flags,
 features, NULL };
 
-if ( !PyArg_ParseTupleAndKeywords(args, kwds, s|ssis#, kwd_list,
+if ( !PyArg_ParseTupleAndKeywords(args, kwds, s|ssis, kwd_list,
   dom, store_evtchn, mem_mb,
   console_evtchn, image,
   /* optional */
   ramdisk, cmdline, flags,
-  features, unused) )
+  features) )
 return NULL;
 
 if ( xc_linux_build(self-xc_handle, dom, mem_mb, image,
@@ -442,6 +441,47 @@ static PyObject *pyxc_hvm_build(XcObject
 return Py_BuildValue({s:i}, store_mfn, store_mfn);
 }
 
+#ifdef __powerpc__
+static PyObject *pyxc_prose_build(XcObject *self,
+  PyObject *args,
+  PyObject *kwds)
+{
+uint32_t dom;
+char *image, *ramdisk = NULL, *cmdline = , *features = NULL;
+int flags = 0;
+int store_evtchn, console_evtchn;
+unsigned int mem_mb;
+unsigned long store_mfn = 0;
+unsigned long console_mfn = 0;
+
+static char *kwd_list[] = { dom, store_evtchn,
+console_evtchn, image, memsize,
+/* optional */
+ramdisk, cmdline, flags,
+features, NULL };
+
+if ( !PyArg_ParseTupleAndKeywords(args, kwds, iiis|ssis, kwd_list,
+  dom, store_evtchn,
+  console_evtchn, image, mem_mb,
+  /* optional */
+  ramdisk, cmdline, flags,
+  features) )
+return NULL;
+
+if ( xc_prose_build(self-xc_handle, dom, mem_mb, image,
+ramdisk, cmdline, features, flags,
+store_evtchn, store_mfn,
+console_evtchn, console_mfn) != 0 ) {
+if (!errno)
+ errno = EINVAL;
+return pyxc_error_to_exception();
+}
+return Py_BuildValue({s:i,s:i}, 
+ store_mfn, store_mfn,
+ console_mfn, console_mfn);
+}
+#endif /* powerpc */
+
 static PyObject *pyxc_evtchn_alloc_unbound(XcObject *self,
PyObject *args,
PyObject *kwds)
@@ -915,68 +955,6 @@ static PyObject *dom_op(XcObject *self, 
 Py_INCREF(zero);
 return zero;
 }
-
-#ifdef __powerpc__
-static PyObject *pyxc_alloc_real_mode_area(XcObject *self,
-   PyObject *args,
-   PyObject *kwds)
-{
-uint32_t dom;
-unsigned int log;
-
-static char *kwd_list[] = { dom, log, NULL };
-
-if ( !PyArg_ParseTupleAndKeywords(args, kwds, ii, kwd_list, 
-  dom, log) )
-return NULL;
-
-if ( xc_alloc_real_mode_area(self-xc_handle, dom, log) )
-return pyxc_error_to_exception();
-
-Py_INCREF(zero);
-return zero;
-}
-
-static PyObject *pyxc_prose_build(XcObject *self,
-  PyObject *args,
-  PyObject *kwds)
-{
-uint32_t dom;
-char *image, *ramdisk = NULL, *cmdline = , *features = NULL;
-int flags = 0;
-int store_evtchn, console_evtchn;
-unsigned int mem_mb;
-unsigned long store_mfn = 0;
-unsigned long console_mfn = 0;
-int unused;
-
-static char *kwd_list[] = { dom, store_evtchn,
-console_evtchn, image, memsize,
-/* optional */
-ramdisk, cmdline, flags,
-   

[XenPPC] [xenppc-unstable] [XEN][POWERPC] big lock to protect some TLB operations

2007-01-20 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID 0a541b530f6a91b0a4de25db25c0ed33f0779202
# Parent  c16586000525f9d9dfbbe336d9d458dd08b44a0e
[XEN][POWERPC] big lock to protect some TLB operations

970 requires locking around TLB operations, see code comment.

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 xen/arch/powerpc/papr/xlate.c |   17 -
 1 files changed, 16 insertions(+), 1 deletion(-)

diff -r c16586000525 -r 0a541b530f6a xen/arch/powerpc/papr/xlate.c
--- a/xen/arch/powerpc/papr/xlate.c Wed Jan 17 19:37:20 2007 -0500
+++ b/xen/arch/powerpc/papr/xlate.c Sat Jan 20 18:57:15 2007 -0500
@@ -72,6 +72,20 @@ static inline void pte_insert(union pte 
 }
 #endif
 
+/*
+ * POWER Arch 2.03 Sec 4.12.1 (Yes 970 is one)
+ *
+ *   when a tlbsync instruction has been executed by a processor in a
+ *   given partition, a ptesync instruction must be executed by that
+ *   processor before a tlbie or tlbsync instruction is executed by
+ *   another processor in that partition.
+ *
+ * So for now, here is a BFLock to deal with it, the lock should be per-domain.
+ *
+ * XXX Will need to audit all tlb usege soon enough.
+ */
+
+static DEFINE_SPINLOCK(native_tlbie_lock);
 static void pte_tlbie(union pte volatile *pte, ulong ptex)
 {
 ulong va;
@@ -91,6 +105,7 @@ static void pte_tlbie(union pte volatile
 va = (pi  12) | (vsid  28);
 va = ~(0xULL  48);
 
+spin_lock(native_tlbie_lock);
 #ifndef FLUSH_THE_WHOLE_THING
 if (pte-bits.l) {
 va |= (pte-bits.rpn  1);
@@ -114,7 +129,7 @@ static void pte_tlbie(union pte volatile
 }
 }
 #endif
-
+spin_unlock(native_tlbie_lock);
 }
 
 long pte_enter(ulong flags, ulong ptex, ulong vsid, ulong rpn)

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


[XenPPC] [xenppc-unstable] [XEN][POWERPC] more ofd /cpus fixups

2007-01-20 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID ae504a49923cd7d4446022f300498d95271ffbd1
# Parent  0a541b530f6a91b0a4de25db25c0ed33f0779202
[XEN][POWERPC] more ofd /cpus fixups

Correct comment on why we prune secondary processors on the devtree.
Get rid of a particularly annoying non-standard cpu property.

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 xen/arch/powerpc/ofd_fixup.c |   11 ++-
 1 files changed, 10 insertions(+), 1 deletion(-)

diff -r 0a541b530f6a -r ae504a49923c xen/arch/powerpc/ofd_fixup.c
--- a/xen/arch/powerpc/ofd_fixup.c  Sat Jan 20 18:57:15 2007 -0500
+++ b/xen/arch/powerpc/ofd_fixup.c  Sat Jan 20 18:59:32 2007 -0500
@@ -178,11 +178,20 @@ static ofdn_t ofd_cpus_props(void *m, st
 if (ofd_boot_cpu == -1)
 ofd_boot_cpu = c;
 while (c  0) {
-/* Since we are not MP yet we prune all but the booting cpu */
+/* We do not use the OF tree to identify secondary processors
+ * so we must prune them from the tree */
 if (c == ofd_boot_cpu) {
+ofdn_t p;
+
 ibm_pft_size[1] = d-arch.htab.log_num_ptes + LOG_PTE_SIZE;
 ofd_prop_add(m, c, ibm,pft-size,
  ibm_pft_size, sizeof (ibm_pft_size));
+
+/* get rid of non-standard properties */
+p = ofd_prop_find(m, c, cpu#);
+if (p  0) {
+ofd_prop_remove(m, c, p);
+}
 
 /* FIXME: Check the the l2-cache property who's
  * contents is an orphaned phandle? */

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


[XenPPC] [xenppc-unstable] [XEN][POWERPC] Print DAR and DSISR registers on CPU register dumps

2007-01-20 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID b4b7249f00d6063286d8d7240f4341e08bd2ee91
# Parent  ae504a49923cd7d4446022f300498d95271ffbd1
[XEN][POWERPC] Print DAR and DSISR registers on CPU register dumps

The information from these register can really help track doen
problems.  They are only saved on program exception, so we show what
in the CPU at time of printing as well.

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 xen/arch/powerpc/backtrace.c |1 -
 xen/arch/powerpc/powerpc64/asm-offsets.c |2 ++
 xen/arch/powerpc/powerpc64/exceptions.S  |8 +++-
 xen/arch/powerpc/powerpc64/traps.c   |   10 +-
 xen/include/public/arch-powerpc.h|   11 +++
 5 files changed, 25 insertions(+), 7 deletions(-)

diff -r ae504a49923c -r b4b7249f00d6 xen/arch/powerpc/backtrace.c
--- a/xen/arch/powerpc/backtrace.c  Sat Jan 20 18:59:32 2007 -0500
+++ b/xen/arch/powerpc/backtrace.c  Sat Jan 20 19:05:18 2007 -0500
@@ -198,7 +198,6 @@ void show_backtrace_regs(struct cpu_user
 console_start_sync();
 
 show_registers(regs);
-printk(dar 0x%016lx, dsisr 0x%08x\n, mfdar(), mfdsisr());
 printk(hid4 0x%016lx\n, regs-hid4);
 printk(---[ backtrace ]---\n);
 show_backtrace(regs-gprs[1], regs-lr, regs-pc);
diff -r ae504a49923c -r b4b7249f00d6 xen/arch/powerpc/powerpc64/asm-offsets.c
--- a/xen/arch/powerpc/powerpc64/asm-offsets.c  Sat Jan 20 18:59:32 2007 -0500
+++ b/xen/arch/powerpc/powerpc64/asm-offsets.c  Sat Jan 20 19:05:18 2007 -0500
@@ -48,6 +48,8 @@ void __dummy__(void)
 OFFSET(UREGS_ctr, struct cpu_user_regs, ctr);
 OFFSET(UREGS_xer, struct cpu_user_regs, xer);
 OFFSET(UREGS_hid4, struct cpu_user_regs, hid4);
+OFFSET(UREGS_dar, struct cpu_user_regs, dar);
+OFFSET(UREGS_dsisr, struct cpu_user_regs, dsisr);
 OFFSET(UREGS_cr, struct cpu_user_regs, cr);
 OFFSET(UREGS_fpscr, struct cpu_user_regs, fpscr);
 DEFINE(UREGS_sizeof, sizeof(struct cpu_user_regs));
diff -r ae504a49923c -r b4b7249f00d6 xen/arch/powerpc/powerpc64/exceptions.S
--- a/xen/arch/powerpc/powerpc64/exceptions.S   Sat Jan 20 18:59:32 2007 -0500
+++ b/xen/arch/powerpc/powerpc64/exceptions.S   Sat Jan 20 19:05:18 2007 -0500
@@ -373,9 +373,15 @@ ex_machcheck_continued:
  * a better way, but this works for now. */
 ex_program_continued:
 SAVE_GPRS r14, r31, r1  /* save all the non-volatiles */
-/* save hid4 for debug */
+
+/* save these for debug, no needed for restore */
 mfspr r14, SPRN_HID4
 std r14, UREGS_hid4(r1)
+mfdar r14
+std r14, UREGS_dar(r1)
+mfdsisr r14
+stw r14, UREGS_dsisr(r1)
+
 mr r14, r0
 EXCEPTION_SAVE_STATE r1
 mr r4, r14
diff -r ae504a49923c -r b4b7249f00d6 xen/arch/powerpc/powerpc64/traps.c
--- a/xen/arch/powerpc/powerpc64/traps.cSat Jan 20 18:59:32 2007 -0500
+++ b/xen/arch/powerpc/powerpc64/traps.cSat Jan 20 19:05:18 2007 -0500
@@ -41,7 +41,15 @@ void show_registers(struct cpu_user_regs
regs-pc, regs-msr,
regs-lr, regs-ctr,
regs-srr0, regs-srr1);
-for (i=0; i32; i+=4) {
+
+/* These come in handy for debugging but are not always saved, so
+ * what is actually in the register should be good */
+printk(dar %016lx dsisr %08x *** saved\n
+   dar %016lx dsisr %08x *** actual\n,
+   regs-dar, regs-dsisr,
+   mfdar(), mfdsisr());
+
+for (i = 0; i  32; i += 4) {
 printk(r%02i: %016lx %016lx %016lx %016lx\n, i,
 regs-gprs[i], regs-gprs[i+1], regs-gprs[i+2], regs-gprs[i+3]);
 }
diff -r ae504a49923c -r b4b7249f00d6 xen/include/public/arch-powerpc.h
--- a/xen/include/public/arch-powerpc.h Sat Jan 20 18:59:32 2007 -0500
+++ b/xen/include/public/arch-powerpc.h Sat Jan 20 19:05:18 2007 -0500
@@ -77,8 +77,8 @@ DEFINE_XEN_GUEST_HANDLE(xen_pfn_t);
 
 typedef uint64_t xen_ulong_t;
 
-/* User-accessible registers: need to be saved/restored for every nested Xen
- * invocation. */
+/* User-accessible registers: nost of these need to be saved/restored
+ * for every nested Xen invocation. */
 struct cpu_user_regs
 {
 uint64_t gprs[32];
@@ -88,10 +88,13 @@ struct cpu_user_regs
 uint64_t srr1;
 uint64_t pc;
 uint64_t msr;
-uint64_t fpscr;
+uint64_t fpscr; /* XXX Is this necessary */
 uint64_t xer;
-uint64_t hid4;
+uint64_t hid4;  /* debug only */
+uint64_t dar;   /* debug only */
+uint32_t dsisr; /* debug only */
 uint32_t cr;
+uint32_t __pad; /* good spot for another 32bit reg */
 uint32_t entry_vector;
 };
 typedef struct cpu_user_regs cpu_user_regs_t;

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


[XenPPC] [xenppc-unstable] [XEN][POWERPC] merge

2007-01-20 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID 40b707df348824b7df499fe79b98289affad2485
# Parent  b4b7249f00d6063286d8d7240f4341e08bd2ee91
# Parent  5bcb155e5de57c02ef3b38d4989625ffafe3fcbe
[XEN][POWERPC] merge
---
 xen/arch/powerpc/boot_of.c   |   39 +++
 xen/arch/powerpc/memory.c|  150 ---
 xen/include/asm-powerpc/mm.h |3 
 3 files changed, 98 insertions(+), 94 deletions(-)

diff -r b4b7249f00d6 -r 40b707df3488 xen/arch/powerpc/boot_of.c
--- a/xen/arch/powerpc/boot_of.cSat Jan 20 19:05:18 2007 -0500
+++ b/xen/arch/powerpc/boot_of.cSat Jan 20 19:13:44 2007 -0500
@@ -43,6 +43,14 @@ static int of_out;
 static int of_out;
 static ulong eomem;
 
+/* Track memory during early boot with a limited per-page bitmap. We need an
+ * allocator to tell us where we can place RTAS, our copy of the device tree.
+ * We could examine the available properties in memory nodes, but we
+ * apparently can't depend on firmware to update those when we call claim. So
+ * we need to track it ourselves.
+ * We can't dynamically allocate the bitmap, because we would need something
+ * to tell us where it's safe to allocate...
+ */
 #define MEM_AVAILABLE_PAGES ((32  20)  PAGE_SHIFT)
 static DECLARE_BITMAP(mem_available_pages, MEM_AVAILABLE_PAGES);
 
@@ -530,6 +538,37 @@ static ulong boot_of_alloc(ulong size)
 
 pos = pos + i;
 }
+}
+
+int boot_of_mem_avail(int pos, ulong *startpage, ulong *endpage)
+{
+ulong freebit;
+ulong usedbit;
+
+if (pos = MEM_AVAILABLE_PAGES)
+/* Stop iterating. */
+return -1;
+
+/* Find first free page. */
+freebit = find_next_zero_bit(mem_available_pages, MEM_AVAILABLE_PAGES, 
pos);
+if (freebit = MEM_AVAILABLE_PAGES) {
+/* We know everything after MEM_AVAILABLE_PAGES is still free. */
+*startpage = MEM_AVAILABLE_PAGES  PAGE_SHIFT;
+*endpage = ~0UL;
+return freebit;
+}
+*startpage = freebit  PAGE_SHIFT;
+
+/* Now find first used page after that. */
+usedbit = find_next_bit(mem_available_pages, MEM_AVAILABLE_PAGES, freebit);
+if (usedbit = MEM_AVAILABLE_PAGES) {
+/* We know everything after MEM_AVAILABLE_PAGES is still free. */
+*endpage = ~0UL;
+return usedbit;
+}
+
+*endpage = usedbit  PAGE_SHIFT;
+return usedbit;
 }
 
 static ulong boot_of_mem_init(void)
diff -r b4b7249f00d6 -r 40b707df3488 xen/arch/powerpc/memory.c
--- a/xen/arch/powerpc/memory.c Sat Jan 20 19:05:18 2007 -0500
+++ b/xen/arch/powerpc/memory.c Sat Jan 20 19:13:44 2007 -0500
@@ -13,7 +13,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  *
- * Copyright (C) IBM Corp. 2006
+ * Copyright IBM Corp. 2006, 2007
  *
  * Authors: Dan Poff [EMAIL PROTECTED]
  *  Jimi Xenidis [EMAIL PROTECTED]
@@ -25,7 +25,7 @@
 #include oftree.h
 #include rtas.h
 
-#undef DEBUG
+#define DEBUG
 #ifdef DEBUG
 #define DBG(fmt...) printk(fmt)
 #else
@@ -42,8 +42,6 @@ unsigned long xenheap_phys_end;
 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;
@@ -51,30 +49,6 @@ struct membuf {
 };
 
 typedef void (*walk_mem_fn)(struct membuf *, uint);
-
-static ulong free_xenheap(ulong start, ulong end)
-{
-start = ALIGN_UP(start, PAGE_SIZE);
-end = ALIGN_DOWN(end, PAGE_SIZE);
-
-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)
 {
@@ -113,6 +87,7 @@ static void heap_init(struct membuf *mb,
 start_blk = xenheap_phys_end;
 }
 
+DBG(boot free: %016lx - %016lx\n, start_blk, end_blk);
 init_boot_pages(start_blk, end_blk);
 total_pages += (end_blk - start_blk)  PAGE_SHIFT;
 }
@@ -141,72 +116,31 @@ static void ofd_walk_mem(void *m, walk_m
 }
 }
 
-static void setup_xenheap(module_t *mod, int mcount)
-{
-int i;
-ulong freemem;
-
-freemem = ALIGN_UP((ulong)_end, PAGE_SIZE);
-
-for (i = 0; i  mcount; i++) {
-u32 s;
-
-if (mod[i].mod_end == mod[i].mod_start)
-continue;
-
-s = ALIGN_DOWN(mod[i].mod_start, PAGE_SIZE);
-
-if (mod[i].mod_start  (ulong)_start 
-   

[XenPPC] [xenppc-unstable] [XEN][POWERPC] add asm/nmi.h

2007-01-17 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID 5327f212fc83dc0d8785b00e7aa74270e89a8061
# Parent  3f6a2745b3a3b40bcdd51f9111b0993bad2c7ec6
[XEN][POWERPC] add asm/nmi.h
Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 xen/include/asm-powerpc/nmi.h |6 ++
 1 files changed, 6 insertions(+)

diff -r 3f6a2745b3a3 -r 5327f212fc83 xen/include/asm-powerpc/nmi.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +
+++ b/xen/include/asm-powerpc/nmi.h Wed Jan 17 13:16:55 2007 -0500
@@ -0,0 +1,6 @@
+#ifndef ASM_NMI_H
+#define ASM_NMI_H
+
+#include public/nmi.h
+
+#endif /* ASM_NMI_H */

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


[XenPPC] [xenppc-unstable] [XEN][POWERPC] Fix arch_set_info_guest() from upstream interface change

2007-01-17 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID 6a86727a3afe85751d916700c1c6db2c75e7bd27
# Parent  5327f212fc83dc0d8785b00e7aa74270e89a8061
[XEN][POWERPC] Fix arch_set_info_guest() from upstream interface change
Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 xen/arch/powerpc/domain.c |6 --
 1 files changed, 4 insertions(+), 2 deletions(-)

diff -r 5327f212fc83 -r 6a86727a3afe xen/arch/powerpc/domain.c
--- a/xen/arch/powerpc/domain.c Wed Jan 17 13:16:55 2007 -0500
+++ b/xen/arch/powerpc/domain.c Wed Jan 17 13:18:02 2007 -0500
@@ -13,7 +13,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  *
- * Copyright (C) IBM Corp. 2005, 2006
+ * Copyright IBM Corp. 2005, 2006, 2007
  *
  * Authors: Jimi Xenidis [EMAIL PROTECTED]
  */
@@ -151,7 +151,9 @@ void vcpu_destroy(struct vcpu *v)
 }
 
 int arch_set_info_guest(struct vcpu *v, vcpu_guest_context_u c)
-{ 
+{
+struct domain *d = v-domain;
+
 memcpy(v-arch.ctxt, c.nat-user_regs, sizeof(c.nat-user_regs));
 
 printk(Domain[%d].%d: initializing\n, d-domain_id, v-vcpu_id);

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


[XenPPC] [xenppc-unstable] [XEN][POWERPC] Update linker symbols and scripts

2007-01-17 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID c759c733f77d5edaa21620f37206521399842023
# Parent  6a86727a3afe85751d916700c1c6db2c75e7bd27
[XEN][POWERPC] Update linker symbols and scripts

The following patch:
  - updates linker symbols and interfaces that use them
  - clean up of dynamically registered PAPR hcalls
  - Way simpler linker script

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 xen/arch/powerpc/Makefile|2 
 xen/arch/powerpc/boot_of.c   |4 
 xen/arch/powerpc/hcalls.c|6 -
 xen/arch/powerpc/of-devtree.h|3 
 xen/arch/powerpc/xen.lds.S   |  206 ++-
 xen/include/asm-powerpc/config.h |5 
 xen/include/asm-powerpc/init.h   |   10 -
 7 files changed, 72 insertions(+), 164 deletions(-)

diff -r 6a86727a3afe -r c759c733f77d xen/arch/powerpc/Makefile
--- a/xen/arch/powerpc/Makefile Wed Jan 17 13:18:02 2007 -0500
+++ b/xen/arch/powerpc/Makefile Wed Jan 17 14:12:08 2007 -0500
@@ -64,7 +64,7 @@ CFLAGS += $(PPC_C_WARNINGS)
 # objects into a single ELF segment and to not link in any additional
 # objects that gcc would normally like to
 #
-OMAGIC = -N -nodefaultlibs -nostartfiles
+OMAGIC = -nodefaultlibs -nostartfiles
 
 firmware: of_handler/built_in.o $(TARGET_SUBARCH)/memcpy.o of-devtree.o
$(CC) $(CFLAGS) $(OMAGIC) -e __ofh_start -Wl,-Ttext,0x0 $^ -o $@
diff -r 6a86727a3afe -r c759c733f77d xen/arch/powerpc/boot_of.c
--- a/xen/arch/powerpc/boot_of.cWed Jan 17 13:18:02 2007 -0500
+++ b/xen/arch/powerpc/boot_of.cWed Jan 17 14:12:08 2007 -0500
@@ -13,7 +13,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  *
- * Copyright (C) IBM Corp. 2005, 2006
+ * Copyright IBM Corp. 2005, 2006, 2007
  *
  * Authors: Jimi Xenidis [EMAIL PROTECTED]
  *  Hollis Blanchard [EMAIL PROTECTED]
@@ -1303,7 +1303,7 @@ multiboot_info_t __init *boot_of_init(
 __func__,
 r3, r4, vec, r6, r7, orig_msr);
 
-if ((vec = (ulong)_start)  (vec = (ulong)_end)) {
+if (is_kernel(vec)) {
 of_panic(Hmm.. OF[0x%lx] seems to have stepped on our image 
 that ranges: %p .. %p.\n,
 vec, _start, _end);
diff -r 6a86727a3afe -r c759c733f77d xen/arch/powerpc/hcalls.c
--- a/xen/arch/powerpc/hcalls.c Wed Jan 17 13:18:02 2007 -0500
+++ b/xen/arch/powerpc/hcalls.c Wed Jan 17 14:12:08 2007 -0500
@@ -13,7 +13,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  *
- * Copyright (C) IBM Corp. 2005
+ * Copyright IBM Corp. 2005, 2006, 2007
  *
  * Authors: Hollis Blanchard [EMAIL PROTECTED]
  */
@@ -130,7 +130,7 @@ static void register_papr_hcall(ulong nu
 
 static void init_papr_hcalls(void)
 {
-inithcall_t *hcall;
+init_hcall_t *hcall;
 int i;
 
 /* initialize PAPR hcall table */
@@ -140,7 +140,7 @@ static void init_papr_hcalls(void)
 register_papr_hcall(i, do_ni_papr_hypercall);
 
 /* register the PAPR hcalls */
-for (hcall = __inithcall_start; hcall  __inithcall_end; hcall++) {
+for (hcall = __init_hcall_start; hcall  __init_hcall_end; hcall++) {
 register_papr_hcall(hcall-number, hcall-handler);
 }
 }
diff -r 6a86727a3afe -r c759c733f77d xen/arch/powerpc/of-devtree.h
--- a/xen/arch/powerpc/of-devtree.h Wed Jan 17 13:18:02 2007 -0500
+++ b/xen/arch/powerpc/of-devtree.h Wed Jan 17 14:12:08 2007 -0500
@@ -13,7 +13,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  *
- * Copyright (C) IBM Corp. 2005
+ * Copyright IBM Corp. 2005, 2006, 2007
  *
  * Authors: Jimi Xenidis [EMAIL PROTECTED]
  */
@@ -23,6 +23,7 @@
 
 #include xen/types.h
 #include xen/string.h
+#include xen/kernel.h
 #include public/xen.h
 
 enum {
diff -r 6a86727a3afe -r c759c733f77d xen/arch/powerpc/xen.lds.S
--- a/xen/arch/powerpc/xen.lds.SWed Jan 17 13:18:02 2007 -0500
+++ b/xen/arch/powerpc/xen.lds.SWed Jan 17 14:12:08 2007 -0500
@@ -7,202 +7,112 @@ OUTPUT_FORMAT(elf64-powerpc, elf64-po
  elf64-powerpc)
 OUTPUT_ARCH(powerpc:common64)
 ENTRY(_start)
-SEARCH_DIR(=/usr/local/lib64); SEARCH_DIR(=/lib64); 
SEARCH_DIR(=/usr/lib64); SEARCH_DIR(=/usr/local/lib); SEARCH_DIR(=/lib); 
SEARCH_DIR(=/usr/lib);
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;*/
 PHDRS
 {
   text PT_LOAD;
 }   
 SECTIONS
 {
+  /* This is the address that we are linking at */ 
   . = 0x0040;
   PROVIDE(_text = .);
+  PROVIDE(_stext = .);
   /* Read-only sections, merged into text segment: */
-  .interp : { *(.interp) } :text
-  .hash   : { *(.hash) }
-  .dynsym : { *(.dynsym) }
-  .dynstr : { *(.dynstr) }
-  .gnu.version: { *(.gnu.version) }
-  .gnu.version_d  : { *(.gnu.version_d) }
-  .gnu.version_r 

[XenPPC] [xenppc-unstable] [XEN] only build xencomm.o if configed to do so.

2007-01-17 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID fa3a95fd876c75a48582db2916b915f985cd52ca
# Parent  58d6c9cb95c65e7583c838d0bbfc4412f518195c
[XEN] only build xencomm.o if configed to do so.
Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 xen/common/Makefile |1 -
 1 files changed, 1 deletion(-)

diff -r 58d6c9cb95c6 -r fa3a95fd876c xen/common/Makefile
--- a/xen/common/Makefile   Wed Jan 17 14:57:04 2007 -0500
+++ b/xen/common/Makefile   Wed Jan 17 17:42:39 2007 -0500
@@ -27,7 +27,6 @@ obj-y += trace.o
 obj-y += trace.o
 obj-y += version.o
 obj-y += vsprintf.o
-obj-y += xencomm.o
 obj-y += xmalloc.o
 
 obj-$(perfc)   += perfc.o

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


[XenPPC] [xenppc-unstable] [XEN][POWERPC] everything is single core right now so get cpu_core_map[] correct.

2007-01-15 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID 5568efb41da42a55318fa05d3ce0aa73e774e6d1
# Parent  d6481755ade6fbe72d8e519191f12160f92cd517
[XEN][POWERPC] everything is single core right now so get cpu_core_map[] 
correct.

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

diff -r d6481755ade6 -r 5568efb41da4 xen/arch/powerpc/setup.c
--- a/xen/arch/powerpc/setup.c  Thu Jan 11 13:39:27 2007 -0600
+++ b/xen/arch/powerpc/setup.c  Mon Jan 15 13:27:20 2007 -0500
@@ -252,7 +252,7 @@ static int kick_secondary_cpus(int maxcp
 cpu_set(i, cpu_sibling_map[cpuid]);
 
 /* For now everything is single core */
-cpu_set(0, cpu_core_map[cpuid]);
+cpu_set(cpuid, cpu_core_map[cpuid]);
 
 numa_set_node(cpuid, 0);
 numa_add_cpu(cpuid);

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


[XenPPC] [xenppc-unstable] [POWERPC][LIBXC] Whitespace cleanup of powerpc64/xc_linux_build.c

2007-01-12 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Ryan Harper [EMAIL PROTECTED]
# Node ID 47a43a108647a9c8523408c39ab0546ab9483c5a
# Parent  3ae579a27697e05040112770c4ffc725954a3a18
[POWERPC][LIBXC] Whitespace cleanup of powerpc64/xc_linux_build.c

Signed-off-by: Ryan Harper [EMAIL PROTECTED]
Signed-off-by: Hollis Blanchard [EMAIL PROTECTED]
---
 tools/libxc/powerpc64/xc_linux_build.c |8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diff -r 3ae579a27697 -r 47a43a108647 tools/libxc/powerpc64/xc_linux_build.c
--- a/tools/libxc/powerpc64/xc_linux_build.cWed Jan 03 17:53:44 2007 -0600
+++ b/tools/libxc/powerpc64/xc_linux_build.cThu Jan 11 13:39:27 2007 -0600
@@ -187,9 +187,9 @@ out:
 }
 
 static unsigned long create_start_info(
-   void *devtree, start_info_t *start_info,
+void *devtree, start_info_t *start_info,
 unsigned int console_evtchn, unsigned int store_evtchn,
-   unsigned long nr_pages, unsigned long rma_pages)
+unsigned long nr_pages, unsigned long rma_pages)
 {
 unsigned long start_info_addr;
 uint64_t rma_top;
@@ -260,8 +260,8 @@ int xc_linux_build(int xc_handle,
 
 rma_pages = get_rma_pages(devtree);
 if (rma_pages == 0) {
-   rc = -1;
-   goto out;
+rc = -1;
+goto out;
 }
 
 if (get_rma_page_array(xc_handle, domid, page_array, rma_pages)) {

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


[XenPPC] [xenppc-unstable] [POWERPC][LIBXC] Fix pointer math in ft_add_rsvmap(), rename string block to match DTC spec.

2007-01-12 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Ryan Harper [EMAIL PROTECTED]
# Node ID d6481755ade6fbe72d8e519191f12160f92cd517
# Parent  47a43a108647a9c8523408c39ab0546ab9483c5a
[POWERPC][LIBXC] Fix pointer math in ft_add_rsvmap(), rename string block to 
match DTC spec.

Signed-off-by: Ryan Harper [EMAIL PROTECTED]
Signed-off-by: Hollis Blanchard [EMAIL PROTECTED]
---
 tools/libxc/powerpc64/flatdevtree.c |7 +--
 tools/libxc/powerpc64/flatdevtree.h |2 +-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff -r 47a43a108647 -r d6481755ade6 tools/libxc/powerpc64/flatdevtree.c
--- a/tools/libxc/powerpc64/flatdevtree.c   Thu Jan 11 13:39:27 2007 -0600
+++ b/tools/libxc/powerpc64/flatdevtree.c   Thu Jan 11 13:39:27 2007 -0600
@@ -14,7 +14,7 @@
  * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  *
  * Copyright Pantelis Antoniou 2006
- * Copyright (C) IBM Corporation 2006
+ * Copyright IBM Corporation 2006, 2007
  * 2006 (c) MontaVista, Software, Inc.
  *
  * Authors: Pantelis Antoniou [EMAIL PROTECTED]
@@ -209,7 +209,7 @@ void ft_add_rsvmap(struct ft_cxt *cxt, u
((u64 *) cxt-pres)[0] = cpu_to_be64(physaddr); /* phys = 0, size = 0, 
terminate */
((u64 *) cxt-pres)[1] = cpu_to_be64(size);
 
-   cxt-pres += 18;/* advance */
+   cxt-pres += 16;/* advance two u64s worth */
 
((u64 *) cxt-pres)[0] = 0; /* phys = 0, size = 0, terminate */
((u64 *) cxt-pres)[1] = 0;
@@ -317,6 +317,9 @@ int ft_end_tree(struct ft_cxt *cxt)
/* the new strings start */
cxt-pstr_begin = cxt-p_begin + cxt-struct_size;
cxt-pstr = cxt-pstr_begin + cxt-strings_size;
+
+   /* mark the size of string structure in bph */
+   bph-size_dt_strings = cxt-strings_size;
 
return 0;
 }
diff -r 47a43a108647 -r d6481755ade6 tools/libxc/powerpc64/flatdevtree.h
--- a/tools/libxc/powerpc64/flatdevtree.h   Thu Jan 11 13:39:27 2007 -0600
+++ b/tools/libxc/powerpc64/flatdevtree.h   Thu Jan 11 13:39:27 2007 -0600
@@ -40,7 +40,7 @@ struct boot_param_header {
/* version 2 fields below */
u32 boot_cpuid_phys;/* Physical CPU id we're booting on */
/* version 3 fields below */
-   u32 dt_strings_size;/* size of the DT strings block */
+   u32 size_dt_strings;/* size of the DT strings block */
 };
 
 struct ft_cxt {

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


[XenPPC] [xenppc-unstable] [XEN][POWERPC] DomU real time clock based off of the real one in Dom0

2006-12-19 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID db52c7d043bb2a7f3dc67f4f2fb4f6498b92e558
# Parent  014c4ef0e124a81a072a92bd4cff17e6214d8897
[XEN][POWERPC] DomU real time clock based off of the real one in Dom0

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 xen/arch/powerpc/domain.c |   21 -
 xen/arch/powerpc/time.c   |6 --
 xen/include/public/arch-powerpc.h |2 +-
 3 files changed, 13 insertions(+), 16 deletions(-)

diff -r 014c4ef0e124 -r db52c7d043bb xen/arch/powerpc/domain.c
--- a/xen/arch/powerpc/domain.c Sun Dec 17 12:54:30 2006 -0500
+++ b/xen/arch/powerpc/domain.c Tue Dec 19 09:20:58 2006 -0500
@@ -152,17 +152,20 @@ void vcpu_destroy(struct vcpu *v)
 
 int arch_set_info_guest(struct vcpu *v, vcpu_guest_context_t *c)
 { 
+struct domain *d = v-domain;
+
 memcpy(v-arch.ctxt, c-user_regs, sizeof(c-user_regs));
 
-printk(Domain[%d].%d: initializing\n,
-   v-domain-domain_id, v-vcpu_id);
-
-if (v-domain-arch.htab.order == 0)
-panic(Page table never allocated for Domain: %d\n,
-  v-domain-domain_id);
-if (v-domain-arch.rma_order == 0)
-panic(RMA never allocated for Domain: %d\n,
-  v-domain-domain_id);
+printk(Domain[%d].%d: initializing\n, d-domain_id, v-vcpu_id);
+
+if (d-arch.htab.order == 0)
+panic(Page table never allocated for Domain: %d\n, d-domain_id);
+if (d-arch.rma_order == 0)
+panic(RMA never allocated for Domain: %d\n, d-domain_id);
+
+d-shared_info-wc_sec = dom0-shared_info-wc_sec;
+d-shared_info-wc_nsec = dom0-shared_info-wc_nsec;
+d-shared_info-arch.boot_timebase = dom0-shared_info-arch.boot_timebase;
 
 set_bit(_VCPUF_initialised, v-vcpu_flags);
 
diff -r 014c4ef0e124 -r db52c7d043bb xen/arch/powerpc/time.c
--- a/xen/arch/powerpc/time.c   Sun Dec 17 12:54:30 2006 -0500
+++ b/xen/arch/powerpc/time.c   Tue Dec 19 09:20:58 2006 -0500
@@ -85,12 +85,6 @@ void send_timer_event(struct vcpu *v)
 vcpu_unblock(v);
 }
 
-/* Set clock to secs,usecs after 00:00:00 UTC, 1 January, 1970. */
-void do_settime(unsigned long secs, unsigned long usecs, u64 system_time_base)
-{
-unimplemented();
-}
-
 void update_vcpu_system_time(struct vcpu *v)
 {
 }
diff -r 014c4ef0e124 -r db52c7d043bb xen/include/public/arch-powerpc.h
--- a/xen/include/public/arch-powerpc.h Sun Dec 17 12:54:30 2006 -0500
+++ b/xen/include/public/arch-powerpc.h Tue Dec 19 09:20:58 2006 -0500
@@ -108,7 +108,7 @@ DEFINE_XEN_GUEST_HANDLE(vcpu_guest_conte
 DEFINE_XEN_GUEST_HANDLE(vcpu_guest_context_t);
 
 struct arch_shared_info {
-uint64_t pad[32];
+uint64_t boot_timebase;
 };
 
 struct arch_vcpu_info {

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


[XenPPC] [xenppc-unstable] [XEN][POWERPC] use symbol to detect processor version

2006-12-17 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID 965d3e42dddaf5971001f7d172d192f925537644
# Parent  6af601c5ebe192a0de72430cdd94da5ba46ff287
[XEN][POWERPC] use symbol to detect processor version

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 xen/arch/powerpc/powerpc64/ppc970_scom.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff -r 6af601c5ebe1 -r 965d3e42ddda xen/arch/powerpc/powerpc64/ppc970_scom.c
--- a/xen/arch/powerpc/powerpc64/ppc970_scom.c  Fri Dec 15 08:36:03 2006 -0500
+++ b/xen/arch/powerpc/powerpc64/ppc970_scom.c  Sun Dec 17 12:36:31 2006 -0500
@@ -158,7 +158,7 @@ void cpu_scom_init(void)
 {
 #ifdef CONFIG_SCOM
 ulong val;
-if (PVR_REV(mfpvr()) == 0x0300) {
+if (PVR_REV(mfpvr()) == PV_970FX) {
 /* these address are only good for 970FX */
 console_start_sync();
 if (!cpu_scom_read(SCOM_PTSR, val))
@@ -174,7 +174,7 @@ void cpu_scom_AMCR(void)
 #ifdef CONFIG_SCOM
 ulong val;
 
-if (PVR_REV(mfpvr()) == 0x0300) {
+if (PVR_REV(mfpvr()) == PV_970FX) {
 /* these address are only good for 970FX */
 cpu_scom_read(SCOM_AMC_REG, val);
 printk(SCOM AMCR: 0x%016lx\n, val);

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


[XenPPC] [xenppc-unstable] merge

2006-12-17 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID 014c4ef0e124a81a072a92bd4cff17e6214d8897
# Parent  4b07d05c1b4e3492199e118d03f89209caffcad2
# Parent  9a758f814f60166dcf4a386bb9835f58c8f68502
merge
---
 xen/arch/powerpc/boot_of.c |   16 
 1 files changed, 12 insertions(+), 4 deletions(-)

diff -r 4b07d05c1b4e -r 014c4ef0e124 xen/arch/powerpc/boot_of.c
--- a/xen/arch/powerpc/boot_of.cSun Dec 17 12:53:12 2006 -0500
+++ b/xen/arch/powerpc/boot_of.cSun Dec 17 12:54:30 2006 -0500
@@ -1070,10 +1070,11 @@ static void * __init boot_of_module(ulon
 static module_t mods[4];
 ulong mod0_start;
 ulong mod0_size;
-static const char sepr[] =  -- ;
+static const char * sepr[] = { -- ,  || };
+int sepr_index;
 extern char dom0_start[] __attribute__ ((weak));
 extern char dom0_size[] __attribute__ ((weak));
-const char *p;
+const char *p = NULL;
 int mod;
 void *oft;
 
@@ -1124,11 +1125,18 @@ static void * __init boot_of_module(ulon
 
 of_printf(%s: dom0 mod @ 0x%016x[0x%x]\n, __func__,
   mods[mod].mod_start, mods[mod].mod_end);
-p = strstr((char *)(ulong)mbi-cmdline, sepr);
+
+/* look for delimiter: -- or || */
+for (sepr_index = 0; sepr_index  ARRAY_SIZE(sepr); sepr_index++){
+p = strstr((char *)(ulong)mbi-cmdline, sepr[sepr_index]);
+if (p != NULL)
+break;
+}
+
 if (p != NULL) {
 /* Xen proper should never know about the dom0 args.  */
 *(char *)p = '\0';
-p += sizeof (sepr) - 1;
+p += strlen(sepr[sepr_index]);
 mods[mod].string = (u32)(ulong)p;
 of_printf(%s: dom0 mod string: %s\n, __func__, p);
 }

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


[XenPPC] [xenppc-unstable] [XEN][POWERPC] Normalize timbase_freq to a 64bit value

2006-12-15 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID 20bd3b7b7519e01f7b6bfa97c7a655e1dc027f5d
# Parent  887e1cbac6154da0a3a3c2433fbc5b0fc2a1c9b8
[XEN][POWERPC] Normalize timbase_freq to a 64bit value

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 xen/arch/powerpc/boot_of.c |7 ---
 xen/arch/powerpc/time.c|2 +-
 xen/include/asm-powerpc/time.h |2 +-
 3 files changed, 6 insertions(+), 5 deletions(-)

diff -r 887e1cbac615 -r 20bd3b7b7519 xen/arch/powerpc/boot_of.c
--- a/xen/arch/powerpc/boot_of.cMon Dec 11 20:50:32 2006 -0500
+++ b/xen/arch/powerpc/boot_of.cFri Dec 15 08:16:56 2006 -0500
@@ -1159,6 +1159,7 @@ static int __init boot_of_cpus(void)
 s32 cpuid;
 u32 cpu_clock[2];
 extern uint cpu_hard_id[NR_CPUS];
+u32 tbf;
 
 /* Look up which CPU we are running on right now and get all info
  * from there */
@@ -1173,12 +1174,12 @@ static int __init boot_of_cpus(void)
 
 cpu_node = bootcpu_node;
 
-result = of_getprop(cpu_node, timebase-frequency, timebase_freq,
-sizeof(timebase_freq));
+result = of_getprop(cpu_node, timebase-frequency, tbf, sizeof(tbf));
+timebase_freq = tbf;
 if (result == OF_FAILURE) {
 of_panic(Couldn't get timebase frequency!\n);
 }
-of_printf(OF: timebase-frequency = %d Hz\n, timebase_freq);
+of_printf(OF: timebase-frequency = %ld Hz\n, timebase_freq);
 
 result = of_getprop(cpu_node, clock-frequency,
 cpu_clock, sizeof(cpu_clock));
diff -r 887e1cbac615 -r 20bd3b7b7519 xen/arch/powerpc/time.c
--- a/xen/arch/powerpc/time.c   Mon Dec 11 20:50:32 2006 -0500
+++ b/xen/arch/powerpc/time.c   Fri Dec 15 08:16:56 2006 -0500
@@ -32,7 +32,7 @@ static int cpu_has_hdec = 1;
 static int cpu_has_hdec = 1;
 ulong ticks_per_usec;
 unsigned long cpu_khz;
-unsigned int timebase_freq;
+s64 timebase_freq;
 
 s_time_t get_s_time(void)
 {
diff -r 887e1cbac615 -r 20bd3b7b7519 xen/include/asm-powerpc/time.h
--- a/xen/include/asm-powerpc/time.hMon Dec 11 20:50:32 2006 -0500
+++ b/xen/include/asm-powerpc/time.hFri Dec 15 08:16:56 2006 -0500
@@ -27,7 +27,7 @@
 #include xen/percpu.h
 #include asm/processor.h
 
-extern unsigned int timebase_freq;
+extern s64 timebase_freq;
 #define CLOCK_TICK_RATE timebase_freq
 
 #define watchdog_disable() ((void)0)

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


[XenPPC] [xenppc-unstable] [XEN][POWERPC] workaround for context_switch() bug

2006-12-15 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID 6af601c5ebe192a0de72430cdd94da5ba46ff287
# Parent  20bd3b7b7519e01f7b6bfa97c7a655e1dc027f5d
[XEN][POWERPC] workaround for context_switch() bug
 We have a bug in that if we switch domains in schedule() we switch
 right away regardless of whatever else is pending.  This means that
 if the timer goes off while in schedule(), the next domain will be
 preempted by the interval defined below.  So until we fix our
 cotnext_switch(), the follow workaround will make sure that the
 domain we switch to does not run for to long so we can continue to
 service the other timers in the timer queue and that the value is
 long enough to escape this particular timer event.

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 xen/arch/powerpc/exceptions.c |   19 +--
 1 files changed, 17 insertions(+), 2 deletions(-)

diff -r 20bd3b7b7519 -r 6af601c5ebe1 xen/arch/powerpc/exceptions.c
--- a/xen/arch/powerpc/exceptions.c Fri Dec 15 08:16:56 2006 -0500
+++ b/xen/arch/powerpc/exceptions.c Fri Dec 15 08:36:03 2006 -0500
@@ -35,7 +35,9 @@ extern ulong ppc_do_softirq(ulong orig_m
 extern ulong ppc_do_softirq(ulong orig_msr);
 extern void do_timer(struct cpu_user_regs *regs);
 extern void do_dec(struct cpu_user_regs *regs);
-extern void program_exception(struct cpu_user_regs *regs, unsigned long 
cookie);
+extern void program_exception(struct cpu_user_regs *regs,
+  unsigned long cookie);
+extern int reprogram_timer(s_time_t timeout); 
 
 int hdec_sample = 0;
 
@@ -43,7 +45,20 @@ void do_timer(struct cpu_user_regs *regs
 {
 /* Set HDEC high so it stops firing and can be reprogrammed by
  * set_preempt() */
-mthdec(INT_MAX);
+/* FIXME! HACK ALERT!
+ *
+ * We have a bug in that if we switch domains in schedule() we
+ * switch right away regardless of whatever else is pending.  This
+ * means that if the timer goes off while in schedule(), the next
+ * domain will be preempted by the interval defined below.  So
+ * until we fix our cotnext_switch(), the follow workaround will
+ * make sure that the domain we switch to does not run for to long
+ * so we can continue to service the other timers in the timer
+ * queue and that the value is long enough to escape this
+ * particular timer event.
+ */
+reprogram_timer(NOW() + MILLISECS(1));
+
 raise_softirq(TIMER_SOFTIRQ);
 }
 

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


[XenPPC] [xenppc-unstable] [POWERPC][XEN] Add support for || as a xen/dom0 commandline divider.

2006-12-15 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Hollis Blanchard [EMAIL PROTECTED]
# Node ID dbc74db14a4b39d359365fcf8257216d968fa269
# Parent  887e1cbac6154da0a3a3c2433fbc5b0fc2a1c9b8
[POWERPC][XEN] Add support for || as a xen/dom0 commandline divider.
Signed-off-by: Jerone Young [EMAIL PROTECTED]
Signed-off-by: Hollis Blanchard [EMAIL PROTECTED]
---
 xen/arch/powerpc/boot_of.c |   16 
 1 files changed, 12 insertions(+), 4 deletions(-)

diff -r 887e1cbac615 -r dbc74db14a4b xen/arch/powerpc/boot_of.c
--- a/xen/arch/powerpc/boot_of.cMon Dec 11 20:50:32 2006 -0500
+++ b/xen/arch/powerpc/boot_of.cTue Dec 12 14:35:07 2006 -0600
@@ -1070,10 +1070,11 @@ static void * __init boot_of_module(ulon
 static module_t mods[4];
 ulong mod0_start;
 ulong mod0_size;
-static const char sepr[] =  -- ;
+static const char * sepr[] = { -- ,  || };
+int sepr_index;
 extern char dom0_start[] __attribute__ ((weak));
 extern char dom0_size[] __attribute__ ((weak));
-const char *p;
+const char *p = NULL;
 int mod;
 void *oft;
 
@@ -1124,11 +1125,18 @@ static void * __init boot_of_module(ulon
 
 of_printf(%s: dom0 mod @ 0x%016x[0x%x]\n, __func__,
   mods[mod].mod_start, mods[mod].mod_end);
-p = strstr((char *)(ulong)mbi-cmdline, sepr);
+
+/* look for delimiter: -- or || */
+for (sepr_index = 0; sepr_index  ARRAY_SIZE(sepr); sepr_index++){
+p = strstr((char *)(ulong)mbi-cmdline, sepr[sepr_index]);
+if (p != NULL)
+break;
+}
+
 if (p != NULL) {
 /* Xen proper should never know about the dom0 args.  */
 *(char *)p = '\0';
-p += sizeof (sepr) - 1;
+p += strlen(sepr[sepr_index]);
 mods[mod].string = (u32)(ulong)p;
 of_printf(%s: dom0 mod string: %s\n, __func__, p);
 }

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


[XenPPC] [xenppc-unstable] [POWERPC] merge

2006-12-15 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Hollis Blanchard [EMAIL PROTECTED]
# Node ID 9a758f814f60166dcf4a386bb9835f58c8f68502
# Parent  dbc74db14a4b39d359365fcf8257216d968fa269
# Parent  6af601c5ebe192a0de72430cdd94da5ba46ff287
[POWERPC] merge
Signed-off-by: Hollis Blanchard [EMAIL PROTECTED]
---
 xen/arch/powerpc/boot_of.c |7 ---
 xen/arch/powerpc/exceptions.c  |   19 +--
 xen/arch/powerpc/time.c|2 +-
 xen/include/asm-powerpc/time.h |2 +-
 4 files changed, 23 insertions(+), 7 deletions(-)

diff -r dbc74db14a4b -r 9a758f814f60 xen/arch/powerpc/boot_of.c
--- a/xen/arch/powerpc/boot_of.cTue Dec 12 14:35:07 2006 -0600
+++ b/xen/arch/powerpc/boot_of.cFri Dec 15 13:37:38 2006 -0600
@@ -1167,6 +1167,7 @@ static int __init boot_of_cpus(void)
 s32 cpuid;
 u32 cpu_clock[2];
 extern uint cpu_hard_id[NR_CPUS];
+u32 tbf;
 
 /* Look up which CPU we are running on right now and get all info
  * from there */
@@ -1181,12 +1182,12 @@ static int __init boot_of_cpus(void)
 
 cpu_node = bootcpu_node;
 
-result = of_getprop(cpu_node, timebase-frequency, timebase_freq,
-sizeof(timebase_freq));
+result = of_getprop(cpu_node, timebase-frequency, tbf, sizeof(tbf));
+timebase_freq = tbf;
 if (result == OF_FAILURE) {
 of_panic(Couldn't get timebase frequency!\n);
 }
-of_printf(OF: timebase-frequency = %d Hz\n, timebase_freq);
+of_printf(OF: timebase-frequency = %ld Hz\n, timebase_freq);
 
 result = of_getprop(cpu_node, clock-frequency,
 cpu_clock, sizeof(cpu_clock));
diff -r dbc74db14a4b -r 9a758f814f60 xen/arch/powerpc/exceptions.c
--- a/xen/arch/powerpc/exceptions.c Tue Dec 12 14:35:07 2006 -0600
+++ b/xen/arch/powerpc/exceptions.c Fri Dec 15 13:37:38 2006 -0600
@@ -35,7 +35,9 @@ extern ulong ppc_do_softirq(ulong orig_m
 extern ulong ppc_do_softirq(ulong orig_msr);
 extern void do_timer(struct cpu_user_regs *regs);
 extern void do_dec(struct cpu_user_regs *regs);
-extern void program_exception(struct cpu_user_regs *regs, unsigned long 
cookie);
+extern void program_exception(struct cpu_user_regs *regs,
+  unsigned long cookie);
+extern int reprogram_timer(s_time_t timeout); 
 
 int hdec_sample = 0;
 
@@ -43,7 +45,20 @@ void do_timer(struct cpu_user_regs *regs
 {
 /* Set HDEC high so it stops firing and can be reprogrammed by
  * set_preempt() */
-mthdec(INT_MAX);
+/* FIXME! HACK ALERT!
+ *
+ * We have a bug in that if we switch domains in schedule() we
+ * switch right away regardless of whatever else is pending.  This
+ * means that if the timer goes off while in schedule(), the next
+ * domain will be preempted by the interval defined below.  So
+ * until we fix our cotnext_switch(), the follow workaround will
+ * make sure that the domain we switch to does not run for to long
+ * so we can continue to service the other timers in the timer
+ * queue and that the value is long enough to escape this
+ * particular timer event.
+ */
+reprogram_timer(NOW() + MILLISECS(1));
+
 raise_softirq(TIMER_SOFTIRQ);
 }
 
diff -r dbc74db14a4b -r 9a758f814f60 xen/arch/powerpc/time.c
--- a/xen/arch/powerpc/time.c   Tue Dec 12 14:35:07 2006 -0600
+++ b/xen/arch/powerpc/time.c   Fri Dec 15 13:37:38 2006 -0600
@@ -32,7 +32,7 @@ static int cpu_has_hdec = 1;
 static int cpu_has_hdec = 1;
 ulong ticks_per_usec;
 unsigned long cpu_khz;
-unsigned int timebase_freq;
+s64 timebase_freq;
 
 s_time_t get_s_time(void)
 {
diff -r dbc74db14a4b -r 9a758f814f60 xen/include/asm-powerpc/time.h
--- a/xen/include/asm-powerpc/time.hTue Dec 12 14:35:07 2006 -0600
+++ b/xen/include/asm-powerpc/time.hFri Dec 15 13:37:38 2006 -0600
@@ -27,7 +27,7 @@
 #include xen/percpu.h
 #include asm/processor.h
 
-extern unsigned int timebase_freq;
+extern s64 timebase_freq;
 #define CLOCK_TICK_RATE timebase_freq
 
 #define watchdog_disable() ((void)0)

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


[XenPPC] [xenppc-unstable] [XEN][POWERPC] boot_of_allocator fixups

2006-12-12 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID 887e1cbac6154da0a3a3c2433fbc5b0fc2a1c9b8
# Parent  878ce1f78ad3976f44a657e5386a7f6d619ffac2
[XEN][POWERPC] boot_of_allocator fixups
This patch:
  - print devtree mod size correctly
  - find next_bit rather then test all needed bits to be zero
  - stop pre-allocating memory below image as used

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 xen/arch/powerpc/boot_of.c |   23 ---
 1 files changed, 4 insertions(+), 19 deletions(-)

diff -r 878ce1f78ad3 -r 887e1cbac615 xen/arch/powerpc/boot_of.c
--- a/xen/arch/powerpc/boot_of.cMon Dec 11 19:43:18 2006 -0500
+++ b/xen/arch/powerpc/boot_of.cMon Dec 11 20:50:32 2006 -0500
@@ -431,19 +431,8 @@ static void boot_of_alloc_init(int m, ui
 }
 }
 
-/* FW is incorrect in that the space below our image is not safe
- * either */
-start = (ulong)_start  PAGE_SHIFT;
-pg = 0;
-DBG(%s: marking 0x%x - 0x%lx\n, __func__,
-pg  PAGE_SHIFT, start);
-while (pg  start - 1) {
-set_bit(pg, mem_available_pages);
-++pg;
-}
-
 /* Now make sure we mark our own memory */
-pg = start;
+pg =  (ulong)_start  PAGE_SHIFT;
 start = (ulong)_end  PAGE_SHIFT;
 
 DBG(%s: marking 0x%x - 0x%lx\n, __func__,
@@ -521,11 +510,8 @@ static ulong boot_of_alloc(ulong size)
 /* find a set that fits */
 DBG(%s: checking for 0x%lx bits: 0x%lx\n, __func__, bits, pos);
 
-i = 1;
-while (i  bits  !test_bit(pos + i, mem_available_pages))
-++i;
-
-if (i == bits) {
+i = find_next_bit(mem_available_pages, MEM_AVAILABLE_PAGES, pos);  
+if (i - pos = bits) {
 uint addr = pos  PAGE_SHIFT;
 
 /* make sure OF is happy with our choice */
@@ -1073,7 +1059,7 @@ static void * __init boot_of_devtree(mod
 
 mod-mod_start = (ulong)oft;
 mod-mod_end = mod-mod_start + oft_sz;
-of_printf(%s: devtree mod @ 0x%016x[0x%x]\n, __func__,
+of_printf(%s: devtree mod @ 0x%016x - 0x%016x\n, __func__,
   mod-mod_start, mod-mod_end);
 
 return oft;
@@ -1152,7 +1138,6 @@ static void * __init boot_of_module(ulon
 ++mod;
 
 oft = boot_of_devtree(mods[mod], mbi);
-of_printf(hello\n);
 if (oft == NULL)
 of_panic(%s: boot_of_devtree failed\n, __func__);
 

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


[XenPPC] [xenppc-unstable] [XEN][POWERPC] should comment the Power Managment workaround in the code as well

2006-12-02 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID 0e85b389980ad1a4d135773d807825d91a94ae9c
# Parent  4f4b8cbcf3bf22ce2d0ff2b2e6589a054a1840fa
[XEN][POWERPC] should comment the Power Managment workaround in the code as well

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 xen/arch/powerpc/powerpc64/ppc970.c |3 +++
 1 files changed, 3 insertions(+)

diff -r 4f4b8cbcf3bf -r 0e85b389980a xen/arch/powerpc/powerpc64/ppc970.c
--- a/xen/arch/powerpc/powerpc64/ppc970.c   Fri Dec 01 16:55:19 2006 -0500
+++ b/xen/arch/powerpc/powerpc64/ppc970.c   Fri Dec 01 19:11:02 2006 -0500
@@ -193,8 +193,11 @@ void cpu_initialize(int cpuid)
 mtdec(timebase_freq);
 mthdec(timebase_freq);
 
+/* FIXME Do not set the NAP and DPM bits in HID0 until we have had a
+ * chance to audit the safe halt and idle loop code. */
 hid0.bits.nap = 0;  /* NAP */
 hid0.bits.dpm = 0;  /* Dynamic Power Management */
+
 hid0.bits.nhr = 1;  /* Not Hard Reset */
 hid0.bits.hdice_en = 1; /* enable HDEC */
 hid0.bits.en_therm = 0; /* ! Enable ext thermal ints */

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


[XenPPC] [xenppc-unstable] [XEN][POWERPC] Do not override smp function call wait flag

2006-11-28 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID e01e08ca629b4f154828b0976a58df8767558aec
# Parent  1e1a63408129bea2d87f485c52f1be21ada35ff0
[XEN][POWERPC] Do not override smp function call wait flag
Do not override the caller's wishes regarding waiting for smp function
call completion.  I was being too conservative in this respect: the lock
protects the call_data structure, and the function called is expected to
be threadsafe.

Signed-off-by: Amos Waterland [EMAIL PROTECTED]
Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 xen/arch/powerpc/smp.c |1 -
 1 files changed, 1 deletion(-)

diff -r 1e1a63408129 -r e01e08ca629b xen/arch/powerpc/smp.c
--- a/xen/arch/powerpc/smp.cTue Nov 28 16:56:40 2006 -0500
+++ b/xen/arch/powerpc/smp.cTue Nov 28 17:01:00 2006 -0500
@@ -97,7 +97,6 @@ int on_selected_cpus(
 call_data.func = func;
 call_data.info = info;
 call_data.wait = wait;
-call_data.wait = 1;  /* Until we get RCU around call_data.  */
 atomic_set(call_data.started, 0);
 atomic_set(call_data.finished, 0);
 mb();

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


[XenPPC] [xenppc-unstable] [XEN][POWERPC] cleanup hard tabs

2006-11-28 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID bb5491a55606b88c86f380aae406f7077c3118bc
# Parent  2e909d6f2ab767fe5723a97e2f5413f876167296
[XEN][POWERPC] cleanup hard tabs
allowed in some files in order to track linux lineage
---
 xen/arch/powerpc/bitops.c |  124 +-
 xen/arch/powerpc/external.c   |2 
 xen/arch/powerpc/memory.c |   12 +--
 xen/arch/powerpc/of-devtree.h |   34 -
 xen/arch/powerpc/of_handler/console.c |   12 +--
 xen/arch/powerpc/papr/xlate.c |2 
 xen/arch/powerpc/rtas.c   |   14 +--
 xen/arch/powerpc/shadow.c |4 -
 xen/arch/powerpc/smp.c|   10 +-
 xen/arch/powerpc/smpboot.c|3 
 10 files changed, 108 insertions(+), 109 deletions(-)

diff -r 2e909d6f2ab7 -r bb5491a55606 xen/arch/powerpc/bitops.c
--- a/xen/arch/powerpc/bitops.c Tue Nov 28 18:46:13 2006 -0500
+++ b/xen/arch/powerpc/bitops.c Tue Nov 28 19:01:46 2006 -0500
@@ -12,42 +12,42 @@
  * @size: The maximum size to search
  */
 unsigned long find_next_bit(const unsigned long *addr, unsigned long size,
-   unsigned long offset)
+unsigned long offset)
 {
-   const unsigned long *p = addr + BITOP_WORD(offset);
-   unsigned long result = offset  ~(BITS_PER_LONG-1);
-   unsigned long tmp;
+const unsigned long *p = addr + BITOP_WORD(offset);
+unsigned long result = offset  ~(BITS_PER_LONG-1);
+unsigned long tmp;
 
-   if (offset = size)
-   return size;
-   size -= result;
-   offset %= BITS_PER_LONG;
-   if (offset) {
-   tmp = *(p++);
-   tmp = (~0UL  offset);
-   if (size  BITS_PER_LONG)
-   goto found_first;
-   if (tmp)
-   goto found_middle;
-   size -= BITS_PER_LONG;
-   result += BITS_PER_LONG;
-   }
-   while (size  ~(BITS_PER_LONG-1)) {
-   if ((tmp = *(p++)))
-   goto found_middle;
-   result += BITS_PER_LONG;
-   size -= BITS_PER_LONG;
-   }
-   if (!size)
-   return result;
-   tmp = *p;
+if (offset = size)
+return size;
+size -= result;
+offset %= BITS_PER_LONG;
+if (offset) {
+tmp = *(p++);
+tmp = (~0UL  offset);
+if (size  BITS_PER_LONG)
+goto found_first;
+if (tmp)
+goto found_middle;
+size -= BITS_PER_LONG;
+result += BITS_PER_LONG;
+}
+while (size  ~(BITS_PER_LONG-1)) {
+if ((tmp = *(p++)))
+goto found_middle;
+result += BITS_PER_LONG;
+size -= BITS_PER_LONG;
+}
+if (!size)
+return result;
+tmp = *p;
 
 found_first:
-   tmp = (~0UL  (BITS_PER_LONG - size));
-   if (tmp == 0UL) /* Are any bits set? */
-   return result + size;   /* Nope. */
+tmp = (~0UL  (BITS_PER_LONG - size));
+if (tmp == 0UL)/* Are any bits set? */
+return result + size;/* Nope. */
 found_middle:
-   return result + __ffs(tmp);
+return result + __ffs(tmp);
 }
 
 /*
@@ -55,40 +55,40 @@ found_middle:
  * Linus' asm-alpha/bitops.h.
  */
 unsigned long find_next_zero_bit(const unsigned long *addr, unsigned long size,
-unsigned long offset)
+ unsigned long offset)
 {
-   const unsigned long *p = addr + BITOP_WORD(offset);
-   unsigned long result = offset  ~(BITS_PER_LONG-1);
-   unsigned long tmp;
+const unsigned long *p = addr + BITOP_WORD(offset);
+unsigned long result = offset  ~(BITS_PER_LONG-1);
+unsigned long tmp;
 
-   if (offset = size)
-   return size;
-   size -= result;
-   offset %= BITS_PER_LONG;
-   if (offset) {
-   tmp = *(p++);
-   tmp |= ~0UL  (BITS_PER_LONG - offset);
-   if (size  BITS_PER_LONG)
-   goto found_first;
-   if (~tmp)
-   goto found_middle;
-   size -= BITS_PER_LONG;
-   result += BITS_PER_LONG;
-   }
-   while (size  ~(BITS_PER_LONG-1)) {
-   if (~(tmp = *(p++)))
-   goto found_middle;
-   result += BITS_PER_LONG;
-   size -= BITS_PER_LONG;
-   }
-   if (!size)
-   return result;
-   tmp = *p;
+if (offset = size)
+return size;
+size -= result;
+offset %= BITS_PER_LONG;
+if (offset) {
+tmp = *(p++);
+tmp |= ~0UL  (BITS_PER_LONG - offset);
+if (size  BITS_PER_LONG)
+goto found_first;
+if (~tmp)
+goto found_middle;
+size -= BITS_PER_LONG;
+result += BITS_PER_LONG;
+}
+while (size  ~(BITS_PER_LONG-1)) {
+if (~(tmp = 

[XenPPC] [xenppc-unstable] [XEN][POWERPC] OFD dump prefix screen and hook into keyhandler

2006-11-27 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID cc45282daf3d242fdcf6e858c0b18b7f1086a318
# Parent  02aaaf00a9229b6564e860618f329bd2f9303a1e
[XEN][POWERPC] OFD dump prefix screen and hook into keyhandler

This patch adds the ability to view the devtree from the Xen console.

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 xen/arch/powerpc/boot_of.c|2 +-
 xen/arch/powerpc/of-devtree.h |6 +++---
 xen/arch/powerpc/of-devwalk.c |   14 +++---
 xen/arch/powerpc/ofd_fixup.c  |2 +-
 xen/arch/powerpc/setup.c  |   19 ++-
 5 files changed, 26 insertions(+), 17 deletions(-)

diff -r 02aaaf00a922 -r cc45282daf3d xen/arch/powerpc/boot_of.c
--- a/xen/arch/powerpc/boot_of.cMon Nov 27 16:14:07 2006 -0500
+++ b/xen/arch/powerpc/boot_of.cMon Nov 27 17:17:07 2006 -0500
@@ -1069,7 +1069,7 @@ static void * __init boot_of_devtree(mod
 if (ofd_size(oft)  oft_sz)
  of_panic(Could not fit all devtree fixups\n);
 
-ofd_walk(oft, OFD_ROOT, /* add_hype_props */ NULL, 2);
+ofd_walk(oft, __func__, OFD_ROOT, /* add_hype_props */ NULL, 2);
 
 mod-mod_start = (ulong)oft;
 mod-mod_end = mod-mod_start + oft_sz;
diff -r 02aaaf00a922 -r cc45282daf3d xen/arch/powerpc/of-devtree.h
--- a/xen/arch/powerpc/of-devtree.h Mon Nov 27 16:14:07 2006 -0500
+++ b/xen/arch/powerpc/of-devtree.h Mon Nov 27 17:17:07 2006 -0500
@@ -115,10 +115,10 @@ extern void ofd_io_close(void *mem, ofdn
 extern void ofd_io_close(void *mem, ofdn_t n);
 
 
-typedef void (*walk_fn)(void *m, ofdn_t p, int arg);
-extern void ofd_dump_props(void *m, ofdn_t p, int dump);
+typedef void (*walk_fn)(void *m, const char *pre, ofdn_t p, int arg);
+extern void ofd_dump_props(void *m, const char *pre, ofdn_t p, int dump);
 
-extern void ofd_walk(void *m, ofdn_t p, walk_fn fn, int arg);
+extern void ofd_walk(void *m, const char *pre, ofdn_t p, walk_fn fn, int arg);
 
 
 /* Recursively look up #address_cells and #size_cells properties */
diff -r 02aaaf00a922 -r cc45282daf3d xen/arch/powerpc/of-devwalk.c
--- a/xen/arch/powerpc/of-devwalk.c Mon Nov 27 16:14:07 2006 -0500
+++ b/xen/arch/powerpc/of-devwalk.c Mon Nov 27 17:17:07 2006 -0500
@@ -80,7 +80,7 @@ void ofd_prop_print(
 #endif
 }
 
-void ofd_dump_props(void *mem, ofdn_t n, int dump)
+void ofd_dump_props(void *mem, const char *pre, ofdn_t n, int dump)
 {
 ofdn_t p;
 char name[128];
@@ -95,7 +95,7 @@ void ofd_dump_props(void *mem, ofdn_t n,
 }
 
 if (dump  OFD_DUMP_NAMES) {
-printk(of_walk: %s: phandle 0x%x\n, path, n);
+printk(%s: %s: phandle 0x%x\n, pre, path, n);
 }
 
 p = ofd_nextprop(mem, n, NULL, name);
@@ -106,30 +106,30 @@ void ofd_dump_props(void *mem, ofdn_t n,
 }
 
 if ( dump  OFD_DUMP_VALUES ) {
-ofd_prop_print(of_walk, path, name, prop, sz);
+ofd_prop_print(pre, path, name, prop, sz);
 }
 
 p = ofd_nextprop(mem, n, name, name);
 }
 }
 
-void ofd_walk(void *m, ofdn_t p, walk_fn fn, int arg)
+void ofd_walk(void *m, const char *pre, ofdn_t p, walk_fn fn, int arg)
 {
 ofdn_t n;
 
 if ( fn != NULL ) {
-(*fn)(m, p, arg);
+(*fn)(m, pre, p, arg);
 }
 
 /* child */
 n = ofd_node_child(m, p);
 if ( n != 0 ) {
-ofd_walk(m, n, fn, arg);
+ofd_walk(m, pre, n, fn, arg);
 }
 
 /* peer */
 n = ofd_node_peer(m, p);
 if ( n != 0 ) {
-ofd_walk(m, n, fn, arg);
+ofd_walk(m, pre, n, fn, arg);
 }
 }
diff -r 02aaaf00a922 -r cc45282daf3d xen/arch/powerpc/ofd_fixup.c
--- a/xen/arch/powerpc/ofd_fixup.c  Mon Nov 27 16:14:07 2006 -0500
+++ b/xen/arch/powerpc/ofd_fixup.c  Mon Nov 27 17:17:07 2006 -0500
@@ -427,7 +427,7 @@ int ofd_dom0_fixup(struct domain *d, ulo
 
 
 #ifdef DEBUG
-ofd_walk(m, OFD_ROOT, ofd_dump_props, OFD_DUMP_ALL);
+ofd_walk(m, __func__, OFD_ROOT, ofd_dump_props, OFD_DUMP_ALL);
 #endif
 return 1;
 }
diff -r 02aaaf00a922 -r cc45282daf3d xen/arch/powerpc/setup.c
--- a/xen/arch/powerpc/setup.c  Mon Nov 27 16:14:07 2006 -0500
+++ b/xen/arch/powerpc/setup.c  Mon Nov 27 17:17:07 2006 -0500
@@ -123,9 +123,17 @@ void noinline __attn(void)
 console_end_sync();
 }
 
-static void hw_probe_attn(unsigned char key, struct cpu_user_regs *regs)
+static void key_hw_probe_attn(unsigned char key)
 {
 __attn();
+}
+
+static void key_ofdump(unsigned char key)
+{
+printk(ofdump:\n);
+/* make sure the OF devtree is good */
+ofd_walk((void *)oftree, devtree, OFD_ROOT,
+ ofd_dump_props, OFD_DUMP_ALL);
 }
 
 static void percpu_init_areas(void)
@@ -178,7 +186,10 @@ static void __init start_of_day(void)
 /* Register another key that will allow for the the Harware Probe
  * to be contacted, this works with RiscWatch probes and should
  * work with Chronos and FSPs */
-register_irq_keyhandler('^', hw_probe_attn,   Trap to Hardware Probe);
+register_keyhandler('^', key_hw_probe_attn, 

[XenPPC] [xenppc-unstable] [XEN][POWERPC] SMP/IPI/MB combined

2006-11-22 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID ea41ccaa8d77134b8fb55e8b002d358e67c47152
# Parent  ce8c1e26b2aebd64c8a2f02e20ed46d587f42870
[XEN][POWERPC] SMP/IPI/MB combined

This patch rolls up and rebases the following patches for submission
against current tip of tree:

 * Memory barrier after SP store
 * IPI support
 * SMP support

The only changes from the previous submission other than trivial
fast-forward merges are to remove the ERAT flush, since it was comitted
seperately, and to make the status messages about waiting for remote
function completion ACKs only kick in after a full second has passed.

Note that this path REQUIRES that some form of the dom0 Linux patch
titled Make Linux bail out of IPI vector reset be applied.

Signed-off-by: Amos Waterland [EMAIL PROTECTED]
Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 xen/arch/powerpc/external.c|   32 
 xen/arch/powerpc/mpic.c|9 -
 xen/arch/powerpc/mpic_init.c   |   48 +++
 xen/arch/powerpc/setup.c   |   50 ---
 xen/arch/powerpc/smp.c |  135 -
 xen/include/asm-powerpc/mach-default/irq_vectors.h |   22 ---
 xen/include/asm-powerpc/smp.h  |   16 ++
 7 files changed, 256 insertions(+), 56 deletions(-)

diff -r ce8c1e26b2ae -r ea41ccaa8d77 xen/arch/powerpc/external.c
--- a/xen/arch/powerpc/external.c   Wed Nov 22 14:35:09 2006 -0500
+++ b/xen/arch/powerpc/external.c   Wed Nov 22 14:53:13 2006 -0500
@@ -82,7 +82,16 @@ void do_external(struct cpu_user_regs *r
 
 vec = xen_mpic_get_irq(regs);
 
-if (vec != -1) {
+if (vector_is_ipi(vec)) {
+   /* do_IRQ is fundamentally broken for reliable IPI delivery.  */
+   irq_desc_t *desc = irq_desc[vec];
+   regs-entry_vector = vec;
+   spin_lock(desc-lock);
+   desc-handler-ack(vec);
+   desc-action-handler(vector_to_irq(vec), desc-action-dev_id, regs);
+   desc-handler-end(vec);
+   spin_unlock(desc-lock);
+} else if (vec != -1) {
 DBG(EE:0x%lx isrc: %d\n, regs-msr, vec);
 regs-entry_vector = vec;
 do_IRQ(regs);
@@ -253,3 +262,24 @@ int ioapic_guest_write(unsigned long phy
 BUG_ON(val != val);
 return 0;
 }
+
+void send_IPI_mask(cpumask_t mask, int vector)
+{
+unsigned int cpus;
+int const bits = 8 * sizeof(cpus);
+
+switch(vector) {
+case CALL_FUNCTION_VECTOR:
+case EVENT_CHECK_VECTOR:
+   break;
+default:
+   BUG();
+   return;
+}
+
+BUG_ON(NR_CPUS  bits);
+BUG_ON(fls(mask.bits[0])  bits);
+
+cpus = mask.bits[0];
+mpic_send_ipi(vector, cpus);
+}
diff -r ce8c1e26b2ae -r ea41ccaa8d77 xen/arch/powerpc/mpic.c
--- a/xen/arch/powerpc/mpic.c   Wed Nov 22 14:35:09 2006 -0500
+++ b/xen/arch/powerpc/mpic.c   Wed Nov 22 14:53:13 2006 -0500
@@ -27,10 +27,6 @@
 
 
 #define alloc_bootmem(x) xmalloc_bytes(x)
-#define request_irq(irq, handler, f, devname, dev_id) \
-panic(IPI requested: %d: %p: %s: %p\n, irq, handler, devname, dev_id)
-
-typedef int irqreturn_t;
 
 #define IRQ_NONE   (0)
 #define IRQ_HANDLED(1)
@@ -96,11 +92,6 @@ typedef int irqreturn_t;
 #endif
 #include asm/mpic.h
 #include asm/smp.h
-
-static inline void smp_message_recv(int msg, struct pt_regs *regs)
-{
-return;
-}
 
 #ifdef DEBUG
 #define DBG(fmt...) printk(fmt)
diff -r ce8c1e26b2ae -r ea41ccaa8d77 xen/arch/powerpc/mpic_init.c
--- a/xen/arch/powerpc/mpic_init.c  Wed Nov 22 14:35:09 2006 -0500
+++ b/xen/arch/powerpc/mpic_init.c  Wed Nov 22 14:53:13 2006 -0500
@@ -22,6 +22,7 @@
 #include xen/init.h
 #include xen/lib.h
 #include asm/mpic.h
+#include errno.h
 #include mpic_init.h
 #include oftree.h
 #include of-devtree.h
@@ -358,6 +359,42 @@ static struct hw_interrupt_type *share_m
 
 #endif
 
+static unsigned int mpic_startup_ipi(unsigned int irq)
+{
+mpic-hc_ipi.enable(irq);
+return 0;
+}
+
+int request_irq(unsigned int irq,
+   irqreturn_t (*handler)(int, void *, struct cpu_user_regs *),
+   unsigned long irqflags, const char * devname, void *dev_id)
+{
+int retval;
+struct irqaction *action;
+void (*func)(int, void *, struct cpu_user_regs *);
+
+action = xmalloc(struct irqaction);
+if (!action) {
+   BUG();
+   return -ENOMEM;
+}
+
+/* Xen's handler prototype is slightly different than Linux's.  */
+func = (void (*)(int, void *, struct cpu_user_regs *))handler;
+
+action-handler = func;
+action-name = devname;
+action-dev_id = dev_id;
+
+retval = setup_irq(irq, action);
+if (retval) {
+   BUG();
+   xfree(action);
+}
+
+return retval;
+}
+
 struct hw_interrupt_type *xen_mpic_init(struct hw_interrupt_type *xen_irq)
 {
 unsigned int isu_size;
@@ -397,6 +434,11 @@ struct hw_interrupt_type *xen_mpic_init(
 hit = share_mpic(mpic-hc_irq, xen_irq);
 
 printk(%s: success\n, 

[XenPPC] [xenppc-unstable] [XEN][POWERPC] Fix Register dumping from ^A^A^A console

2006-11-22 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID 177007615848aa444b0ccb4f5846ba74e67ac003
# Parent  ea41ccaa8d77134b8fb55e8b002d358e67c47152
[XEN][POWERPC] Fix Register dumping from ^A^A^A console

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 xen/arch/powerpc/backtrace.c   |   12 
 xen/include/asm-powerpc/debugger.h |   21 -
 2 files changed, 24 insertions(+), 9 deletions(-)

diff -r ea41ccaa8d77 -r 177007615848 xen/arch/powerpc/backtrace.c
--- a/xen/arch/powerpc/backtrace.c  Wed Nov 22 14:53:13 2006 -0500
+++ b/xen/arch/powerpc/backtrace.c  Wed Nov 22 16:09:28 2006 -0500
@@ -220,3 +220,15 @@ void __warn(char *file, int line)
 
 console_end_sync();
 }
+
+void dump_execution_state(void)
+{
+struct vcpu *v = current;
+struct cpu_user_regs *regs = v-arch.ctxt;
+
+show_registers(regs);
+if (regs-msr  MSR_HV) {
+printk(In Xen:\n);
+show_backtrace(regs-gprs[1], regs-pc, regs-lr);
+}
+}
diff -r ea41ccaa8d77 -r 177007615848 xen/include/asm-powerpc/debugger.h
--- a/xen/include/asm-powerpc/debugger.hWed Nov 22 14:53:13 2006 -0500
+++ b/xen/include/asm-powerpc/debugger.hWed Nov 22 16:09:28 2006 -0500
@@ -27,11 +27,19 @@ extern void show_backtrace_regs(struct c
 extern void show_backtrace_regs(struct cpu_user_regs *);
 extern void show_backtrace(ulong sp, ulong lr, ulong pc);
 
-static inline void dump_execution_state(void)
+static inline void show_execution_state(struct cpu_user_regs *regs)
+{
+show_registers(regs);
+}
+
+extern void dump_execution_state(void);
+
+static inline void dump_all_execution_state(void)
 {
 ulong sp;
 ulong lr;
 
+dump_execution_state();
 sp = (ulong)__builtin_frame_address(0);
 lr = (ulong)__builtin_return_address(0);
 
@@ -40,13 +48,13 @@ static inline void dump_execution_state(
 
 static inline void __force_crash(void)
 {
-dump_execution_state();
+dump_all_execution_state();
 __builtin_trap();
 }
 
 static inline void debugger_trap_immediate(void)
 {
-dump_execution_state();
+dump_all_execution_state();
 #ifdef CRASH_DEBUG
 __builtin_trap();
 #endif
@@ -55,13 +63,8 @@ static inline void unimplemented(void)
 static inline void unimplemented(void)
 {
 #ifdef VERBOSE
-dump_execution_state();
+dump_all_execution_state();
 #endif
-}
-
-static inline void show_execution_state(struct cpu_user_regs *regs)
-{
-show_registers(regs);
 }
 
 extern void __warn(char *file, int line);

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


[XenPPC] [xenppc-unstable] [TOOLS][POWERPC] no need to allocate extents in a loop

2006-11-14 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID b17300195f02f7da17f3ad94aed955863ffd4fed
# Parent  b35682af48d01ddba1d26e6fe2d0c5607a343228
[TOOLS][POWERPC] no need to allocate extents in a loop

This patch decreases the number of hcalls needed to allocate all the
extents for a domain with large amounts of memory.

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 tools/python/xen/xend/XendDomainInfo.py |   18 ++
 1 files changed, 10 insertions(+), 8 deletions(-)

diff -r b35682af48d0 -r b17300195f02 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Mon Nov 13 14:32:55 2006 -0600
+++ b/tools/python/xen/xend/XendDomainInfo.py   Tue Nov 14 19:46:26 2006 -0500
@@ -2017,6 +2017,10 @@ class XendDomainInfo (Common_XendDomainI
 if memory  rma_kb:
 raise ValueError(Domain memory must be at least %d KB % rma_kb)
 
+if memory  (16  10):
+raise ValueError(Domain memory %dKB must be a multiple of 16MB
+ % memory)
+
 # allocate the RMA
 log.debug(alloc_real_mode_area(%d, %d), self.domid, rma_log)
 xc.alloc_real_mode_area(self.domid, rma_log)
@@ -2024,13 +2028,11 @@ class XendDomainInfo (Common_XendDomainI
 # now allocate the remaining memory as large-order allocations
 memory -= rma_kb
 extent_log = 24 # 16 MB
-extent_size = 1  extent_log
 page_log = 12 # 4 KB
 extent_order = extent_log - page_log
-for i in range(0, memory * 1024, extent_size):
-log.debug(increase_reservation(%d, 0x%x, %d), self.domid,
-extent_size  10, extent_order)
-xc.domain_memory_increase_reservation(self.domid,
-  extent_size  10,
-  extent_order)
-
+log.debug(increase_reservation(%d, 0x%x, %d), self.domid,
+  memory, extent_order)
+xc.domain_memory_increase_reservation(self.domid,
+  memory,
+  extent_order)
+

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


[XenPPC] [xenppc-unstable] [POWERPC][XEN] Rename Mambo to systemsim.

2006-11-13 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Hollis Blanchard [EMAIL PROTECTED]
# Node ID 8e42a0a40c21193ea2b66a602b1fd519d27fbc3d
# Parent  b30cb72ed5e20d4957207145022e648b913c033b
[POWERPC][XEN] Rename Mambo to systemsim.
Signed-off-by: Hollis Blanchard [EMAIL PROTECTED]
---
 xen/arch/powerpc/mambo.S   |   64 -
 xen/arch/powerpc/Makefile  |2 
 xen/arch/powerpc/dart.c|6 --
 xen/arch/powerpc/exceptions.h  |2 
 xen/arch/powerpc/mm.c  |6 +-
 xen/arch/powerpc/systemsim.S   |   64 +
 xen/include/asm-powerpc/config.h   |2 
 xen/include/asm-powerpc/msr.h  |4 -
 xen/include/asm-powerpc/powerpc64/string.h |3 +
 xen/include/asm-powerpc/processor.h|   14 +++---
 10 files changed, 83 insertions(+), 84 deletions(-)

diff -r b30cb72ed5e2 -r 8e42a0a40c21 xen/arch/powerpc/Makefile
--- a/xen/arch/powerpc/Makefile Fri Nov 03 16:53:17 2006 -0500
+++ b/xen/arch/powerpc/Makefile Fri Nov 10 16:45:25 2006 -0600
@@ -22,7 +22,7 @@ obj-y += hcalls.o
 obj-y += hcalls.o
 obj-y += iommu.o
 obj-y += irq.o
-obj-y += mambo.o
+obj-y += systemsim.o
 obj-y += memory.o
 obj-y += mm.o
 obj-y += mpic.o
diff -r b30cb72ed5e2 -r 8e42a0a40c21 xen/arch/powerpc/dart.c
--- a/xen/arch/powerpc/dart.c   Fri Nov 03 16:53:17 2006 -0500
+++ b/xen/arch/powerpc/dart.c   Fri Nov 10 16:45:25 2006 -0600
@@ -189,10 +189,8 @@ static int find_dart(struct dart_info *d
 ofdn_t n;
 char compat[128];
 
-
-if (on_mambo()) {
-/* mambo has no dart */
-DBG(%s: Mambo does not support a dart\n, __func__);
+if (on_systemsim()) {
+DBG(%s: systemsim does not support a dart\n, __func__);
 return -1;
 }
 
diff -r b30cb72ed5e2 -r 8e42a0a40c21 xen/arch/powerpc/exceptions.h
--- a/xen/arch/powerpc/exceptions.h Fri Nov 03 16:53:17 2006 -0500
+++ b/xen/arch/powerpc/exceptions.h Fri Nov 10 16:45:25 2006 -0600
@@ -44,8 +44,6 @@ extern void program_exception(
 
 extern long xen_hvcall_jump(struct cpu_user_regs *regs, ulong address);
 
-extern void *mambo_memset(void *, int, ulong);
-extern void *mambo_memcpy(void *, const void *, ulong);
 extern void sleep(void);
 extern void idle_loop(void);
 
diff -r b30cb72ed5e2 -r 8e42a0a40c21 xen/arch/powerpc/mm.c
--- a/xen/arch/powerpc/mm.c Fri Nov 03 16:53:17 2006 -0500
+++ b/xen/arch/powerpc/mm.c Fri Nov 10 16:45:25 2006 -0600
@@ -27,6 +27,7 @@
 #include xen/perfc.h
 #include asm/init.h
 #include asm/page.h
+#include asm/string.h
 
 #ifdef VERBOSE
 #define MEM_LOG(_f, _a...)  \
@@ -276,9 +277,8 @@ long arch_memory_op(int op, XEN_GUEST_HA
 
 extern void copy_page(void *dp, void *sp)
 {
-if (on_mambo()) {
-extern void *mambo_memcpy(void *,const void *,__kernel_size_t);
-mambo_memcpy(dp, sp, PAGE_SIZE);
+if (on_systemsim()) {
+systemsim_memcpy(dp, sp, PAGE_SIZE);
 } else {
 memcpy(dp, sp, PAGE_SIZE);
 }
diff -r b30cb72ed5e2 -r 8e42a0a40c21 xen/include/asm-powerpc/config.h
--- a/xen/include/asm-powerpc/config.h  Fri Nov 03 16:53:17 2006 -0500
+++ b/xen/include/asm-powerpc/config.h  Fri Nov 10 16:45:25 2006 -0600
@@ -21,7 +21,7 @@
 #ifndef __PPC_CONFIG_H__
 #define __PPC_CONFIG_H__
 
-#define CONFIG_MAMBO 1
+#define CONFIG_SYSTEMSIM 1
 #define HYPERVISOR_VIRT_START 0x0 /* XXX temp hack for common/kernel.c */
 
 
diff -r b30cb72ed5e2 -r 8e42a0a40c21 xen/include/asm-powerpc/msr.h
--- a/xen/include/asm-powerpc/msr.h Fri Nov 03 16:53:17 2006 -0500
+++ b/xen/include/asm-powerpc/msr.h Fri Nov 10 16:45:25 2006 -0600
@@ -51,9 +51,9 @@
 #define MSR_RI  ULL(0x0002)
 #define MSR_LE  ULL(0x0001)
 
-/* MSR bits set on the Mambo simulator */
+/* MSR bits set on the systemsim simulator */
 #define MSR_SIM ULL(0x2000)
-#define MSR_MAMBO   ULL(0x1000)
+#define MSR_SYSTEMSIM ULL(0x1000)
 
 /* On a trap, srr1's copy of msr defines some bits as follows: */
 #define MSR_TRAP_FE ULL(0x0010) /* Floating Point Exception */
diff -r b30cb72ed5e2 -r 8e42a0a40c21 xen/include/asm-powerpc/powerpc64/string.h
--- a/xen/include/asm-powerpc/powerpc64/string.hFri Nov 03 16:53:17 
2006 -0500
+++ b/xen/include/asm-powerpc/powerpc64/string.hFri Nov 10 16:45:25 
2006 -0600
@@ -37,4 +37,7 @@ extern int memcmp(const void *,const voi
 extern int memcmp(const void *,const void *,__kernel_size_t);
 extern void * memchr(const void *,int,__kernel_size_t);
 
+extern void *systemsim_memset(void *, int, ulong);
+extern void *systemsim_memcpy(void *, const void *, ulong);
+
 #endif
diff -r b30cb72ed5e2 -r 8e42a0a40c21 xen/include/asm-powerpc/processor.h
--- a/xen/include/asm-powerpc/processor.h   Fri Nov 03 16:53:17 2006 -0500
+++ b/xen/include/asm-powerpc/processor.h   Fri Nov 10 16:45:25 2006 -0600
@@ -276,13 +276,13 @@ static inline unsigned 

[XenPPC] [xenppc-unstable] [XEN][POWERPC] Change license on public/ headers from GPL to BSD.

2006-11-13 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Hollis Blanchard [EMAIL PROTECTED]
# Node ID b35682af48d01ddba1d26e6fe2d0c5607a343228
# Parent  e7a54ea1405716153eba36d22a113d76624612be
[XEN][POWERPC] Change license on public/ headers from GPL to BSD.
Signed-off-by: Hollis Blanchard [EMAIL PROTECTED]
---
 xen/include/public/arch-powerpc.h |   26 +++---
 xen/include/public/xencomm.h  |   30 +-
 2 files changed, 32 insertions(+), 24 deletions(-)

diff -r e7a54ea14057 -r b35682af48d0 xen/include/public/arch-powerpc.h
--- a/xen/include/public/arch-powerpc.h Mon Nov 13 12:35:17 2006 -0600
+++ b/xen/include/public/arch-powerpc.h Mon Nov 13 14:32:55 2006 -0600
@@ -1,17 +1,21 @@
 /*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the Software), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
  *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
  *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
  *
  * Copyright (C) IBM Corp. 2005, 2006
  *
diff -r e7a54ea14057 -r b35682af48d0 xen/include/public/xencomm.h
--- a/xen/include/public/xencomm.h  Mon Nov 13 12:35:17 2006 -0600
+++ b/xen/include/public/xencomm.h  Mon Nov 13 14:32:55 2006 -0600
@@ -1,17 +1,21 @@
 /*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the Software), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
  *
  * Copyright (C) IBM Corp. 2006
  *

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


[XenPPC] [xenppc-unstable] [TOOLS][POWERPC] apply start_info changes to xc_prose_build.c

2006-10-18 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID d408fcf1975a43593d746b2acbe840dbffd911b8
# Parent  f6ce35ef6f1c373785cc3ddb5ebd9dcaf4d499d0
[TOOLS][POWERPC] apply start_info changes to xc_prose_build.c

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 tools/libxc/powerpc64/xc_prose_build.c |   62 +++--
 1 files changed, 30 insertions(+), 32 deletions(-)

diff -r f6ce35ef6f1c -r d408fcf1975a tools/libxc/powerpc64/xc_prose_build.c
--- a/tools/libxc/powerpc64/xc_prose_build.cWed Oct 18 06:43:33 2006 -0400
+++ b/tools/libxc/powerpc64/xc_prose_build.cWed Oct 18 06:50:35 2006 -0400
@@ -167,10 +167,10 @@ static int load_devtree(
 unsigned long devtree_addr,
 uint64_t initrd_base,
 unsigned long initrd_len,
-start_info_t *si,
-unsigned long si_addr)
-{
-uint32_t start_info[4] = {0, si_addr, 0, 0x1000};
+start_info_t *start_info __attribute__((unused)),
+unsigned long start_info_addr)
+{
+uint32_t si[4] = {0, start_info_addr, 0, 0x1000};
 struct boot_param_header *header;
 void *chosen;
 void *xen;
@@ -215,8 +215,7 @@ static int load_devtree(
 }
 
 /* start-info (XXX being removed soon) */
-rc = ft_set_prop(devtree, xen, start-info,
-start_info, sizeof(start_info));
+rc = ft_set_prop(devtree, xen, start-info, si, sizeof(si));
 if (rc  0) {
 DPRINTF(couldn't set /xen/start-info\n);
 return rc;
@@ -317,18 +316,19 @@ out:
 return rc;
 }
 
-static unsigned long create_start_info(void *devtree, start_info_t *si,
+static unsigned long create_start_info(void *devtree, start_info_t *start_info,
 unsigned int console_evtchn, unsigned int store_evtchn,
 unsigned long nr_pages, const char *cmdline)
 {
 void *rma;
-unsigned long si_addr;
+unsigned long start_info_addr;
 uint64_t rma_reg[2];
 uint64_t rma_top;
 int rc;
 
-memset(si, 0, sizeof(*si));
-snprintf(si-magic, sizeof(si-magic), xen-%d.%d-powerpc64HV, 3, 0);
+memset(start_info, 0, sizeof(*start_info));
+snprintf(start_info-magic, sizeof(start_info-magic),
+ xen-%d.%d-powerpc64HV, 3, 0);
 
 rma = ft_find_node(devtree, /[EMAIL PROTECTED]);
 if (rma == NULL) {
@@ -343,25 +343,22 @@ static unsigned long create_start_info(v
 rma_top = rma_reg[0] + rma_reg[1];
 DPRINTF(RMA top = 0x%PRIX64\n, rma_top);
 
-si-nr_pages = nr_pages;
-si-shared_info = rma_top - PAGE_SIZE;
-si-store_mfn = (rma_top  PAGE_SHIFT) - 2;
-si-store_evtchn = store_evtchn;
-si-console.domU.mfn = (rma_top  PAGE_SHIFT) - 3;
-si-console.domU.evtchn = console_evtchn;
-strncpy((char *)si-cmd_line, cmdline, MAX_GUEST_CMDLINE);
-/* just in case we truncated cmdline with strncpy add 0 at the end */
-si-cmd_line[MAX_GUEST_CMDLINE]=0;
-si_addr = rma_top - 4*PAGE_SIZE;
-
-rc = ft_set_rsvmap(devtree, 0, si_addr, 4*PAGE_SIZE);
+start_info-nr_pages = nr_pages;
+start_info-shared_info = rma_top - PAGE_SIZE;
+start_info-store_mfn = (rma_top  PAGE_SHIFT) - 2;
+start_info-store_evtchn = store_evtchn;
+start_info-console.domU.mfn = (rma_top  PAGE_SHIFT) - 3;
+start_info-console.domU.evtchn = console_evtchn;
+start_info_addr = rma_top - 4*PAGE_SIZE;
+
+rc = ft_set_rsvmap(devtree, 0, start_info_addr, 4*PAGE_SIZE);
 if (rc  0) {
 DPRINTF(couldn't set start_info reservation\n);
 return ~0UL;
 }
 
 
-return si_addr;
+return start_info_addr;
 }
 
 static int get_page_array(int xc_handle, int domid, xen_pfn_t **page_array,
@@ -409,7 +406,7 @@ int xc_prose_build(int xc_handle,
unsigned long *console_mfn,
void *devtree)
 {
-start_info_t si;
+start_info_t start_info;
 struct domain_setup_info dsi;
 xen_pfn_t *page_array = NULL;
 unsigned long nr_pages;
@@ -417,7 +414,7 @@ int xc_prose_build(int xc_handle,
 unsigned long kern_addr;
 unsigned long initrd_base = 0;
 unsigned long initrd_len = 0;
-unsigned long si_addr;
+unsigned long start_info_addr;
 int rc = 0;
 
 DPRINTF(%s\n, __func__);
@@ -446,12 +443,12 @@ int xc_prose_build(int xc_handle,
 }
 
 /* start_info stuff: about to be removed  */
-si_addr = create_start_info(devtree, si, console_evtchn, store_evtchn,
-nr_pages,cmdline);
-*console_mfn = page_array[si.console.domU.mfn];
-*store_mfn = page_array[si.store_mfn];
-if (install_image(xc_handle, domid, page_array, si, si_addr,
-sizeof(start_info_t))) {
+start_info_addr = create_start_info(devtree, start_info, console_evtchn,
+store_evtchn, nr_pages, cmdline);
+*console_mfn = page_array[start_info.console.domU.mfn];
+*store_mfn = page_array[start_info.store_mfn];
+if (install_image(xc_handle, domid, page_array, start_info,
+  start_info_addr, 

[XenPPC] [xenppc-unstable] [TOOLS][POWERPC] Fix build breakage in powerpc64/xc_linux_build.c

2006-10-18 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID da91bd66504d63394ebef4cd64ff6d1d8a9ae337
# Parent  a1fdeb2c6d77d626010533b7111c93f24e86201e
[TOOLS][POWERPC] Fix build breakage in powerpc64/xc_linux_build.c

The patch [SOLARIS] Don't build ptrace code on Solaris. from
xen-unstable now causes siginfo.h to be included which
#defines si_addr to _sifields._sigfault.si_addr.
and breaks the build of  powerpc64/xc_linux_build.c.

This patch renames
 si_addr - start_info_addr
 si  - start_info (for consistency)
and
 start_info - si (in load_devtree beuse of the renaming above)

Signed-off-by: Tony Breeds [EMAIL PROTECTED]
Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 tools/libxc/powerpc64/xc_linux_build.c |   59 -
 1 files changed, 30 insertions(+), 29 deletions(-)

diff -r a1fdeb2c6d77 -r da91bd66504d tools/libxc/powerpc64/xc_linux_build.c
--- a/tools/libxc/powerpc64/xc_linux_build.cTue Oct 17 16:44:57 2006 -0400
+++ b/tools/libxc/powerpc64/xc_linux_build.cWed Oct 18 06:24:57 2006 -0400
@@ -167,10 +167,10 @@ static int load_devtree(
 unsigned long devtree_addr,
 uint64_t initrd_base,
 unsigned long initrd_len,
-start_info_t *si,
-unsigned long si_addr)
-{
-uint32_t start_info[4] = {0, si_addr, 0, 0x1000};
+start_info_t *start_info __attribute__((unused)),
+unsigned long start_info_addr)
+{
+uint32_t si[4] = {0, start_info_addr, 0, 0x1000};
 struct boot_param_header *header;
 void *chosen;
 void *xen;
@@ -215,8 +215,7 @@ static int load_devtree(
 }
 
 /* start-info (XXX being removed soon) */
-rc = ft_set_prop(devtree, xen, start-info,
-start_info, sizeof(start_info));
+rc = ft_set_prop(devtree, xen, start-info, si, sizeof(si));
 if (rc  0) {
 DPRINTF(couldn't set /xen/start-info\n);
 return rc;
@@ -349,18 +348,19 @@ out:
 return rc;
 }
 
-static unsigned long create_start_info(void *devtree, start_info_t *si,
+static unsigned long create_start_info(void *devtree, start_info_t *start_info,
 unsigned int console_evtchn, unsigned int store_evtchn,
 unsigned long nr_pages)
 {
 void *rma;
-unsigned long si_addr;
+unsigned long start_info_addr;
 uint64_t rma_reg[2];
 uint64_t rma_top;
 int rc;
 
-memset(si, 0, sizeof(*si));
-snprintf(si-magic, sizeof(si-magic), xen-%d.%d-powerpc64HV, 3, 0);
+memset(start_info, 0, sizeof(*start_info));
+snprintf(start_info-magic, sizeof(start_info-magic),
+ xen-%d.%d-powerpc64HV, 3, 0);
 
 rma = ft_find_node(devtree, /[EMAIL PROTECTED]);
 if (rma == NULL) {
@@ -375,22 +375,22 @@ static unsigned long create_start_info(v
 rma_top = rma_reg[0] + rma_reg[1];
 DPRINTF(RMA top = 0x%PRIX64\n, rma_top);
 
-si-nr_pages = nr_pages;
-si-shared_info = rma_top - PAGE_SIZE;
-si-store_mfn = (rma_top  PAGE_SHIFT) - 2;
-si-store_evtchn = store_evtchn;
-si-console.domU.mfn = (rma_top  PAGE_SHIFT) - 3;
-si-console.domU.evtchn = console_evtchn;
-si_addr = rma_top - 4*PAGE_SIZE;
-
-rc = ft_set_rsvmap(devtree, 0, si_addr, 4*PAGE_SIZE);
+start_info-nr_pages = nr_pages;
+start_info-shared_info = rma_top - PAGE_SIZE;
+start_info-store_mfn = (rma_top  PAGE_SHIFT) - 2;
+start_info-store_evtchn = store_evtchn;
+start_info-console.domU.mfn = (rma_top  PAGE_SHIFT) - 3;
+start_info-console.domU.evtchn = console_evtchn;
+start_info_addr = rma_top - 4*PAGE_SIZE;
+
+rc = ft_set_rsvmap(devtree, 0, start_info_addr, 4*PAGE_SIZE);
 if (rc  0) {
 DPRINTF(couldn't set start_info reservation\n);
 return ~0UL;
 }
 
 
-return si_addr;
+return start_info_addr;
 }
 
 static int get_page_array(int xc_handle, int domid, xen_pfn_t **page_array,
@@ -438,7 +438,7 @@ int xc_linux_build(int xc_handle,
unsigned long *console_mfn,
void *devtree)
 {
-start_info_t si;
+start_info_t start_info;
 struct domain_setup_info dsi;
 xen_pfn_t *page_array = NULL;
 unsigned long nr_pages;
@@ -446,7 +446,7 @@ int xc_linux_build(int xc_handle,
 unsigned long kern_addr;
 unsigned long initrd_base = 0;
 unsigned long initrd_len = 0;
-unsigned long si_addr;
+unsigned long start_info_addr;
 int rc = 0;
 
 DPRINTF(%s\n, __func__);
@@ -473,12 +473,12 @@ int xc_linux_build(int xc_handle,
 }
 
 /* start_info stuff: about to be removed  */
-si_addr = create_start_info(devtree, si, console_evtchn, store_evtchn,
-nr_pages);
-*console_mfn = page_array[si.console.domU.mfn];
-*store_mfn = page_array[si.store_mfn];
-if (install_image(xc_handle, domid, page_array, si, si_addr,
-sizeof(start_info_t))) {
+start_info_addr = create_start_info(devtree, start_info, console_evtchn,
+store_evtchn, nr_pages);
+*console_mfn = 

[XenPPC] [xenppc-unstable] [TOOLS][POWERPC] Use a smaller page array and place common code in utils.c

2006-10-18 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID 2fcfe6600b1db8ca2ba78a00317f2da6fc2620bf
# Parent  d408fcf1975a43593d746b2acbe840dbffd911b8
[TOOLS][POWERPC] Use a smaller page array and place common code in utils.c

Since all the bits must be loaded into the RMA there is no need to get
the entire page array, just those pages in the RMA.
We also place common functions in utils.c

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 tools/libxc/powerpc64/Makefile |4 
 tools/libxc/powerpc64/utils.c  |  162 +++
 tools/libxc/powerpc64/utils.h  |   38 +
 tools/libxc/powerpc64/xc_linux_build.c |  227 ++---
 tools/libxc/powerpc64/xc_prose_build.c |  197 +++-
 5 files changed, 244 insertions(+), 384 deletions(-)

diff -r d408fcf1975a -r 2fcfe6600b1d tools/libxc/powerpc64/Makefile
--- a/tools/libxc/powerpc64/MakefileWed Oct 18 06:50:35 2006 -0400
+++ b/tools/libxc/powerpc64/MakefileWed Oct 18 09:01:37 2006 -0400
@@ -1,4 +1,6 @@ GUEST_SRCS-y += powerpc64/xc_linux_build
+GUEST_SRCS-y += powerpc64/flatdevtree.c
 GUEST_SRCS-y += powerpc64/xc_linux_build.c
-GUEST_SRCS-y += powerpc64/flatdevtree.c
 GUEST_SRCS-y += powerpc64/xc_prose_build.c
+GUEST_SRCS-y += powerpc64/utils.c
+
 CTRL_SRCS-y += powerpc64/xc_memory.c
diff -r d408fcf1975a -r 2fcfe6600b1d tools/libxc/powerpc64/xc_linux_build.c
--- a/tools/libxc/powerpc64/xc_linux_build.cWed Oct 18 06:50:35 2006 -0400
+++ b/tools/libxc/powerpc64/xc_linux_build.cWed Oct 18 09:01:37 2006 -0400
@@ -35,60 +35,10 @@
 
 #include flatdevtree_env.h
 #include flatdevtree.h
+#include utils.h
 
 #define INITRD_ADDR (24UL  20)
 #define DEVTREE_ADDR (16UL  20)
-
-#define ALIGN_UP(addr,size) (((addr)+((size)-1))(~((size)-1)))
-
-#define max(x,y) ({ \
-const typeof(x) _x = (x);   \
-const typeof(y) _y = (y);   \
-(void) (_x == _y);\
-_x  _y ? _x : _y; })
-
-static void *load_file(const char *path, unsigned long *filesize)
-{
-void *img;
-ssize_t size;
-int fd;
-
-DPRINTF(load_file(%s)\n, path);
-
-fd = open(path, O_RDONLY);
-if (fd  0) {
-perror(path);
-return NULL;
-}
-
-size = lseek(fd, 0, SEEK_END);
-if (size  0) {
-perror(path);
-close(fd);
-return NULL;
-}
-lseek(fd, 0, SEEK_SET);
-
-img = malloc(size);
-if (img == NULL) {
-perror(path);
-close(fd);
-return NULL;
-}
-
-size = read(fd, img, size);
-if (size = 0) {
-perror(path);
-close(fd);
-free(img);
-return NULL;
-}
-
-if (filesize)
-*filesize = size;
-close(fd);
-return img;
-}
 
 static int init_boot_vcpu(
 int xc_handle,
@@ -128,37 +78,6 @@ static int init_boot_vcpu(
 return rc;
 }
 
-static int install_image(
-int xc_handle,
-int domid,
-xen_pfn_t *page_array,
-void *image,
-unsigned long paddr,
-unsigned long size)
-{
-uint8_t *img = image;
-int i;
-int rc = 0;
-
-if (paddr  ~PAGE_MASK) {
-printf(*** unaligned address\n);
-return -1;
-}
-
-for (i = 0; i  size; i += PAGE_SIZE) {
-void *page = img + i;
-xen_pfn_t pfn = (paddr + i)  PAGE_SHIFT;
-xen_pfn_t mfn = page_array[pfn];
-
-rc = xc_copy_to_domain_page(xc_handle, domid, mfn, page);
-if (rc  0) {
-perror(xc_copy_to_domain_page);
-break;
-}
-}
-return rc;
-}
-
 static int load_devtree(
 int xc_handle,
 int domid,
@@ -238,87 +157,6 @@ static int load_devtree(
devtree_size);
 }
 
-unsigned long spin_list[] = {
-#if 0
-0x100,
-0x200,
-0x300,
-0x380,
-0x400,
-0x480,
-0x500,
-0x700,
-0x900,
-0xc00,
-#endif
-0
-};
-
-/* XXX yes, this is a hack */
-static void hack_kernel_img(char *img)
-{
-const off_t file_offset = 0x1;
-unsigned long *addr = spin_list;
-
-while (*addr) {
-uint32_t *instruction = (uint32_t *)(img + *addr + file_offset);
-printf(installing spin loop at %lx (%x)\n, *addr, *instruction);
-*instruction = 0x4800;
-addr++;
-}
-}
-
-static int load_kernel(
-int xc_handle,
-int domid,
-const char *kernel_path,
-struct domain_setup_info *dsi,
-xen_pfn_t *page_array)
-{
-struct load_funcs load_funcs;
-char *kernel_img;
-unsigned long kernel_size;
-int rc;
-
-/* load the kernel ELF file */
-kernel_img = load_file(kernel_path, kernel_size);
-if (kernel_img == NULL) {
-rc = -1;
-goto out;
-}
-
-hack_kernel_img(kernel_img);
-
-DPRINTF(probe_elf\n);
-rc = probe_elf(kernel_img, kernel_size, load_funcs);
-if (rc  0) {
-rc = -1;
-printf(%s is not an ELF file\n, kernel_path);
-goto out;
-}
-
-

[XenPPC] [xenppc-unstable] [TOOLS][POWERPC] oops, forgot load_elf_kernel()

2006-10-18 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID ece7037c72c6b7944ede2261ec1fe99c1489cff4
# Parent  2fcfe6600b1db8ca2ba78a00317f2da6fc2620bf
[TOOLS][POWERPC] oops, forgot load_elf_kernel()

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 tools/libxc/powerpc64/utils.c |   49 ++
 1 files changed, 49 insertions(+)

diff -r 2fcfe6600b1d -r ece7037c72c6 tools/libxc/powerpc64/utils.c
--- a/tools/libxc/powerpc64/utils.c Wed Oct 18 09:01:37 2006 -0400
+++ b/tools/libxc/powerpc64/utils.c Wed Oct 18 11:29:57 2006 -0400
@@ -160,3 +160,52 @@ void *load_file(const char *path, unsign
 close(fd);
 return img;
 }
+
+int load_elf_kernel(
+int xc_handle,
+int domid,
+const char *kernel_path,
+struct domain_setup_info *dsi,
+xen_pfn_t *page_array)
+{
+struct load_funcs load_funcs;
+char *kernel_img;
+unsigned long kernel_size;
+int rc;
+
+/* load the kernel ELF file */
+kernel_img = load_file(kernel_path, kernel_size);
+if (kernel_img == NULL) {
+rc = -1;
+goto out;
+}
+
+DPRINTF(probe_elf\n);
+rc = probe_elf(kernel_img, kernel_size, load_funcs);
+if (rc  0) {
+rc = -1;
+printf(%s is not an ELF file\n, kernel_path);
+goto out;
+}
+
+DPRINTF(parseimage\n);
+rc = (load_funcs.parseimage)(kernel_img, kernel_size, dsi);
+if (rc  0) {
+rc = -1;
+goto out;
+}
+
+DPRINTF(loadimage\n);
+(load_funcs.loadimage)(kernel_img, kernel_size, xc_handle, domid,
+page_array, dsi);
+
+DPRINTF(  v_start %016PRIx64\n, dsi-v_start);
+DPRINTF(  v_end   %016PRIx64\n, dsi-v_end);
+DPRINTF(  v_kernstart %016PRIx64\n, dsi-v_kernstart);
+DPRINTF(  v_kernend   %016PRIx64\n, dsi-v_kernend);
+DPRINTF(  v_kernentry %016PRIx64\n, dsi-v_kernentry);
+
+out:
+free(kernel_img);
+return rc;
+}

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


[XenPPC] [xenppc-unstable] [TOOLS][POWERPC] use python quad encoding for 2 cell devtree values

2006-10-18 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID d18a0c0b77d7004631559d4e2f9d31744fe9b34a
# Parent  ece7037c72c6b7944ede2261ec1fe99c1489cff4
[TOOLS][POWERPC] use python quad encoding for 2 cell devtree values
When creating a 2G DomU pyhton chokes when it sees a long type.  If a
value is of type long, or promoted to long it should be packed as a
quad.

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 tools/python/xen/xend/FlatDeviceTree.py |   16 +---
 1 files changed, 9 insertions(+), 7 deletions(-)

diff -r ece7037c72c6 -r d18a0c0b77d7 tools/python/xen/xend/FlatDeviceTree.py
--- a/tools/python/xen/xend/FlatDeviceTree.py   Wed Oct 18 11:29:57 2006 -0400
+++ b/tools/python/xen/xend/FlatDeviceTree.py   Wed Oct 18 16:07:33 2006 -0400
@@ -37,8 +37,10 @@ def _bincat(seq, separator=''):
 '''Concatenate the contents of seq into a bytestream.'''
 strs = []
 for item in seq:
-if type(item) == type(0):
+if isinstance(item, int):
 strs.append(struct.pack(I, item))
+elif isinstance(item, long):
+strs.append(struct.pack(Q, item))
 else:
 try:
 strs.append(item.to_bin())
@@ -287,9 +289,9 @@ def build(imghandler):
 root.addprop('compatible', 'Momentum,Maple\0')
 
 xen = root.addnode('xen')
-xen.addprop('start-info', 0, 0x3ffc000, 0, 0x1000)
+xen.addprop('start-info', long(0x3ffc000), long(0x1000))
 xen.addprop('version', 'Xen-3.0-unstable\0')
-xen.addprop('reg', 0, imghandler.vm.domid, 0, 0)
+xen.addprop('reg', long(imghandler.vm.domid), long(0))
 xen.addprop('domain-name', imghandler.vm.getName() + '\0')
 xencons = xen.addnode('console')
 xencons.addprop('interrupts', 1, 0)
@@ -301,14 +303,14 @@ def build(imghandler):
 
 # RMA node
 rma = root.addnode('[EMAIL PROTECTED]')
-rma.addprop('reg', 0, 0, 0, rma_bytes)
+rma.addprop('reg', long(0), long(rma_bytes))
 rma.addprop('device_type', 'memory\0')
 
 # all the rest in a single node
 remaining = totalmem - rma_bytes
 if remaining  0:
 mem = root.addnode('[EMAIL PROTECTED]')
-mem.addprop('reg', 0, rma_bytes, 0, remaining)
+mem.addprop('reg', long(rma_bytes), long(remaining))
 mem.addprop('device_type', 'memory\0')
 
 # add CPU nodes
@@ -346,8 +348,8 @@ def build(imghandler):
 chosen.addprop('interrupt-controller', xen.get_phandle())
 chosen.addprop('bootargs', imghandler.cmdline + '\0')
 # xc_linux_load.c will overwrite these 64-bit properties later
-chosen.addprop('linux,initrd-start', 0, 0)
-chosen.addprop('linux,initrd-end', 0, 0)
+chosen.addprop('linux,initrd-start', long(0))
+chosen.addprop('linux,initrd-end', long(0))
 
 if 1:
 f = file('/tmp/domU.dtb', 'w')

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


[XenPPC] [xenppc-unstable] [POWERPC][XEN] Improve presentation of objcopy output.

2006-10-13 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Hollis Blanchard [EMAIL PROTECTED]
# Node ID f67efbf6dfa9dc8ccebf85956ef9c5bc5c5928cc
# Parent  b53c343b47ae930248f5db194b72d390e4143ccd
[POWERPC][XEN] Improve presentation of objcopy output.
This makes it easier to grep log files, and just looks a lot better in
the console output of a make.

Signed-off-by: Amos Waterland [EMAIL PROTECTED]
Signed-off-by: Hollis Blanchard [EMAIL PROTECTED]
---
 xen/arch/powerpc/Makefile |6 ++
 1 files changed, 2 insertions(+), 4 deletions(-)

diff -r b53c343b47ae -r f67efbf6dfa9 xen/arch/powerpc/Makefile
--- a/xen/arch/powerpc/Makefile Wed Oct 11 13:04:07 2006 -0400
+++ b/xen/arch/powerpc/Makefile Thu Oct 12 18:22:26 2006 -0500
@@ -120,11 +120,9 @@ xen-syms.o: xen-syms.S
$(CC) $(CFLAGS) $(TARGET_OPTS) xen-syms.o -o $@
 
 # our firmware only loads 32-bit ELF files
+OCPYFLAGS := --input-target=elf64-powerpc --output-target=elf32-powerpc
 $(TARGET): $(TARGET)-syms
-   $(CROSS_COMPILE)objcopy \
-   --input-target=elf64-powerpc \
-   --output-target=elf32-powerpc \
-   $^ $@
+   $(CROSS_COMPILE)objcopy $(OCPYFLAGS) $^ $@
 
 asm-offsets.s: $(TARGET_SUBARCH)/asm-offsets.c $(HDRS)
$(CC) $(CFLAGS) -S -o $@ $

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


[XenPPC] [xenppc-unstable] [XEN] #include errno.h in gdbstub.c.

2006-10-13 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Hollis Blanchard [EMAIL PROTECTED]
# Node ID ff3ab3fc802484087ecf24521f66c4f7ab44849a
# Parent  f67efbf6dfa9dc8ccebf85956ef9c5bc5c5928cc
[XEN] #include errno.h in gdbstub.c.
Signed-off-by: Hollis Blanchard [EMAIL PROTECTED]
---
 xen/common/gdbstub.c |1 +
 1 files changed, 1 insertion(+)

diff -r f67efbf6dfa9 -r ff3ab3fc8024 xen/common/gdbstub.c
--- a/xen/common/gdbstub.c  Thu Oct 12 18:22:26 2006 -0500
+++ b/xen/common/gdbstub.c  Thu Oct 12 18:24:50 2006 -0500
@@ -42,6 +42,7 @@
 #include xen/init.h
 #include xen/smp.h
 #include xen/console.h
+#include xen/errno.h
 
 /* Printk isn't particularly safe just after we've trapped to the
debugger. so avoid it. */

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


[XenPPC] [xenppc-unstable] [XEN][POWERPC] Support your older compilers

2006-10-13 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User [EMAIL PROTECTED]
# Node ID 9372353e3b095cfaf82d09c8b891d9a2b58ca735
# Parent  b53c343b47ae930248f5db194b72d390e4143ccd
[XEN][POWERPC] Support your older compilers

gcc 3.3.x doesn't like some instructions we are using so lets dum them
down a bit.

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 xen/arch/powerpc/powerpc64/exceptions.S |2 +-
 xen/arch/powerpc/setup.c|2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff -r b53c343b47ae -r 9372353e3b09 xen/arch/powerpc/powerpc64/exceptions.S
--- a/xen/arch/powerpc/powerpc64/exceptions.S   Wed Oct 11 13:04:07 2006 -0400
+++ b/xen/arch/powerpc/powerpc64/exceptions.S   Thu Oct 12 17:09:19 2006 -0400
@@ -587,7 +587,7 @@ 4:  dcbf r0,r9
 b .
 /* Find our index in the array of processor_area struct pointers.  */
 2:  LOADADDR(r14, global_cpu_table)
-muli r15, r3, 8
+mulli r15, r3, 8
 add r14, r14, r15
 /* Spin until the pointer for our processor goes valid.  */
 1:  ld r15, 0(r14)
diff -r b53c343b47ae -r 9372353e3b09 xen/arch/powerpc/setup.c
--- a/xen/arch/powerpc/setup.c  Wed Oct 11 13:04:07 2006 -0400
+++ b/xen/arch/powerpc/setup.c  Thu Oct 12 17:09:19 2006 -0400
@@ -118,7 +118,7 @@ void noinline __attn(void)
  * NOP is there to make sure there is something sane to step
  * over to. */
 console_start_sync();
-asm volatile(attn);
+asm volatile(.long 0x200;nop);
 console_end_sync();
 }
 

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


[XenPPC] [xenppc-unstable] merge

2006-10-13 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID 3dfeb3e4a03f0f1eb6b015b89e7d7cc2f2d50207
# Parent  9372353e3b095cfaf82d09c8b891d9a2b58ca735
# Parent  ff3ab3fc802484087ecf24521f66c4f7ab44849a
merge
---
 xen/arch/powerpc/Makefile |6 ++
 xen/common/gdbstub.c  |1 +
 2 files changed, 3 insertions(+), 4 deletions(-)

diff -r 9372353e3b09 -r 3dfeb3e4a03f xen/arch/powerpc/Makefile
--- a/xen/arch/powerpc/Makefile Thu Oct 12 17:09:19 2006 -0400
+++ b/xen/arch/powerpc/Makefile Fri Oct 13 11:00:32 2006 -0400
@@ -120,11 +120,9 @@ xen-syms.o: xen-syms.S
$(CC) $(CFLAGS) $(TARGET_OPTS) xen-syms.o -o $@
 
 # our firmware only loads 32-bit ELF files
+OCPYFLAGS := --input-target=elf64-powerpc --output-target=elf32-powerpc
 $(TARGET): $(TARGET)-syms
-   $(CROSS_COMPILE)objcopy \
-   --input-target=elf64-powerpc \
-   --output-target=elf32-powerpc \
-   $^ $@
+   $(CROSS_COMPILE)objcopy $(OCPYFLAGS) $^ $@
 
 asm-offsets.s: $(TARGET_SUBARCH)/asm-offsets.c $(HDRS)
$(CC) $(CFLAGS) -S -o $@ $
diff -r 9372353e3b09 -r 3dfeb3e4a03f xen/common/gdbstub.c
--- a/xen/common/gdbstub.c  Thu Oct 12 17:09:19 2006 -0400
+++ b/xen/common/gdbstub.c  Fri Oct 13 11:00:32 2006 -0400
@@ -42,6 +42,7 @@
 #include xen/init.h
 #include xen/smp.h
 #include xen/console.h
+#include xen/errno.h
 
 /* Printk isn't particularly safe just after we've trapped to the
debugger. so avoid it. */

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


[XenPPC] [xenppc-unstable] [TOOLS] oops, put this back

2006-10-11 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID e7cb3aefc233e24c6fa2803bc591b8442b833b6d
# Parent  294577be7c024b72f897d32d7a22edcf265c09b6
[TOOLS] oops, put this back
it causes other issues

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 tools/xm-test/lib/XmTestLib/XenDomain.py |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff -r 294577be7c02 -r e7cb3aefc233 tools/xm-test/lib/XmTestLib/XenDomain.py
--- a/tools/xm-test/lib/XmTestLib/XenDomain.py  Tue Oct 10 12:02:56 2006 -0400
+++ b/tools/xm-test/lib/XmTestLib/XenDomain.py  Wed Oct 11 13:01:31 2006 -0400
@@ -50,7 +50,7 @@ class XenConfig:
 class XenConfig:
 An object to help create a xen-compliant config file
 def __init__(self):
-self.defaultOpts = arch.configDefaults
+self.defaultOpts = {}
 
 # These options need to be lists
 self.defaultOpts[disk] = []

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


[XenPPC] [xenppc-unstable] [XEN][POWERPC] Remove pfn2mfn() now that it is understood

2006-10-10 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID 7af3636da4b955e556af19af91b03633b565cce2
# Parent  3583d270140501b208f08335e10105d3f05c52d8
[XEN][POWERPC] Remove pfn2mfn() now that it is understood

It is possible (thank you xm-test) to initiate a grant copy to a page
belonging to a dying domain, the page end up being owned by nobody
which is what the original test asserted.

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 xen/arch/powerpc/mm.c |   13 -
 1 files changed, 12 insertions(+), 1 deletion(-)

diff -r 3583d2701405 -r 7af3636da4b9 xen/arch/powerpc/mm.c
--- a/xen/arch/powerpc/mm.c Sun Oct 08 11:52:28 2006 -0400
+++ b/xen/arch/powerpc/mm.c Tue Oct 10 09:09:38 2006 -0400
@@ -416,7 +416,18 @@ ulong pfn2mfn(struct domain *d, ulong pf
 cur_pfn += pe_pages;
 }
 }
-BUG_ON(t != PFN_TYPE_NONE  page_get_owner(mfn_to_page(mfn)) != d);
+#ifdef DEBUG
+if (t != PFN_TYPE_NONE 
+(d-domain_flags  DOMF_dying) 
+page_get_owner(mfn_to_page(mfn)) != d) {
+printk(%s: page type: %d owner Dom[%d]:%p expected Dom[%d]:%p\n,
+   __func__, t,
+   page_get_owner(mfn_to_page(mfn))-domain_id,
+   page_get_owner(mfn_to_page(mfn)),
+   d-domain_id, d);
+BUG();
+}
+#endif
 }
 
 if (t == PFN_TYPE_NONE) {

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


[XenPPC] [xenppc-unstable] [XEN][POWERPC] New interface ATTN() to conact the HW probe

2006-10-10 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID 05c8ce1d697cd7d16adbfb706680adfb95d4490f
# Parent  7af3636da4b955e556af19af91b03633b565cce2
[XEN][POWERPC] New interface ATTN() to conact the HW probe

Sometimes it is useful to have your code contact the HW probe directly
rather than call BUG().

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 xen/arch/powerpc/setup.c   |   12 ++--
 xen/include/asm-powerpc/debugger.h |3 +++
 2 files changed, 13 insertions(+), 2 deletions(-)

diff -r 7af3636da4b9 -r 05c8ce1d697c xen/arch/powerpc/setup.c
--- a/xen/arch/powerpc/setup.c  Tue Oct 10 09:09:38 2006 -0400
+++ b/xen/arch/powerpc/setup.c  Tue Oct 10 09:11:32 2006 -0400
@@ -114,12 +114,20 @@ static void __init do_initcalls(void)
 }
 }
 
-static void hw_probe_attn(unsigned char key, struct cpu_user_regs *regs)
+
+void noinline __attn(void)
 {
 /* To continue the probe will step over the ATTN instruction.  The
  * NOP is there to make sure there is something sane to step
  * over to. */
-asm volatile(.long 0x0200; nop);
+console_start_sync();
+asm volatile(attn);
+console_end_sync();
+}
+
+static void hw_probe_attn(unsigned char key, struct cpu_user_regs *regs)
+{
+__attn();
 }
 
 static void percpu_init_areas(void)
diff -r 7af3636da4b9 -r 05c8ce1d697c xen/include/asm-powerpc/debugger.h
--- a/xen/include/asm-powerpc/debugger.hTue Oct 10 09:09:38 2006 -0400
+++ b/xen/include/asm-powerpc/debugger.hTue Oct 10 09:11:32 2006 -0400
@@ -68,6 +68,9 @@ extern void __warn(char *file, int line)
 #define WARN() __warn(__FILE__, __LINE__)
 #define WARN_ON(_p) do { if (_p) WARN(); } while ( 0 )
 
+extern void __attn(void);
+#define ATTN() __attn();
+
 #define FORCE_CRASH() __force_crash()
 
 #ifdef CRASH_DEBUG

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


[XenPPC] [xenppc-unstable] [TOOLS][XM-TEST] Update to use uClib buildroot-snapshot.

2006-10-10 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID 5620501536931f9936c7ff24cb368eb8f145bb24
# Parent  05c8ce1d697cd7d16adbfb706680adfb95d4490f
[TOOLS][XM-TEST] Update to use uClib buildroot-snapshot.

Dated file no longer exists on upstream server.

Signed-off-by: Tony Breeds [EMAIL PROTECTED]
Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---

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

diff -r 05c8ce1d697c -r 562050153693 tools/xm-test/ramdisk/Makefile.am
--- a/tools/xm-test/ramdisk/Makefile.am Tue Oct 10 09:11:32 2006 -0400
+++ b/tools/xm-test/ramdisk/Makefile.am Tue Oct 10 11:27:57 2006 -0400
@@ -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] [xenppc-unstable] [TOOLS][XM-TEST] Remove hard coded reference to i386.

2006-10-10 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID b09b2e0b1389a9d47903de283c2e046bec87aaac
# Parent  5620501536931f9936c7ff24cb368eb8f145bb24
[TOOLS][XM-TEST] Remove hard coded reference to i386.

In preparation for other architectures.

Signed-off-by: Tony Breeds [EMAIL PROTECTED]
Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---

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

diff -r 562050153693 -r b09b2e0b1389 tools/xm-test/ramdisk/Makefile.am
--- a/tools/xm-test/ramdisk/Makefile.am Tue Oct 10 11:27:57 2006 -0400
+++ b/tools/xm-test/ramdisk/Makefile.am Tue Oct 10 11:28:01 2006 -0400
@@ -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] [xenppc-unstable] [TOOLS][XM-TEST] rename buildroot - buildroot-i386.

2006-10-10 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID e00e016022c22108431a54b1eecae5e1de1729c7
# Parent  b09b2e0b1389a9d47903de283c2e046bec87aaac
[TOOLS][XM-TEST] rename buildroot - buildroot-i386.

Also update Makefile.

Signed-off-by: Tony Breeds [EMAIL PROTECTED]
Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---

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

diff -r b09b2e0b1389 -r e00e016022c2 tools/xm-test/ramdisk/Makefile.am
--- a/tools/xm-test/ramdisk/Makefile.am Tue Oct 10 11:28:01 2006 -0400
+++ b/tools/xm-test/ramdisk/Makefile.am Tue Oct 10 11:28:04 2006 -0400
@@ -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 b09b2e0b1389 -r e00e016022c2 
tools/xm-test/ramdisk/configs/buildroot-i386
--- /dev/null   Thu Jan 01 00:00:00 1970 +
+++ b/tools/xm-test/ramdisk/configs/buildroot-i386  Tue Oct 10 11:28:04 
2006 -0400
@@ -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
+# 

[XenPPC] [xenppc-unstable] [TOOLS][XM-TEST] ignore generated .test files

2006-10-10 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID c02e48cca22ef60b7d448351184118ba6015c50a
# Parent  3a7a59a7f103ae4f9382adf54f049dee95cfb55f
[TOOLS][XM-TEST] ignore generated .test files

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 .hgignore |1 +
 1 files changed, 1 insertion(+)

diff -r 3a7a59a7f103 -r c02e48cca22e .hgignore
--- a/.hgignore Tue Oct 10 11:28:16 2006 -0400
+++ b/.hgignore Tue Oct 10 11:38:24 2006 -0400
@@ -189,6 +189,7 @@
 ^tools/xm-test/.*/Makefile(.in)*$
 ^tools/xm-test/lib/XmTestLib/config.py$
 ^tools/xm-test/lib/XmTestReport/xmtest.py$
+^tools/xm-test/tests/.*\.test$
 ^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] [xenppc-unstable] [TOOLS][XM-TEST] Use arch specific defaults for initial values

2006-10-10 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID 294577be7c024b72f897d32d7a22edcf265c09b6
# Parent  c02e48cca22ef60b7d448351184118ba6015c50a
[TOOLS][XM-TEST] Use arch specific defaults for initial values

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 tools/xm-test/lib/XmTestLib/XenDomain.py |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff -r c02e48cca22e -r 294577be7c02 tools/xm-test/lib/XmTestLib/XenDomain.py
--- a/tools/xm-test/lib/XmTestLib/XenDomain.py  Tue Oct 10 11:38:24 2006 -0400
+++ b/tools/xm-test/lib/XmTestLib/XenDomain.py  Tue Oct 10 12:02:56 2006 -0400
@@ -50,7 +50,7 @@ class XenConfig:
 class XenConfig:
 An object to help create a xen-compliant config file
 def __init__(self):
-self.defaultOpts = {}
+self.defaultOpts = arch.configDefaults
 
 # These options need to be lists
 self.defaultOpts[disk] = []

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


[XenPPC] [xenppc-unstable] [POWERPC][XEN] Alloc IOMMU to map a Foreign page

2006-10-08 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID aebee004e517fb391c1345749c71a22861ec254d
# Parent  701c68921ff32370caeaaac17a5e0a25ebc8a83a
[POWERPC][XEN] Alloc IOMMU to map a Foreign page

VIO to a physical device reulsts in the granted page getting mapped
into the IOMMU.

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 xen/arch/powerpc/iommu.c |   35 ---
 1 files changed, 28 insertions(+), 7 deletions(-)

diff -r 701c68921ff3 -r aebee004e517 xen/arch/powerpc/iommu.c
--- a/xen/arch/powerpc/iommu.c  Wed Oct 04 14:06:14 2006 -0400
+++ b/xen/arch/powerpc/iommu.c  Sat Oct 07 15:38:27 2006 -0400
@@ -32,6 +32,12 @@
 #include tce.h
 #include iommu.h
 
+#ifdef DEBUG
+#define DBG(fmt...) printk(fmt)
+#else
+#define DBG(fmt...)
+#endif
+
 struct iommu_funcs {
 int (*iommu_put)(ulong, union tce);
 };
@@ -46,16 +52,31 @@ int iommu_put(u32 buid, ulong ioba, unio
 struct domain *d = v-domain;
 
 if (buid  iommu_phbs_num  iommu_phbs[buid].iommu_put != NULL) {
-ulong gpfn;
+ulong gmfn;
 ulong mfn;
+int mtype;
 
-gpfn = tce.tce_bits.tce_rpn;
-mfn = gmfn_to_mfn(d, gpfn);
+gmfn = tce.tce_bits.tce_rpn;
+
+
+mfn = pfn2mfn(d, gmfn, mtype);
 if (mfn != INVALID_MFN) {
-#ifdef DEBUG
-printk(%s: ioba=0x%lx pfn=0x%lx mfn=0x%lx\n, __func__,
-   ioba, pfn, mfn);
-#endif
+switch (mtype) {
+case PFN_TYPE_RMA:
+case PFN_TYPE_LOGICAL:
+break;
+case PFN_TYPE_FOREIGN:
+DBG(%s: assigning to Foriegn page: 
+gmfn: 0x%lx mfn: 0x%lx\n,  __func__, gmfn, mfn);
+break;
+default:
+printk(%s: unsupported type[%d]: gmfn: 0x%lx mfn: 0x%lx\n,
+   __func__, mtype, gmfn, mfn);
+return -1;
+break;
+}
+DBG(%s: ioba=0x%lx gmfn=0x%lx mfn=0x%lx\n, __func__,
+ioba, gmfn, mfn);
 tce.tce_bits.tce_rpn = mfn;
 return iommu_phbs[buid].iommu_put(ioba, tce);
 }

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


[XenPPC] [xenppc-unstable] [XEN]

2006-10-08 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID c836899002deb97bb9601d247f6e078d201aeff5
# Parent  e30376a0abc39117f604b0f6cc7817deb3eb9079
[XEN]

The following patch allows for an architecture to decorate the
dev_bus_addr returned by a gnttab mapping.

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 xen/common/grant_table.c  |2 +-
 xen/include/xen/grant_table.h |4 
 2 files changed, 5 insertions(+), 1 deletion(-)

diff -r e30376a0abc3 -r c836899002de xen/common/grant_table.c
--- a/xen/common/grant_table.c  Sat Oct 07 16:25:46 2006 -0400
+++ b/xen/common/grant_table.c  Sun Oct 08 11:32:53 2006 -0400
@@ -280,7 +280,7 @@ __gnttab_map_grant_ref(
 ld-grant_table-maptrack[handle].ref   = op-ref;
 ld-grant_table-maptrack[handle].flags = op-flags;
 
-op-dev_bus_addr = (u64)frame  PAGE_SHIFT;
+op-dev_bus_addr = GNTTAB_DEV_BUS((u64)frame  PAGE_SHIFT);
 op-handle   = handle;
 op-status   = GNTST_okay;
 
diff -r e30376a0abc3 -r c836899002de xen/include/xen/grant_table.h
--- a/xen/include/xen/grant_table.h Sat Oct 07 16:25:46 2006 -0400
+++ b/xen/include/xen/grant_table.h Sun Oct 08 11:32:53 2006 -0400
@@ -96,4 +96,8 @@ gnttab_release_mappings(
 gnttab_release_mappings(
 struct domain *d);
 
+#ifndef GNTTAB_DEV_BUS
+#define GNTTAB_DEV_BUS(f) (f)
+#endif
+
 #endif /* __XEN_GRANT_TABLE_H__ */

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


[XenPPC] [xenppc-unstable] [XEN][POWERPC] Create a Domain Foreign Map space

2006-10-08 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID 1849e7806e199e8feecb280605c53c9949541d9b
# Parent  c836899002deb97bb9601d247f6e078d201aeff5
[XEN][POWERPC] Create a Domain Foreign Map space

The following patch creates a Domain Foreign Map space that is uses to
map granted memory into the Linear Map of the domain.  The Linear Map
of Linux is the is the Kernel Virtual address space where VA = PA +
PAGE_OFFSET.

Also:
 - lots of grant_* interfaces work now
 - mm.[ch] cleanups
 - first pass at extracting Page Table operations from PAPR interfaces
 - get_page_type() fix logic bug
 - recognize a grant table mapping by placing its gmfn at the end of
   real memory.
 - grant table usually mapped like an IO page, so force WIMG bits I=0
 - mfn_to_gmfn and pfn2mfn get WAY to complex, need get a simpler model in.
 - communicate the Domain Foreign Map to domains using /xen/foreign-map
 - make sure all bit definitions are UL where possible
 - now that we actually assign Xen heap pages to domains they must be
   relinquished

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 xen/arch/powerpc/domain.c |2 
 xen/arch/powerpc/mm.c |  163 +-
 xen/arch/powerpc/ofd_fixup.c  |5 +
 xen/arch/powerpc/papr/xlate.c |  130 +++
 xen/include/asm-powerpc/grant_table.h |   16 ++-
 xen/include/asm-powerpc/mm.h  |   76 ---
 xen/include/asm-powerpc/page.h|   37 ---
 7 files changed, 297 insertions(+), 132 deletions(-)

diff -r c836899002de -r 1849e7806e19 xen/arch/powerpc/domain.c
--- a/xen/arch/powerpc/domain.c Sun Oct 08 11:32:53 2006 -0400
+++ b/xen/arch/powerpc/domain.c Sun Oct 08 11:34:24 2006 -0400
@@ -94,6 +94,7 @@ void arch_domain_destroy(struct domain *
 void arch_domain_destroy(struct domain *d)
 {
 shadow_teardown(d);
+/* shared_info is part of the RMA so no need to release it */
 }
 
 static void machine_fail(const char *s)
@@ -288,6 +289,7 @@ static void relinquish_memory(struct dom
 
 void domain_relinquish_resources(struct domain *d)
 {
+relinquish_memory(d, d-xenpage_list);
 relinquish_memory(d, d-page_list);
 free_extents(d);
 return;
diff -r c836899002de -r 1849e7806e19 xen/arch/powerpc/mm.c
--- a/xen/arch/powerpc/mm.c Sun Oct 08 11:32:53 2006 -0400
+++ b/xen/arch/powerpc/mm.c Sun Oct 08 11:34:24 2006 -0400
@@ -41,18 +41,107 @@ unsigned long max_page;
 unsigned long max_page;
 unsigned long total_pages;
 
+void __init init_frametable(void)
+{
+unsigned long p;
+unsigned long nr_pages;
+int i;
+
+nr_pages = PFN_UP(max_page * sizeof(struct page_info));
+
+p = alloc_boot_pages(nr_pages, 1);
+if (p == 0)
+panic(Not enough memory for frame table\n);
+
+frame_table = (struct page_info *)(p  PAGE_SHIFT);
+for (i = 0; i  nr_pages; i += 1)
+clear_page((void *)((p + i)  PAGE_SHIFT));
+}
+
+void share_xen_page_with_guest(
+struct page_info *page, struct domain *d, int readonly)
+{
+if ( page_get_owner(page) == d )
+return;
+
+/* this causes us to leak pages in the Domain and reuslts in
+ * Zombie domains, I think we are missing a piece, until we find
+ * it we disable the following code */
+set_gpfn_from_mfn(page_to_mfn(page), INVALID_M2P_ENTRY);
+
+spin_lock(d-page_alloc_lock);
+
+/* The incremented type count pins as writable or read-only. */
+page-u.inuse.type_info  = (readonly ? PGT_none : PGT_writable_page);
+page-u.inuse.type_info |= PGT_validated | 1;
+
+page_set_owner(page, d);
+wmb(); /* install valid domain ptr before updating refcnt. */
+ASSERT(page-count_info == 0);
+page-count_info |= PGC_allocated | 1;
+
+if ( unlikely(d-xenheap_pages++ == 0) )
+get_knownalive_domain(d);
+list_add_tail(page-list, d-xenpage_list);
+
+spin_unlock(d-page_alloc_lock);
+}
+
+void share_xen_page_with_privileged_guests(
+struct page_info *page, int readonly)
+{
+unimplemented();
+}
+
+static int create_grant_va_mapping(
+unsigned long va, unsigned long frame, struct vcpu *v)
+{
+if (v-domain-domain_id != 0) {
+printk(only Dom0 can map a grant entry\n);
+BUG();
+return GNTST_permission_denied;
+}
+return GNTST_okay;
+}
+
+static int destroy_grant_va_mapping(
+unsigned long addr, unsigned long frame, struct domain *d)
+{
+if (d-domain_id != 0) {
+printk(only Dom0 can map a grant entry\n);
+BUG();
+return GNTST_permission_denied;
+}
+return GNTST_okay;
+}
+
 int create_grant_host_mapping(
 unsigned long addr, unsigned long frame, unsigned int flags)
 {
-panic(%s called\n, __func__);
-return 1;
+if (flags  GNTMAP_application_map) {
+printk(%s: GNTMAP_application_map not supported\n, __func__);
+BUG();
+return GNTST_general_error;
+}
+if (flags  GNTMAP_contains_pte) {
+printk(%s: 

[XenPPC] [xenppc-unstable] merge

2006-10-08 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID 3583d270140501b208f08335e10105d3f05c52d8
# Parent  1849e7806e199e8feecb280605c53c9949541d9b
# Parent  a41b8cd01ad287d60a5e59ccffa23b5dd8837af8
merge
---
 xen/arch/powerpc/boot/boot32.S   |   75 ---
 xen/arch/powerpc/boot/start.S|   51 --
 .hgignore|7 ++-
 xen/arch/powerpc/Makefile|   63 ++--
 xen/arch/powerpc/boot_of.c   |   25 ++---
 xen/arch/powerpc/cmdline.c   |   24 
 xen/arch/powerpc/start.S |   62 
 xen/arch/powerpc/xen.lds.S   |8 +---
 xen/include/asm-powerpc/config.h |1 
 xen/include/asm-powerpc/mm.h |2 -
 xen/include/asm-powerpc/page.h   |1 
 11 files changed, 134 insertions(+), 185 deletions(-)

diff -r 1849e7806e19 -r 3583d2701405 .hgignore
--- a/.hgignore Sun Oct 08 11:34:24 2006 -0400
+++ b/.hgignore Sun Oct 08 11:52:28 2006 -0400
@@ -203,10 +203,11 @@
 ^xen/arch/powerpc/dom0\.bin$
 ^xen/arch/powerpc/asm-offsets\.s$
 ^xen/arch/powerpc/firmware$
-^xen/arch/powerpc/firmware_image$
+^xen/arch/powerpc/firmware_image.bin$
 ^xen/arch/powerpc/xen\.lds$
-^xen/arch/powerpc/.xen-syms$
-^xen/arch/powerpc/xen-syms.S$
+^xen/arch/powerpc/\.xen-syms$
+^xen/arch/powerpc/xen-syms\.S$
+^xen/arch/powerpc/cmdline.dep$
 ^unmodified_drivers/linux-2.6/\.tmp_versions
 ^unmodified_drivers/linux-2.6/.*\.cmd$
 ^unmodified_drivers/linux-2.6/.*\.ko$
diff -r 1849e7806e19 -r 3583d2701405 xen/arch/powerpc/Makefile
--- a/xen/arch/powerpc/Makefile Sun Oct 08 11:34:24 2006 -0400
+++ b/xen/arch/powerpc/Makefile Sun Oct 08 11:52:28 2006 -0400
@@ -9,6 +9,7 @@ obj-y += backtrace.o
 obj-y += backtrace.o
 obj-y += bitops.o
 obj-y += boot_of.o
+obj-y += cmdline.o
 obj-y += dart.o
 obj-y += dart_u3.o
 obj-y += dart_u4.o
@@ -54,11 +55,6 @@ PPC_C_WARNINGS += -Wshadow
 PPC_C_WARNINGS += -Wshadow
 CFLAGS += $(PPC_C_WARNINGS)
 
-LINK=0x40
-boot32_link_base = $(LINK)
-xen_link_offset  = 100
-xen_link_base= $(patsubst %000,%$(xen_link_offset),$(LINK))
-
 #
 # The following flags are fed to gcc in order to link several
 # objects into a single ELF segment and to not link in any additional
@@ -69,16 +65,8 @@ firmware: of_handler/built_in.o $(TARGET
 firmware: of_handler/built_in.o $(TARGET_SUBARCH)/memcpy.o of-devtree.o
$(CC) $(CFLAGS) $(OMAGIC) -e __ofh_start -Wl,-Ttext,0x0 $^ -o $@
 
-firmware_image: firmware
+firmware_image.bin: firmware
$(CROSS_COMPILE)objcopy --output-target=binary $ $@
-
-firmware_image.o: firmware_image
-   $(CROSS_COMPILE)objcopy --input-target=binary \
-   --output-target=elf64-powerpc \
-   --binary-architecture=powerpc \
-   --redefine-sym _binary_$_start=$(@:%.o=%)_start \
-   --redefine-sym _binary_$_end=$(@:%.o=%)_end \
-   --redefine-sym _binary_$_size=$(@:%.o=%)_size  $ $@
 
 #
 # Hacks for included C files
@@ -88,15 +76,27 @@ physdev.o: ../x86/physdev.c
 
 HDRS += $(wildcard *.h)
 
+ifneq ($(CMDLINE),)
 # The first token in the arguments will be silently dropped.
-IMAGENAME = xen
-CMDLINE = 
-boot_of.o: CFLAGS += -DCMDLINE=\$(IMAGENAME) $(CMDLINE)\
+FULL_CMDLINE := xen $(CMDLINE)
+endif
 
-start.o: boot/start.S
-   $(CC) $(CFLAGS) -D__ASSEMBLY__ -c $ -o $@
+ifeq ($(wildcard cmdline.dep),)
+cmdline.dep:
+   echo $(FULL_CMDLINE)  cmdline.dep
+else
+ifneq ($(FULL_CMDLINE),$(shell cat cmdline.dep))
+cmdline.dep::
+   echo $(FULL_CMDLINE)  cmdline.dep
+else
+cmdline.dep:
+endif
+endif
 
-TARGET_OPTS = $(OMAGIC) -Wl,-Ttext,$(xen_link_base),-T,xen.lds
+cmdline.o: cmdline.dep
+cmdline.o: CFLAGS += -DCMDLINE=\$(FULL_CMDLINE)\
+
+TARGET_OPTS = $(OMAGIC) -Wl,-T,xen.lds
 TARGET_OPTS += start.o $(ALL_OBJS)
 
 .xen-syms: start.o $(ALL_OBJS) xen.lds
@@ -118,22 +118,12 @@ xen-syms.o: xen-syms.S
 $(TARGET)-syms: start.o $(ALL_OBJS) xen-syms.o xen.lds
$(CC) $(CFLAGS) $(TARGET_OPTS) xen-syms.o -o $@
 
-$(TARGET).bin: $(TARGET)-syms
-   $(CROSS_COMPILE)objcopy --output-target=binary $ $@
-
-$(TARGET).bin.o: $(TARGET).bin
-   $(CROSS_COMPILE)objcopy --input-target=binary \
+# our firmware only loads 32-bit ELF files
+$(TARGET): $(TARGET)-syms
+   $(CROSS_COMPILE)objcopy \
+   --input-target=elf64-powerpc \
--output-target=elf32-powerpc \
-   --binary-architecture=powerpc  $ $@
-
-boot32.o: boot/boot32.S
-   $(CC) -m32 -Wa,-a32,-mppc64bridge \
-   -D__ASSEMBLY__ -D__BRIDGE64__ $(CFLAGS) -c $ -o $@
-
-$(TARGET): boot32.o $(TARGET).bin.o
-   $(CC) -m32 -N -Wl,-melf32ppclinux -static -nostdlib \
-   -Wl,-Ttext,$(boot32_link_base)  -Wl,-Tdata,$(xen_link_base) \
-   $(CFLAGS) $^ -o $@
+   $^ $@
 
 asm-offsets.s: $(TARGET_SUBARCH)/asm-offsets.c $(HDRS)
$(CC) $(CFLAGS) -S -o $@ $
@@ -146,4 +136,5 @@ dom0.bin: $(DOM0_IMAGE)
 
 clean::
  

[XenPPC] [xenppc-unstable] [POWERPC][XEN] Fix yaboot loading and other linker script tweaks.

2006-10-06 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Hollis Blanchard [EMAIL PROTECTED]
# Node ID a41b8cd01ad287d60a5e59ccffa23b5dd8837af8
# Parent  f9631d8c3e3c38cd618003487e5bd21b4a0acb5d
[POWERPC][XEN] Fix yaboot loading and other linker script tweaks.
yaboot refuses to load segments at file offset 0, so move the ELF headers out
of our text segment. Also hardcode the link address in the linker script, and
remove the now-inaccurate start/end comments.
Signed-off-by: Hollis Blanchard [EMAIL PROTECTED]
---
 xen/arch/powerpc/Makefile  |2 +-
 xen/arch/powerpc/xen.lds.S |8 ++--
 2 files changed, 3 insertions(+), 7 deletions(-)

diff -r f9631d8c3e3c -r a41b8cd01ad2 xen/arch/powerpc/Makefile
--- a/xen/arch/powerpc/Makefile Thu Oct 05 16:06:42 2006 -0500
+++ b/xen/arch/powerpc/Makefile Fri Oct 06 12:15:06 2006 -0500
@@ -96,7 +96,7 @@ cmdline.o: cmdline.dep
 cmdline.o: cmdline.dep
 cmdline.o: CFLAGS += -DCMDLINE=\$(FULL_CMDLINE)\
 
-TARGET_OPTS = $(OMAGIC) -Wl,-Ttext,0x40,-T,xen.lds
+TARGET_OPTS = $(OMAGIC) -Wl,-T,xen.lds
 TARGET_OPTS += start.o $(ALL_OBJS)
 
 .xen-syms: start.o $(ALL_OBJS) xen.lds
diff -r f9631d8c3e3c -r a41b8cd01ad2 xen/arch/powerpc/xen.lds.S
--- a/xen/arch/powerpc/xen.lds.SThu Oct 05 16:06:42 2006 -0500
+++ b/xen/arch/powerpc/xen.lds.SFri Oct 06 12:15:06 2006 -0500
@@ -12,12 +12,12 @@ SEARCH_DIR(=/usr/local/lib64); SEARCH_
__DYNAMIC = 0;*/
 PHDRS
 {
-  text PT_LOAD FILEHDR PHDRS;
+  text PT_LOAD;
 }   
 SECTIONS
 {
+  . = 0x0040;
   /* Read-only sections, merged into text segment: */
-  PROVIDE (__executable_start = 0x1000); . = 0x1000 + SIZEOF_HEADERS;
   .interp : { *(.interp) } :text
   .hash   : { *(.hash) }
   .dynsym : { *(.dynsym) }
@@ -111,8 +111,6 @@ SECTIONS
 SORT(CONSTRUCTORS)
   }
 
-  /* Xen addition */
-
   . = ALIGN(32);
   __setup_start = .;
   .setup.init : { *(.setup.init) }
@@ -130,8 +128,6 @@ SECTIONS
   . = __per_cpu_start + (NR_CPUS  PERCPU_SHIFT);
   . = ALIGN(STACK_SIZE);
   __per_cpu_end = .;
-
-  /* end Xen addition */
 
   .data1  : { *(.data1) }
   .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }

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


[XenPPC] [xenppc-unstable] [POWERPC][XEN] Move gmfn_to_mfn() from page.h to mm.h to avoid recursive header dependencies.

2006-10-04 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Hollis Blanchard [EMAIL PROTECTED]
# Node ID c3312bbd598a50b3c48955a8f4c9dba6330fc7d8
# Parent  d1f6d0f820d890ac6075f47ad1ba6e38012167b4
[POWERPC][XEN] Move gmfn_to_mfn() from page.h to mm.h to avoid recursive header 
dependencies.
Signed-off-by: Hollis Blanchard [EMAIL PROTECTED]
---
 xen/include/asm-powerpc/mm.h   |   23 +++
 xen/include/asm-powerpc/page.h |   23 ---
 2 files changed, 23 insertions(+), 23 deletions(-)

diff -r d1f6d0f820d8 -r c3312bbd598a xen/include/asm-powerpc/mm.h
--- a/xen/include/asm-powerpc/mm.h  Mon Oct 02 21:43:09 2006 -0400
+++ b/xen/include/asm-powerpc/mm.h  Tue Oct 03 18:23:21 2006 -0500
@@ -28,6 +28,7 @@
 #include asm/system.h
 #include asm/flushtlb.h
 #include asm/page.h
+#include asm/debugger.h
 
 #define memguard_guard_range(_p,_l)((void)0)
 #define memguard_unguard_range(_p,_l)((void)0)
@@ -244,4 +245,26 @@ extern int steal_page(struct domain *d, 
 #define access_ok(addr,size) 1
 #define array_access_ok(addr,count,size) 1
 
+static inline unsigned long gmfn_to_mfn(struct domain *d, unsigned long gmfn)
+{
+int mtype;
+ulong mfn;
+
+mfn = pfn2mfn(d, gmfn, mtype);
+if (mfn != INVALID_MFN) {
+switch (mtype) {
+case PFN_TYPE_RMA:
+case PFN_TYPE_LOGICAL:
+break;
+default:
+WARN();
+mfn = INVALID_MFN;
+break;
+}
+}
+return mfn;
+}
+
+#define mfn_to_gmfn(_d, mfn) (mfn)
+
 #endif
diff -r d1f6d0f820d8 -r c3312bbd598a xen/include/asm-powerpc/page.h
--- a/xen/include/asm-powerpc/page.hMon Oct 02 21:43:09 2006 -0400
+++ b/xen/include/asm-powerpc/page.hTue Oct 03 18:23:21 2006 -0500
@@ -30,7 +30,6 @@
 
 #include xen/config.h
 #include asm/cache.h
-#include asm/debugger.h
 
 #define PFN_DOWN(x)   ((x)  PAGE_SHIFT)
 #define PFN_UP(x) (((x) + PAGE_SIZE-1)  PAGE_SHIFT)
@@ -146,27 +145,5 @@ extern unsigned long paddr_to_maddr(unsi
 /* XXX only used for debug print right now... */
 #define get_gpfn_from_mfn(mfn) (mfn)
 
-static inline unsigned long gmfn_to_mfn(struct domain *d, unsigned long gmfn)
-{
-int mtype;
-ulong mfn;
-
-mfn = pfn2mfn(d, gmfn, mtype);
-if (mfn != INVALID_MFN) {
-switch (mtype) {
-case PFN_TYPE_RMA:
-case PFN_TYPE_LOGICAL:
-break;
-default:
-WARN();
-mfn = INVALID_MFN;
-break;
-}
-}
-return mfn;
-}
-
-#define mfn_to_gmfn(_d, mfn) (mfn)
-
 #endif  /* ! __ASSEMBLY__ */
 #endif

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


[XenPPC] [xenppc-unstable] [POWERPC][XEN] Remove boot wrapper, and extensive Makefile simplifications.

2006-10-04 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Hollis Blanchard [EMAIL PROTECTED]
# Node ID 8550ae9d12626763357a52a1aa0f682a2a82b290
# Parent  c3312bbd598a50b3c48955a8f4c9dba6330fc7d8
[POWERPC][XEN] Remove boot wrapper, and extensive Makefile simplifications.
Instead of embedding the 64-bit Xen image inside a 32-bit boot wrapper, we
can just use objcopy. This combines boot32.S and start.S, and removes the boot/
subdirectory entirely.
Signed-off-by: Hollis Blanchard [EMAIL PROTECTED]
---
 xen/arch/powerpc/boot/boot32.S |   75 -
 xen/arch/powerpc/boot/start.S  |   51 ---
 .hgignore  |2 -
 xen/arch/powerpc/Makefile  |   42 --
 xen/arch/powerpc/start.S   |   62 +
 5 files changed, 71 insertions(+), 161 deletions(-)

diff -r c3312bbd598a -r 8550ae9d1262 .hgignore
--- a/.hgignore Tue Oct 03 18:23:21 2006 -0500
+++ b/.hgignore Wed Oct 04 17:17:41 2006 -0500
@@ -203,7 +203,7 @@
 ^xen/arch/powerpc/dom0\.bin$
 ^xen/arch/powerpc/asm-offsets\.s$
 ^xen/arch/powerpc/firmware$
-^xen/arch/powerpc/firmware_image$
+^xen/arch/powerpc/firmware_image.bin$
 ^xen/arch/powerpc/xen\.lds$
 ^xen/arch/powerpc/.xen-syms$
 ^xen/arch/powerpc/xen-syms.S$
diff -r c3312bbd598a -r 8550ae9d1262 xen/arch/powerpc/Makefile
--- a/xen/arch/powerpc/Makefile Tue Oct 03 18:23:21 2006 -0500
+++ b/xen/arch/powerpc/Makefile Wed Oct 04 17:17:41 2006 -0500
@@ -54,11 +54,6 @@ PPC_C_WARNINGS += -Wshadow
 PPC_C_WARNINGS += -Wshadow
 CFLAGS += $(PPC_C_WARNINGS)
 
-LINK=0x40
-boot32_link_base = $(LINK)
-xen_link_offset  = 100
-xen_link_base= $(patsubst %000,%$(xen_link_offset),$(LINK))
-
 #
 # The following flags are fed to gcc in order to link several
 # objects into a single ELF segment and to not link in any additional
@@ -69,16 +64,8 @@ firmware: of_handler/built_in.o $(TARGET
 firmware: of_handler/built_in.o $(TARGET_SUBARCH)/memcpy.o of-devtree.o
$(CC) $(CFLAGS) $(OMAGIC) -e __ofh_start -Wl,-Ttext,0x0 $^ -o $@
 
-firmware_image: firmware
+firmware_image.bin: firmware
$(CROSS_COMPILE)objcopy --output-target=binary $ $@
-
-firmware_image.o: firmware_image
-   $(CROSS_COMPILE)objcopy --input-target=binary \
-   --output-target=elf64-powerpc \
-   --binary-architecture=powerpc \
-   --redefine-sym _binary_$_start=$(@:%.o=%)_start \
-   --redefine-sym _binary_$_end=$(@:%.o=%)_end \
-   --redefine-sym _binary_$_size=$(@:%.o=%)_size  $ $@
 
 #
 # Hacks for included C files
@@ -93,10 +80,7 @@ CMDLINE = 
 CMDLINE = 
 boot_of.o: CFLAGS += -DCMDLINE=\$(IMAGENAME) $(CMDLINE)\
 
-start.o: boot/start.S
-   $(CC) $(CFLAGS) -D__ASSEMBLY__ -c $ -o $@
-
-TARGET_OPTS = $(OMAGIC) -Wl,-Ttext,$(xen_link_base),-T,xen.lds
+TARGET_OPTS = $(OMAGIC) -Wl,-Ttext,0x40,-T,xen.lds
 TARGET_OPTS += start.o $(ALL_OBJS)
 
 .xen-syms: start.o $(ALL_OBJS) xen.lds
@@ -118,22 +102,12 @@ xen-syms.o: xen-syms.S
 $(TARGET)-syms: start.o $(ALL_OBJS) xen-syms.o xen.lds
$(CC) $(CFLAGS) $(TARGET_OPTS) xen-syms.o -o $@
 
-$(TARGET).bin: $(TARGET)-syms
-   $(CROSS_COMPILE)objcopy --output-target=binary $ $@
-
-$(TARGET).bin.o: $(TARGET).bin
-   $(CROSS_COMPILE)objcopy --input-target=binary \
+# our firmware only loads 32-bit ELF files
+$(TARGET): $(TARGET)-syms
+   $(CROSS_COMPILE)objcopy \
+   --input-target=elf64-powerpc \
--output-target=elf32-powerpc \
-   --binary-architecture=powerpc  $ $@
-
-boot32.o: boot/boot32.S
-   $(CC) -m32 -Wa,-a32,-mppc64bridge \
-   -D__ASSEMBLY__ -D__BRIDGE64__ $(CFLAGS) -c $ -o $@
-
-$(TARGET): boot32.o $(TARGET).bin.o
-   $(CC) -m32 -N -Wl,-melf32ppclinux -static -nostdlib \
-   -Wl,-Ttext,$(boot32_link_base)  -Wl,-Tdata,$(xen_link_base) \
-   $(CFLAGS) $^ -o $@
+   $^ $@
 
 asm-offsets.s: $(TARGET_SUBARCH)/asm-offsets.c $(HDRS)
$(CC) $(CFLAGS) -S -o $@ $
@@ -146,4 +120,4 @@ dom0.bin: $(DOM0_IMAGE)
 
 clean::
$(MAKE) -f $(BASEDIR)/Rules.mk -C of_handler clean
-   rm -f firmware firmware_image dom0.bin .xen-syms
+   rm -f firmware firmware_image.bin dom0.bin .xen-syms
diff -r c3312bbd598a -r 8550ae9d1262 xen/arch/powerpc/start.S
--- /dev/null   Thu Jan 01 00:00:00 1970 +
+++ b/xen/arch/powerpc/start.S  Wed Oct 04 17:17:41 2006 -0500
@@ -0,0 +1,62 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the 

[XenPPC] [xenppc-unstable] [POWERPC][XEN] Create a cmdline.c to hold builtin/post-installed parameters.

2006-10-04 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Hollis Blanchard [EMAIL PROTECTED]
# Node ID 80274bed86ca1749fe29e22147cbc7c495222731
# Parent  8550ae9d12626763357a52a1aa0f682a2a82b290
[POWERPC][XEN] Create a cmdline.c to hold builtin/post-installed parameters.
Signed-off-by: Hollis Blanchard [EMAIL PROTECTED]
---
 xen/arch/powerpc/Makefile|8 +---
 xen/arch/powerpc/boot_of.c   |   23 +++
 xen/arch/powerpc/cmdline.c   |   24 
 xen/include/asm-powerpc/config.h |1 +
 4 files changed, 41 insertions(+), 15 deletions(-)

diff -r 8550ae9d1262 -r 80274bed86ca xen/arch/powerpc/Makefile
--- a/xen/arch/powerpc/Makefile Wed Oct 04 17:17:41 2006 -0500
+++ b/xen/arch/powerpc/Makefile Wed Oct 04 17:22:59 2006 -0500
@@ -9,6 +9,7 @@ obj-y += backtrace.o
 obj-y += backtrace.o
 obj-y += bitops.o
 obj-y += boot_of.o
+obj-y += cmdline.o
 obj-y += dart.o
 obj-y += dart_u3.o
 obj-y += dart_u4.o
@@ -75,10 +76,11 @@ physdev.o: ../x86/physdev.c
 
 HDRS += $(wildcard *.h)
 
+ifneq ($(CMDLINE),)
 # The first token in the arguments will be silently dropped.
-IMAGENAME = xen
-CMDLINE = 
-boot_of.o: CFLAGS += -DCMDLINE=\$(IMAGENAME) $(CMDLINE)\
+FULL_CMDLINE := xen $(CMDLINE)
+endif
+cmdline.o: CFLAGS += -DCMDLINE=\$(FULL_CMDLINE)\
 
 TARGET_OPTS = $(OMAGIC) -Wl,-Ttext,0x40,-T,xen.lds
 TARGET_OPTS += start.o $(ALL_OBJS)
diff -r 8550ae9d1262 -r 80274bed86ca xen/arch/powerpc/boot_of.c
--- a/xen/arch/powerpc/boot_of.cWed Oct 04 17:17:41 2006 -0500
+++ b/xen/arch/powerpc/boot_of.cWed Oct 04 17:22:59 2006 -0500
@@ -16,6 +16,7 @@
  * Copyright (C) IBM Corp. 2005, 2006
  *
  * Authors: Jimi Xenidis [EMAIL PROTECTED]
+ *  Hollis Blanchard [EMAIL PROTECTED]
  */
 
 #include xen/config.h
@@ -40,12 +41,8 @@ static ulong of_vec;
 static ulong of_vec;
 static ulong of_msr;
 static int of_out;
-static char bootargs[256];
-
-#define COMMAND_LINE_SIZE 512
-static char builtin_cmdline[COMMAND_LINE_SIZE]
-__attribute__((section(__builtin_cmdline))) = CMDLINE;
-
+
+extern char builtin_cmdline[];
 extern struct ns16550_defaults ns16550;
 
 #undef OF_DEBUG
@@ -464,15 +461,17 @@ static void boot_of_bootargs(multiboot_i
 {
 int rc;
 
-rc = of_getprop(bof_chosen, bootargs, bootargs, sizeof (bootargs));
-if (rc == OF_FAILURE || bootargs[0] == '\0') {
-strlcpy(bootargs, builtin_cmdline, sizeof(bootargs));
+if (builtin_cmdline[0] == '\0') {
+rc = of_getprop(bof_chosen, bootargs, builtin_cmdline,
+CONFIG_CMDLINE_SIZE);
+if (rc  CONFIG_CMDLINE_SIZE)
+of_panic(bootargs[] not big enough for /chosen/bootargs\n);
 }
 
 mbi-flags |= MBI_CMDLINE;
-mbi-cmdline = (u32)bootargs;
-
-of_printf(bootargs = %s\n, bootargs);
+mbi-cmdline = (ulong)builtin_cmdline;
+
+of_printf(bootargs = %s\n, builtin_cmdline);
 }
 
 static int save_props(void *m, ofdn_t n, int pkg)
diff -r 8550ae9d1262 -r 80274bed86ca xen/include/asm-powerpc/config.h
--- a/xen/include/asm-powerpc/config.h  Wed Oct 04 17:17:41 2006 -0500
+++ b/xen/include/asm-powerpc/config.h  Wed Oct 04 17:22:59 2006 -0500
@@ -50,6 +50,7 @@ extern char __bss_start[];
 #define CONFIG_GDB 1
 #define CONFIG_SMP 1
 #define CONFIG_PCI 1
+#define CONFIG_CMDLINE_SIZE 512
 #define NR_CPUS 16
 
 #ifndef ELFSIZE
diff -r 8550ae9d1262 -r 80274bed86ca xen/arch/powerpc/cmdline.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +
+++ b/xen/arch/powerpc/cmdline.cWed Oct 04 17:22:59 2006 -0500
@@ -0,0 +1,24 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ * Copyright (C) IBM Corp. 2006
+ *
+ * Authors: Hollis Blanchard [EMAIL PROTECTED]
+ */
+
+#include asm/config.h
+
+char builtin_cmdline[CONFIG_CMDLINE_SIZE] 
+__attribute__((section(__builtin_cmdline))) = CMDLINE;

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


[XenPPC] [xenppc-unstable] [POWERPC][XEN] Hide builtin dom0 args from Xen.

2006-10-04 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Hollis Blanchard [EMAIL PROTECTED]
# Node ID 1b759b2522cdf09354dca6d8fde27cbd6b03bab9
# Parent  80274bed86ca1749fe29e22147cbc7c495222731
[POWERPC][XEN] Hide builtin dom0 args from Xen.
Signed-off-by: Amos Waterland [EMAIL PROTECTED]
Signed-off-by: Hollis Blanchard [EMAIL PROTECTED]
---
 xen/arch/powerpc/boot_of.c |2 ++
 1 files changed, 2 insertions(+)

diff -r 80274bed86ca -r 1b759b2522cd xen/arch/powerpc/boot_of.c
--- a/xen/arch/powerpc/boot_of.cWed Oct 04 17:22:59 2006 -0500
+++ b/xen/arch/powerpc/boot_of.cWed Oct 04 17:27:16 2006 -0500
@@ -1022,6 +1022,8 @@ static void * __init boot_of_module(ulon
   mods[mod].mod_start, mods[mod].mod_end);
 p = strstr((char *)(ulong)mbi-cmdline, sepr);
 if (p != NULL) {
+/* Xen proper should never know about the dom0 args.  */
+*(char *)p = '\0';
 p += sizeof (sepr) - 1;
 mods[mod].string = (u32)(ulong)p;
 of_printf(%s: dom0 mod string: %s\n, __func__, p);

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


[XenPPC] [xenppc-unstable] [XEN][POWERPC] oops on debug build break

2006-10-01 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID 77373497916f9e24939bf4d9549ba7c67c02c73f
# Parent  b91cda0fb75535d2008191ef259ecf2441edae23
[XEN][POWERPC] oops on debug build break

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 xen/arch/powerpc/papr/xlate.c |   14 ++
 1 files changed, 6 insertions(+), 8 deletions(-)

diff -r b91cda0fb755 -r 77373497916f xen/arch/powerpc/papr/xlate.c
--- a/xen/arch/powerpc/papr/xlate.c Sun Oct 01 08:38:38 2006 -0400
+++ b/xen/arch/powerpc/papr/xlate.c Sun Oct 01 20:40:44 2006 -0400
@@ -378,7 +378,6 @@ static void h_protect(struct cpu_user_re
 
 static void h_clear_ref(struct cpu_user_regs *regs)
 {
-ulong flags = regs-gprs[4];
 ulong ptex = regs-gprs[5];
 struct vcpu *v = get_current();
 struct domain *d = v-domain;
@@ -387,13 +386,13 @@ static void h_clear_ref(struct cpu_user_
 union pte lpte;
 
 DBG_LOW(%s: flags: 0x%lx ptex: 0x%lx\n, __func__,
-flags, ptex);
+regs-gprs[4], ptex);
 
 #ifdef DEBUG
-if (flags != 0) {
+if (regs-gprs[4] != 0) {
 DBG(WARNING: %s: 
 flags are undefined and should be 0: 0x%lx\n,
-__func__, flags);
+__func__, regs-gprs[4]);
 }
 #endif
 
@@ -421,7 +420,6 @@ static void h_clear_ref(struct cpu_user_
 
 static void h_clear_mod(struct cpu_user_regs *regs)
 {
-ulong flags = regs-gprs[4];
 ulong ptex = regs-gprs[5];
 struct vcpu *v = get_current();
 struct domain *d = v-domain;
@@ -430,13 +428,13 @@ static void h_clear_mod(struct cpu_user_
 union pte lpte;
 
 DBG_LOW(%s: flags: 0x%lx ptex: 0x%lx\n, __func__,
-   flags, ptex);
+  regs-gprs[4], ptex);
 
 #ifdef DEBUG
-if (flags != 0) {
+if (regs-gprs[4] != 0) {
 DBG(WARNING: %s: 
 flags are undefined and should be 0: 0x%lx\n,
-__func__, flags);
+__func__, regs-gprs[4]);
 }
 #endif
 

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


[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] [XEN][POWERPC] Allow Xen to use RTAS if available

2006-09-28 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID c9bf3af5624b6186e665e6d8d783ff92a5b3afce
# Parent  2aa9a65408bc10594cd2488f6640574f5ea67549
[XEN][POWERPC] Allow Xen to use RTAS if available

If FW provides an RTAS layer, it will be instantiated and Xen will try
to use it for power control (halt, reboot, power-off, etc).  Xen will
also communicate to Dom0 (using /xen/power-control in the devtree)
when Xen cannot control power and it is hoped that the domain can,
especially useful for Maple boards running non-RTAS versions of PIBS.

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 xen/arch/powerpc/boot_of.c |  210 ++---
 xen/arch/powerpc/domain.c  |   17 ++
 xen/arch/powerpc/memory.c  |   26 +++-
 xen/arch/powerpc/ofd_fixup.c   |5 
 xen/arch/powerpc/rtas.c|   84 ++
 xen/arch/powerpc/rtas.h|   34 +
 xen/arch/powerpc/setup.c   |   15 +-
 xen/include/asm-powerpc/debugger.h |   10 +
 8 files changed, 321 insertions(+), 80 deletions(-)

diff -r 2aa9a65408bc -r c9bf3af5624b xen/arch/powerpc/boot_of.c
--- a/xen/arch/powerpc/boot_of.cTue Sep 26 14:01:11 2006 -0400
+++ b/xen/arch/powerpc/boot_of.cThu Sep 28 12:34:01 2006 -0400
@@ -32,6 +32,7 @@
 #include exceptions.h
 #include of-devtree.h
 #include oftree.h
+#include rtas.h
 
 /* Secondary processors use this for handshaking with main processor.  */
 volatile unsigned int __spin_ack;
@@ -68,7 +69,6 @@ static int bof_chosen;
 static int bof_chosen;
 
 static struct of_service s;
-extern s32 prom_call(void *arg, ulong rtas_base, ulong func, ulong msr);
 
 static int __init of_call(
 const char *service, u32 nargs, u32 nrets, s32 rets[], ...)
@@ -359,6 +359,14 @@ static int __init of_getparent(int ph)
 of_call(parent, 1, 1, rets, ph);
 
 DBG(getparent 0x%x - 0x%x\n, ph, rets[0]);
+return rets[0];
+}
+
+static int __init of_open(const char *devspec)
+{
+int rets[1] = { OF_FAILURE };
+
+of_call(open, 1, 1, rets, devspec);
 return rets[0];
 }
 
@@ -500,7 +508,8 @@ static int save_props(void *m, ofdn_t n,
 of_panic(obj array not big enough for 0x%x\n, sz);
 }
 actual = of_getprop(pkg, name, obj, sz);
-if (actual  sz) of_panic(obj too small);
+if (actual  sz)
+of_panic(obj too small);
 }
 
 if (strncmp(name, name_str, sizeof(name_str)) == 0) {
@@ -512,7 +521,8 @@ static int save_props(void *m, ofdn_t n,
 }
 
 pos = ofd_prop_add(m, n, name, obj, actual);
-if (pos == 0) of_panic(prop_create);
+if (pos == 0)
+of_panic(prop_create);
 }
 
 result = of_nextprop(pkg, name, name);
@@ -536,10 +546,12 @@ retry:
 
 if (pnext != 0) {
 sz = of_package_to_path(pnext, path, psz);
-if (sz == OF_FAILURE) of_panic(bad path\n);
+if (sz == OF_FAILURE)
+of_panic(bad path\n);
 
 nnext = ofd_node_child_create(m, n, path, sz);
-if (nnext == 0) of_panic(out of mem\n);
+if (nnext == 0)
+of_panic(out of mem\n);
 
 do_pkg(m, nnext, pnext, path, psz);
 }
@@ -551,7 +563,8 @@ retry:
 sz = of_package_to_path(pnext, path, psz);
 
 nnext = ofd_node_peer_create(m, n, path, sz);
-if (nnext = 0) of_panic(out of space in OFD tree.\n);
+if (nnext = 0)
+of_panic(out of space in OFD tree.\n);
 
 n = nnext;
 p = pnext;
@@ -570,7 +583,8 @@ static int pkg_save(void *mem)
 
 /* get root */
 root = of_getpeer(0);
-if (root == OF_FAILURE) of_panic(no root package\n);
+if (root == OF_FAILURE)
+of_panic(no root package\n);
 
 do_pkg(mem, OFD_ROOT, root, path, sizeof(path));
 
@@ -604,7 +618,8 @@ static int boot_of_fixup_refs(void *mem)
 char ofpath[256];
 
 path = ofd_node_path(mem, c);
-if (path == NULL) of_panic(no path to found prop: %s\n, name);
+if (path == NULL)
+of_panic(no path to found prop: %s\n, name);
 
 rp = of_finddevice(path);
 if (rp == OF_FAILURE)
@@ -629,13 +644,15 @@ static int boot_of_fixup_refs(void *mem)
  ref 0x%x\n, name, path, rp, ref);
 
 dp = ofd_node_find(mem, ofpath);
-if (dp = 0) of_panic(no ofd node for OF node[0x%x]: %s\n,
-  ref, ofpath);
+if (dp = 0)
+of_panic(no ofd node for OF node[0x%x]: %s\n,
+ ref, ofpath);
 
 ref = dp;
 
 upd = ofd_prop_add(mem, c, name, ref, sizeof(ref));
-if (upd = 0) of_panic(update failed: %s\n, name);
+if (upd = 0)
+of_panic(update failed: %s\n, name);
 
 #ifdef DEBUG
 of_printf(%s: %s/%s - %s\n, __func__,
@@ -658,7 

[XenPPC] [xenppc-unstable] [XEN][POWERPC] Fix compile error in gdbstub.c

2006-09-25 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID acfb1ac23f80286c8b532052f5e4b77f33612636
# Parent  0e83ba62a3a5c3b22ae99ebb6b6b7fe604ddb447
[XEN][POWERPC] Fix compile error in gdbstub.c

With crash_debug=y the compiler can't find a prototype for unimplemented(),
where gdb-arch-read_reg is calling it.

Signed-off-by: Amos Waterland [EMAIL PROTECTED]
---
 xen/arch/powerpc/gdbstub.c |1 +
 1 files changed, 1 insertion(+)

diff -r 0e83ba62a3a5 -r acfb1ac23f80 xen/arch/powerpc/gdbstub.c
--- a/xen/arch/powerpc/gdbstub.cFri Sep 22 11:51:56 2006 -0400
+++ b/xen/arch/powerpc/gdbstub.cMon Sep 25 11:19:55 2006 -0400
@@ -25,6 +25,7 @@
 #include asm/msr.h
 #include asm/bitops.h
 #include asm/cache.h
+#include asm/debugger.h
 #include asm/processor.h
 
 asm(.globl trap_instruction\n

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


[XenPPC] [xenppc-unstable] [XEN] __trap_to_gdb should return something different on failure

2006-09-22 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID e5b1f6154f3121ad3b4172de17f9618f1acc3e90
# Parent  e0bb62683805bc0dcd6ca5198b140f5910dbd358
[XEN] __trap_to_gdb should return something different on failure
This patch allows the caller to find out if the gdbstub actually did
anything.

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 xen/common/gdbstub.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff -r e0bb62683805 -r e5b1f6154f31 xen/common/gdbstub.c
--- a/xen/common/gdbstub.c  Fri Sep 22 11:02:47 2006 -0400
+++ b/xen/common/gdbstub.c  Fri Sep 22 11:08:12 2006 -0400
@@ -481,7 +481,7 @@ __trap_to_gdb(struct cpu_user_regs *regs
 if ( gdb_ctx-serhnd  0 )
 {
 dbg_printk(Debugger not ready yet.\n);
-return 0;
+return -1;
 }
 
 /* We rely on our caller to ensure we're only on one processor
@@ -500,7 +500,7 @@ __trap_to_gdb(struct cpu_user_regs *regs
 {
 printk(WARNING WARNING WARNING: Avoiding recursive gdb.\n);
 atomic_inc(gdb_ctx-running);
-return 0;
+return -1;
 }
 
 if ( !gdb_ctx-connected )

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


[XenPPC] [xenppc-unstable] [XEN][POWERPC] Machine check now inspects the SCOM for more information

2006-09-22 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID e0bb62683805bc0dcd6ca5198b140f5910dbd358
# Parent  f48cd49f4ee21fc44ef2fd85553c8c2008da8489
[XEN][POWERPC] Machine check now inspects the SCOM for more information

Also fixes suggested by [EMAIL PROTECTED]

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 xen/arch/powerpc/powerpc64/ppc970_machinecheck.c |7 +++
 xen/arch/powerpc/powerpc64/ppc970_scom.c |   41 ++-
 2 files changed, 25 insertions(+), 23 deletions(-)

diff -r f48cd49f4ee2 -r e0bb62683805 
xen/arch/powerpc/powerpc64/ppc970_machinecheck.c
--- a/xen/arch/powerpc/powerpc64/ppc970_machinecheck.c  Thu Sep 21 13:48:24 
2006 -0400
+++ b/xen/arch/powerpc/powerpc64/ppc970_machinecheck.c  Fri Sep 22 11:02:47 
2006 -0400
@@ -24,6 +24,8 @@
 #include public/xen.h
 #include asm/processor.h
 #include asm/percpu.h
+#include asm/debugger.h
+#include scom.h
 
 #define MCK_SRR1_INSN_FETCH_UNIT0x0020 /* 42 */
 #define MCK_SRR1_LOAD_STORE 0x0010 /* 43 */
@@ -54,6 +56,8 @@ int cpu_machinecheck(struct cpu_user_reg
 if (mck_cpu_stats[mfpir()] != 0)
 printk(While in CI IO\n);
 
+show_backtrace_regs(regs);
+
 printk(SRR1: 0x%016lx\n, regs-msr);
 if (regs-msr  MCK_SRR1_INSN_FETCH_UNIT)
 printk(42: Exception caused by Instruction Fetch Unit (IFU)\n
@@ -67,6 +71,7 @@ int cpu_machinecheck(struct cpu_user_reg
 case 0:
 printk(0b00: Likely caused by an asynchronous machine check,\n
  see SCOM Asynchronous Machine Check Register\n);
+cpu_scom_AMCR();
 break;
 case MCK_SRR1_CAUSE_SLB_PAR:
 printk(0b01: Exception caused by an SLB parity error detected\n
@@ -116,5 +121,5 @@ int cpu_machinecheck(struct cpu_user_reg
 dump_segments(0);
 }
 
-return 0; /* for now lets not recover; */
+return 0; /* for now lets not recover */
 }
diff -r f48cd49f4ee2 -r e0bb62683805 xen/arch/powerpc/powerpc64/ppc970_scom.c
--- a/xen/arch/powerpc/powerpc64/ppc970_scom.c  Thu Sep 21 13:48:24 2006 -0400
+++ b/xen/arch/powerpc/powerpc64/ppc970_scom.c  Fri Sep 22 11:02:47 2006 -0400
@@ -24,6 +24,7 @@
 #include xen/console.h
 #include xen/errno.h
 #include asm/delay.h
+#include scom.h
 
 #define SPRN_SCOMC 276
 #define SPRN_SCOMD 277
@@ -48,7 +49,7 @@ union scomc {
 };
 
 
-static inline int read_scom(uint addr, ulong *d)
+int cpu_scom_read(uint addr, ulong *d)
 {
 union scomc c;
 ulong flags;
@@ -56,9 +57,9 @@ static inline int read_scom(uint addr, u
 /* drop the low 8bits (including parity) */
 addr = 8;
 
-/* these give iface errors because the address is ambiguous after
- * the above bit dropping */
-BUG_ON(addr == 0x8000);
+/* these give iface errors because the addresses are not software
+ * accessible */
+BUG_ON(addr  0x8000);
 
 for (;;) {
 c.word = 0;
@@ -100,7 +101,7 @@ static inline int read_scom(uint addr, u
 }
 }
 
-static inline int write_scom(uint addr, ulong d)
+int cpu_scom_write(uint addr, ulong d)
 {
 union scomc c;
 ulong flags;
@@ -108,9 +109,9 @@ static inline int write_scom(uint addr, 
 /* drop the low 8bits (including parity) */
 addr = 8;
 
-/* these give iface errors because the address is ambiguous after
- * the above bit dropping */
-BUG_ON(addr == 0x8000);
+/* these give iface errors because the addresses are not software
+ * accessible */
+BUG_ON(addr  0x8000);
 
 for (;;) {
 c.word = 0;
@@ -150,25 +151,21 @@ static inline int write_scom(uint addr, 
 }
 }
 
-/* SCOMC addresses are 16bit but we are given 24 bits in the
- * books. The low oerder 8 bits are some kinda parity thin and should
- * be ignored */
-#define SCOM_AMCS_REG  0x022601
-#define SCOM_AMCS_AND_MASK 0x022700
-#define SCOM_AMCS_OR_MASK  0x022800
-#define SCOM_CMCE  0x030901
-#define SCOM_PMCR  0x400801
-#define SCOM_PTSR  0x408001
-
-/* cannot access these since only top 16bits are considered */
-#define SCOM_STATUS0x83
-
 void cpu_scom_init(void)
 {
 ulong val;
 console_start_sync();
-if (!read_scom(SCOM_PTSR, val))
+if (!cpu_scom_read(SCOM_PTSR, val))
 printk(SCOM PTSR: 0x%016lx\n, val);
 
 console_end_sync();
 }
+
+void cpu_scom_AMCR(void)
+{
+ulong val;
+
+cpu_scom_read(SCOM_AMC_REG, val);
+printk(SCOM AMCR: 0x%016lx\n, val);
+}
+

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


[XenPPC] [xenppc-unstable] attempt to adjust thread priority is futile and meaningless

2006-09-22 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID f48cd49f4ee21fc44ef2fd85553c8c2008da8489
# Parent  bcb5998a0abc50a36cb800b843ce343952cccb66
attempt to adjust thread priority is futile and meaningless
---
 xen/include/asm-powerpc/delay.h |1 -
 1 files changed, 1 deletion(-)

diff -r bcb5998a0abc -r f48cd49f4ee2 xen/include/asm-powerpc/delay.h
--- a/xen/include/asm-powerpc/delay.h   Thu Sep 21 07:37:00 2006 -0400
+++ b/xen/include/asm-powerpc/delay.h   Thu Sep 21 13:48:24 2006 -0400
@@ -34,7 +34,6 @@ static inline void udelay(unsigned long 
 
 s = get_timebase();
 do {
-asm volatile(or 1,1,1); /* also puts the thread to low priority */
 e = get_timebase();
 } while ((e-s)  ticks);
 }

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


[XenPPC] [xenppc-unstable] [XEN][POWERPC] Clean up debug/traceback/trapping logic

2006-09-22 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID 04ed07cd741a27041e52c810e5e0ca66b80ef157
# Parent  e5b1f6154f3121ad3b4172de17f9618f1acc3e90
[XEN][POWERPC] Clean up debug/traceback/trapping logic

This patch tries to sort out all the debugging mechanisms we have
available to us.

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 xen/include/asm-powerpc/misc.h |   33 -
 xen/arch/powerpc/backtrace.c   |   22 ++
 xen/arch/powerpc/exceptions.c  |   34 +
 xen/arch/powerpc/mm.c  |1 
 xen/arch/powerpc/powerpc64/ppc970.c|1 
 xen/arch/powerpc/powerpc64/scom.h  |   39 +
 xen/arch/powerpc/powerpc64/traps.c |4 --
 xen/arch/powerpc/setup.c   |2 -
 xen/arch/powerpc/smp.c |2 -
 xen/arch/powerpc/time.c|2 -
 xen/arch/powerpc/usercopy.c|1 
 xen/include/asm-powerpc/debugger.h |   45 -
 xen/include/asm-powerpc/flushtlb.h |1 
 xen/include/asm-powerpc/mm.h   |1 
 xen/include/asm-powerpc/page.h |1 
 xen/include/asm-powerpc/powerpc64/config.h |7 
 xen/include/asm-powerpc/processor.h|   10 --
 17 files changed, 108 insertions(+), 98 deletions(-)

diff -r e5b1f6154f31 -r 04ed07cd741a xen/arch/powerpc/backtrace.c
--- a/xen/arch/powerpc/backtrace.c  Fri Sep 22 11:08:12 2006 -0400
+++ b/xen/arch/powerpc/backtrace.c  Fri Sep 22 11:10:28 2006 -0400
@@ -14,6 +14,7 @@
 #include xen/console.h
 #include xen/sched.h
 #include xen/symbols.h
+#include asm/debugger.h
 
 static char namebuf[KSYM_NAME_LEN+1];
 
@@ -192,6 +193,19 @@ void show_backtrace(ulong sp, ulong lr, 
 console_end_sync();
 }
 
+void show_backtrace_regs(struct cpu_user_regs *regs)
+{
+console_start_sync();
+
+show_registers(regs);
+printk(dar 0x%016lx, dsisr 0x%08x\n, mfdar(), mfdsisr());
+printk(hid4 0x%016lx\n, regs-hid4);
+printk(---[ backtrace ]---\n);
+show_backtrace(regs-gprs[1], regs-lr, regs-pc);
+
+console_end_sync();
+}
+
 void __warn(char *file, int line)
 {
 ulong sp;
@@ -202,9 +216,7 @@ void __warn(char *file, int line)
 
 sp = (ulong)__builtin_frame_address(0);
 lr = (ulong)__builtin_return_address(0);
-
 backtrace(sp, lr, lr);
-console_end_sync();
-}
-
-
+
+console_end_sync();
+}
diff -r e5b1f6154f31 -r 04ed07cd741a xen/arch/powerpc/exceptions.c
--- a/xen/arch/powerpc/exceptions.c Fri Sep 22 11:08:12 2006 -0400
+++ b/xen/arch/powerpc/exceptions.c Fri Sep 22 11:10:28 2006 -0400
@@ -25,8 +25,10 @@
 #include xen/serial.h
 #include xen/gdbstub.h
 #include xen/console.h
+#include xen/shutdown.h
 #include asm/time.h
 #include asm/processor.h
+#include asm/debugger.h
 
 #undef DEBUG
 
@@ -56,25 +58,19 @@ void do_dec(struct cpu_user_regs *regs)
 
 void program_exception(struct cpu_user_regs *regs, unsigned long cookie)
 {
+if (cookie == 0x200) {
+if (cpu_machinecheck(regs))
+return;
+
+printk(%s: machine check\n, __func__);
+} else {
 #ifdef CRASH_DEBUG
-__trap_to_gdb(regs, cookie);
-#else /* CRASH_DEBUG */
-int recover = 0;
+if (__trap_to_gdb(regs, cookie) == 0)
+return;
+#endif /* CRASH_DEBUG */
 
-console_start_sync();
-
-show_registers(regs);
-printk(dar 0x%016lx, dsisr 0x%08x\n, mfdar(), mfdsisr());
-printk(hid4 0x%016lx\n, regs-hid4);
-printk(---[ backtrace ]---\n);
-show_backtrace(regs-gprs[1], regs-lr, regs-pc);
-
-if (cookie == 0x200)
-recover = cpu_machinecheck(regs);
-
-if (!recover)
-panic(%s: 0x%lx\n, __func__, cookie);
-
-console_end_sync();
-#endif /* CRASH_DEBUG */
+printk(%s: type: 0x%lx\n, __func__, cookie);
+show_backtrace_regs(regs);
+}
+machine_halt();
 }
diff -r e5b1f6154f31 -r 04ed07cd741a xen/arch/powerpc/mm.c
--- a/xen/arch/powerpc/mm.c Fri Sep 22 11:08:12 2006 -0400
+++ b/xen/arch/powerpc/mm.c Fri Sep 22 11:10:28 2006 -0400
@@ -25,7 +25,6 @@
 #include xen/kernel.h
 #include xen/sched.h
 #include xen/perfc.h
-#include asm/misc.h
 #include asm/init.h
 #include asm/page.h
 
diff -r e5b1f6154f31 -r 04ed07cd741a xen/arch/powerpc/powerpc64/ppc970.c
--- a/xen/arch/powerpc/powerpc64/ppc970.c   Fri Sep 22 11:08:12 2006 -0400
+++ b/xen/arch/powerpc/powerpc64/ppc970.c   Fri Sep 22 11:10:28 2006 -0400
@@ -30,6 +30,7 @@
 #include asm/powerpc64/procarea.h
 #include asm/powerpc64/processor.h
 #include asm/powerpc64/ppc970-hid.h
+#include scom.h
 
 #undef DEBUG
 #undef SERIALIZE
diff -r e5b1f6154f31 -r 04ed07cd741a xen/arch/powerpc/powerpc64/traps.c
--- a/xen/arch/powerpc/powerpc64/traps.cFri Sep 22 11:08:12 2006 -0400
+++ b/xen/arch/powerpc/powerpc64/traps.cFri Sep 22 11:10:28 2006 -0400
@@ -48,7 +48,3 @@ void show_registers(struct 

[XenPPC] [xenppc-unstable] [XEN][POWERPC] Be a little smarter with unimplemented()

2006-09-22 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID 0e83ba62a3a5c3b22ae99ebb6b6b7fe604ddb447
# Parent  04ed07cd741a27041e52c810e5e0ca66b80ef157
[XEN][POWERPC] Be a little smarter with unimplemented()

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 xen/arch/powerpc/smp.c |   16 +++-
 xen/arch/powerpc/time.c|1 -
 xen/include/asm-powerpc/debugger.h |8 +++-
 3 files changed, 18 insertions(+), 7 deletions(-)

diff -r 04ed07cd741a -r 0e83ba62a3a5 xen/arch/powerpc/smp.c
--- a/xen/arch/powerpc/smp.cFri Sep 22 11:10:28 2006 -0400
+++ b/xen/arch/powerpc/smp.cFri Sep 22 11:51:56 2006 -0400
@@ -32,16 +32,21 @@ void __flush_tlb_mask(cpumask_t mask, un
 unimplemented();
 }
 
-void smp_send_event_check_mask(cpumask_t cpu_mask)
+void smp_send_event_check_mask(cpumask_t mask)
 {
-unimplemented();
+cpu_clear(smp_processor_id(), mask);
+if (!cpus_empty(mask))
+unimplemented();
 }
 
-int smp_call_function(void (*func) (void *info), void *info, int unused,
+
+int smp_call_function(void (*func) (void *info), void *info, int retry,
 int wait)
 {
-unimplemented();
-return 0;
+cpumask_t allbutself = cpu_online_map;
+cpu_clear(smp_processor_id(), allbutself);
+
+return on_selected_cpus(allbutself, func, info, retry, wait);
 }
 
 void smp_send_stop(void)
@@ -56,5 +61,6 @@ int on_selected_cpus(
 int retry,
 int wait)
 {
+unimplemented();
 return 0;
 }
diff -r 04ed07cd741a -r 0e83ba62a3a5 xen/arch/powerpc/time.c
--- a/xen/arch/powerpc/time.c   Fri Sep 22 11:10:28 2006 -0400
+++ b/xen/arch/powerpc/time.c   Fri Sep 22 11:51:56 2006 -0400
@@ -93,5 +93,4 @@ void do_settime(unsigned long secs, unsi
 
 void update_vcpu_system_time(struct vcpu *v)
 {
-unimplemented();
 }
diff -r 04ed07cd741a -r 0e83ba62a3a5 xen/include/asm-powerpc/debugger.h
--- a/xen/include/asm-powerpc/debugger.hFri Sep 22 11:10:28 2006 -0400
+++ b/xen/include/asm-powerpc/debugger.hFri Sep 22 11:51:56 2006 -0400
@@ -41,6 +41,13 @@ static inline void debugger_trap_immedia
 __builtin_trap();
 }
 
+static inline void unimplemented(void)
+{
+#ifdef VERBOSE
+dump_execution_state();
+#endif
+}
+
 static inline void show_execution_state(struct cpu_user_regs *regs)
 {
 show_registers(regs);
@@ -49,7 +56,6 @@ extern void __warn(char *file, int line)
 extern void __warn(char *file, int line);
 #define WARN() __warn(__FILE__, __LINE__)
 #define WARN_ON(_p) do { if (_p) WARN(); } while ( 0 )
-#define unimplemented() WARN()
 
 #define FORCE_CRASH() debugger_trap_immediate()
 

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


[XenPPC] [xenppc-unstable] [XEN][POWERPC] Fully inline udelay()

2006-09-21 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID bcb5998a0abc50a36cb800b843ce343952cccb66
# Parent  e22cbd2ea1e4720b7853e4b05a4a9cdda2bff348
[XEN][POWERPC] Fully inline udelay()

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 xen/arch/powerpc/delay.c|   37 -
 xen/arch/powerpc/Makefile   |1 -
 xen/include/asm-powerpc/delay.h |   17 +++--
 3 files changed, 15 insertions(+), 40 deletions(-)

diff -r e22cbd2ea1e4 -r bcb5998a0abc xen/arch/powerpc/Makefile
--- a/xen/arch/powerpc/Makefile Thu Sep 21 07:36:17 2006 -0400
+++ b/xen/arch/powerpc/Makefile Thu Sep 21 07:37:00 2006 -0400
@@ -12,7 +12,6 @@ obj-y += dart.o
 obj-y += dart.o
 obj-y += dart_u3.o
 obj-y += dart_u4.o
-obj-y += delay.o
 obj-y += domctl.o
 obj-y += domain_build.o
 obj-y += domain.o
diff -r e22cbd2ea1e4 -r bcb5998a0abc xen/include/asm-powerpc/delay.h
--- a/xen/include/asm-powerpc/delay.h   Thu Sep 21 07:36:17 2006 -0400
+++ b/xen/include/asm-powerpc/delay.h   Thu Sep 21 07:37:00 2006 -0400
@@ -13,16 +13,29 @@
  * along with this program; if not, write to the Free Software
  * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  *
- * Copyright (C) IBM Corp. 2005
+ * Copyright (C) IBM Corp. 2005, 2006
  *
  * Authors: Hollis Blanchard [EMAIL PROTECTED]
+ *  Jimi Xenidis [EMAIL PROTECTED]
  */
 
 #ifndef _ASM_DELAY_H_
 #define _ASM_DELAY_H_
 
+#include asm/time.h
+
 extern unsigned long ticks_per_usec; 
 #define __udelay udelay
-extern void udelay(unsigned long usecs);
+static inline void udelay(unsigned long usecs)
+{
+unsigned long ticks = usecs * ticks_per_usec;
+unsigned long s;
+unsigned long e;
 
+s = get_timebase();
+do {
+asm volatile(or 1,1,1); /* also puts the thread to low priority */
+e = get_timebase();
+} while ((e-s)  ticks);
+}
 #endif
diff -r e22cbd2ea1e4 -r bcb5998a0abc xen/arch/powerpc/delay.c
--- a/xen/arch/powerpc/delay.c  Thu Sep 21 07:36:17 2006 -0400
+++ /dev/null   Thu Jan 01 00:00:00 1970 +
@@ -1,37 +0,0 @@
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- * Copyright (C) IBM Corp. 2005
- *
- * Authors: Jimi Xenidis [EMAIL PROTECTED]
- */
-
-#include xen/config.h
-#include xen/delay.h
-#include xen/time.h
-#include asm/processor.h
-
-void udelay(unsigned long usecs)
-{
-ulong ticks = usecs * ticks_per_usec;
-ulong s;
-ulong e;
-
-s = get_timebase();
-do {
-asm volatile(or 1,1,1); /* also puts the thread to low priority */
-e = get_timebase();
-} while ((e-s)  ticks);
-}

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


[XenPPC] [xenppc-unstable] [POWERPC][TOOLS] flatdevtree requires us to reserve the ramdisk

2006-09-16 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID 7a20fed8be73857abe33d308ed27099efbff4a3c
# Parent  1d9c135673e4db41789d730d843c9e5f8de3a4eb
[POWERPC][TOOLS] flatdevtree requires us to reserve the ramdisk

The following patch solves the DomU:
  Freeing initrd memory: 3137k freed
  Bad page state in process 'swapper'

error message that was cause by not reserving the memory in the
flattened device tree.

We have to pre-reserve these entries when we create the tree in
FlatDeviceTree.py and fix it later because there appears to be no way
to add a reservation in libxc.

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 tools/libxc/powerpc64/xc_linux_build.c  |8 +++-
 tools/python/xen/xend/FlatDeviceTree.py |8 +++-
 2 files changed, 14 insertions(+), 2 deletions(-)

diff -r 1d9c135673e4 -r 7a20fed8be73 tools/libxc/powerpc64/xc_linux_build.c
--- a/tools/libxc/powerpc64/xc_linux_build.cFri Sep 15 18:20:55 2006 -0400
+++ b/tools/libxc/powerpc64/xc_linux_build.cSat Sep 16 09:34:26 2006 -0400
@@ -208,6 +208,12 @@ static int load_devtree(
 return rc;
 }
 
+rc = ft_set_rsvmap(devtree, 1, initrd_base, initrd_len);
+if (rc  0) {
+DPRINTF(couldn't set initrd reservation\n);
+return ~0UL;
+}
+
 /* start-info (XXX being removed soon) */
 rc = ft_set_prop(devtree, xen, start-info,
 start_info, sizeof(start_info));
@@ -379,7 +385,7 @@ static unsigned long create_start_info(v
 
 rc = ft_set_rsvmap(devtree, 0, si_addr, 4*PAGE_SIZE);
 if (rc  0) {
-DPRINTF(couldn't set first reservation\n);
+DPRINTF(couldn't set start_info reservation\n);
 return ~0UL;
 }
 
diff -r 1d9c135673e4 -r 7a20fed8be73 tools/python/xen/xend/FlatDeviceTree.py
--- a/tools/python/xen/xend/FlatDeviceTree.py   Fri Sep 15 18:20:55 2006 -0400
+++ b/tools/python/xen/xend/FlatDeviceTree.py   Sat Sep 16 09:34:26 2006 -0400
@@ -271,8 +271,14 @@ def build(imghandler):
 the host's device tree.'''
 root = Tree()
 
-# 4 pages: start_info, console, store, shared_info
+# 1st reseravtion entry used for start_info, console, store, shared_info
 root.reserve(0x3ffc000, 0x4000)
+
+# 2nd reservation enrty used for initrd, later on when we load the
+# initrd we may fill this in with zeroes which signifies the end
+# of the reservation map.  So as to avoid adding a zero map now we
+# put some bogus yet sensible numbers here.
+root.reserve(0x100, 0x1000)
 
 root.addprop('device_type', 'chrp-but-not-really\0')
 root.addprop('#size-cells', 2)

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


[XenPPC] [xenppc-unstable] [POWERPC][TOOLS] add the ability to replace an entry in the ft rsvmap

2006-09-15 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID d0faa25f5d3af8d4b0c97f3482d95dad2db1dec1
# Parent  4490f6744b286d62fec3d0792ba5a44db114153b
[POWERPC][TOOLS] add the ability to replace an entry in the ft rsvmap

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 tools/libxc/powerpc64/flatdevtree.c |   23 +++
 tools/libxc/powerpc64/flatdevtree.h |1 +
 2 files changed, 24 insertions(+)

diff -r 4490f6744b28 -r d0faa25f5d3a tools/libxc/powerpc64/flatdevtree.c
--- a/tools/libxc/powerpc64/flatdevtree.c   Thu Sep 14 22:06:15 2006 -0400
+++ b/tools/libxc/powerpc64/flatdevtree.c   Fri Sep 15 12:55:14 2006 -0400
@@ -220,6 +220,29 @@ void ft_add_rsvmap(struct ft_cxt *cxt, u
cxt-p_anchor = cxt-pres + 16; /* over the terminator */
 }
 
+int ft_set_rsvmap(void *bphp, int m, u64 physaddr, u64 size)
+{
+   const struct boot_param_header *bph = bphp;
+   u64 *p_rsvmap = (u64 *)
+   ((char *)bph + be32_to_cpu(bph-off_mem_rsvmap));
+   u32 i;
+
+   for (i = 0;; i++) {
+   u64 addr, sz;
+
+   addr = be64_to_cpu(p_rsvmap[i * 2]);
+   sz = be64_to_cpu(p_rsvmap[i * 2 + 1]);
+   if (addr == 0  size == 0)
+   break;
+   if (m == i) {
+   p_rsvmap[i * 2] = cpu_to_be64(physaddr);
+   p_rsvmap[i * 2 + 1] = cpu_to_be64(size);
+   return 0;
+   }
+   }
+   return -1;
+}
+
 void ft_begin_tree(struct ft_cxt *cxt)
 {
cxt-p_begin = cxt-p_anchor;
diff -r 4490f6744b28 -r d0faa25f5d3a tools/libxc/powerpc64/flatdevtree.h
--- a/tools/libxc/powerpc64/flatdevtree.h   Thu Sep 14 22:06:15 2006 -0400
+++ b/tools/libxc/powerpc64/flatdevtree.h   Fri Sep 15 12:55:14 2006 -0400
@@ -66,6 +66,7 @@ void ft_prop_int(struct ft_cxt *cxt, con
 void ft_prop_int(struct ft_cxt *cxt, const char *name, unsigned int val);
 void ft_begin(struct ft_cxt *cxt, void *blob, unsigned int max_size);
 void ft_add_rsvmap(struct ft_cxt *cxt, u64 physaddr, u64 size);
+int ft_set_rsvmap(void *bphp, int m, u64 physaddr, u64 size);
 
 void ft_dump_blob(const void *bphp);
 void ft_merge_blob(struct ft_cxt *cxt, void *blob);

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


[XenPPC] [xenppc-unstable] [POWERPC][TOOLS] Update the reservation map for the start_info page

2006-09-15 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID 5979ad294b645d828ad3069cfed65c33b5292610
# Parent  d0faa25f5d3af8d4b0c97f3482d95dad2db1dec1
[POWERPC][TOOLS] Update the reservation map for the start_info page

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 tools/libxc/powerpc64/xc_linux_build.c |   16 
 1 files changed, 16 insertions(+)

diff -r d0faa25f5d3a -r 5979ad294b64 tools/libxc/powerpc64/xc_linux_build.c
--- a/tools/libxc/powerpc64/xc_linux_build.cFri Sep 15 12:55:14 2006 -0400
+++ b/tools/libxc/powerpc64/xc_linux_build.cFri Sep 15 12:56:21 2006 -0400
@@ -218,6 +218,15 @@ static int load_devtree(
 
 header = devtree;
 devtree_size = header-totalsize;
+{
+static const char dtb[] = /tmp/xc_domU.dtb;
+int dfd = creat(dtb, 0666);
+if (dfd != -1) {
+write(dfd, devtree, devtree_size);
+close(dfd);
+} else
+DPRINTF(could not open(\%s\)\n, dtb);
+}
 
 DPRINTF(copying device tree to 0x%lx[0x%x]\n, DEVTREE_ADDR, 
devtree_size);
 return install_image(xc_handle, domid, page_array, devtree, DEVTREE_ADDR,
@@ -368,6 +377,13 @@ static unsigned long create_start_info(v
 si-console.domU.evtchn = console_evtchn;
 si_addr = rma_top - 4*PAGE_SIZE;
 
+rc = ft_set_rsvmap(devtree, 0, si_addr, 4*PAGE_SIZE);
+if (rc  0) {
+DPRINTF(couldn't set first reservation\n);
+return ~0UL;
+}
+
+
 return si_addr;
 }
 

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


[XenPPC] [xenppc-unstable] [POWERPC][TOOLS] Allow the setting of the RMA size from XM scripts

2006-09-15 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID 88f394c082fc543e7826b880ac5b9694b3b94559
# Parent  5979ad294b645d828ad3069cfed65c33b5292610
[POWERPC][TOOLS] Allow the setting of the RMA size from XM scripts

This patch add a new XM variable called powerpc_rma_log with is
the log2 size of Real Mode Area for a guest.

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 tools/python/xen/xend/FlatDeviceTree.py |2 +-
 tools/python/xen/xend/XendDomainInfo.py |   16 +---
 tools/python/xen/xm/create.py   |6 +-
 3 files changed, 19 insertions(+), 5 deletions(-)

diff -r 5979ad294b64 -r 88f394c082fc tools/python/xen/xend/FlatDeviceTree.py
--- a/tools/python/xen/xend/FlatDeviceTree.py   Fri Sep 15 12:56:21 2006 -0400
+++ b/tools/python/xen/xend/FlatDeviceTree.py   Fri Sep 15 13:03:27 2006 -0400
@@ -290,7 +290,7 @@ def build(imghandler):
 
 # add memory nodes
 totalmem = imghandler.vm.getMemoryTarget() * 1024
-rma_log = imghandler.vm.info.get('rma_log')
+rma_log = imghandler.vm.info.get('powerpc_rma_log')
 rma_bytes = 1  rma_log
 
 # RMA node
diff -r 5979ad294b64 -r 88f394c082fc tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Fri Sep 15 12:56:21 2006 -0400
+++ b/tools/python/xen/xend/XendDomainInfo.py   Fri Sep 15 13:03:27 2006 -0400
@@ -132,6 +132,7 @@ ROUNDTRIPPING_CONFIG_ENTRIES = [
 ('vcpu_avail',  int),
 ('cpu_weight',  float),
 ('memory',  int),
+('powerpc_rma_log', int),
 ('shadow_memory',   int),
 ('maxmem',  int),
 ('bootloader',  str),
@@ -152,6 +153,7 @@ VM_STORE_ENTRIES = [
 ('vcpus', int),
 ('vcpu_avail',int),
 ('memory',int),
+('powerpc_rma_log',   int),
 ('shadow_memory', int),
 ('maxmem',int),
 ('start_time',float),
@@ -575,6 +577,7 @@ class XendDomainInfo:
 defaultInfo('vcpu_avail',   lambda: (1  self.info['vcpus']) - 1)
 
 defaultInfo('memory',   lambda: 0)
+defaultInfo('powerpc_rma_log',  lambda: 0)
 defaultInfo('shadow_memory', lambda: 0)
 defaultInfo('maxmem',   lambda: 0)
 defaultInfo('bootloader',   lambda: None)
@@ -1755,9 +1758,16 @@ class XendDomainInfoPPC(XendDomainInfo):
 shadow_cur = xc.shadow_mem_control(self.domid, shadow_mb)
 self.info['shadow_memory'] = shadow_cur
 
-# use smallest RMA size available
-rma_log = self.getRealModeLogs()[0]
-self.info['rma_log'] = rma_log # store info for FlatDeviceTree
+rma_log = self.info['powerpc_rma_log']
+if rma_log == 0:
+# use smallest RMA size available
+rma_log = self.getRealModeLogs()[0]
+
+if rma_log not in self.getRealModeLogs():
+raise ValueError(rma_log(%d) must be one of % rma_log,
+ self.getRealModeLogs())
+
+self.info['powerpc_rma_log'] = rma_log # store info for FlatDeviceTree
 
 rma_kb = (1  rma_log) / 1024
 if mem_kb  rma_kb:
diff -r 5979ad294b64 -r 88f394c082fc tools/python/xen/xm/create.py
--- a/tools/python/xen/xm/create.py Fri Sep 15 12:56:21 2006 -0400
+++ b/tools/python/xen/xm/create.py Fri Sep 15 13:03:27 2006 -0400
@@ -157,6 +157,10 @@ gopts.var('maxmem', val='MEMORY',
 gopts.var('maxmem', val='MEMORY',
   fn=set_int, default=None,
   use=Maximum domain memory in MB.)
+
+gopts.var('powerpc_rma_log', val='MEMORY',
+  fn=set_int, default=0,
+  use=Log2 size of the PowerPC Real Mode Area.)
 
 gopts.var('shadow_memory', val='MEMORY',
   fn=set_int, default=0,
@@ -672,7 +676,7 @@ def make_config(vals):
 
 map(add_conf, ['name', 'memory', 'maxmem', 'shadow_memory',
'restart', 'on_poweroff', 'on_reboot', 'on_crash',
-   'vcpus', 'features'])
+   'vcpus', 'features', 'powerpc_rma_log'])
 
 if vals.uuid is not None:
 config.append(['uuid', vals.uuid])

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


[XenPPC] [xenppc-unstable] [POWERPC][XEN] Better explane the larx/stcx issue with interrupts

2006-09-14 Thread Xen patchbot-xenppc-unstable
# HG changeset patch
# User Jimi Xenidis [EMAIL PROTECTED]
# Node ID 25442712f4cb2de72b1dd9dbdb471942c84ceca3
# Parent  1d50658481071d73564b4d722e3d3199104c481a
[POWERPC][XEN] Better explane the larx/stcx issue with interrupts

Signed-off-by: Jimi Xenidis [EMAIL PROTECTED]
---
 xen/arch/powerpc/powerpc64/exceptions.S |6 +-
 1 files changed, 5 insertions(+), 1 deletion(-)

diff -r 1d5065848107 -r 25442712f4cb xen/arch/powerpc/powerpc64/exceptions.S
--- a/xen/arch/powerpc/powerpc64/exceptions.S   Thu Sep 14 01:41:13 2006 -0400
+++ b/xen/arch/powerpc/powerpc64/exceptions.S   Thu Sep 14 10:17:23 2006 -0400
@@ -118,7 +118,11 @@ 1:
 mfspr r0, SPRN_HSPRG1
 std r0, UREGS_r13(r1)   /* save R13 from HSPRG1 */
 
-/* Blow away any reservation according to 970 errata after saving CR */
+/* Only _one_ larx is allowed at a time.  Any future use will be
+ * rejected until the earlier one (if any) completes.  Since we
+ * may have interrupted a larx in the Domain, or Xen we need to
+ * clear any larx that may currently exist.  We could probably
+ * skip which for hcalls */
 ldx r0, 0, r1
 stdcx. r0, 0, r1
 

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


  1   2   >