* Re: [PATCH 2/2] x86: Enable monitor/mwait on Intel if BIOS hasn't already [not found] ` <5bec80947da3fb72f2f18fbe6d924a69f83fbed9.1312386029.git.luto@mit.edu> @ 2011-08-03 16:15 ` Len Brown 2011-08-03 16:22 ` Andrew Lutomirski 0 siblings, 1 reply; 10+ messages in thread From: Len Brown @ 2011-08-03 16:15 UTC (permalink / raw) To: Andy Lutomirski; +Cc: x86, linux-kernel, Fenghua Yu, linux-acpi On Wed, 3 Aug 2011, Andy Lutomirski wrote: > I have a Sandy Bridge machine with an Intel BIOS that enables > monitor/mwait on all but the boot CPU. With this patch, intel_idle > works. What machine has this BIOS bug, and are you running the latest version of the BIOS? thanks, Len Brown, Intel Open Source Technolgy Center > Signed-off-by: Andy Lutomirski <luto@mit.edu> > --- > arch/x86/kernel/cpu/intel.c | 20 ++++++++++++++++++++ > 1 files changed, 20 insertions(+), 0 deletions(-) > > diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c > index 6b20fef..a3339a1 100644 > --- a/arch/x86/kernel/cpu/intel.c > +++ b/arch/x86/kernel/cpu/intel.c > @@ -487,6 +487,26 @@ static void __cpuinit init_intel(struct cpuinfo_x86 *c) > wrmsrl(MSR_IA32_ENERGY_PERF_BIAS, epb); > } > } > + > + /* Enable monitor/mwait if BIOS didn't do it for us. */ > + if (!cpu_has(c, X86_FEATURE_MWAIT) && cpu_has(c, X86_FEATURE_XMM3) > + && c->x86 >= 6 && !(c->x86 == 6 && c->x86_model < 0x1c) > + && !(c->x86 == 0xf && c->x86_model < 3)) { > + u64 misc_enable; > + rdmsrl(MSR_IA32_MISC_ENABLE, misc_enable); > + misc_enable |= MSR_IA32_MISC_ENABLE_MWAIT; > + > + /* > + * Some non-SSE3 cpus will #GP. We check for that, > + * but it can't hurt to be safe. > + */ > + wrmsr_safe(MSR_IA32_MISC_ENABLE, (u32)misc_enable, > + (u32)(misc_enable >> 32)); > + > + /* Re-read monitor capability. */ > + if (cpuid_ecx(1) & 0x8) > + set_cpu_cap(c, X86_FEATURE_MWAIT); > + } > } > > #ifdef CONFIG_X86_32 > -- > 1.7.6 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ > ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2/2] x86: Enable monitor/mwait on Intel if BIOS hasn't already 2011-08-03 16:15 ` [PATCH 2/2] x86: Enable monitor/mwait on Intel if BIOS hasn't already Len Brown @ 2011-08-03 16:22 ` Andrew Lutomirski 2011-08-03 16:42 ` Andrew Lutomirski 0 siblings, 1 reply; 10+ messages in thread From: Andrew Lutomirski @ 2011-08-03 16:22 UTC (permalink / raw) To: Len Brown; +Cc: x86, linux-kernel, Fenghua Yu, linux-acpi On Wed, Aug 3, 2011 at 12:15 PM, Len Brown <lenb@kernel.org> wrote: > On Wed, 3 Aug 2011, Andy Lutomirski wrote: > >> I have a Sandy Bridge machine with an Intel BIOS that enables >> monitor/mwait on all but the boot CPU. With this patch, intel_idle >> works. > > What machine has this BIOS bug, and are you running > the latest version of the BIOS? Intel DQ67SW, version SWQ6710H.86A.0051.2011.0413.1154. This is not quite up-to-date -- I'll test a newer BIOS. (Enabling monitor/mwait on some but not all CPUs is obnoxious, too. I think it's just dumb luck that Linux notices at all and doesn't crash.) --Andy -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2/2] x86: Enable monitor/mwait on Intel if BIOS hasn't already 2011-08-03 16:22 ` Andrew Lutomirski @ 2011-08-03 16:42 ` Andrew Lutomirski 2011-08-03 19:17 ` Len Brown 0 siblings, 1 reply; 10+ messages in thread From: Andrew Lutomirski @ 2011-08-03 16:42 UTC (permalink / raw) To: Len Brown; +Cc: x86, linux-kernel, Fenghua Yu, linux-acpi On Wed, Aug 3, 2011 at 12:22 PM, Andrew Lutomirski <luto@mit.edu> wrote: > On Wed, Aug 3, 2011 at 12:15 PM, Len Brown <lenb@kernel.org> wrote: >> On Wed, 3 Aug 2011, Andy Lutomirski wrote: >> >>> I have a Sandy Bridge machine with an Intel BIOS that enables >>> monitor/mwait on all but the boot CPU. With this patch, intel_idle >>> works. >> >> What machine has this BIOS bug, and are you running >> the latest version of the BIOS? > > Intel DQ67SW, version SWQ6710H.86A.0051.2011.0413.1154. This is not > quite up-to-date -- I'll test a newer BIOS. SWQ6710H.86A.0053.2011.0615.1535 has the same problem. It fixed ASPM, though :) Should I redo the patch with a printk to warn about the firmware bug? --Andy > > (Enabling monitor/mwait on some but not all CPUs is obnoxious, too. I > think it's just dumb luck that Linux notices at all and doesn't > crash.) > > --Andy > -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2/2] x86: Enable monitor/mwait on Intel if BIOS hasn't already 2011-08-03 16:42 ` Andrew Lutomirski @ 2011-08-03 19:17 ` Len Brown 2011-08-04 3:18 ` Andrew Lutomirski 2011-08-04 19:41 ` Matthew Garrett 0 siblings, 2 replies; 10+ messages in thread From: Len Brown @ 2011-08-03 19:17 UTC (permalink / raw) To: Andrew Lutomirski; +Cc: x86, linux-kernel, Fenghua Yu, linux-acpi [-- Attachment #1: Type: TEXT/PLAIN, Size: 785 bytes --] > >> What machine has this BIOS bug, and are you running > >> the latest version of the BIOS? > > > > Intel DQ67SW, version SWQ6710H.86A.0051.2011.0413.1154. This is not > > quite up-to-date -- I'll test a newer BIOS. > > SWQ6710H.86A.0053.2011.0615.1535 has the same problem. It fixed ASPM, though :) > > Should I redo the patch with a printk to warn about the firmware bug? I would hope that a patch that _only_ prints [Firmware bug] should be enough. This isn't the kind of workaround that we should really have to carry in the kernel. This is still a very new platform, and my guess is that they are actively updating the BIOS as we speak. I'll see if I can figure out who to talk to in order to make sure of that:-) thanks, Len Brown, Intel Open Source Technology Center ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2/2] x86: Enable monitor/mwait on Intel if BIOS hasn't already 2011-08-03 19:17 ` Len Brown @ 2011-08-04 3:18 ` Andrew Lutomirski 2011-08-04 19:41 ` Matthew Garrett 1 sibling, 0 replies; 10+ messages in thread From: Andrew Lutomirski @ 2011-08-04 3:18 UTC (permalink / raw) To: Len Brown; +Cc: x86, linux-kernel, Fenghua Yu, linux-acpi On Wed, Aug 3, 2011 at 3:17 PM, Len Brown <lenb@kernel.org> wrote: >> >> What machine has this BIOS bug, and are you running >> >> the latest version of the BIOS? >> > >> > Intel DQ67SW, version SWQ6710H.86A.0051.2011.0413.1154. This is not >> > quite up-to-date -- I'll test a newer BIOS. >> >> SWQ6710H.86A.0053.2011.0615.1535 has the same problem. It fixed ASPM, though :) >> >> Should I redo the patch with a printk to warn about the firmware bug? > > I would hope that a patch that _only_ prints [Firmware bug] > should be enough. This isn't the kind of workaround > that we should really have to carry in the kernel. > > This is still a very new platform, and my guess is that > they are actively updating the BIOS as we speak. > I'll see if I can figure out who to talk to > in order to make sure of that:-) I can add a strange data point: with TXT enabled in BIOS, fast strings are disabled (on all CPUs, I think) and monitor/mwait is disabled on the boot CPU. With TXT disabled, both features are enabled. I'll see if my laptop does the same thing. --Andy -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2/2] x86: Enable monitor/mwait on Intel if BIOS hasn't already 2011-08-03 19:17 ` Len Brown 2011-08-04 3:18 ` Andrew Lutomirski @ 2011-08-04 19:41 ` Matthew Garrett 2011-08-04 21:54 ` Len Brown 1 sibling, 1 reply; 10+ messages in thread From: Matthew Garrett @ 2011-08-04 19:41 UTC (permalink / raw) To: Len Brown; +Cc: Andrew Lutomirski, x86, linux-kernel, Fenghua Yu, linux-acpi On Wed, Aug 03, 2011 at 03:17:59PM -0400, Len Brown wrote: > > >> What machine has this BIOS bug, and are you running > > >> the latest version of the BIOS? > > > > > > Intel DQ67SW, version SWQ6710H.86A.0051.2011.0413.1154. This is not > > > quite up-to-date -- I'll test a newer BIOS. > > > > SWQ6710H.86A.0053.2011.0615.1535 has the same problem. It fixed ASPM, though :) > > > > Should I redo the patch with a printk to warn about the firmware bug? > > I would hope that a patch that _only_ prints [Firmware bug] > should be enough. This isn't the kind of workaround > that we should really have to carry in the kernel. We can't trust BIOS authors to get things right. Where we can reliably fix up things that are broken, we should do so. -- Matthew Garrett | mjg59@srcf.ucam.org -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2/2] x86: Enable monitor/mwait on Intel if BIOS hasn't already 2011-08-04 19:41 ` Matthew Garrett @ 2011-08-04 21:54 ` Len Brown 2011-08-04 21:56 ` Matthew Garrett 0 siblings, 1 reply; 10+ messages in thread From: Len Brown @ 2011-08-04 21:54 UTC (permalink / raw) To: Matthew Garrett Cc: Andrew Lutomirski, x86, linux-kernel, Fenghua Yu, linux-acpi > We can't trust BIOS authors to get things right. Where we can reliably > fix up things that are broken, we should do so. How about if we can get a BIOS fix for this brand new system, then we shall not clutter the kernel with a workaround, otherwise we shall. thanks, -Len ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2/2] x86: Enable monitor/mwait on Intel if BIOS hasn't already 2011-08-04 21:54 ` Len Brown @ 2011-08-04 21:56 ` Matthew Garrett 2011-08-05 9:43 ` Ingo Molnar 0 siblings, 1 reply; 10+ messages in thread From: Matthew Garrett @ 2011-08-04 21:56 UTC (permalink / raw) To: Len Brown; +Cc: Andrew Lutomirski, x86, linux-kernel, Fenghua Yu, linux-acpi On Thu, Aug 04, 2011 at 05:54:04PM -0400, Len Brown wrote: > > We can't trust BIOS authors to get things right. Where we can reliably > > fix up things that are broken, we should do so. > > How about if we can get a BIOS fix for this brand new system, > then we shall not clutter the kernel with a workaround, > otherwise we shall. It's a pretty good rule of thumb that if a BIOS bug is present in one BIOS it's present in others, but the users will just never notice. -- Matthew Garrett | mjg59@srcf.ucam.org ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2/2] x86: Enable monitor/mwait on Intel if BIOS hasn't already 2011-08-04 21:56 ` Matthew Garrett @ 2011-08-05 9:43 ` Ingo Molnar 2011-08-06 11:42 ` Andrew Lutomirski 0 siblings, 1 reply; 10+ messages in thread From: Ingo Molnar @ 2011-08-05 9:43 UTC (permalink / raw) To: Matthew Garrett Cc: Len Brown, Andrew Lutomirski, x86, linux-kernel, Fenghua Yu, linux-acpi * Matthew Garrett <mjg59@srcf.ucam.org> wrote: > On Thu, Aug 04, 2011 at 05:54:04PM -0400, Len Brown wrote: > > > We can't trust BIOS authors to get things right. Where we can reliably > > > fix up things that are broken, we should do so. > > > > How about if we can get a BIOS fix for this brand new system, > > then we shall not clutter the kernel with a workaround, otherwise > > we shall. > > It's a pretty good rule of thumb that if a BIOS bug is present in > one BIOS it's present in others, but the users will just never > notice. Yes. There's no harm really from working around a BIOS bug and warning about it - when the BIOS gets fixed the warning message will go away. Btw., few people risk upgrading their BIOSen on already purchased hardware. I almost never do it, i only do it if it's impossible to continue with a current BIOS. Thanks, Ingo ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2/2] x86: Enable monitor/mwait on Intel if BIOS hasn't already 2011-08-05 9:43 ` Ingo Molnar @ 2011-08-06 11:42 ` Andrew Lutomirski 0 siblings, 0 replies; 10+ messages in thread From: Andrew Lutomirski @ 2011-08-06 11:42 UTC (permalink / raw) To: Ingo Molnar Cc: Matthew Garrett, Len Brown, x86, linux-kernel, Fenghua Yu, linux-acpi On Fri, Aug 5, 2011 at 5:43 AM, Ingo Molnar <mingo@elte.hu> wrote: > > * Matthew Garrett <mjg59@srcf.ucam.org> wrote: > >> On Thu, Aug 04, 2011 at 05:54:04PM -0400, Len Brown wrote: >> > > We can't trust BIOS authors to get things right. Where we can reliably >> > > fix up things that are broken, we should do so. >> > >> > How about if we can get a BIOS fix for this brand new system, >> > then we shall not clutter the kernel with a workaround, otherwise >> > we shall. >> >> It's a pretty good rule of thumb that if a BIOS bug is present in >> one BIOS it's present in others, but the users will just never >> notice. > > Yes. There's no harm really from working around a BIOS bug and > warning about it - when the BIOS gets fixed the warning message will > go away. > > Btw., few people risk upgrading their BIOSen on already purchased > hardware. I almost never do it, i only do it if it's impossible to > continue with a current BIOS. I do it, but I understand the sentiment. I've destroyed laptops with BIOS upgrades, and the new Intel BIOS seems to insist on spewing garbage into my keyboard input when Linux (but not grub) starts. Updates patches coming. > > Thanks, > > Ingo > -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2011-08-06 11:42 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <cover.1312386029.git.luto@mit.edu>
[not found] ` <5bec80947da3fb72f2f18fbe6d924a69f83fbed9.1312386029.git.luto@mit.edu>
2011-08-03 16:15 ` [PATCH 2/2] x86: Enable monitor/mwait on Intel if BIOS hasn't already Len Brown
2011-08-03 16:22 ` Andrew Lutomirski
2011-08-03 16:42 ` Andrew Lutomirski
2011-08-03 19:17 ` Len Brown
2011-08-04 3:18 ` Andrew Lutomirski
2011-08-04 19:41 ` Matthew Garrett
2011-08-04 21:54 ` Len Brown
2011-08-04 21:56 ` Matthew Garrett
2011-08-05 9:43 ` Ingo Molnar
2011-08-06 11:42 ` Andrew Lutomirski
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox