mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: LKML <linux-kernel@vger.kernel.org>, Ingo Molnar <mingo@elte.hu>,
	"H. Peter Anvin" <hpa@zytor.com>
Subject: [GIT pull] x86 fixes for 2.6.26
Date: Sat, 17 May 2008 00:38:53 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LFD.1.10.0805170037180.3255@apollo.tec.linutronix.de> (raw)

Linus, 

please pull the latest x86 fixes from:

   ssh://master.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git x86-fixes-for-linus

Thanks,

	tglx

------------------>
Avi Kivity (1):
      x86: fix crash on cpu hotplug on pat-incapable machines

Ingo Molnar (1):
      x86: remove mwait capability C-state check

Thomas Gleixner (1):
      x86: disable mwait for AMD family 10H/11H CPUs

 arch/x86/kernel/process.c |   36 +++++++++++++++++++++++++++---------
 arch/x86/mm/pat.c         |    2 +-
 2 files changed, 28 insertions(+), 10 deletions(-)

diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
index 67e9b4a..ba370dc 100644
--- a/arch/x86/kernel/process.c
+++ b/arch/x86/kernel/process.c
@@ -99,15 +99,6 @@ static void mwait_idle(void)
 		local_irq_enable();
 }
 
-
-static int __cpuinit mwait_usable(const struct cpuinfo_x86 *c)
-{
-	if (force_mwait)
-		return 1;
-	/* Any C1 states supported? */
-	return c->cpuid_level >= 5 && ((cpuid_edx(5) >> 4) & 0xf) > 0;
-}
-
 /*
  * On SMP it's slightly faster (but much more power-consuming!)
  * to poll the ->work.need_resched flag instead of waiting for the
@@ -119,6 +110,33 @@ static void poll_idle(void)
 	cpu_relax();
 }
 
+/*
+ * mwait selection logic:
+ *
+ * It depends on the CPU. For AMD CPUs that support MWAIT this is
+ * wrong. Family 0x10 and 0x11 CPUs will enter C1 on HLT. Powersavings
+ * then depend on a clock divisor and current Pstate of the core. If
+ * all cores of a processor are in halt state (C1) the processor can
+ * enter the C1E (C1 enhanced) state. If mwait is used this will never
+ * happen.
+ *
+ * idle=mwait overrides this decision and forces the usage of mwait.
+ */
+static int __cpuinit mwait_usable(const struct cpuinfo_x86 *c)
+{
+	if (force_mwait)
+		return 1;
+
+	if (c->x86_vendor == X86_VENDOR_AMD) {
+		switch(c->x86) {
+		case 0x10:
+		case 0x11:
+			return 0;
+		}
+	}
+	return 1;
+}
+
 void __cpuinit select_idle_routine(const struct cpuinfo_x86 *c)
 {
 	static int selected;
diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c
index bcb1a8e..de3a998 100644
--- a/arch/x86/mm/pat.c
+++ b/arch/x86/mm/pat.c
@@ -28,7 +28,7 @@
 #ifdef CONFIG_X86_PAT
 int __read_mostly pat_wc_enabled = 1;
 
-void __init pat_disable(char *reason)
+void __cpuinit pat_disable(char *reason)
 {
 	pat_wc_enabled = 0;
 	printk(KERN_INFO "%s\n", reason);

             reply	other threads:[~2008-05-16 22:39 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-16 22:38 Thomas Gleixner [this message]
2008-05-16 22:47 ` Linus Torvalds
2008-05-16 22:51   ` Linus Torvalds
2008-05-16 23:44   ` Thomas Gleixner
2008-05-17  0:03     ` Linus Torvalds
2008-05-17  0:28       ` David Miller
2008-05-17  1:38         ` Linus Torvalds
2008-05-17 19:39           ` Ingo Molnar
2008-05-17 20:00             ` Linus Torvalds
2008-05-17 21:02               ` Thomas Gleixner
2008-05-17 21:36                 ` Linus Torvalds
2008-05-17  1:57   ` Theodore Tso
2008-05-17  3:19     ` Linus Torvalds
2008-05-17 14:58       ` Theodore Tso
2008-05-17 17:05         ` Linus Torvalds
2008-05-17 20:37           ` Thomas Gleixner
2008-05-17 20:26         ` Junio C Hamano
2008-05-17 22:45       ` Jesper Juhl
2008-05-18  0:35         ` Linus Torvalds
2008-05-18  2:22           ` Stephen Rothwell
2008-05-18 22:09           ` Jesper Juhl
2008-05-18 22:26             ` Linus Torvalds
2008-05-20  0:01               ` Jesper Juhl
2008-05-23 21:49 Thomas Gleixner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LFD.1.10.0805170037180.3255@apollo.tec.linutronix.de \
    --to=tglx@linutronix.de \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®