1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * Copyright 2013, Michael (Ellerman|Neuling), IBM Corporation.
6 #include <asm/asm-offsets.h>
7 #include <asm/ppc_asm.h>
13 _GLOBAL(split_core_secondary_loop)
15 * r3 = u8 *state, used throughout the routine
23 /* Disable interrupts so SRR0/1 don't get trashed */
25 ori r4,r4,MSR_EE|MSR_SE|MSR_BE|MSR_RI
30 /* Switch to real mode and leave interrupts off */
34 LOAD_REG_ADDR(r4, real_mode)
39 b . /* prevent speculative execution */
42 /* Grab values from unsplit SPRs */
49 /* Order reading the SPRs vs telling the primary we are ready to split */
52 /* Tell thread 0 we are in real mode */
53 li r4, SYNC_STEP_REAL_MODE
56 li r5, (HID0_POWER8_4LPARMODE | HID0_POWER8_2LPARMODE)@highest
59 /* Loop until we see the split happen in HID0 */
60 1: mfspr r4, SPRN_HID0
65 * We only need to initialise the below regs once for each subcore,
66 * but it's simpler and harmless to do it on each thread.
69 /* Make sure various SPRS have sane values */
75 /* Restore SPR values now we are split */
82 LOAD_REG_ADDR(r5, virtual_mode)
84 /* Get out of real mode */
88 b . /* prevent speculative execution */