blob: 0ad15768d762cf37f29b7b29ebfcdbf1abeb5d62 [file] [log] [blame]
Thomas Gleixner2874c5f2019-05-27 08:55:01 +02001// SPDX-License-Identifier: GPL-2.0-or-later
Linus Torvalds1da177e2005-04-16 15:20:36 -07002/*
3 * c 2001 PPC 64 Team, IBM Corp
Linus Torvalds1da177e2005-04-16 15:20:36 -07004 */
5
Milton Miller2cd947f2011-05-10 19:28:52 +00006#include <linux/smp.h>
Paul Gortmaker4b16f8e2011-07-22 18:24:23 -04007#include <linux/export.h>
Yinghai Lu95f72d12010-07-12 14:36:09 +10008#include <linux/memblock.h>
Ingo Molnar9164bb42017-02-04 01:20:53 +01009#include <linux/sched/task.h>
Anshuman Khandual98fa15f2019-03-05 15:42:58 -080010#include <linux/numa.h>
Mike Rapoport65fddcf2020-06-08 21:32:42 -070011#include <linux/pgtable.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070012
Linus Torvalds1da177e2005-04-16 15:20:36 -070013#include <asm/lppaca.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070014#include <asm/paca.h>
Paul Mackerras549e8152008-08-30 11:43:47 +100015#include <asm/sections.h>
Michael Neuling1fc711f2010-05-13 19:40:11 +000016#include <asm/kexec.h>
Anshuman Khandualbd104e62019-08-19 23:13:18 -030017#include <asm/svm.h>
18#include <asm/ultravisor.h>
Leonardo Brasb664db82020-05-18 20:42:45 -030019#include <asm/rtas.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070020
Nicholas Piggin1af19332017-12-22 21:17:13 +100021#include "setup.h"
22
Nicholas Piggin4890aea2018-02-14 01:08:20 +100023#ifndef CONFIG_SMP
24#define boot_cpuid 0
25#endif
26
27static void *__init alloc_paca_data(unsigned long size, unsigned long align,
28 unsigned long limit, int cpu)
29{
Mike Rapoportf8067142019-03-07 16:30:48 -080030 void *ptr;
Nicholas Piggin4890aea2018-02-14 01:08:20 +100031 int nid;
32
33 /*
34 * boot_cpuid paca is allocated very early before cpu_to_node is up.
35 * Set bottom-up mode, because the boot CPU should be on node-0,
36 * which will put its paca in the right place.
37 */
38 if (cpu == boot_cpuid) {
Anshuman Khandual98fa15f2019-03-05 15:42:58 -080039 nid = NUMA_NO_NODE;
Nicholas Piggin4890aea2018-02-14 01:08:20 +100040 memblock_set_bottom_up(true);
41 } else {
42 nid = early_cpu_to_node(cpu);
43 }
44
Mike Rapoportf8067142019-03-07 16:30:48 -080045 ptr = memblock_alloc_try_nid(size, align, MEMBLOCK_LOW_LIMIT,
46 limit, nid);
47 if (!ptr)
48 panic("cannot allocate paca data");
Nicholas Piggin4890aea2018-02-14 01:08:20 +100049
50 if (cpu == boot_cpuid)
51 memblock_set_bottom_up(false);
52
Mike Rapoportf8067142019-03-07 16:30:48 -080053 return ptr;
Nicholas Piggin4890aea2018-02-14 01:08:20 +100054}
55
Nicholas Piggin8e0b634b2018-02-14 01:08:11 +100056#ifdef CONFIG_PPC_PSERIES
Benjamin Herrenschmidt91c60b52009-06-02 21:17:41 +000057
Thiago Jung Bauermanne311a922019-08-19 23:13:17 -030058#define LPPACA_SIZE 0x400
59
Satheesh Rajendran178748b2020-06-12 19:59:53 +053060static void *__init alloc_shared_lppaca(unsigned long size, unsigned long limit,
61 int cpu)
Anshuman Khandualbd104e62019-08-19 23:13:18 -030062{
63 size_t shared_lppaca_total_size = PAGE_ALIGN(nr_cpu_ids * LPPACA_SIZE);
64 static unsigned long shared_lppaca_size;
65 static void *shared_lppaca;
66 void *ptr;
67
68 if (!shared_lppaca) {
69 memblock_set_bottom_up(true);
70
Satheesh Rajendran178748b2020-06-12 19:59:53 +053071 /*
72 * See Documentation/powerpc/ultravisor.rst for more details.
73 *
74 * UV/HV data sharing is in PAGE_SIZE granularity. In order to
75 * minimize the number of pages shared, align the allocation to
76 * PAGE_SIZE.
77 */
Anshuman Khandualbd104e62019-08-19 23:13:18 -030078 shared_lppaca =
79 memblock_alloc_try_nid(shared_lppaca_total_size,
80 PAGE_SIZE, MEMBLOCK_LOW_LIMIT,
81 limit, NUMA_NO_NODE);
82 if (!shared_lppaca)
83 panic("cannot allocate shared data");
84
85 memblock_set_bottom_up(false);
86 uv_share_page(PHYS_PFN(__pa(shared_lppaca)),
87 shared_lppaca_total_size >> PAGE_SHIFT);
88 }
89
90 ptr = shared_lppaca + shared_lppaca_size;
91 shared_lppaca_size += size;
92
93 /*
94 * This is very early in boot, so no harm done if the kernel crashes at
95 * this point.
96 */
Satheesh Rajendranb710d272020-06-19 12:31:13 +053097 BUG_ON(shared_lppaca_size > shared_lppaca_total_size);
Anshuman Khandualbd104e62019-08-19 23:13:18 -030098
99 return ptr;
100}
101
David Gibson3356bb9f72006-01-13 10:26:42 +1100102/*
Nicholas Piggin499dcd42018-02-14 01:08:13 +1000103 * See asm/lppaca.h for more detail.
104 *
105 * lppaca structures must must be 1kB in size, L1 cache line aligned,
106 * and not cross 4kB boundary. A 1kB size and 1kB alignment will satisfy
107 * these requirements.
David Gibson3356bb9f72006-01-13 10:26:42 +1100108 */
Nicholas Piggin499dcd42018-02-14 01:08:13 +1000109static inline void init_lppaca(struct lppaca *lppaca)
110{
111 BUILD_BUG_ON(sizeof(struct lppaca) != 640);
112
113 *lppaca = (struct lppaca) {
Anton Blanchard7ffcf8e2013-08-07 02:01:46 +1000114 .desc = cpu_to_be32(0xd397d781), /* "LpPa" */
Thiago Jung Bauermanne311a922019-08-19 23:13:17 -0300115 .size = cpu_to_be16(LPPACA_SIZE),
David Gibson3356bb9f72006-01-13 10:26:42 +1100116 .fpregs_in_use = 1,
Anton Blanchard7ffcf8e2013-08-07 02:01:46 +1000117 .slb_count = cpu_to_be16(64),
David Gibson3356bb9f72006-01-13 10:26:42 +1100118 .vmxregs_in_use = 0,
Nicholas Piggin499dcd42018-02-14 01:08:13 +1000119 .page_ins = 0, };
David Gibson3356bb9f72006-01-13 10:26:42 +1100120};
121
Nicholas Piggin499dcd42018-02-14 01:08:13 +1000122static struct lppaca * __init new_lppaca(int cpu, unsigned long limit)
Paul Mackerras93c22702010-08-12 20:18:48 +0000123{
124 struct lppaca *lp;
125
Thiago Jung Bauermanne311a922019-08-19 23:13:17 -0300126 BUILD_BUG_ON(sizeof(struct lppaca) > LPPACA_SIZE);
Paul Mackerras93c22702010-08-12 20:18:48 +0000127
Nicholas Piggin8e0b634b2018-02-14 01:08:11 +1000128 if (early_cpu_has_feature(CPU_FTR_HVMODE))
129 return NULL;
130
Anshuman Khandualbd104e62019-08-19 23:13:18 -0300131 if (is_secure_guest())
Satheesh Rajendran178748b2020-06-12 19:59:53 +0530132 lp = alloc_shared_lppaca(LPPACA_SIZE, limit, cpu);
Anshuman Khandualbd104e62019-08-19 23:13:18 -0300133 else
134 lp = alloc_paca_data(LPPACA_SIZE, 0x400, limit, cpu);
135
Nicholas Piggin499dcd42018-02-14 01:08:13 +1000136 init_lppaca(lp);
Paul Mackerras93c22702010-08-12 20:18:48 +0000137
138 return lp;
139}
Thiago Jung Bauermanne311a922019-08-19 23:13:17 -0300140#endif /* CONFIG_PPC_PSERIES */
Benjamin Herrenschmidt91c60b52009-06-02 21:17:41 +0000141
Michael Ellerman4e003742017-10-19 15:08:43 +1100142#ifdef CONFIG_PPC_BOOK3S_64
Benjamin Herrenschmidt91c60b52009-06-02 21:17:41 +0000143
Michael Neuling2f6093c2006-08-07 16:19:19 +1000144/*
Nicholas Piggin384e8062018-02-14 01:08:14 +1000145 * 3 persistent SLBs are allocated here. The buffer will be zero
Michael Neuling2f6093c2006-08-07 16:19:19 +1000146 * initially, hence will all be invaild until we actually write them.
Alexander Grafd8d164a92014-05-15 14:38:03 +0200147 *
148 * If you make the number of persistent SLB entries dynamic, please also
149 * update PR KVM to flush and restore them accordingly.
Michael Neuling2f6093c2006-08-07 16:19:19 +1000150 */
Nicholas Piggin384e8062018-02-14 01:08:14 +1000151static struct slb_shadow * __init new_slb_shadow(int cpu, unsigned long limit)
Jeremy Kerr6f4441e2013-12-05 11:42:40 +0800152{
Nicholas Pigginb68b1d72017-08-13 11:33:43 +1000153 struct slb_shadow *s;
154
Nicholas Piggin384e8062018-02-14 01:08:14 +1000155 if (cpu != boot_cpuid) {
156 /*
157 * Boot CPU comes here before early_radix_enabled
158 * is parsed (e.g., for disable_radix). So allocate
159 * always and this will be fixed up in free_unused_pacas.
160 */
161 if (early_radix_enabled())
162 return NULL;
163 }
Nicholas Pigginb68b1d72017-08-13 11:33:43 +1000164
Nicholas Piggin4890aea2018-02-14 01:08:20 +1000165 s = alloc_paca_data(sizeof(*s), L1_CACHE_BYTES, limit, cpu);
Gavin Shan6f20e7f2015-01-08 16:40:51 +1100166
Jeremy Kerr6f4441e2013-12-05 11:42:40 +0800167 s->persistent = cpu_to_be32(SLB_NUM_BOLTED);
168 s->buffer_length = cpu_to_be32(sizeof(*s));
169
170 return s;
171}
172
Michael Ellerman4e003742017-10-19 15:08:43 +1100173#endif /* CONFIG_PPC_BOOK3S_64 */
Benjamin Herrenschmidt91c60b52009-06-02 21:17:41 +0000174
Leonardo Brasb664db82020-05-18 20:42:45 -0300175#ifdef CONFIG_PPC_PSERIES
176/**
177 * new_rtas_args() - Allocates rtas args
178 * @cpu: CPU number
179 * @limit: Memory limit for this allocation
180 *
181 * Allocates a struct rtas_args and return it's pointer,
182 * if not in Hypervisor mode
183 *
184 * Return: Pointer to allocated rtas_args
185 * NULL if CPU in Hypervisor Mode
186 */
187static struct rtas_args * __init new_rtas_args(int cpu, unsigned long limit)
188{
189 limit = min_t(unsigned long, limit, RTAS_INSTANTIATE_MAX);
190
191 if (early_cpu_has_feature(CPU_FTR_HVMODE))
192 return NULL;
193
194 return alloc_paca_data(sizeof(struct rtas_args), L1_CACHE_BYTES,
195 limit, cpu);
196}
197#endif /* CONFIG_PPC_PSERIES */
198
David Gibson8882a4d2005-11-09 13:38:01 +1100199/* The Paca is an array with one entry per processor. Each contains an
Linus Torvalds1da177e2005-04-16 15:20:36 -0700200 * lppaca, which contains the information shared between the
David Gibson1888e7b2005-11-24 16:34:45 +1100201 * hypervisor and Linux.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700202 * On systems with hardware multi-threading, there are two threads
203 * per processor. The Paca array must contain an entry for each thread.
204 * The VPD Areas will give a max logical processors = 2 * max physical
205 * processors. The processor VPD array needs one entry per physical
206 * processor (not thread).
207 */
Nicholas Piggind2e60072018-02-14 01:08:12 +1000208struct paca_struct **paca_ptrs __read_mostly;
209EXPORT_SYMBOL(paca_ptrs);
Tony Breeds90035fe2008-04-24 13:43:49 +1000210
Michael Ellerman7053f802020-03-20 14:21:16 +1100211void __init __nostackprotector initialise_paca(struct paca_struct *new_paca, int cpu)
Michael Ellerman1426d5a2010-01-28 13:23:22 +0000212{
Nicholas Piggin8e0b634b2018-02-14 01:08:11 +1000213#ifdef CONFIG_PPC_PSERIES
Nicholas Piggin499dcd42018-02-14 01:08:13 +1000214 new_paca->lppaca_ptr = NULL;
Nicholas Piggin8e0b634b2018-02-14 01:08:11 +1000215#endif
216#ifdef CONFIG_PPC_BOOK3E
Michael Ellerman1426d5a2010-01-28 13:23:22 +0000217 new_paca->kernel_pgd = swapper_pg_dir;
Benjamin Herrenschmidt91c60b52009-06-02 21:17:41 +0000218#endif
Michael Ellerman1426d5a2010-01-28 13:23:22 +0000219 new_paca->lock_token = 0x8000;
220 new_paca->paca_index = cpu;
Michael Ellermana5cab832016-03-03 15:26:53 +1100221 new_paca->kernel_toc = kernel_toc_addr();
Michael Ellerman1426d5a2010-01-28 13:23:22 +0000222 new_paca->kernelbase = (unsigned long) _stext;
Benjamin Herrenschmidta944a9c2014-03-28 13:36:29 +1100223 /* Only set MSR:IR/DR when MMU is initialized */
224 new_paca->kernel_msr = MSR_KERNEL & ~(MSR_IR | MSR_DR);
Michael Ellerman1426d5a2010-01-28 13:23:22 +0000225 new_paca->hw_cpu_id = 0xffff;
Michael Neuling1fc711f2010-05-13 19:40:11 +0000226 new_paca->kexec_state = KEXEC_STATE_NONE;
Michael Ellerman1426d5a2010-01-28 13:23:22 +0000227 new_paca->__current = &init_task;
Michael Ellerman407821a2012-09-07 15:31:44 +0000228 new_paca->data_offset = 0xfeeeeeeeeeeeeeeeULL;
Michael Ellerman4e003742017-10-19 15:08:43 +1100229#ifdef CONFIG_PPC_BOOK3S_64
Nicholas Piggin384e8062018-02-14 01:08:14 +1000230 new_paca->slb_shadow_ptr = NULL;
Michael Ellerman4e003742017-10-19 15:08:43 +1100231#endif
Scott Wood28efc352013-10-11 19:22:38 -0500232
233#ifdef CONFIG_PPC_BOOK3E
234 /* For now -- if we have threads this will be adjusted later */
235 new_paca->tcd_ptr = &new_paca->tcd;
236#endif
Leonardo Brasb664db82020-05-18 20:42:45 -0300237
238#ifdef CONFIG_PPC_PSERIES
239 new_paca->rtas_args_reentrant = NULL;
240#endif
Michael Ellerman1426d5a2010-01-28 13:23:22 +0000241}
Tony Breeds90035fe2008-04-24 13:43:49 +1000242
Matt Evansfc53b422010-07-07 21:55:37 +0000243/* Put the paca pointer into r13 and SPRG_PACA */
Michael Ellerman7053f802020-03-20 14:21:16 +1100244void __nostackprotector setup_paca(struct paca_struct *new_paca)
Matt Evansfc53b422010-07-07 21:55:37 +0000245{
Benjamin Herrenschmidt2dd60d72011-01-20 17:50:21 +1100246 /* Setup r13 */
Matt Evansfc53b422010-07-07 21:55:37 +0000247 local_paca = new_paca;
Benjamin Herrenschmidt2dd60d72011-01-20 17:50:21 +1100248
Matt Evansfc53b422010-07-07 21:55:37 +0000249#ifdef CONFIG_PPC_BOOK3E
Benjamin Herrenschmidt2dd60d72011-01-20 17:50:21 +1100250 /* On Book3E, initialize the TLB miss exception frames */
Matt Evansfc53b422010-07-07 21:55:37 +0000251 mtspr(SPRN_SPRG_TLB_EXFRAME, local_paca->extlb);
Benjamin Herrenschmidt2dd60d72011-01-20 17:50:21 +1100252#else
Daniel Axtensd4a8e982020-03-20 14:21:15 +1100253 /*
254 * In HV mode, we setup both HPACA and PACA to avoid problems
Benjamin Herrenschmidt2dd60d72011-01-20 17:50:21 +1100255 * if we do a GET_PACA() before the feature fixups have been
Daniel Axtensd4a8e982020-03-20 14:21:15 +1100256 * applied.
257 *
258 * Normally you should test against CPU_FTR_HVMODE, but CPU features
259 * are not yet set up when we first reach here.
Benjamin Herrenschmidt2dd60d72011-01-20 17:50:21 +1100260 */
Daniel Axtensd4a8e982020-03-20 14:21:15 +1100261 if (mfmsr() & MSR_HV)
Benjamin Herrenschmidt2dd60d72011-01-20 17:50:21 +1100262 mtspr(SPRN_SPRG_HPACA, local_paca);
Matt Evansfc53b422010-07-07 21:55:37 +0000263#endif
Benjamin Herrenschmidt2dd60d72011-01-20 17:50:21 +1100264 mtspr(SPRN_SPRG_PACA, local_paca);
265
Matt Evansfc53b422010-07-07 21:55:37 +0000266}
267
Nicholas Piggind2e60072018-02-14 01:08:12 +1000268static int __initdata paca_nr_cpu_ids;
269static int __initdata paca_ptrs_size;
Nicholas Piggin59f57772018-02-14 01:08:19 +1000270static int __initdata paca_struct_size;
Michael Ellerman1426d5a2010-01-28 13:23:22 +0000271
Nicholas Piggin59f57772018-02-14 01:08:19 +1000272void __init allocate_paca_ptrs(void)
273{
274 paca_nr_cpu_ids = nr_cpu_ids;
275
276 paca_ptrs_size = sizeof(struct paca_struct *) * nr_cpu_ids;
Christophe Leroy1269f7b2019-03-11 23:29:00 -0700277 paca_ptrs = memblock_alloc_raw(paca_ptrs_size, SMP_CACHE_BYTES);
278 if (!paca_ptrs)
279 panic("Failed to allocate %d bytes for paca pointers\n",
280 paca_ptrs_size);
281
Nicholas Piggin59f57772018-02-14 01:08:19 +1000282 memset(paca_ptrs, 0x88, paca_ptrs_size);
283}
284
285void __init allocate_paca(int cpu)
Michael Ellerman1426d5a2010-01-28 13:23:22 +0000286{
Scott Woodecc49992015-10-06 22:48:17 -0500287 u64 limit;
Nicholas Piggin59f57772018-02-14 01:08:19 +1000288 struct paca_struct *paca;
289
290 BUG_ON(cpu >= paca_nr_cpu_ids);
Michael Ellerman1426d5a2010-01-28 13:23:22 +0000291
Scott Woodecc49992015-10-06 22:48:17 -0500292#ifdef CONFIG_PPC_BOOK3S_64
Michael Ellerman1426d5a2010-01-28 13:23:22 +0000293 /*
Nicholas Piggin1af19332017-12-22 21:17:13 +1000294 * We access pacas in real mode, and cannot take SLB faults
295 * on them when in virtual mode, so allocate them accordingly.
Michael Ellerman1426d5a2010-01-28 13:23:22 +0000296 */
Nicholas Piggin1af19332017-12-22 21:17:13 +1000297 limit = min(ppc64_bolted_size(), ppc64_rma_size);
298#else
299 limit = ppc64_rma_size;
Scott Woodecc49992015-10-06 22:48:17 -0500300#endif
Michael Ellerman1426d5a2010-01-28 13:23:22 +0000301
Nicholas Piggin4890aea2018-02-14 01:08:20 +1000302 paca = alloc_paca_data(sizeof(struct paca_struct), L1_CACHE_BYTES,
303 limit, cpu);
Nicholas Piggin59f57772018-02-14 01:08:19 +1000304 paca_ptrs[cpu] = paca;
Michael Ellerman1426d5a2010-01-28 13:23:22 +0000305
Nicholas Piggin59f57772018-02-14 01:08:19 +1000306 initialise_paca(paca, cpu);
Nicholas Piggin499dcd42018-02-14 01:08:13 +1000307#ifdef CONFIG_PPC_PSERIES
Nicholas Piggin59f57772018-02-14 01:08:19 +1000308 paca->lppaca_ptr = new_lppaca(cpu, limit);
Nicholas Piggin384e8062018-02-14 01:08:14 +1000309#endif
310#ifdef CONFIG_PPC_BOOK3S_64
Nicholas Piggin59f57772018-02-14 01:08:19 +1000311 paca->slb_shadow_ptr = new_slb_shadow(cpu, limit);
Nicholas Piggin499dcd42018-02-14 01:08:13 +1000312#endif
Leonardo Brasb664db82020-05-18 20:42:45 -0300313#ifdef CONFIG_PPC_PSERIES
314 paca->rtas_args_reentrant = new_rtas_args(cpu, limit);
315#endif
Nicholas Piggin59f57772018-02-14 01:08:19 +1000316 paca_struct_size += sizeof(struct paca_struct);
Michael Ellerman1426d5a2010-01-28 13:23:22 +0000317}
318
319void __init free_unused_pacas(void)
320{
Nicholas Piggind2e60072018-02-14 01:08:12 +1000321 int new_ptrs_size;
Michael Ellerman1426d5a2010-01-28 13:23:22 +0000322
Nicholas Piggind2e60072018-02-14 01:08:12 +1000323 new_ptrs_size = sizeof(struct paca_struct *) * nr_cpu_ids;
Nicholas Piggin59f57772018-02-14 01:08:19 +1000324 if (new_ptrs_size < paca_ptrs_size)
Nicholas Piggind2e60072018-02-14 01:08:12 +1000325 memblock_free(__pa(paca_ptrs) + new_ptrs_size,
326 paca_ptrs_size - new_ptrs_size);
Michael Ellerman1426d5a2010-01-28 13:23:22 +0000327
Nicholas Piggind2e60072018-02-14 01:08:12 +1000328 paca_nr_cpu_ids = nr_cpu_ids;
329 paca_ptrs_size = new_ptrs_size;
Michael Ellerman1426d5a2010-01-28 13:23:22 +0000330
Nicholas Piggin384e8062018-02-14 01:08:14 +1000331#ifdef CONFIG_PPC_BOOK3S_64
332 if (early_radix_enabled()) {
333 /* Ugly fixup, see new_slb_shadow() */
334 memblock_free(__pa(paca_ptrs[boot_cpuid]->slb_shadow_ptr),
335 sizeof(struct slb_shadow));
336 paca_ptrs[boot_cpuid]->slb_shadow_ptr = NULL;
337 }
338#endif
Michael Ellerman1426d5a2010-01-28 13:23:22 +0000339
Nicholas Piggin59f57772018-02-14 01:08:19 +1000340 printk(KERN_DEBUG "Allocated %u bytes for %u pacas\n",
341 paca_ptrs_size + paca_struct_size, nr_cpu_ids);
Tony Breeds90035fe2008-04-24 13:43:49 +1000342}
Aneesh Kumar K.V52b1e662017-03-22 09:06:49 +0530343
344void copy_mm_to_paca(struct mm_struct *mm)
345{
346#ifdef CONFIG_PPC_BOOK3S
347 mm_context_t *context = &mm->context;
348
349 get_paca()->mm_ctx_id = context->id;
350#ifdef CONFIG_PPC_MM_SLICES
Aneesh Kumar K.V60458fb2019-04-17 18:33:48 +0530351 VM_BUG_ON(!mm_ctx_slb_addr_limit(context));
352 get_paca()->mm_ctx_slb_addr_limit = mm_ctx_slb_addr_limit(context);
353 memcpy(&get_paca()->mm_ctx_low_slices_psize, mm_ctx_low_slices(context),
354 LOW_SLICE_ARRAY_SZ);
355 memcpy(&get_paca()->mm_ctx_high_slices_psize, mm_ctx_high_slices(context),
356 TASK_SLICE_ARRAY_SZ(context));
Aneesh Kumar K.V52b1e662017-03-22 09:06:49 +0530357#else /* CONFIG_PPC_MM_SLICES */
358 get_paca()->mm_ctx_user_psize = context->user_psize;
359 get_paca()->mm_ctx_sllp = context->sllp;
360#endif
Michael Ellerman4e003742017-10-19 15:08:43 +1100361#else /* !CONFIG_PPC_BOOK3S */
Aneesh Kumar K.V52b1e662017-03-22 09:06:49 +0530362 return;
363#endif
364}