Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Jan 2018 08:34:20 +0000 (UTC)
From:      Wojciech Macek <wma@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r328113 - head/sys/powerpc/powerpc
Message-ID:  <201801180834.w0I8YKKk079118@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201801180834.w0I8YKKk079118>