Re: [XenPPC] Xen and firmware RTAS
On Dec 6, 2006, at 4:28 PM, Yoder Stuart-B08248 wrote: Is Xen/PPC is reliant on any OF/RTAS services being resident. Doing a quick grep of the code turns up what looks to be calls to initialize the rtas, and calls to rtas halt and reboot functions. We instantiate RTAS only for IBM JS2x because there is no public specification available on how to perform halt and reboot directly on these machines. For this reason the FW (SLOF) provides us with RTAS methods for performing this task. Newer JS21s will soon have devtree entries so we can access the IPMI logic on these boards, when that happens we will probably cease to use RTAS for these operations and use IPMI. So really we consider RTAS as a last resort. Do you know if Xen relies in any other way on services being available by resident firmware? Xen does _not_ rely on RTAS, but it _can_ use it if it needs to. Another example where we would have to use RTAS more is if we ported to a PPC platform that did not publish the IO host-bridge specification but abstracts it using RTAS, in that case we would not only use but, but we would actually have to virtualize it as well. -JX ___ Xen-ppc-devel mailing list Xen-ppc-devel@lists.xensource.com http://lists.xensource.com/xen-ppc-devel
[XenPPC] [RFC] 'xm restore' following boot
'xm restore' immediately following boot usually wedges the cpu. However, xm save followed by xm restore works fine (even when guest domain and htab are relocated to new memory areas). ^AAA shows: with .plpar_hcall_norets @ c003af78 and .HYPERVISOR_sched_op @ c004415c (XEN) *** Dumping CPU3 state: *** (XEN) [ Xen-3.0-unstable ] (XEN) CPU: 0003 DOMID: 0001 (XEN) pc c003af88 msr 80009032 (XEN) lr c0044210 ctr c0044238 (XEN) srr0 srr1 (XEN) r00: 2448 c065bcb0 c0656630 (XEN) r04: 0001 2442 c000fc24 (XEN) r08: ecf515a8 c0044238 00989680 c00441a4 (XEN) r12: 01a9f9f8 c052e300 (XEN) r16: (XEN) r20: (XEN) r24: 4000 c000 (XEN) r28: 0010 c053d3c8 0001 (XEN) reprogram_timer[00] Timeout in the past 0x004332DBA479 > 0x0042C2424DF3 Here are typical console with debug prints and execptions: If 'xm restore' is run several times, often it will start working, though the exceptions still occur... (user domain has ramdisk & networking) At the bottom, some code specified by a couple Exceptions... 1. 'xm restore' following xm save: cso84:~ # xm console 6 mfdec: -12 TIMEBASE_FREQ: 71592390 Here we're resuming hid4: 0x62001242 arch_gnttab_map: grant table at d8008000 irq_resume() switch_idle_mm() mfdec: 14315899 __sti() xencons_resume() xenbus_resume() smp_resume() mfdec: 63024 returning netfront: device eth0 has copying receive path. [EMAIL PROTECTED] /]# 2. reboot with 'xm restore' that worked 1st time: cso84:~ # xm console 1 mfdec: -14 TIMEBASE_FREQ: 71592390 Here we're resuming hid4: 0x60001241 arch_gnttab_map: grant table at d8008000 irq_resume() switch_idle_mm() mfdec: 14315924 __sti() xencons_resume() xenbus_resume() BUG: soft lockup detected on CPU#0! Call Trace: [C065B090] [C001062C] .show_stack+0x50/0x1cc (unreliable) [C065B140] [C008956C] .softlockup_tick+0x100/0x128 [C065B200] [C0065BC0] .run_local_timers+0x1c/0x30 [C065B280] [C0023C60] .timer_interrupt+0x108/0x4f0 [C065B3B0] [C00034EC] decrementer_common+0xec/0x100 --- Exception: 901 at .handle_IRQ_event+0x4c/0x13c LR = .__do_IRQ+0x1ac/0x2b4 [C065B6A0] [C05AB7B0] 0xc05ab7b0 (unreliable) [C065B740] [C0089FC8] .__do_IRQ+0x1ac/0x2b4 [C065B800] [C02B7134] .evtchn_do_upcall+0x128/0x1a4 [C065B8C0] [C0043664] .xen_get_irq+0x10/0x28 [C065B940] [C000BD7C] .do_IRQ+0x7c/0x100 [C065B9C0] [C00041EC] hardware_interrupt_entry+0xc/0x10 --- Exception: 501 at .plpar_hcall_norets+0x10/0x1c LR = .HYPERVISOR_sched_op+0xb4/0x10c [C065BCB0] [C00BDA74] .kmem_cache_free+0xe4/0x2f4 (unreliable) [C065BD60] [C00455CC] .xen_power_save+0x80/0x98 [C065BDE0] [C00120E4] .cpu_idle+0x14c/0x154 [C065BE70] [C0009174] .rest_init+0x44/0x5c [C065BEF0] [C04E58D8] .start_kernel+0x2a0/0x308 [C065BF90] [C00084FC] .start_here_common+0x50/0x54 smp_resume() mfdec: 90178 returning netfront: device eth0 has copying receive path. [EMAIL PROTECTED] /]# 3. reboot with typical wedge: cso84:~ # xm console 1 mfdec: -12 TIMEBASE_FREQ: 71592390 Here we're resuming hid4: 0x60001241 arch_gnttab_map: grant table at d8008000 irq_resume() switch_idle_mm() mfdec: 14315903 __sti() xencons_resume() xenbus_resume() smp_resume() mfdec: 14218880 returning BUG: soft lockup detected on CPU#0! Call Trace: [C065B090] [C001062C] .show_stack+0x50/0x1cc (unreliable) [C065B140] [C008956C] .softlockup_tick+0x100/0x128 [C065B200] [C0065BC0] .run_local_timers+0x1c/0x30 [C065B280] [C0023C60] .timer_interrupt+0x108/0x4f0 [C065B3B0] [C00034EC] decrementer_common+0xec/0x100 --- Exception: 901 at .handle_IRQ_event+0x4c/0x13c LR = .__do_IRQ+0x1ac/0x2b4 [C065B6A0] [C05AB7B0] 0xc05ab7b0 (unreliable) [C065B740] [C0089FC8] .__do_IRQ+0x1ac/0x2b4 [C065B800] [C02B7134] .evtchn_do_upcall+0x128/0x1a4 [C065B8C0] [C0043664] .xen_get_irq+0x10/0x28 [C065B940] [C000BD7C] .do_IRQ+0x7c/0x100 [C065B9C0] [C00041EC] hardware_interrupt_entry+0xc/0x10 --- Exception: 501 at .plpar_hcall_norets+0x10/0x1c LR = .HYPERVISOR_sched_op+0xb4/0x10c [C065BCB0] [C00BDA74] .kmem_cache_free+
[XenPPC] Xen and firmware RTAS
Is Xen/PPC is reliant on any OF/RTAS services being resident. Doing a quick grep of the code turns up what looks to be calls to initialize the rtas, and calls to rtas halt and reboot functions. Do you know if Xen relies in any other way on services being available by resident firmware? Thanks, Stuart Yoder ___ Xen-ppc-devel mailing list Xen-ppc-devel@lists.xensource.com http://lists.xensource.com/xen-ppc-devel
Re: [XenPPC] [PATCH] Change to add boot param delimiter " || "
Thanks Hollis for the feedback. Added changes. Signed-off-by: Jerone Young <[EMAIL PROTECTED]> diff -r 9148f7816d00 xen/arch/powerpc/boot_of.c --- a/xen/arch/powerpc/boot_of.cTue Oct 24 19:11:00 2006 -0400 +++ b/xen/arch/powerpc/boot_of.cWed Dec 06 13:59:37 2006 -0600 @@ -964,10 +964,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; @@ -1020,11 +1021,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 || is delimiter */ +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); } On Wed, 2006-12-06 at 13:41 -0600, Hollis Blanchard wrote: > On Wed, 2006-12-06 at 11:37 -0600, Jerone Young wrote: > > Update patch with Jimi's suggestions: > > > > Signed-off-by: Jerone Young <[EMAIL PROTECTED]> > > > > diff -r 9148f7816d00 xen/arch/powerpc/boot_of.c > > --- a/xen/arch/powerpc/boot_of.cTue Oct 24 19:11:00 2006 -0400 > > +++ b/xen/arch/powerpc/boot_of.cWed Dec 06 11:34:37 2006 -0600 > > @@ -964,10 +964,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 = 0; > > extern char dom0_start[] __attribute__ ((weak)); > > extern char dom0_size[] __attribute__ ((weak)); > > -const char *p; > > +const char *p = NULL; > > int mod; > > void *oft; > > > > @@ -1020,11 +1021,17 @@ 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 deliminator -- or || is delimator */ > > "delimiter" > > > +for(sepr_index; sepr_index < ARRAY_SIZE(sepr); sepr_index++){ > > Add a space after "for", and move the "sepr_index = 0" initialization > here please. > > > +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); > > } > > You've removed the code where we terminate Xen's arguments with a NULL > char. > > Fix these issues and I'm quite happy with it. > > -- > Hollis Blanchard > IBM Linux Technology Center > ___ Xen-ppc-devel mailing list Xen-ppc-devel@lists.xensource.com http://lists.xensource.com/xen-ppc-devel
Re: [XenPPC] [PATCH] Change to add boot param delimiter " || "
On Wed, 2006-12-06 at 11:37 -0600, Jerone Young wrote: > Update patch with Jimi's suggestions: > > Signed-off-by: Jerone Young <[EMAIL PROTECTED]> > > diff -r 9148f7816d00 xen/arch/powerpc/boot_of.c > --- a/xen/arch/powerpc/boot_of.cTue Oct 24 19:11:00 2006 -0400 > +++ b/xen/arch/powerpc/boot_of.cWed Dec 06 11:34:37 2006 -0600 > @@ -964,10 +964,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 = 0; > extern char dom0_start[] __attribute__ ((weak)); > extern char dom0_size[] __attribute__ ((weak)); > -const char *p; > +const char *p = NULL; > int mod; > void *oft; > > @@ -1020,11 +1021,17 @@ 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 deliminator -- or || is delimator */ "delimiter" > +for(sepr_index; sepr_index < ARRAY_SIZE(sepr); sepr_index++){ Add a space after "for", and move the "sepr_index = 0" initialization here please. > +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); > } You've removed the code where we terminate Xen's arguments with a NULL char. Fix these issues and I'm quite happy with it. -- 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] xend and routes
We have several JS21, all with two ethernet interfaces, both interfaces in use.For example this is what things look like when we boot one such blade with the latest xen and linux for xen and before starting xend. cso89:~ # ifconfig ifconfig eth0 Link encap:Ethernet HWaddr 00:11:25:C9:4D:5A inet addr:192.168.4.9 Bcast:192.168.255.255 Mask:255.255.0.0 UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU:1500 Metric:1 RX packets:15436 errors:0 dropped:0 overruns:0 frame:0 TX packets:679 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:1084295 (1.0 Mb) TX bytes:62108 (60.6 Kb) Interrupt:17 eth1 Link encap:Ethernet HWaddr 00:11:25:C9:4D:5B inet addr:9.2.78.89 Bcast:9.2.78.255 Mask:255.255.255.0 UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU:1500 Metric:1 RX packets:14899 errors:0 dropped:0 overruns:0 frame:0 TX packets:1514 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:1076900 (1.0 Mb) TX bytes:171946 (167.9 Kb) Interrupt:18 loLink encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:22 errors:0 dropped:0 overruns:0 frame:0 TX packets:22 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:1480 (1.4 Kb) TX bytes:1480 (1.4 Kb) This is what the routing tables look like. cso89:~ # netstat -rn netstat -rn Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Iface 9.2.78.00.0.0.0 255.255.255.0 U 0 0 0 eth1 169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0 192.168.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0 127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo 0.0.0.0 9.2.78.10.0.0.0 UG0 0 0 eth1 Notice that the machine name, cso89 corresponds to ip address 9.2.78.89 and is on eth1. Notice also that there is a default route from the machine, the last one, in the table above. After we start xend this is the network interface table. cso89:~ # ifconfig ifconfig eth0 Link encap:Ethernet HWaddr 00:11:25:C9:4D:5A inet addr:192.168.4.9 Bcast:192.168.255.255 Mask:255.255.0.0 UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU:1500 Metric:1 RX packets:18 errors:0 dropped:0 overruns:0 frame:0 TX packets:2 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:1333 (1.3 Kb) TX bytes:650 (650.0 b) eth1 Link encap:Ethernet HWaddr 00:11:25:C9:4D:5B inet addr:9.2.78.89 Bcast:9.2.78.255 Mask:255.255.255.0 UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU:1500 Metric:1 RX packets:15102 errors:0 dropped:0 overruns:0 frame:0 TX packets:1605 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:1090820 (1.0 Mb) TX bytes:190036 (185.5 Kb) Interrupt:18 loLink encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:22 errors:0 dropped:0 overruns:0 frame:0 TX packets:22 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:1480 (1.4 Kb) TX bytes:1480 (1.4 Kb) peth0 Link encap:Ethernet HWaddr FE:FF:FF:FF:FF:FF UP BROADCAST RUNNING NOARP MTU:1500 Metric:1 RX packets:19 errors:0 dropped:0 overruns:0 frame:0 TX packets:3 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:1541 (1.5 Kb) TX bytes:748 (748.0 b) Interrupt:17 vif0.1Link encap:Ethernet HWaddr FE:FF:FF:FF:FF:FF UP BROADCAST RUNNING NOARP MTU:1500 Metric:1 RX packets:2 errors:0 dropped:0 overruns:0 frame:0 TX packets:18 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:650 (650.0 b) TX bytes:1333 (1.3 Kb) xenbr1Link encap:Ethernet HWaddr FE:FF:FF:FF:FF:FF UP BROADCAST RUNNING NOARP MTU:1500 Metric:1 RX packets:19 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:1348 (1.3 Kb) TX bytes:0 (0.0 b) This is as expected. However notice what happened to our routing tables. cso89:~ # netstat -rn netstat -rn Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Iface 9.2.78.10.0.0.0 255.255.255.255 UH0 0 0 eth0 9.2.78.00.0.0.0 255.255.255.0 U 0 0 0 eth1 169.254.0.0 0.0.0.0 255.255.0.0 U
Re: [XenPPC] [PATCH] Change to add boot param delimiter " || "
Update patch with Jimi's suggestions: Signed-off-by: Jerone Young <[EMAIL PROTECTED]> diff -r 9148f7816d00 xen/arch/powerpc/boot_of.c --- a/xen/arch/powerpc/boot_of.cTue Oct 24 19:11:00 2006 -0400 +++ b/xen/arch/powerpc/boot_of.cWed Dec 06 11:34:37 2006 -0600 @@ -964,10 +964,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 = 0; extern char dom0_start[] __attribute__ ((weak)); extern char dom0_size[] __attribute__ ((weak)); -const char *p; +const char *p = NULL; int mod; void *oft; @@ -1020,11 +1021,17 @@ 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 deliminator -- or || is delimator */ +for(sepr_index; 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); } On Tue, 2006-12-05 at 19:06 -0500, Jimi Xenidis wrote: > On Dec 5, 2006, at 6:20 PM, Jerone Young wrote: > > > This patch changes the code so can support more than one type > > delimiter > > on the command line. Now you can use "||" as well as "--". " || " > > works > > better with SLOF currently available. There is a bug in some cases > > using > > SLOF where "--" is not treated as desired. > > > > Patch has been tested and ready to go. > > > > Signed-off-by: Jerone Young <[EMAIL PROTECTED]> > > > > diff -r 9148f7816d00 xen/arch/powerpc/boot_of.c > > --- a/xen/arch/powerpc/boot_of.cTue Oct 24 19:11:00 2006 -0400 > > +++ b/xen/arch/powerpc/boot_of.cTue Dec 05 17:08:41 2006 -0600 > > @@ -964,10 +964,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[] = {" -- ", " || "}; > > +static int sepr_index = 0; > > no reason for sepr_index to be static > > > extern char dom0_start[] __attribute__ ((weak)); > > extern char dom0_size[] __attribute__ ((weak)); > > -const char *p; > > +const char *p = NULL; > > int mod; > > void *oft; > > > > @@ -1020,11 +1021,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 deliminator -- or || is delimator > We avoid C++ comments please use /* */ and I can't believe _I_ cought > a typo :) > > > +for(sepr_index; sepr_index < (sizeof(sepr)/sizeof(char *)); > > sepr_index++){ > Please use "ARRAY_SIZE(sepr)" > > > +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]) - 1; > > The -1 is because sizeof() includes '\0', so you can drop it here. > > > ___ Xen-ppc-devel mailing list Xen-ppc-devel@lists.xensource.com http://lists.xensource.com/xen-ppc-devel