All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: Don't use MWAIT if explicitly requested
@ 2019-10-18  3:45 Zhenzhong Duan
  2019-10-18  7:12 ` Peter Zijlstra
  0 siblings, 1 reply; 3+ messages in thread
From: Zhenzhong Duan @ 2019-10-18  3:45 UTC (permalink / raw)
  To: linux-kernel
  Cc: x86, tim.c.chen, Zhenzhong Duan, Thomas Gleixner,
	Borislav Petkov, Ingo Molnar, H. Peter Anvin, Boris Ostrovsky

If 'idle=nomwait' is specified or process matching what's in
processor_idle_dmi_table, we should't use MWAIT at bootup stage before
cpuidle driver loaded, even if it's preferred by default on Intel.

Add a check so that HALT instruction is used in those cases.

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@oracle.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
---
 arch/x86/kernel/process.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
index 5e94c43..37fc577 100644
--- a/arch/x86/kernel/process.c
+++ b/arch/x86/kernel/process.c
@@ -667,6 +667,10 @@ static void amd_e400_idle(void)
  */
 static int prefer_mwait_c1_over_halt(const struct cpuinfo_x86 *c)
 {
+	/* Don't use MWAIT-C1 if explicitly requested */
+	if (boot_option_idle_override == IDLE_NOMWAIT)
+		return 0;
+
 	if (c->x86_vendor != X86_VENDOR_INTEL)
 		return 0;
 
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-10-18  8:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-18  3:45 [PATCH] x86: Don't use MWAIT if explicitly requested Zhenzhong Duan
2019-10-18  7:12 ` Peter Zijlstra
2019-10-18  8:47   ` Zhenzhong Duan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.