Author: kib
Date: Tue May  8 10:56:06 2018
New Revision: 333361
URL: https://svnweb.freebsd.org/changeset/base/333361

Log:
  MFC r333125:
  Turn off IBRS on suspend.
  
  Approved by:  re (marius)

Modified:
  stable/11/sys/x86/acpica/acpi_wakeup.c
  stable/11/sys/x86/include/x86_var.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/x86/acpica/acpi_wakeup.c
==============================================================================
--- stable/11/sys/x86/acpica/acpi_wakeup.c      Tue May  8 10:18:24 2018        
(r333360)
+++ stable/11/sys/x86/acpica/acpi_wakeup.c      Tue May  8 10:56:06 2018        
(r333361)
@@ -190,6 +190,10 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state)
 {
        ACPI_STATUS     status;
        struct pcb      *pcb;
+#ifdef __amd64__
+       struct pcpu *pc;
+       int i;
+#endif
 
        if (sc->acpi_wakeaddr == 0ul)
                return (-1);    /* couldn't alloc wake memory */
@@ -217,6 +221,14 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state)
                if (!CPU_EMPTY(&suspcpus) && suspend_cpus(suspcpus) == 0) {
                        device_printf(sc->acpi_dev, "Failed to suspend APs\n");
                        return (0);     /* couldn't sleep */
+               }
+#endif
+#ifdef __amd64__
+               hw_ibrs_active = 0;
+               cpu_stdext_feature3 = 0;
+               CPU_FOREACH(i) {
+                       pc = pcpu_find(i);
+                       pc->pc_ibpb_set = 0;
                }
 #endif
 

Modified: stable/11/sys/x86/include/x86_var.h
==============================================================================
--- stable/11/sys/x86/include/x86_var.h Tue May  8 10:18:24 2018        
(r333360)
+++ stable/11/sys/x86/include/x86_var.h Tue May  8 10:56:06 2018        
(r333361)
@@ -81,7 +81,8 @@ extern        int     _ufssel;
 extern int     _ugssel;
 extern int     use_xsave;
 extern uint64_t xsave_mask;
-extern int     pti;
+extern int     pti;
+extern int     hw_ibrs_active;
 
 struct pcb;
 struct thread;
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to