Skip to content

Commit 4e00374

Browse files
committed
powerpc/64s: Replace CONFIG_PPC_STD_MMU_64 with CONFIG_PPC_BOOK3S_64
CONFIG_PPC_STD_MMU_64 indicates support for the "standard" powerpc MMU on 64-bit CPUs. The "standard" MMU refers to the hash page table MMU found in "server" processors, from IBM mainly. Currently CONFIG_PPC_STD_MMU_64 is == CONFIG_PPC_BOOK3S_64. While it's annoying to have two symbols that always have the same value, it's not quite annoying enough to bother removing one. However with the arrival of Power9, we now have the situation where CONFIG_PPC_STD_MMU_64 is enabled, but the kernel is running using the Radix MMU - *not* the "standard" MMU. So it is now actively confusing to use it, because it implies that code is disabled or inactive when the Radix MMU is in use, however that is not necessarily true. So s/CONFIG_PPC_STD_MMU_64/CONFIG_PPC_BOOK3S_64/, and do some minor formatting updates of some of the affected lines. This will be a pain for backports, but c'est la vie. Signed-off-by: Michael Ellerman <[email protected]>
1 parent c1807e3 commit 4e00374

26 files changed

+68
-72
lines changed

arch/powerpc/Kconfig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ config PPC_OF_PLATFORM_PCI
334334
default n
335335

336336
config ARCH_SUPPORTS_DEBUG_PAGEALLOC
337-
depends on PPC32 || PPC_STD_MMU_64
337+
depends on PPC32 || PPC_BOOK3S_64
338338
def_bool y
339339

340340
config ARCH_SUPPORTS_UPROBES
@@ -721,7 +721,7 @@ config PPC_16K_PAGES
721721

722722
config PPC_64K_PAGES
723723
bool "64k page size"
724-
depends on !PPC_FSL_BOOK3E && (44x || PPC_STD_MMU_64 || PPC_BOOK3E_64)
724+
depends on !PPC_FSL_BOOK3E && (44x || PPC_BOOK3S_64 || PPC_BOOK3E_64)
725725
select HAVE_ARCH_SOFT_DIRTY if PPC_BOOK3S_64
726726

727727
config PPC_256K_PAGES
@@ -780,7 +780,7 @@ config FORCE_MAX_ZONEORDER
780780

781781
config PPC_SUBPAGE_PROT
782782
bool "Support setting protections for 4k subpages"
783-
depends on PPC_STD_MMU_64 && PPC_64K_PAGES
783+
depends on PPC_BOOK3S_64 && PPC_64K_PAGES
784784
help
785785
This option adds support for a system call to allow user programs
786786
to set access permissions (read/write, readonly, or no access)

arch/powerpc/include/asm/nohash/64/pgtable.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ static inline unsigned long pte_update(struct mm_struct *mm,
203203
if (!huge)
204204
assert_pte_locked(mm, addr);
205205

206-
#ifdef CONFIG_PPC_STD_MMU_64
206+
#ifdef CONFIG_PPC_BOOK3S_64
207207
if (old & _PAGE_HASHPTE)
208208
hpte_need_flush(mm, addr, ptep, old, huge);
209209
#endif

arch/powerpc/include/asm/paca.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,14 @@ struct paca_struct {
9191
u8 cpu_start; /* At startup, processor spins until */
9292
/* this becomes non-zero. */
9393
u8 kexec_state; /* set when kexec down has irqs off */
94-
#ifdef CONFIG_PPC_STD_MMU_64
94+
#ifdef CONFIG_PPC_BOOK3S_64
9595
struct slb_shadow *slb_shadow_ptr;
9696
struct dtl_entry *dispatch_log;
9797
struct dtl_entry *dispatch_log_end;
98-
#endif /* CONFIG_PPC_STD_MMU_64 */
98+
#endif
9999
u64 dscr_default; /* per-CPU default DSCR */
100100

101-
#ifdef CONFIG_PPC_STD_MMU_64
101+
#ifdef CONFIG_PPC_BOOK3S_64
102102
/*
103103
* Now, starting in cacheline 2, the exception save areas
104104
*/
@@ -110,7 +110,7 @@ struct paca_struct {
110110
u16 vmalloc_sllp;
111111
u16 slb_cache_ptr;
112112
u32 slb_cache[SLB_CACHE_ENTRIES];
113-
#endif /* CONFIG_PPC_STD_MMU_64 */
113+
#endif /* CONFIG_PPC_BOOK3S_64 */
114114

115115
#ifdef CONFIG_PPC_BOOK3E
116116
u64 exgen[8] __aligned(0x40);
@@ -192,7 +192,7 @@ struct paca_struct {
192192
struct stop_sprs stop_sprs;
193193
#endif
194194

195-
#ifdef CONFIG_PPC_STD_MMU_64
195+
#ifdef CONFIG_PPC_BOOK3S_64
196196
/* Non-maskable exceptions that are not performance critical */
197197
u64 exnmi[EX_SIZE]; /* used for system reset (nmi) */
198198
u64 exmc[EX_SIZE]; /* used for machine checks */

arch/powerpc/include/asm/page_64.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,21 +117,21 @@ extern void slice_set_range_psize(struct mm_struct *mm, unsigned long start,
117117
#endif /* __ASSEMBLY__ */
118118
#else
119119
#define slice_init()
120-
#ifdef CONFIG_PPC_STD_MMU_64
120+
#ifdef CONFIG_PPC_BOOK3S_64
121121
#define get_slice_psize(mm, addr) ((mm)->context.user_psize)
122122
#define slice_set_user_psize(mm, psize) \
123123
do { \
124124
(mm)->context.user_psize = (psize); \
125125
(mm)->context.sllp = SLB_VSID_USER | mmu_psize_defs[(psize)].sllp; \
126126
} while (0)
127-
#else /* CONFIG_PPC_STD_MMU_64 */
127+
#else /* !CONFIG_PPC_BOOK3S_64 */
128128
#ifdef CONFIG_PPC_64K_PAGES
129129
#define get_slice_psize(mm, addr) MMU_PAGE_64K
130130
#else /* CONFIG_PPC_64K_PAGES */
131131
#define get_slice_psize(mm, addr) MMU_PAGE_4K
132132
#endif /* !CONFIG_PPC_64K_PAGES */
133133
#define slice_set_user_psize(mm, psize) do { BUG(); } while(0)
134-
#endif /* !CONFIG_PPC_STD_MMU_64 */
134+
#endif /* CONFIG_PPC_BOOK3S_64 */
135135

136136
#define slice_set_range_psize(mm, start, len, psize) \
137137
slice_set_user_psize((mm), (psize))

arch/powerpc/include/asm/pgtable-be-types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ typedef struct { unsigned long pgprot; } pgprot_t;
7676
* With hash config 64k pages additionally define a bigger "real PTE" type that
7777
* gathers the "second half" part of the PTE for pseudo 64k pages
7878
*/
79-
#if defined(CONFIG_PPC_64K_PAGES) && defined(CONFIG_PPC_STD_MMU_64)
79+
#if defined(CONFIG_PPC_64K_PAGES) && defined(CONFIG_PPC_BOOK3S_64)
8080
typedef struct { pte_t pte; unsigned long hidx; } real_pte_t;
8181
#else
8282
typedef struct { pte_t pte; } real_pte_t;

arch/powerpc/include/asm/pgtable-types.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ typedef struct { unsigned long pgprot; } pgprot_t;
4949
* With hash config 64k pages additionally define a bigger "real PTE" type that
5050
* gathers the "second half" part of the PTE for pseudo 64k pages
5151
*/
52-
#if defined(CONFIG_PPC_64K_PAGES) && defined(CONFIG_PPC_STD_MMU_64)
52+
#if defined(CONFIG_PPC_64K_PAGES) && defined(CONFIG_PPC_BOOK3S_64)
5353
typedef struct { pte_t pte; unsigned long hidx; } real_pte_t;
5454
#else
5555
typedef struct { pte_t pte; } real_pte_t;
5656
#endif
5757

58-
#ifdef CONFIG_PPC_STD_MMU_64
58+
#ifdef CONFIG_PPC_BOOK3S_64
5959
#include <asm/cmpxchg.h>
6060

6161
static inline bool pte_xchg(pte_t *ptep, pte_t old, pte_t new)

arch/powerpc/include/asm/tlbflush.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ static inline void local_flush_tlb_mm(struct mm_struct *mm)
7777
flush_tlb_mm(mm);
7878
}
7979

80-
#elif defined(CONFIG_PPC_STD_MMU_64)
80+
#elif defined(CONFIG_PPC_BOOK3S_64)
8181
#include <asm/book3s/64/tlbflush.h>
8282
#else
8383
#error Unsupported MMU type

arch/powerpc/kernel/asm-offsets.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ int main(void)
208208
OFFSET(TCD_ESEL_FIRST, tlb_core_data, esel_first);
209209
#endif /* CONFIG_PPC_BOOK3E */
210210

211-
#ifdef CONFIG_PPC_STD_MMU_64
211+
#ifdef CONFIG_PPC_BOOK3S_64
212212
OFFSET(PACASLBCACHE, paca_struct, slb_cache);
213213
OFFSET(PACASLBCACHEPTR, paca_struct, slb_cache_ptr);
214214
OFFSET(PACAVMALLOCSLLP, paca_struct, vmalloc_sllp);
@@ -230,7 +230,7 @@ int main(void)
230230
OFFSET(LPPACA_DTLIDX, lppaca, dtl_idx);
231231
OFFSET(LPPACA_YIELDCOUNT, lppaca, yield_count);
232232
OFFSET(PACA_DTL_RIDX, paca_struct, dtl_ridx);
233-
#endif /* CONFIG_PPC_STD_MMU_64 */
233+
#endif /* CONFIG_PPC_BOOK3S_64 */
234234
OFFSET(PACAEMERGSP, paca_struct, emergency_sp);
235235
#ifdef CONFIG_PPC_BOOK3S_64
236236
OFFSET(PACAMCEMERGSP, paca_struct, mc_emergency_sp);

arch/powerpc/kernel/entry_64.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ _GLOBAL(_switch)
539539
std r6,PACACURRENT(r13) /* Set new 'current' */
540540

541541
ld r8,KSP(r4) /* new stack pointer */
542-
#ifdef CONFIG_PPC_STD_MMU_64
542+
#ifdef CONFIG_PPC_BOOK3S_64
543543
BEGIN_MMU_FTR_SECTION
544544
b 2f
545545
END_MMU_FTR_SECTION_IFSET(MMU_FTR_TYPE_RADIX)
@@ -588,7 +588,7 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_1T_SEGMENT)
588588
slbmte r7,r0
589589
isync
590590
2:
591-
#endif /* CONFIG_PPC_STD_MMU_64 */
591+
#endif /* CONFIG_PPC_BOOK3S_64 */
592592

593593
CURRENT_THREAD_INFO(r7, r8) /* base of new stack */
594594
/* Note: this uses SWITCH_FRAME_SIZE rather than INT_FRAME_SIZE

arch/powerpc/kernel/exceptions-64s.S

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ EXC_COMMON_BEGIN(slb_miss_common)
607607
cmpdi cr5,r11,MSR_RI
608608

609609
crset 4*cr0+eq
610-
#ifdef CONFIG_PPC_STD_MMU_64
610+
#ifdef CONFIG_PPC_BOOK3S_64
611611
BEGIN_MMU_FTR_SECTION
612612
bl slb_allocate
613613
END_MMU_FTR_SECTION_IFCLR(MMU_FTR_TYPE_RADIX)
@@ -1497,7 +1497,7 @@ USE_TEXT_SECTION()
14971497
*/
14981498
.balign IFETCH_ALIGN_BYTES
14991499
do_hash_page:
1500-
#ifdef CONFIG_PPC_STD_MMU_64
1500+
#ifdef CONFIG_PPC_BOOK3S_64
15011501
lis r0,DSISR_BAD_FAULT_64S@h
15021502
ori r0,r0,DSISR_BAD_FAULT_64S@l
15031503
and. r0,r4,r0 /* weird error? */
@@ -1528,7 +1528,7 @@ do_hash_page:
15281528

15291529
/* Reload DSISR into r4 for the DABR check below */
15301530
ld r4,_DSISR(r1)
1531-
#endif /* CONFIG_PPC_STD_MMU_64 */
1531+
#endif /* CONFIG_PPC_BOOK3S_64 */
15321532

15331533
/* Here we have a page fault that hash_page can't handle. */
15341534
handle_page_fault:
@@ -1557,7 +1557,7 @@ handle_dabr_fault:
15571557
12: b ret_from_except_lite
15581558

15591559

1560-
#ifdef CONFIG_PPC_STD_MMU_64
1560+
#ifdef CONFIG_PPC_BOOK3S_64
15611561
/* We have a page fault that hash_page could handle but HV refused
15621562
* the PTE insertion
15631563
*/

arch/powerpc/kernel/machine_kexec_64.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ void default_machine_kexec(struct kimage *image)
360360
/* NOTREACHED */
361361
}
362362

363-
#ifdef CONFIG_PPC_STD_MMU_64
363+
#ifdef CONFIG_PPC_BOOK3S_64
364364
/* Values we need to export to the second kernel via the device tree. */
365365
static unsigned long htab_base;
366366
static unsigned long htab_size;
@@ -402,4 +402,4 @@ static int __init export_htab_values(void)
402402
return 0;
403403
}
404404
late_initcall(export_htab_values);
405-
#endif /* CONFIG_PPC_STD_MMU_64 */
405+
#endif /* CONFIG_PPC_BOOK3S_64 */

arch/powerpc/kernel/mce_power.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ void __flush_tlb_power9(unsigned int action)
168168

169169

170170
/* flush SLBs and reload */
171-
#ifdef CONFIG_PPC_STD_MMU_64
171+
#ifdef CONFIG_PPC_BOOK3S_64
172172
static void flush_and_reload_slb(void)
173173
{
174174
struct slb_shadow *slb;
@@ -215,7 +215,7 @@ static void flush_erat(void)
215215

216216
static int mce_flush(int what)
217217
{
218-
#ifdef CONFIG_PPC_STD_MMU_64
218+
#ifdef CONFIG_PPC_BOOK3S_64
219219
if (what == MCE_FLUSH_SLB) {
220220
flush_and_reload_slb();
221221
return 1;

arch/powerpc/kernel/paca.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ static inline void free_lppacas(void) { }
9090

9191
#endif /* CONFIG_PPC_BOOK3S */
9292

93-
#ifdef CONFIG_PPC_STD_MMU_64
93+
#ifdef CONFIG_PPC_BOOK3S_64
9494

9595
/*
9696
* 3 persistent SLBs are registered here. The buffer will be zero
@@ -135,11 +135,11 @@ static struct slb_shadow * __init init_slb_shadow(int cpu)
135135
return s;
136136
}
137137

138-
#else /* CONFIG_PPC_STD_MMU_64 */
138+
#else /* !CONFIG_PPC_BOOK3S_64 */
139139

140140
static void __init allocate_slb_shadows(int nr_cpus, int limit) { }
141141

142-
#endif /* CONFIG_PPC_STD_MMU_64 */
142+
#endif /* CONFIG_PPC_BOOK3S_64 */
143143

144144
/* The Paca is an array with one entry per processor. Each contains an
145145
* lppaca, which contains the information shared between the
@@ -170,9 +170,9 @@ void __init initialise_paca(struct paca_struct *new_paca, int cpu)
170170
new_paca->kexec_state = KEXEC_STATE_NONE;
171171
new_paca->__current = &init_task;
172172
new_paca->data_offset = 0xfeeeeeeeeeeeeeeeULL;
173-
#ifdef CONFIG_PPC_STD_MMU_64
173+
#ifdef CONFIG_PPC_BOOK3S_64
174174
new_paca->slb_shadow_ptr = init_slb_shadow(cpu);
175-
#endif /* CONFIG_PPC_STD_MMU_64 */
175+
#endif
176176

177177
#ifdef CONFIG_PPC_BOOK3E
178178
/* For now -- if we have threads this will be adjusted later */
@@ -271,7 +271,7 @@ void copy_mm_to_paca(struct mm_struct *mm)
271271
get_paca()->mm_ctx_user_psize = context->user_psize;
272272
get_paca()->mm_ctx_sllp = context->sllp;
273273
#endif
274-
#else /* CONFIG_PPC_BOOK3S */
274+
#else /* !CONFIG_PPC_BOOK3S */
275275
return;
276276
#endif
277277
}

arch/powerpc/kernel/pci_64.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,14 @@ int pcibios_unmap_io_space(struct pci_bus *bus)
9090
* to do an appropriate TLB flush here too
9191
*/
9292
if (bus->self) {
93-
#ifdef CONFIG_PPC_STD_MMU_64
93+
#ifdef CONFIG_PPC_BOOK3S_64
9494
struct resource *res = bus->resource[0];
9595
#endif
9696

9797
pr_debug("IO unmapping for PCI-PCI bridge %s\n",
9898
pci_name(bus->self));
9999

100-
#ifdef CONFIG_PPC_STD_MMU_64
100+
#ifdef CONFIG_PPC_BOOK3S_64
101101
__flush_hash_table_range(&init_mm, res->start + _IO_BASE,
102102
res->end + _IO_BASE + 1);
103103
#endif

arch/powerpc/kernel/process.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,15 +1164,15 @@ struct task_struct *__switch_to(struct task_struct *prev,
11641164
}
11651165
#endif /* CONFIG_PPC64 */
11661166

1167-
#ifdef CONFIG_PPC_STD_MMU_64
1167+
#ifdef CONFIG_PPC_BOOK3S_64
11681168
batch = this_cpu_ptr(&ppc64_tlb_batch);
11691169
if (batch->active) {
11701170
current_thread_info()->local_flags |= _TLF_LAZY_MMU;
11711171
if (batch->index)
11721172
__flush_tlb_pending(batch);
11731173
batch->active = 0;
11741174
}
1175-
#endif /* CONFIG_PPC_STD_MMU_64 */
1175+
#endif /* CONFIG_PPC_BOOK3S_64 */
11761176

11771177
#ifdef CONFIG_PPC_ADV_DEBUG_REGS
11781178
switch_booke_debug_regs(&new->thread.debug);
@@ -1218,7 +1218,7 @@ struct task_struct *__switch_to(struct task_struct *prev,
12181218

12191219
last = _switch(old_thread, new_thread);
12201220

1221-
#ifdef CONFIG_PPC_STD_MMU_64
1221+
#ifdef CONFIG_PPC_BOOK3S_64
12221222
if (current_thread_info()->local_flags & _TLF_LAZY_MMU) {
12231223
current_thread_info()->local_flags &= ~_TLF_LAZY_MMU;
12241224
batch = this_cpu_ptr(&ppc64_tlb_batch);
@@ -1247,7 +1247,7 @@ struct task_struct *__switch_to(struct task_struct *prev,
12471247
: : "r"(dummy_copy_buffer), "r"(0));
12481248
}
12491249
}
1250-
#endif /* CONFIG_PPC_STD_MMU_64 */
1250+
#endif /* CONFIG_PPC_BOOK3S_64 */
12511251

12521252
return last;
12531253
}
@@ -1476,7 +1476,7 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src)
14761476

14771477
static void setup_ksp_vsid(struct task_struct *p, unsigned long sp)
14781478
{
1479-
#ifdef CONFIG_PPC_STD_MMU_64
1479+
#ifdef CONFIG_PPC_BOOK3S_64
14801480
unsigned long sp_vsid;
14811481
unsigned long llp = mmu_psize_defs[mmu_linear_psize].sllp;
14821482

@@ -2056,7 +2056,7 @@ unsigned long arch_randomize_brk(struct mm_struct *mm)
20562056
unsigned long base = mm->brk;
20572057
unsigned long ret;
20582058

2059-
#ifdef CONFIG_PPC_STD_MMU_64
2059+
#ifdef CONFIG_PPC_BOOK3S_64
20602060
/*
20612061
* If we are using 1TB segments and we are allowed to randomise
20622062
* the heap, we can put it above 1TB so it is backed by a 1TB

arch/powerpc/kernel/prom.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ static void __init check_cpu_pa_features(unsigned long node)
229229
ibm_pa_features, ARRAY_SIZE(ibm_pa_features));
230230
}
231231

232-
#ifdef CONFIG_PPC_STD_MMU_64
232+
#ifdef CONFIG_PPC_BOOK3S_64
233233
static void __init init_mmu_slb_size(unsigned long node)
234234
{
235235
const __be32 *slb_size_ptr;

arch/powerpc/kernel/setup-common.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,7 @@ void arch_setup_pdev_archdata(struct platform_device *pdev)
773773
static __init void print_system_info(void)
774774
{
775775
pr_info("-----------------------------------------------------\n");
776-
#ifdef CONFIG_PPC_STD_MMU_64
776+
#ifdef CONFIG_PPC_BOOK3S_64
777777
pr_info("ppc64_pft_size = 0x%llx\n", ppc64_pft_size);
778778
#endif
779779
#ifdef CONFIG_PPC_STD_MMU_32
@@ -800,7 +800,7 @@ static __init void print_system_info(void)
800800
pr_info("firmware_features = 0x%016lx\n", powerpc_firmware_features);
801801
#endif
802802

803-
#ifdef CONFIG_PPC_STD_MMU_64
803+
#ifdef CONFIG_PPC_BOOK3S_64
804804
if (htab_address)
805805
pr_info("htab_address = 0x%p\n", htab_address);
806806
if (htab_hash_mask)

0 commit comments

Comments
 (0)