mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] x86/asm: Fix MWAITX C-state hint value
@ 2019-10-07 19:00 Natarajan, Janakarajan
  2019-10-08  8:19 ` [tip: x86/urgent] " tip-bot2 for Janakarajan Natarajan
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Natarajan, Janakarajan @ 2019-10-07 19:00 UTC (permalink / raw)
  To: x86, linux-kernel
  Cc: Thomas Gleixner, Ingo Molnar, Borislav Petkov, H . Peter Anvin,
	Jon Masters, Greg Kroah-Hartman, Zhenzhong Duan, Natarajan,
	Janakarajan

As per "AMD64 Architecture Programmer's Manual Volume 3: General-Purpose
and System Instructions", MWAITX EAX[7:4]+1 specifies the optional hint
of the optimized C-state. For C0 state, EAX[7:4] should be set to 0xf.

Currently, a value of 0xf is set for EAX[3:0] instead of EAX[7:4]. Fix
this by changing MWAITX_DISABLE_CSTATES from 0xf to 0xf0.

Signed-off-by: Janakarajan Natarajan <Janakarajan.Natarajan@amd.com>
---
 arch/x86/include/asm/mwait.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/mwait.h b/arch/x86/include/asm/mwait.h
index e28f8b723b5c..9d5252c9685c 100644
--- a/arch/x86/include/asm/mwait.h
+++ b/arch/x86/include/asm/mwait.h
@@ -21,7 +21,7 @@
 #define MWAIT_ECX_INTERRUPT_BREAK	0x1
 #define MWAITX_ECX_TIMER_ENABLE		BIT(1)
 #define MWAITX_MAX_LOOPS		((u32)-1)
-#define MWAITX_DISABLE_CSTATES		0xf
+#define MWAITX_DISABLE_CSTATES		0xf0
 
 static inline void __monitor(const void *eax, unsigned long ecx,
 			     unsigned long edx)
-- 
2.17.1


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

end of thread, other threads:[~2019-10-08 11:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-07 19:00 [PATCH] x86/asm: Fix MWAITX C-state hint value Natarajan, Janakarajan
2019-10-08  8:19 ` [tip: x86/urgent] " tip-bot2 for Janakarajan Natarajan
2019-10-08  8:19 ` tip-bot2 for Janakarajan Natarajan
2019-10-08 11:33 ` tip-bot2 for Janakarajan Natarajan
2019-10-08 11:33 ` tip-bot2 for Janakarajan Natarajan

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®