svn commit: r328113 - head/sys/powerpc/powerpc

Wojciech Macek wma at FreeBSD.org
Thu Jan 18 08:34:22 UTC 2018


Author: wma
Date: Thu Jan 18 08:34:20 2018
New Revision: 328113
URL: https://svnweb.freebsd.org/changeset/base/328113

Log:
  Call platform_smp_ap_init before decr_ap_init
  
      In platform_smp_ap_init we are doing some crucial code (eg. set LPCR register)
      which have influence over further execution.
  
      Practiculary in PowerNV platform we have experienced Data Storage Interrupt
      before we set apropriate LPCR. It caused code execution from location which was
      legal in bootloader (petitboot based on linux) but illegal in FreeBSD

Modified:
  head/sys/powerpc/powerpc/mp_machdep.c

Modified: head/sys/powerpc/powerpc/mp_machdep.c
==============================================================================
--- head/sys/powerpc/powerpc/mp_machdep.c	Thu Jan 18 07:42:51 2018	(r328112)
+++ head/sys/powerpc/powerpc/mp_machdep.c	Thu Jan 18 08:34:20 2018	(r328113)
@@ -81,12 +81,12 @@ machdep_ap_bootstrap(void)
 		__asm __volatile("or 27,27,27");
 	__asm __volatile("or 6,6,6");
 
+	/* Give platform code a chance to do anything necessary */
+	platform_smp_ap_init();
+
 	/* Initialize DEC and TB, sync with the BSP values */
 	platform_smp_timebase_sync(ap_timebase, 1);
 	decr_ap_init();
-
-	/* Give platform code a chance to do anything necessary */
-	platform_smp_ap_init();
 
 	/* Serialize console output and AP count increment */
 	mtx_lock_spin(&ap_boot_mtx);


More information about the svn-src-all mailing list