summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Mustacchi <rm@joyent.com>2016-12-06 20:05:20 +0000
committerRobert Mustacchi <rm@joyent.com>2017-01-03 17:28:10 -0800
commitb8692e0c2f0c23ce751c0af9c1efb4391bfd00f2 (patch)
tree192118e5ea6c503d590605055582f425db0d2c97
parentbb8a2a6a74b7eec7d62e371f17d319edb81f8501 (diff)
downloadillumos-joyent-b8692e0c2f0c23ce751c0af9c1efb4391bfd00f2.tar.gz
7706 cpuid_pass2 can clobber leaf 7
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com> Reviewed by: Toomas Soome <tsoome@me.com> Approved by: Richard Lowe <richlowe@richlowe.net>
-rw-r--r--usr/src/uts/i86pc/os/cpuid.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr/src/uts/i86pc/os/cpuid.c b/usr/src/uts/i86pc/os/cpuid.c
index dfb72dacf4..0e8f013ff7 100644
--- a/usr/src/uts/i86pc/os/cpuid.c
+++ b/usr/src/uts/i86pc/os/cpuid.c
@@ -1793,8 +1793,10 @@ cpuid_pass2(cpu_t *cpu)
*
* Note: we need to explicitly initialize %ecx here, since
* function 4 may have been previously invoked.
+ *
+ * The same is all true for CPUID function 7.
*/
- if (n == 4)
+ if (n == 4 || n == 7)
cp->cp_ecx = 0;
(void) __cpuid_insn(cp);