2 * Copyright 2013, Michael (Ellerman|Neuling), IBM Corporation.
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
10 #include <asm/asm-offsets.h>
11 #include <asm/ppc_asm.h>
17 _GLOBAL(split_core_secondary_loop)
19 * r3 = u8 *state, used throughout the routine
27 /* Disable interrupts so SRR0/1 don't get trashed */
29 ori r4,r4,MSR_EE|MSR_SE|MSR_BE|MSR_RI
34 /* Switch to real mode and leave interrupts off */
38 LOAD_REG_ADDR(r4, real_mode)
43 b . /* prevent speculative execution */
46 /* Grab values from unsplit SPRs */
53 /* Order reading the SPRs vs telling the primary we are ready to split */
56 /* Tell thread 0 we are in real mode */
57 li r4, SYNC_STEP_REAL_MODE
60 li r5, (HID0_POWER8_4LPARMODE | HID0_POWER8_2LPARMODE)@highest
63 /* Loop until we see the split happen in HID0 */
64 1: mfspr r4, SPRN_HID0
69 * We only need to initialise the below regs once for each subcore,
70 * but it's simpler and harmless to do it on each thread.
73 /* Make sure various SPRS have sane values */
79 /* Restore SPR values now we are split */
86 LOAD_REG_ADDR(r5, virtual_mode)
88 /* Get out of real mode */
92 b . /* prevent speculative execution */