summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authorRobert Mustacchi <rm@joyent.com>2019-01-15 01:26:05 +0000
committerRobert Mustacchi <rm@joyent.com>2019-02-08 14:33:06 +0000
commit007d65bc4ff2f2e56cc6fae2335af27bf16d373f (patch)
tree404cf5a488bfe79c09f1536280d10406fc68b81a /usr/src
parent2a1fd0ffe121888d44fdec321c25b53dcfaa9118 (diff)
downloadillumos-gate-007d65bc4ff2f2e56cc6fae2335af27bf16d373f.tar.gz
10278 Prefer use of mwait on AMD Zen
Reviewed by: John Levon <john.levon@joyent.com> Reviewed by: Jordan Hendricks <jordan.hendricks@joyent.com> Approved by: Hans Rosenfeld <hans.rosenfeld@joyent.com>
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/uts/i86pc/os/cpuid.c13
1 files changed, 7 insertions, 6 deletions
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;