summaryrefslogtreecommitdiff
path: root/usr/src/uts/i86pc/os/microcode.c
diff options
context:
space:
mode:
authorRobert Mustacchi <rm@joyent.com>2018-06-14 15:55:36 +0000
committerRobert Mustacchi <rm@joyent.com>2018-09-11 02:31:02 +0000
commitf226ceedc64a2db2c8016f3de28194d222fec764 (patch)
treea81c65740975df11c478329d91ffad415a452133 /usr/src/uts/i86pc/os/microcode.c
parenteefd54bbb6ed4d7d16358eae44834b65fcb304cd (diff)
downloadillumos-gate-f226ceedc64a2db2c8016f3de28194d222fec764.tar.gz
9744 invalidate cache before microcode update
Reviewed by: John Levon <john.levon@joyent.com> Reviewed by: Andy Fiddaman <omnios@citrus-it.co.uk> Reviewed by: Richard Lowe <richlowe@richlowe.net> Approved by: Dan McDonald <danmcd@joyent.com>
Diffstat (limited to 'usr/src/uts/i86pc/os/microcode.c')
-rw-r--r--usr/src/uts/i86pc/os/microcode.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/usr/src/uts/i86pc/os/microcode.c b/usr/src/uts/i86pc/os/microcode.c
index e59bdb8530..afc48953f5 100644
--- a/usr/src/uts/i86pc/os/microcode.c
+++ b/usr/src/uts/i86pc/os/microcode.c
@@ -24,6 +24,7 @@
* Use is subject to license terms.
*
* Copyright 2012 Nexenta Systems, Inc. All rights reserved.
+ * Copyright (c) 2018, Joyent, Inc.
*/
#include <sys/asm_linkage.h>
@@ -754,8 +755,15 @@ ucode_write(xc_arg_t arg1, xc_arg_t unused2, xc_arg_t unused3)
return (0);
}
- if (!on_trap(&otd, OT_DATA_ACCESS))
+ if (!on_trap(&otd, OT_DATA_ACCESS)) {
+ /*
+ * On some platforms a cache invalidation is required for the
+ * ucode update to be successful due to the parts of the
+ * processor that the microcode is updating.
+ */
+ invalidate_cache();
wrmsr(ucode->write_msr, (uintptr_t)uusp->ucodep);
+ }
no_trap();
#endif
@@ -849,6 +857,12 @@ ucode_load_intel(ucode_file_t *ufp, cpu_ucode_info_t *uinfop, cpu_t *cp)
uus.new_rev = uinfop->cui_rev;
#else
kpreempt_disable();
+ /*
+ * On some platforms a cache invalidation is required for the
+ * ucode update to be successful due to the parts of the
+ * processor that the microcode is updating.
+ */
+ invalidate_cache();
wrmsr(ucode->write_msr, (uintptr_t)ucodefp->uf_body);
ucode->read_rev(uinfop);
kpreempt_enable();