From cb1c0651a46b4d36bf9eed4a3cdd986aad9c9936 Mon Sep 17 00:00:00 2001 From: markj Date: Fri, 25 May 2018 19:16:05 +0000 Subject: [PATCH] MFC r334050, r334051: Flush caches before initiating a microcode update on Intel CPUs. Approved by: re (gjb, kib) --- sys/dev/cpuctl/cpuctl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/dev/cpuctl/cpuctl.c b/sys/dev/cpuctl/cpuctl.c index ed44442b3fd..76163ca9609 100644 --- a/sys/dev/cpuctl/cpuctl.c +++ b/sys/dev/cpuctl/cpuctl.c @@ -365,8 +365,10 @@ update_intel(int cpu, cpuctl_update_args_t *args, struct thread *td) rdmsr_safe(MSR_BIOS_SIGN, &rev0); /* Get current microcode revision. */ /* - * Perform update. + * Perform update. Flush caches first to work around seemingly + * undocumented errata applying to some Broadwell CPUs. */ + wbinvd(); wrmsr_safe(MSR_BIOS_UPDT_TRIG, (uintptr_t)(ptr)); wrmsr_safe(MSR_BIOS_SIGN, 0); -- 2.45.0