[XenPPC] [xenppc-unstable] [POWERPC] workaround for broken claim is insufficient
# HG changeset patch # User Jimi Xenidis [EMAIL PROTECTED] # Node ID 7855f2e8074882ae27ac2e2a700124bcc3f9c579 # Parent d16b31d3998a29adeea7bb6f892636181ae6eaf4 [POWERPC] workaround for broken claim is insufficient Ifdef'ed out so we can revisit, maybe. Also add a check to make sure we allocated enough for the devtree. Signed-off-by: Jimi Xenidis [EMAIL PROTECTED] --- xen/arch/powerpc/boot_of.c | 34 +++--- 1 files changed, 23 insertions(+), 11 deletions(-) diff -r d16b31d3998a -r 7855f2e80748 xen/arch/powerpc/boot_of.c --- a/xen/arch/powerpc/boot_of.cThu Aug 17 19:03:06 2006 -0400 +++ b/xen/arch/powerpc/boot_of.cThu Aug 17 20:38:08 2006 -0400 @@ -685,7 +685,6 @@ static int boot_of_fixup_chosen(void *me } static ulong space_base; -static int broken_claim; /* * The following function is necessary because we cannot depend on all @@ -706,14 +705,20 @@ static ulong find_space(u32 size, u32 al if (align == 0) of_panic(cannot call %s() with align of 0\n, __func__); -if (!broken_claim) { -/* just try and claim it to the FW chosen address */ -base = of_claim(0, size, align); -if (base != OF_FAILURE) -return base; -of_printf(%s: Firmware does not allocate memory for you\n, __func__); -broken_claim = 1; -} +#ifdef BROKEN_CLAIM_WORKAROUND +{ +static int broken_claim; +if (!broken_claim) { +/* just try and claim it to the FW chosen address */ +base = of_claim(0, size, align); +if (base != OF_FAILURE) +return base; +of_printf(%s: Firmware does not allocate memory for you\n, + __func__); +broken_claim = 1; +} +} +#endif of_printf(%s base=0x%016lx eomem=0x%016lx size=0x%08x align=0x%x\n, __func__, space_base, eomem, size, align); @@ -915,15 +920,22 @@ static void boot_of_module(ulong r3, ulo /* snapshot the tree */ oftree = (void*)find_space(oftree_sz, PAGE_SIZE, mbi); -if (oftree == 0) of_panic(Could not allocate OFD tree\n); +if (oftree == 0) +of_panic(Could not allocate OFD tree\n); of_printf(creating oftree\n); of_test(package-to-path); -ofd_create(oftree, oftree_sz); +oftree = ofd_create(oftree, oftree_sz); pkg_save(oftree); + +if (ofd_size(oftree) oftree_sz) + of_panic(Could not fit all of native devtree\n); boot_of_fixup_refs(oftree); boot_of_fixup_chosen(oftree); + +if (ofd_size(oftree) oftree_sz) + of_panic(Could not fit all devtree fixups\n); ofd_walk(oftree, OFD_ROOT, /* add_hype_props */ NULL, 2); ___ Xen-ppc-devel mailing list Xen-ppc-devel@lists.xensource.com http://lists.xensource.com/xen-ppc-devel
[XenPPC] [xenppc-unstable] [POWERPC] Boot Module freeing
# HG changeset patch # User Jimi Xenidis [EMAIL PROTECTED] # Node ID bcba998e95575602fe3953bdc5ee19bc383740bc # Parent b10e48a5d1e3b8a14619f52a09851f20769a46cc [POWERPC] Boot Module freeing - Fix bad logic that frees the modules anyway. - Allow for the absence of a Dom0 to continue exectution until its time to load it, usefull for debugging bringup code. Signed-off-by: Jimi Xenidis [EMAIL PROTECTED] --- xen/arch/powerpc/domain_build.c |5 + xen/arch/powerpc/setup.c|7 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff -r b10e48a5d1e3 -r bcba998e9557 xen/arch/powerpc/domain_build.c --- a/xen/arch/powerpc/domain_build.c Fri Aug 18 05:17:14 2006 -0400 +++ b/xen/arch/powerpc/domain_build.c Fri Aug 18 05:39:01 2006 -0400 @@ -118,13 +118,18 @@ int construct_dom0(struct domain *d, 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); memset(dsi, 0, sizeof(struct domain_setup_info)); dsi.image_addr = image_start; dsi.image_len = image_len; +printk(Trying Dom0 as 64bit ELF\n); if ((rc = parseelfimage(dsi)) != 0) { +printk(Trying Dom0 as 32bit ELF\n); if ((rc = parseelfimage_32(dsi)) != 0) return rc; am64 = 0; diff -r b10e48a5d1e3 -r bcba998e9557 xen/arch/powerpc/setup.c --- a/xen/arch/powerpc/setup.c Fri Aug 18 05:17:14 2006 -0400 +++ b/xen/arch/powerpc/setup.c Fri Aug 18 05:39:01 2006 -0400 @@ -326,6 +326,9 @@ static void __init __start_xen(multiboot for (i = 0; i mbi-mods_count; 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 @@ -337,7 +340,9 @@ static void __init __start_xen(multiboot if (s freemem) panic(module addresses must assend\n); -freemem = free_xenheap(freemem, s); +free_xenheap(freemem, s); +freemem = ALIGN_UP(mod[i].mod_end, PAGE_SIZE); + } /* the rest of the xenheap, starting at the end of modules */ ___ Xen-ppc-devel mailing list Xen-ppc-devel@lists.xensource.com http://lists.xensource.com/xen-ppc-devel
[XenPPC] [xenppc-unstable] [POWERPC] remove test lines that snuck in
# HG changeset patch # User Jimi Xenidis [EMAIL PROTECTED] # Node ID 0af18fd083ed3d09784a7b2b86517557cf91b73d # Parent 7855f2e8074882ae27ac2e2a700124bcc3f9c579 [POWERPC] remove test lines that snuck in --- xen/arch/powerpc/setup.c |2 -- 1 files changed, 2 deletions(-) diff -r 7855f2e80748 -r 0af18fd083ed xen/arch/powerpc/setup.c --- a/xen/arch/powerpc/setup.c Thu Aug 17 20:38:08 2006 -0400 +++ b/xen/arch/powerpc/setup.c Fri Aug 18 05:00:37 2006 -0400 @@ -44,8 +44,6 @@ #include exceptions.h #include of-devtree.h -DEFINE_PER_CPU(ulong, pcpu_var); - #define DEBUG unsigned long xenheap_phys_end; ___ Xen-ppc-devel mailing list Xen-ppc-devel@lists.xensource.com http://lists.xensource.com/xen-ppc-devel
[XenPPC] [xenppc-unstable] [POWERPC] Enable gcc -Wshadow and fix the warnings
# HG changeset patch # User Jimi Xenidis [EMAIL PROTECTED] # Node ID b10e48a5d1e3b8a14619f52a09851f20769a46cc # Parent 0af18fd083ed3d09784a7b2b86517557cf91b73d [POWERPC] Enable gcc -Wshadow and fix the warnings As sugested by: Amos Waterland [EMAIL PROTECTED] Signed-off-by: Jimi Xenidis [EMAIL PROTECTED] --- xen/arch/powerpc/Makefile|1 + xen/arch/powerpc/mpic.c |6 +++--- xen/arch/powerpc/ofd_fixup.c |4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff -r 0af18fd083ed -r b10e48a5d1e3 xen/arch/powerpc/Makefile --- a/xen/arch/powerpc/Makefile Fri Aug 18 05:00:37 2006 -0400 +++ b/xen/arch/powerpc/Makefile Fri Aug 18 05:17:14 2006 -0400 @@ -47,6 +47,7 @@ obj-y += elf32.o # These are extra warnings like for the arch/ppc directory but may not # allow the rest of the tree to build. PPC_C_WARNINGS += -Wundef -Wmissing-prototypes -Wmissing-declarations +PPC_C_WARNINGS += -Wshadow CFLAGS += $(PPC_C_WARNINGS) LINK=0x40 diff -r 0af18fd083ed -r b10e48a5d1e3 xen/arch/powerpc/mpic.c --- a/xen/arch/powerpc/mpic.c Fri Aug 18 05:00:37 2006 -0400 +++ b/xen/arch/powerpc/mpic.c Fri Aug 18 05:17:14 2006 -0400 @@ -498,10 +498,10 @@ static void mpic_enable_irq(unsigned int #ifdef CONFIG_MPIC_BROKEN_U3 if (mpic-flags MPIC_BROKEN_U3) { - unsigned int src = irq - mpic-irq_offset; - if (mpic_is_ht_interrupt(mpic, src) + unsigned int bsrc = irq - mpic-irq_offset; + if (mpic_is_ht_interrupt(mpic, bsrc) (irq_desc[irq].status IRQ_LEVEL)) - mpic_ht_end_irq(mpic, src); + mpic_ht_end_irq(mpic, bsrc); } #endif /* CONFIG_MPIC_BROKEN_U3 */ } diff -r 0af18fd083ed -r b10e48a5d1e3 xen/arch/powerpc/ofd_fixup.c --- a/xen/arch/powerpc/ofd_fixup.c Fri Aug 18 05:00:37 2006 -0400 +++ b/xen/arch/powerpc/ofd_fixup.c Fri Aug 18 05:17:14 2006 -0400 @@ -497,8 +497,8 @@ int ofd_dom0_fixup(struct domain *d, ulo r = ofd_prop_add(m, n, ibm,partition-no, did, sizeof(did)); ASSERT( r 0 ); -const char dom0[] = dom0; -r = ofd_prop_add(m, n, ibm,partition-name, dom0, sizeof (dom0)); +const char d0[] = dom0; +r = ofd_prop_add(m, n, ibm,partition-name, d0, sizeof (d0)); ASSERT( r 0 ); ___ Xen-ppc-devel mailing list Xen-ppc-devel@lists.xensource.com http://lists.xensource.com/xen-ppc-devel
Re: [Xen-devel] Re: [XenPPC] Xencomm for xen/ia64
On Fri, 2006-08-18 at 11:04 +0200, Tristan Gingold wrote: Le Jeudi 17 Août 2006 20:35, Hollis Blanchard a écrit : If we agree on using xencomm we will have to work with xen/ppc people in order not to duplicate the code. Hopefully it is rather small. I have enhanced the xencomm code so that the kernel may not use xencomm area but pass the guest physical address with a flag to know the space is linear in memory. At this time I can boot dom0 with xencomm. I will publish the patch later. I'll be very interested to see your patch. I guess the flag is a reserved bit in the (physical) address passed from kernel to hypervisor? Yes. Does that really gain much performance? I don't think performance will be decreased. But it simplifies hcall.c a lot! I'm not sure how it simplifies hcall.c. You always need to create xencomm descriptors, unless you're manually guaranteeing that the dom0_op structures do not cross page boundaries (in which case they are not linear in memory). Is that what you're doing? Using xencomm_create (and __get_free_page) is tricky: it doesn't work all the time and at least it doesn't work very early duing kernel boot. Using xencomm_create_mini is possible but rather heavy. Heavy meaning what? It adds almost no CPU overhead (just checking for crossing page boundaries), and the stack space used is 64 bytes. The only reason it's not the preferred API is that a) it's a little cumbersome to use (in that the caller must manually allocate stack space), and b) it handles only up to two pages worth of data. I guess you will need to do the same thing we need to with privcmd ioctl handling, i.e. copy and modify the pointers in the dom0_op data structures passed to the kernel. :( Yes. hcall.c *has* to be shared between ppc and ia64. We need to do one more thing though: we *also* need to change fix up the size of longs and pointers in our code (since 32-bit userland is passing structures to a 64-bit kernel). So perhaps these two fixup passes could be split: we could share the xencomm conversion in common code, and PPC arch code could contain the size munging. Are structure sizes different on 32 and 64 bits ? Yes, in particular longs and pointers. -- Hollis Blanchard IBM Linux Technology Center ___ Xen-ppc-devel mailing list Xen-ppc-devel@lists.xensource.com http://lists.xensource.com/xen-ppc-devel
[XenPPC] Xencomm on ia64 - The patches
Hi, these are the patches to port xencomm on ia64. This is just an RFC. I have to clean-up the code so that it could be shared between ia64 and ppc. I have added the xencomm_inline feature which makes (IMHO) hcall.c more readable and safer (particularly at boot time). Wether or not xencomm_mini should be deprecated is a question for ppc people (xencomm_mini is buggy: the area should be reserved as an array of struct xencomm_mini for alignment). I have also fixed a few bugs in guest_access.h Many files should be shared between ia64 and ppc. In xen: * guest_access.h should be the same. I will propose to put as include/xen/xencomm_access.h * usercopy.c sould be shared too. The paddr_to_maddr() function should be defined in arch files as xencomm_paddr_to_maddr. I will propose to put this file into xen/common/xencomm.c In linux: * drivers/xen/core/xencomm.c should be shared. We just need to agree on xen_pa(). On linux-ia64, __pa() doesn't work for this use. asm/xencomm.h should define this macro/function. * hcall.c should be shared because it is the biggest and the most boring file. This won't be that easy, but it will try to made a proposal soon. Tristan. diff -r 8c6bb45901e7 linux-2.6-xen-sparse/arch/ia64/Kconfig --- a/linux-2.6-xen-sparse/arch/ia64/Kconfig Wed Aug 16 14:28:57 2006 -0600 +++ b/linux-2.6-xen-sparse/arch/ia64/Kconfig Fri Aug 18 14:26:09 2006 +0200 @@ -530,6 +530,9 @@ config XEN_REBOOT config XEN_SMPBOOT default n + +config XEN_XENCOMM + default y endif source drivers/xen/Kconfig diff -r 8c6bb45901e7 linux-2.6-xen-sparse/arch/ia64/kernel/setup.c --- a/linux-2.6-xen-sparse/arch/ia64/kernel/setup.c Wed Aug 16 14:28:57 2006 -0600 +++ b/linux-2.6-xen-sparse/arch/ia64/kernel/setup.c Fri Aug 18 14:26:09 2006 +0200 @@ -433,6 +433,9 @@ setup_arch (char **cmdline_p) #ifdef CONFIG_XEN if (is_running_on_xen()) { + extern unsigned long kernel_start_pa; + + kernel_start_pa = KERNEL_START - ia64_tpa (KERNEL_START); setup_xen_features(); /* Register a call for panic conditions. */ notifier_chain_register(panic_notifier_list, xen_panic_block); diff -r 8c6bb45901e7 linux-2.6-xen-sparse/arch/ia64/xen/Makefile --- a/linux-2.6-xen-sparse/arch/ia64/xen/Makefile Wed Aug 16 14:28:57 2006 -0600 +++ b/linux-2.6-xen-sparse/arch/ia64/xen/Makefile Fri Aug 18 14:26:09 2006 +0200 @@ -3,6 +3,6 @@ # obj-y := hypercall.o xenivt.o xenentry.o xensetup.o xenpal.o xenhpski.o \ - hypervisor.o pci-dma-xen.o util.o + hypervisor.o pci-dma-xen.o util.o hcall.o pci-dma-xen-y := ../../i386/kernel/pci-dma-xen.o diff -r 8c6bb45901e7 linux-2.6-xen-sparse/arch/ia64/xen/hypervisor.c --- a/linux-2.6-xen-sparse/arch/ia64/xen/hypervisor.c Wed Aug 16 14:28:57 2006 -0600 +++ b/linux-2.6-xen-sparse/arch/ia64/xen/hypervisor.c Fri Aug 18 14:26:09 2006 +0200 @@ -371,8 +371,6 @@ int int HYPERVISOR_grant_table_op(unsigned int cmd, void *uop, unsigned int count) { - __u64 va1, va2, pa1, pa2; - if (cmd == GNTTABOP_map_grant_ref) { unsigned int i; for (i = 0; i count; i++) { @@ -380,29 +378,7 @@ HYPERVISOR_grant_table_op(unsigned int c (struct gnttab_map_grant_ref*)uop + i); } } - va1 = (__u64)uop PAGE_MASK; - pa1 = pa2 = 0; - if ((REGION_NUMBER(va1) == 5) - ((va1 - KERNEL_START) = KERNEL_TR_PAGE_SIZE)) { - pa1 = ia64_tpa(va1); - if (cmd = GNTTABOP_transfer) { - static uint32_t uop_size[GNTTABOP_transfer + 1] = { -sizeof(struct gnttab_map_grant_ref), -sizeof(struct gnttab_unmap_grant_ref), -sizeof(struct gnttab_setup_table), -sizeof(struct gnttab_dump_table), -sizeof(struct gnttab_transfer), - }; - va2 = (__u64)uop + (uop_size[cmd] * count) - 1; - va2 = PAGE_MASK; - if (va1 != va2) { -/* maximum size of uop is 2pages */ -BUG_ON(va2 va1 + PAGE_SIZE); -pa2 = ia64_tpa(va2); - } - } - } - return HYPERVISOR_grant_table_op(cmd, uop, count, pa1, pa2); + return HYPERVISOR_grant_table_op(cmd, uop, count); } EXPORT_SYMBOL(HYPERVISOR_grant_table_op); diff -r 8c6bb45901e7 linux-2.6-xen-sparse/drivers/xen/Kconfig --- a/linux-2.6-xen-sparse/drivers/xen/Kconfig Wed Aug 16 14:28:57 2006 -0600 +++ b/linux-2.6-xen-sparse/drivers/xen/Kconfig Fri Aug 18 14:26:09 2006 +0200 @@ -257,4 +257,7 @@ config XEN_SMPBOOT default y depends on SMP +config XEN_XENCOMM + bool + default n endif diff -r 8c6bb45901e7 linux-2.6-xen-sparse/drivers/xen/core/Makefile --- a/linux-2.6-xen-sparse/drivers/xen/core/Makefile Wed Aug 16 14:28:57 2006 -0600 +++ b/linux-2.6-xen-sparse/drivers/xen/core/Makefile Fri Aug 18 14:26:09 2006 +0200 @@ -11,3 +11,4 @@ obj-$(CONFIG_XEN_SKBUFF) += skbuff.o obj-$(CONFIG_XEN_SKBUFF) += skbuff.o obj-$(CONFIG_XEN_REBOOT) += reboot.o obj-$(CONFIG_XEN_SMPBOOT) += smpboot.o +obj-$(CONFIG_XEN_XENCOMM) += xencomm.o diff -r 8c6bb45901e7 linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c --- a/linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c Wed Aug 16 14:28:57 2006 -0600 +++
[XenPPC] [xenppc-unstable] [POWERPC][TOOLS] sync with start_info_t changes
# HG changeset patch # User Jimi Xenidis [EMAIL PROTECTED] # Node ID 4b028786b67e720e8b36b2d9dda0184a09b1f661 # Parent 66cd49a0e239c4ba20a493b8743e712dcaae0391 [POWERPC][TOOLS] sync with start_info_t changes Signed-off-by: Jimi Xenidis [EMAIL PROTECTED] --- tools/libxc/powerpc64/xc_linux_build.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff -r 66cd49a0e239 -r 4b028786b67e tools/libxc/powerpc64/xc_linux_build.c --- a/tools/libxc/powerpc64/xc_linux_build.cFri Aug 18 13:30:01 2006 -0400 +++ b/tools/libxc/powerpc64/xc_linux_build.cFri Aug 18 14:06:02 2006 -0400 @@ -349,7 +349,7 @@ static unsigned long create_start_info(s si-store_evtchn = store_evtchn; si-console.domU.mfn = si-nr_pages - 3; si-console.domU.evtchn = console_evtchn; -si_addr = eomem - (PAGE_SIZE * 4); +si_addr = si-nr_pages - 4; return si_addr; } @@ -435,7 +435,7 @@ int xc_linux_build(int xc_handle, /* start_info stuff: about to be removed */ si_addr = create_start_info(si, console_evtchn, store_evtchn, nr_pages); -*console_mfn = page_array[si.console_mfn]; +*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))) { ___ Xen-ppc-devel mailing list Xen-ppc-devel@lists.xensource.com http://lists.xensource.com/xen-ppc-devel
[XenPPC] [xenppc-unstable] [POWERPC] add missing vga components
# HG changeset patch # User Jimi Xenidis [EMAIL PROTECTED] # Node ID 227c65d72a657360a8373eeffaa602ee8a3cee8f # Parent 4b028786b67e720e8b36b2d9dda0184a09b1f661 [POWERPC] add missing vga components --- xen/arch/powerpc/setup.c |1 + xen/include/asm-powerpc/io.h |2 ++ 2 files changed, 3 insertions(+) diff -r 4b028786b67e -r 227c65d72a65 xen/arch/powerpc/setup.c --- a/xen/arch/powerpc/setup.c Fri Aug 18 14:06:02 2006 -0400 +++ b/xen/arch/powerpc/setup.c Fri Aug 18 14:06:58 2006 -0400 @@ -67,6 +67,7 @@ cpumask_t cpu_online_map; /* missing ifd cpumask_t cpu_online_map; /* missing ifdef in schedule.c */ /* XXX get this from ISA node in device tree */ +void *vgabase; ulong isa_io_base; struct ns16550_defaults ns16550; diff -r 4b028786b67e -r 227c65d72a65 xen/include/asm-powerpc/io.h --- a/xen/include/asm-powerpc/io.h Fri Aug 18 14:06:02 2006 -0400 +++ b/xen/include/asm-powerpc/io.h Fri Aug 18 14:06:58 2006 -0400 @@ -40,6 +40,8 @@ extern ulong isa_io_base; #define readb(port) in_8((void *)(port)) #define writeb(val, port) out_8((void *)(port), val) +extern char *vgabase; +#define vga_writeb(val, port) out_8((void *)((ulong)(port) + vgabase), val) extern u8 in_8(const volatile u8 *addr); extern void out_8(volatile u8 *addr, int val); ___ Xen-ppc-devel mailing list Xen-ppc-devel@lists.xensource.com http://lists.xensource.com/xen-ppc-devel
[XenPPC] breakage
domain building does not work do not update.. I'll fix it ASAP -JX ___ Xen-ppc-devel mailing list Xen-ppc-devel@lists.xensource.com http://lists.xensource.com/xen-ppc-devel
[XenPPC] [PATCH] Init secondary processors up to assigning r13 (respin)
Respin because the -Wshadow portion went in today. Re-tested on systemsim-gpul with up to four simulated processors, Maple-D with two processors, JS20 with two processors, and JS21 with four processors. This patch brings the secondary processors up to the point where they have a per-processor structure pointer in r13, at which point they just enter a spinloop. If you test it, you should see two additional pieces of output on your console: spinning up secondary processor #1: ping = 0x: pong = 0x1 spinning up secondary processor #2: ping = 0x: pong = 0x2 spinning up secondary processor #3: ping = 0x: pong = 0x3 (XEN) CPU #1: Hello World! SP = 1fe60 TOC = 757e78 HID0 = 5111818000 (XEN) CPU #2: Hello World! SP = 1be60 TOC = 757e78 HID0 = 5111818000 (XEN) CPU #3: Hello World! SP = 79fe60 TOC = 757e78 HID0 = 5111818000 I think this patch is a candidate for merging. I will submit a patch next for smp_processor_id, and then one for making the secondary processors join the idle domain, but I would like to have any necessary discussion about this portion first. Signed-off-by: Amos Waterland [EMAIL PROTECTED] --- arch/powerpc/boot_of.c | 53 +--- arch/powerpc/powerpc64/exceptions.S | 31 + arch/powerpc/powerpc64/ppc970.c | 22 -- arch/powerpc/setup.c| 52 ++- include/asm-powerpc/config.h|2 - include/asm-powerpc/current.h |2 - include/asm-powerpc/processor.h |2 - 7 files changed, 147 insertions(+), 17 deletions(-) diff -r 539a1e666982 xen/arch/powerpc/boot_of.c --- a/xen/arch/powerpc/boot_of.cFri Aug 18 14:07:50 2006 -0400 +++ b/xen/arch/powerpc/boot_of.cFri Aug 18 14:55:34 2006 -0400 @@ -31,6 +31,9 @@ #include asm/io.h #include exceptions.h #include of-devtree.h + +/* Secondary processors use this for handshaking with main processor. */ +volatile unsigned int __spin_ack; static ulong of_vec; static ulong of_msr; @@ -955,7 +958,7 @@ static int __init boot_of_cpus(void) static int __init boot_of_cpus(void) { int cpus; -int cpu; +int cpu, bootcpu; int result; u32 cpu_clock[2]; @@ -980,10 +983,53 @@ static int __init boot_of_cpus(void) cpu_khz /= 1000; of_printf(OF: clock-frequency = %ld KHz\n, cpu_khz); -/* FIXME: should not depend on the boot CPU bring the first child */ +/* Look up which CPU we are running on right now. */ +result = of_getprop(bof_chosen, cpu, bootcpu, sizeof (bootcpu)); +if (result == OF_FAILURE) +of_panic(Failed to look up boot cpu\n); + cpu = of_getpeer(cpu); while (cpu 0) { -of_start_cpu(cpu, (ulong)spin_start, 0); +unsigned int cpuid, ping, pong; +unsigned long now, then, timeout; + +if (cpu == bootcpu) { +of_printf(skipping boot cpu!\n); +continue; +} + +result = of_getprop(cpu, reg, cpuid, sizeof(cpuid)); +if (result == OF_FAILURE) +of_panic(cpuid lookup failed\n); + +of_printf(spinning up secondary processor #%d: , cpuid); + +__spin_ack = ~0x0; +ping = __spin_ack; +pong = __spin_ack; +of_printf(ping = 0x%x: , ping); + +mb(); +result = of_start_cpu(cpu, (ulong)spin_start, cpuid); +if (result == OF_FAILURE) +of_panic(start cpu failed\n); + +/* We will give the secondary processor five seconds to reply. */ +then = mftb(); +timeout = then + (5 * timebase_freq); + +do { +now = mftb(); +if (now = timeout) { +of_printf(BROKEN: ); +break; +} + +mb(); +pong = __spin_ack; +} while (pong == ping); +of_printf(pong = 0x%x\n, pong); + cpu = of_getpeer(cpu); } return 1; @@ -1031,6 +1077,7 @@ multiboot_info_t __init *boot_of_init( boot_of_rtas(); /* end of OF */ +of_printf(Quiescing Open Firmware ...\n); of_call(quiesce, 0, 0, NULL); return mbi; diff -r 539a1e666982 xen/arch/powerpc/powerpc64/exceptions.S --- a/xen/arch/powerpc/powerpc64/exceptions.S Fri Aug 18 14:07:50 2006 -0400 +++ b/xen/arch/powerpc/powerpc64/exceptions.S Fri Aug 18 04:21:12 2006 -0400 @@ -514,6 +514,37 @@ _GLOBAL(sleep) mtmsrd r3 blr +/* The primary processor issues a firmware call to spin us up at this + * address, passing our CPU number in r3. We only need a function + * entry point instead of a descriptor since this is never called from + * C code. + */ .globl spin_start spin_start: +/* Write our processor number as an acknowledgment that we're alive. */ +LOADADDR(r14, __spin_ack) +stw r3, 0(r14) +sync +/* Find our index in the array of processor_area struct pointers. */ +LOADADDR(r14, global_cpu_table) +
Re: [XenPPC] xm and xend use
On Fri, 2006-08-18 at 15:47 -0400, Maria Butrico wrote: Are there debug option of any sort for these two? debug build options? Debug messages are logged to /var/log/xend.log and /var/log/xend-debug.log. PS: Send more memory, anytime. Do you mean xend is slow? If so, I heartily agree. It's amazing how fast the domctrl tool is, by comparison... -- Hollis Blanchard IBM Linux Technology Center ___ Xen-ppc-devel mailing list Xen-ppc-devel@lists.xensource.com http://lists.xensource.com/xen-ppc-devel