Author: jhibbits
Date: Fri Apr 26 03:18:49 2019
New Revision: 346730
URL: https://svnweb.freebsd.org/changeset/base/346730

Log:
  powerpc64: Clear FSCR SPR, so that it's in a known state
  
  This now turns any access to the DSCR SPR into a SIGILL.  Later commits will
  make DCSR work correctly on POWER8 and POWER9.
  
  PR:           237208

Modified:
  head/sys/powerpc/aim/mp_cpudep.c
  head/sys/powerpc/powerpc/cpu.c

Modified: head/sys/powerpc/aim/mp_cpudep.c
==============================================================================
--- head/sys/powerpc/aim/mp_cpudep.c    Fri Apr 26 03:13:44 2019        
(r346729)
+++ head/sys/powerpc/aim/mp_cpudep.c    Fri Apr 26 03:18:49 2019        
(r346730)
@@ -98,6 +98,12 @@ cpudep_ap_early_bootstrap(void)
 
                        mtspr(SPR_LPCR, lpcr);
                        isync();
+
+                       /*
+                        * Nuke FSCR, to be managed on a per-process basis
+                        * later.
+                        */
+                       mtspr(SPR_FSCR, 0);
                }
 #endif
                break;

Modified: head/sys/powerpc/powerpc/cpu.c
==============================================================================
--- head/sys/powerpc/powerpc/cpu.c      Fri Apr 26 03:13:44 2019        
(r346729)
+++ head/sys/powerpc/powerpc/cpu.c      Fri Apr 26 03:18:49 2019        
(r346730)
@@ -663,6 +663,9 @@ cpu_powerx_setup(int cpuid, uint16_t vers)
        if ((mfmsr() & PSL_HV) == 0)
                return;
 
+       /* Nuke the FSCR, to disable all facilities. */
+       mtspr(SPR_FSCR, 0);
+
        /* Configure power-saving */
        switch (vers) {
        case IBMPOWER8:
_______________________________________________
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