Marco Gerards
2006-Sep-13 20:45 UTC
[Xen-devel] [PATCH] Disable SMP on the MacBook by default
Hi, As I mentioned before, SMP is non functional on the MacBook. It even makes the machine crash. I am using a patch to disable SMP support in the case a MacBook was detected. I have included this patch at the end of this email. Because this will be useful for the LiveCD, I hope you will commit this patch. Please let me know if there are issues that I need to take care of before it can be committed. Thanks, Marco diff -r 3e31c5e160cf xen/arch/x86/dmi_scan.c --- a/xen/arch/x86/dmi_scan.c Wed Sep 13 14:59:14 2006 +++ b/xen/arch/x86/dmi_scan.c Wed Sep 13 22:34:01 2006 @@ -8,6 +8,7 @@ #include <xen/acpi.h> #include <asm/io.h> #include <asm/system.h> +#include <xen/smp.h> #include <xen/dmi.h> #define bt_ioremap(b,l) ((u8 *)__acpi_map_table(b,l)) @@ -181,6 +182,15 @@ return 0; } +/* + * Disable SMP. */ +static int __init dmi_disable_smp(struct dmi_blacklist *d) +{ + printk(KERN_NOTICE "%s detected: SMP support disabled\n", d->ident); + opt_nosmp = 1; + return 0; +} + #ifdef CONFIG_ACPI_SLEEP static __init int reset_videomode_after_s3(struct dmi_blacklist *d) @@ -262,6 +272,17 @@ MATCH(DMI_PRODUCT_NAME, "S4030CDT/4.3"), NO_MATCH, NO_MATCH, NO_MATCH } }, + + /* + * SMP support is broken for the MacBook. Disable SMP to + * prevent further problems. + */ + { + .callback = dmi_disable_smp, + .ident = "Apple MacBook", + .matches = {DMI_MATCH(DMI_PRODUCT_NAME, "MacBook1,1"),}, + }, + #ifdef CONFIG_ACPI_SLEEP { reset_videomode_after_s3, "Toshiba Satellite 4030cdt", { /* Reset video mode after returning from ACPI S3 sleep */ MATCH(DMI_PRODUCT_NAME, "S4030CDT/4.3"), diff -r 3e31c5e160cf xen/arch/x86/setup.c --- a/xen/arch/x86/setup.c Wed Sep 13 14:59:14 2006 +++ b/xen/arch/x86/setup.c Wed Sep 13 22:34:01 2006 @@ -40,7 +40,7 @@ #endif /* opt_nosmp: If true, secondary processors are ignored. */ -static int opt_nosmp = 0; +int opt_nosmp = 0; boolean_param("nosmp", opt_nosmp); /* maxcpus: maximum number of CPUs to activate. */ diff -r 3e31c5e160cf xen/include/xen/smp.h --- a/xen/include/xen/smp.h Wed Sep 13 14:59:14 2006 +++ b/xen/include/xen/smp.h Wed Sep 13 22:34:01 2006 @@ -111,4 +111,6 @@ #define smp_processor_id() raw_smp_processor_id() +extern int opt_nosmp ; + #endif _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Pratt
2006-Sep-13 20:57 UTC
RE: [Xen-devel] [PATCH] Disable SMP on the MacBook by default
> As I mentioned before, SMP is non functional on the MacBook. It even > makes the machine crash. I am using a patch to disable SMP support in > the case a MacBook was detected. I have included this patch at the > end of this email.Am I totally confused, or wasn''t this solved by some update to grub legacy to change A20 gate stuff? Thanks, Ian> Because this will be useful for the LiveCD, I hope you will commit > this patch. Please let me know if there are issues that I need to > take care of before it can be committed. > > Thanks, > Marco > > > diff -r 3e31c5e160cf xen/arch/x86/dmi_scan.c > --- a/xen/arch/x86/dmi_scan.c Wed Sep 13 14:59:14 2006 > +++ b/xen/arch/x86/dmi_scan.c Wed Sep 13 22:34:01 2006 > @@ -8,6 +8,7 @@ > #include <xen/acpi.h> > #include <asm/io.h> > #include <asm/system.h> > +#include <xen/smp.h> > #include <xen/dmi.h> > > #define bt_ioremap(b,l) ((u8 *)__acpi_map_table(b,l)) > @@ -181,6 +182,15 @@ > return 0; > } > > +/* > + * Disable SMP. */ > +static int __init dmi_disable_smp(struct dmi_blacklist *d) > +{ > + printk(KERN_NOTICE "%s detected: SMP support disabled\n",d->ident);> + opt_nosmp = 1; > + return 0; > +} > + > > #ifdef CONFIG_ACPI_SLEEP > static __init int reset_videomode_after_s3(struct dmi_blacklist *d) > @@ -262,6 +272,17 @@ > MATCH(DMI_PRODUCT_NAME, "S4030CDT/4.3"), > NO_MATCH, NO_MATCH, NO_MATCH > } }, > + > + /* > + * SMP support is broken for the MacBook. Disable SMP to > + * prevent further problems. > + */ > + { > + .callback = dmi_disable_smp, > + .ident = "Apple MacBook", > + .matches = {DMI_MATCH(DMI_PRODUCT_NAME, "MacBook1,1"),}, > + }, > + > #ifdef CONFIG_ACPI_SLEEP > { reset_videomode_after_s3, "Toshiba Satellite 4030cdt", { /*Reset> video mode after returning from ACPI S3 sleep */ > MATCH(DMI_PRODUCT_NAME, "S4030CDT/4.3"), > diff -r 3e31c5e160cf xen/arch/x86/setup.c > --- a/xen/arch/x86/setup.c Wed Sep 13 14:59:14 2006 > +++ b/xen/arch/x86/setup.c Wed Sep 13 22:34:01 2006 > @@ -40,7 +40,7 @@ > #endif > > /* opt_nosmp: If true, secondary processors are ignored. */ > -static int opt_nosmp = 0; > +int opt_nosmp = 0; > boolean_param("nosmp", opt_nosmp); > > /* maxcpus: maximum number of CPUs to activate. */ > diff -r 3e31c5e160cf xen/include/xen/smp.h > --- a/xen/include/xen/smp.h Wed Sep 13 14:59:14 2006 > +++ b/xen/include/xen/smp.h Wed Sep 13 22:34:01 2006 > @@ -111,4 +111,6 @@ > > #define smp_processor_id() raw_smp_processor_id() > > +extern int opt_nosmp ; > + > #endif > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Pratt
2006-Sep-13 21:38 UTC
RE: [Xen-devel] [PATCH] Disable SMP on the MacBook by default
> >> As I mentioned before, SMP is non functional on the MacBook. Iteven> >> makes the machine crash. I am using a patch to disable SMP supportin> >> the case a MacBook was detected. I have included this patch at the > >> end of this email. > > > > Am I totally confused, or wasn''t this solved by some update to grub > > legacy to change A20 gate stuff? > > The A20 gate patch was to make sure GRUB works on the Intel Mac. The > old way to enable the A20 gate is not present anymore. So this patch > is also required when using the Intel Mac, but unrelated. > > The SMP issue can be avoided from GRUB when you press the "right > arrow" key instead of "enter" to boot. Someone mentioned this on the > mailinglist, perhaps that is why you mixed up the two?This does kinda suggest that a further Grub patch might be part of the solution, no? Are there any issues with SMP linux 2.6.16 at all? Any idea what''s going on? What are distros link Ubuntu using for booting on MacBook? Do they go with bootcamp/grub, or elilo? Thanks, Ian _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Marco Gerards
2006-Sep-13 21:38 UTC
Re: [Xen-devel] [PATCH] Disable SMP on the MacBook by default
"Ian Pratt" <m+Ian.Pratt@cl.cam.ac.uk> writes: Hi Ian,>> As I mentioned before, SMP is non functional on the MacBook. It even >> makes the machine crash. I am using a patch to disable SMP support in >> the case a MacBook was detected. I have included this patch at the >> end of this email. > > Am I totally confused, or wasn''t this solved by some update to grub > legacy to change A20 gate stuff?The A20 gate patch was to make sure GRUB works on the Intel Mac. The old way to enable the A20 gate is not present anymore. So this patch is also required when using the Intel Mac, but unrelated. The SMP issue can be avoided from GRUB when you press the "right arrow" key instead of "enter" to boot. Someone mentioned this on the mailinglist, perhaps that is why you mixed up the two? Thanks, Marco _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Marco Gerards
2006-Sep-13 22:11 UTC
Re: [Xen-devel] [PATCH] Disable SMP on the MacBook by default
"Ian Pratt" <m+Ian.Pratt@cl.cam.ac.uk> writes: [...]>> The SMP issue can be avoided from GRUB when you press the "right >> arrow" key instead of "enter" to boot. Someone mentioned this on the >> mailinglist, perhaps that is why you mixed up the two? > > This does kinda suggest that a further Grub patch might be part of the > solution, no?This is something I looked at, of course. The GRUB code doesn''t make a difference between "right arrow" and return. Besides that, it doesn''t work with the timeout either.> Are there any issues with SMP linux 2.6.16 at all?No, unless you disable ACPI. The FreeBSD and NetBSD hackers have encountered the same problem. They were not able to come up with a patch yet.> Any idea what''s going on?The second core can not be initialized because the INIT IPI does not arrive. It only happens on the MacBook and not on the desktop Intel Macs. On the MacBook the second core is put into deep sleep mode. It should get out of sleep mode when an IPI or interrupt is received. That does not happen. It looks like the keyboard interrupt does wakeup the second core, after which the IPI is received. The annoying thing is that both the keyboard handling and ACPI on the Intel Mac is a big mess. There are a lot of bugs. It could also be a bug in the processor itself. The reason why Windows and Linux work is that the ACPI interpreter is used, perhaps this also has a side effect of waking up the second core.> What are distros link Ubuntu using for booting on MacBook? Do they go > with bootcamp/grub, or elilo?Sorry, I am not sure what you mean. English is not my native language. Do you mean which bootloaders they use by default? When I was installing Ubuntu for the first time on the MacBook, it tried installing GRUB and failed. First I tried lilo which worked. Later I started using GRUB. I haven''t seen ELILO being used anywhere. -- Marco _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Marco Gerards schrieb:> "Ian Pratt" <m+Ian.Pratt@cl.cam.ac.uk> writes: > > [...] > >>> The SMP issue can be avoided from GRUB when you press the "right >>> arrow" key instead of "enter" to boot. Someone mentioned this on the >>> mailinglist, perhaps that is why you mixed up the two? >> This does kinda suggest that a further Grub patch might be part of the >> solution, no? > > This is something I looked at, of course. The GRUB code doesn''t make > a difference between "right arrow" and return. Besides that, it > doesn''t work with the timeout either.Hm... The strange thing is, hitting the "Return" key crashed xen every time. Using the "Rigth arrow" key made xen bootable evry time from grub. So there must be a difference.>> Are there any issues with SMP linux 2.6.16 at all? > > No, unless you disable ACPI. > > The FreeBSD and NetBSD hackers have encountered the same problem. > They were not able to come up with a patch yet. > >> Any idea what''s going on? > > The second core can not be initialized because the INIT IPI does not > arrive. It only happens on the MacBook and not on the desktop Intel > Macs. On the MacBook the second core is put into deep sleep mode. It > should get out of sleep mode when an IPI or interrupt is received. > > That does not happen. It looks like the keyboard interrupt does > wakeup the second core, after which the IPI is received. > > The annoying thing is that both the keyboard handling and ACPI on the > Intel Mac is a big mess. There are a lot of bugs. It could also be a > bug in the processor itself. The reason why Windows and Linux work is > that the ACPI interpreter is used, perhaps this also has a side effect > of waking up the second core. > >> What are distros link Ubuntu using for booting on MacBook? Do they go >> with bootcamp/grub, or elilo? > > Sorry, I am not sure what you mean. English is not my native > language. Do you mean which bootloaders they use by default? > > When I was installing Ubuntu for the first time on the MacBook, it > tried installing GRUB and failed. First I tried lilo which worked. > Later I started using GRUB. I haven''t seen ELILO being used anywhere.I use the patched grub and elilo.> -- > Marco > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
I had also many crashes with xen until. I did some search on google and found a patch on the xen ml for the bridging code in linux which cused the crashes. Have atached the patch. cu Edgar (gimli) Hucek gimli schrieb:> Marco Gerards schrieb: >> "Ian Pratt" <m+Ian.Pratt@cl.cam.ac.uk> writes: >> >> [...] >> >>>> The SMP issue can be avoided from GRUB when you press the "right >>>> arrow" key instead of "enter" to boot. Someone mentioned this on the >>>> mailinglist, perhaps that is why you mixed up the two? >>> This does kinda suggest that a further Grub patch might be part of the >>> solution, no? >> This is something I looked at, of course. The GRUB code doesn''t make >> a difference between "right arrow" and return. Besides that, it >> doesn''t work with the timeout either. > > Hm... The strange thing is, hitting the "Return" key crashed xen every time. > Using the "Rigth arrow" key made xen bootable evry time from grub. So there must > be a difference. > >>> Are there any issues with SMP linux 2.6.16 at all? >> No, unless you disable ACPI. >> >> The FreeBSD and NetBSD hackers have encountered the same problem. >> They were not able to come up with a patch yet. >> >>> Any idea what''s going on? >> The second core can not be initialized because the INIT IPI does not >> arrive. It only happens on the MacBook and not on the desktop Intel >> Macs. On the MacBook the second core is put into deep sleep mode. It >> should get out of sleep mode when an IPI or interrupt is received. >> >> That does not happen. It looks like the keyboard interrupt does >> wakeup the second core, after which the IPI is received. >> >> The annoying thing is that both the keyboard handling and ACPI on the >> Intel Mac is a big mess. There are a lot of bugs. It could also be a >> bug in the processor itself. The reason why Windows and Linux work is >> that the ACPI interpreter is used, perhaps this also has a side effect >> of waking up the second core. >> >>> What are distros link Ubuntu using for booting on MacBook? Do they go >>> with bootcamp/grub, or elilo? >> Sorry, I am not sure what you mean. English is not my native >> language. Do you mean which bootloaders they use by default? >> >> When I was installing Ubuntu for the first time on the MacBook, it >> tried installing GRUB and failed. First I tried lilo which worked. >> Later I started using GRUB. I haven''t seen ELILO being used anywhere. > > I use the patched grub and elilo. > >> -- >> Marco >> >> >> _______________________________________________ >> Xen-devel mailing list >> Xen-devel@lists.xensource.com >> http://lists.xensource.com/xen-devel >> > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Marco Gerards
2006-Sep-13 22:34 UTC
Re: [Xen-devel] [PATCH] Disable SMP on the MacBook by default
gimli <gimli@dark-green.com> writes:> Marco Gerards schrieb: >> "Ian Pratt" <m+Ian.Pratt@cl.cam.ac.uk> writes: >> >> [...] >> >>>> The SMP issue can be avoided from GRUB when you press the "right >>>> arrow" key instead of "enter" to boot. Someone mentioned this on the >>>> mailinglist, perhaps that is why you mixed up the two? >>> This does kinda suggest that a further Grub patch might be part of the >>> solution, no? >> >> This is something I looked at, of course. The GRUB code doesn''t make >> a difference between "right arrow" and return. Besides that, it >> doesn''t work with the timeout either. > > Hm... The strange thing is, hitting the "Return" key crashed xen every time. > Using the "Rigth arrow" key made xen bootable evry time from grub. So there must > be a difference.What I am thinking about is that it is a difference related to interrupts or so. Another thing can be that the Legacy BIOS code has a bug. There is another known bug in this code already related to keyboard handling. But this is all speculation. There is nothing in GRUB that even remotely looks like something that can cause such a problem. [...]>> When I was installing Ubuntu for the first time on the MacBook, it >> tried installing GRUB and failed. First I tried lilo which worked. >> Later I started using GRUB. I haven''t seen ELILO being used anywhere. > > I use the patched grub and elilo.Right, otherwise it will not work at all. -- Marco _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Pratt
2006-Sep-13 22:39 UTC
RE: [Xen-devel] [PATCH] Disable SMP on the MacBook by default
> I had also many crashes with xen until. I did some search on googleand> found > a patch on the xen ml for the bridging code in linux which cused the > crashes. > Have atached the patch.I''m pretty sure a ''better'' fix from upstream linux was put in the xen-unstable patch queue sometime back. As I recall, it was the sky2 driver that exhibited this. Would be good if you could confirm the fix. Thanks, Ian> cu > > Edgar (gimli) Hucek > > gimli schrieb: > > Marco Gerards schrieb: > >> "Ian Pratt" <m+Ian.Pratt@cl.cam.ac.uk> writes: > >> > >> [...] > >> > >>>> The SMP issue can be avoided from GRUB when you press the "right > >>>> arrow" key instead of "enter" to boot. Someone mentioned this onthe> >>>> mailinglist, perhaps that is why you mixed up the two? > >>> This does kinda suggest that a further Grub patch might be part ofthe> >>> solution, no? > >> This is something I looked at, of course. The GRUB code doesn''tmake> >> a difference between "right arrow" and return. Besides that, it > >> doesn''t work with the timeout either. > > > > Hm... The strange thing is, hitting the "Return" key crashed xenevery> time. > > Using the "Rigth arrow" key made xen bootable evry time from grub.So> there must > > be a difference. > > > >>> Are there any issues with SMP linux 2.6.16 at all? > >> No, unless you disable ACPI. > >> > >> The FreeBSD and NetBSD hackers have encountered the same problem. > >> They were not able to come up with a patch yet. > >> > >>> Any idea what''s going on? > >> The second core can not be initialized because the INIT IPI doesnot> >> arrive. It only happens on the MacBook and not on the desktopIntel> >> Macs. On the MacBook the second core is put into deep sleep mode.It> >> should get out of sleep mode when an IPI or interrupt is received. > >> > >> That does not happen. It looks like the keyboard interrupt does > >> wakeup the second core, after which the IPI is received. > >> > >> The annoying thing is that both the keyboard handling and ACPI onthe> >> Intel Mac is a big mess. There are a lot of bugs. It could alsobe a> >> bug in the processor itself. The reason why Windows and Linux workis> >> that the ACPI interpreter is used, perhaps this also has a sideeffect> >> of waking up the second core. > >> > >>> What are distros link Ubuntu using for booting on MacBook? Do theygo> >>> with bootcamp/grub, or elilo? > >> Sorry, I am not sure what you mean. English is not my native > >> language. Do you mean which bootloaders they use by default? > >> > >> When I was installing Ubuntu for the first time on the MacBook, it > >> tried installing GRUB and failed. First I tried lilo which worked. > >> Later I started using GRUB. I haven''t seen ELILO being usedanywhere.> > > > I use the patched grub and elilo. > > > >> -- > >> Marco > >> > >> > >> _______________________________________________ > >> Xen-devel mailing list > >> Xen-devel@lists.xensource.com > >> http://lists.xensource.com/xen-devel > >> > > > > > > _______________________________________________ > > Xen-devel mailing list > > Xen-devel@lists.xensource.com > > http://lists.xensource.com/xen-devel > >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2006-Sep-14 14:48 UTC
Re: [Xen-devel] [PATCH] Disable SMP on the MacBook by default
On 13/9/06 23:11, "Marco Gerards" <mgerards@xs4all.nl> wrote:> The second core can not be initialized because the INIT IPI does not > arrive. It only happens on the MacBook and not on the desktop Intel > Macs. On the MacBook the second core is put into deep sleep mode. It > should get out of sleep mode when an IPI or interrupt is received. > > That does not happen. It looks like the keyboard interrupt does > wakeup the second core, after which the IPI is received.Have you tried tickling the second core with some interrupt or NMI IPIs from the boot core? Sounds like a slightly harder kick is required. What about tracing what the Linux ACPI interpreter kicks out in terms of hardware accesses? Perhaps you can work out what the ACPI goop actually does in low-level terms, which could then perhaps be applied in a simpler form (than ACPI interpreting) to Xen? -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Marco Gerards
2006-Sep-14 17:15 UTC
Re: [Xen-devel] [PATCH] Disable SMP on the MacBook by default
Keir Fraser <Keir.Fraser@cl.cam.ac.uk> writes:> On 13/9/06 23:11, "Marco Gerards" <mgerards@xs4all.nl> wrote: > >> The second core can not be initialized because the INIT IPI does not >> arrive. It only happens on the MacBook and not on the desktop Intel >> Macs. On the MacBook the second core is put into deep sleep mode. It >> should get out of sleep mode when an IPI or interrupt is received. >> >> That does not happen. It looks like the keyboard interrupt does >> wakeup the second core, after which the IPI is received. > > Have you tried tickling the second core with some interrupt or NMI IPIs from > the boot core? Sounds like a slightly harder kick is required.Yes I did try NMI IPIs, that did not have any effect. IIRC I tried generating interrupts using the APIC, but I do not remember if I succeed, but if I did it didn''t fix the problem. Is there any other way I can have a look at to easily generate an interrupt without causing weird side effects?> What about tracing what the Linux ACPI interpreter kicks out in terms of > hardware accesses? Perhaps you can work out what the ACPI goop actually does > in low-level terms, which could then perhaps be applied in a simpler form > (than ACPI interpreting) to Xen?How would that work? To be honest I do not know much about ACPI and what''s possible with it. A few pointers to get me started is highly appreciated. Thanks, Marco _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel