From 007d65bc4ff2f2e56cc6fae2335af27bf16d373f Mon Sep 17 00:00:00 2001 From: Robert Mustacchi Date: Tue, 15 Jan 2019 01:26:05 +0000 Subject: 10278 Prefer use of mwait on AMD Zen Reviewed by: John Levon Reviewed by: Jordan Hendricks Approved by: Hans Rosenfeld --- usr/src/uts/i86pc/os/cpuid.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'usr/src') diff --git a/usr/src/uts/i86pc/os/cpuid.c b/usr/src/uts/i86pc/os/cpuid.c index 0174eb4bbb..e4bd0c7c99 100644 --- a/usr/src/uts/i86pc/os/cpuid.c +++ b/usr/src/uts/i86pc/os/cpuid.c @@ -2458,13 +2458,14 @@ cpuid_pass1(cpu_t *cpu, uchar_t *featureset) #if !defined(__xpv) /* - * Do not use MONITOR/MWAIT to halt in the idle loop on any AMD - * processors. AMD does not intend MWAIT to be used in the cpu - * idle loop on current and future processors. 10h and future - * AMD processors use more power in MWAIT than HLT. - * Pre-family-10h Opterons do not have the MWAIT instruction. + * AMD has not historically used MWAIT in the CPU's idle loop. + * Pre-family-10h Opterons do not have the MWAIT instruction. We + * know for certain that in at least family 17h, per AMD, mwait + * is preferred. Families in-between are less certain. */ - idle_cpu_prefer_mwait = 0; + if (cpi->cpi_family < 0x17) { + idle_cpu_prefer_mwait = 0; + } #endif break; -- cgit v1.2.3