Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/x86/x86 Invalidate the cache before updating the mi...



details:   https://anonhg.NetBSD.org/src/rev/764be74b7e07
branches:  trunk
changeset: 451203:764be74b7e07
user:      maxv <maxv%NetBSD.org@localhost>
date:      Thu May 09 18:53:14 2019 +0000

description:
Invalidate the cache before updating the microcode. Some platforms require
this. Seen in Illumos and FreeBSD.

diffstat:

 sys/arch/x86/x86/cpu_ucode_intel.c |  11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diffs (33 lines):

diff -r 190ce7834e5c -r 764be74b7e07 sys/arch/x86/x86/cpu_ucode_intel.c
--- a/sys/arch/x86/x86/cpu_ucode_intel.c        Thu May 09 17:09:50 2019 +0000
+++ b/sys/arch/x86/x86/cpu_ucode_intel.c        Thu May 09 18:53:14 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu_ucode_intel.c,v 1.15 2019/01/27 02:08:39 pgoyette Exp $ */
+/* $NetBSD: cpu_ucode_intel.c,v 1.16 2019/05/09 18:53:14 maxv Exp $ */
 /*
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu_ucode_intel.c,v 1.15 2019/01/27 02:08:39 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu_ucode_intel.c,v 1.16 2019/05/09 18:53:14 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_xen.h"
@@ -213,7 +213,14 @@
                rv = EEXIST; /* ??? */
                goto out;
        }
+
+       /*
+        * Perform update. On some platforms a cache invalidation is
+        * required.
+        */
+       wbinvd();
        wrmsr(MSR_BIOS_UPDT_TRIG, (uintptr_t)uh + 48);
+
        intel_getcurrentucode(&nucodeversion, &platformid);
        cpuid = curcpu()->ci_index;
 



Home | Main Index | Thread Index | Old Index