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
This commit is contained in:
Wojciech Macek 2018-01-18 08:34:20 +00:00
parent 054a090d49
commit 720212d30d

View File

@ -81,13 +81,13 @@ 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);
ap_awake++;