Skip to content

Commit 0a956d5

Browse files
rpptmcgrof
authored andcommitted
powerpc: use CONFIG_EXECMEM instead of CONFIG_MODULES where appropriate
There are places where CONFIG_MODULES guards the code that depends on memory allocation being done with module_alloc(). Replace CONFIG_MODULES with CONFIG_EXECMEM in such places. Signed-off-by: Mike Rapoport (IBM) <rppt@kernel.org> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
1 parent 14e56fb commit 0a956d5

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

arch/powerpc/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ config PPC
286286
select IOMMU_HELPER if PPC64
287287
select IRQ_DOMAIN
288288
select IRQ_FORCED_THREADING
289-
select KASAN_VMALLOC if KASAN && MODULES
289+
select KASAN_VMALLOC if KASAN && EXECMEM
290290
select LOCK_MM_AND_FIND_VMA
291291
select MMU_GATHER_PAGE_SIZE
292292
select MMU_GATHER_RCU_TABLE_FREE

arch/powerpc/include/asm/kasan.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
#define KASAN_SHADOW_SCALE_SHIFT 3
2121

22-
#if defined(CONFIG_MODULES) && defined(CONFIG_PPC32)
22+
#if defined(CONFIG_EXECMEM) && defined(CONFIG_PPC32)
2323
#define KASAN_KERN_START ALIGN_DOWN(PAGE_OFFSET - SZ_256M, SZ_256M)
2424
#else
2525
#define KASAN_KERN_START PAGE_OFFSET

arch/powerpc/kernel/head_8xx.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,12 +199,12 @@ instruction_counter:
199199
mfspr r10, SPRN_SRR0 /* Get effective address of fault */
200200
INVALIDATE_ADJACENT_PAGES_CPU15(r10, r11)
201201
mtspr SPRN_MD_EPN, r10
202-
#ifdef CONFIG_MODULES
202+
#ifdef CONFIG_EXECMEM
203203
mfcr r11
204204
compare_to_kernel_boundary r10, r10
205205
#endif
206206
mfspr r10, SPRN_M_TWB /* Get level 1 table */
207-
#ifdef CONFIG_MODULES
207+
#ifdef CONFIG_EXECMEM
208208
blt+ 3f
209209
rlwinm r10, r10, 0, 20, 31
210210
oris r10, r10, (swapper_pg_dir - PAGE_OFFSET)@ha

arch/powerpc/kernel/head_book3s_32.S

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -419,14 +419,14 @@ InstructionTLBMiss:
419419
*/
420420
/* Get PTE (linux-style) and check access */
421421
mfspr r3,SPRN_IMISS
422-
#ifdef CONFIG_MODULES
422+
#ifdef CONFIG_EXECMEM
423423
lis r1, TASK_SIZE@h /* check if kernel address */
424424
cmplw 0,r1,r3
425425
#endif
426426
mfspr r2, SPRN_SDR1
427427
li r1,_PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_EXEC
428428
rlwinm r2, r2, 28, 0xfffff000
429-
#ifdef CONFIG_MODULES
429+
#ifdef CONFIG_EXECMEM
430430
li r0, 3
431431
bgt- 112f
432432
lis r2, (swapper_pg_dir - PAGE_OFFSET)@ha /* if kernel address, use */
@@ -442,7 +442,7 @@ InstructionTLBMiss:
442442
andc. r1,r1,r2 /* check access & ~permission */
443443
bne- InstructionAddressInvalid /* return if access not permitted */
444444
/* Convert linux-style PTE to low word of PPC-style PTE */
445-
#ifdef CONFIG_MODULES
445+
#ifdef CONFIG_EXECMEM
446446
rlwimi r2, r0, 0, 31, 31 /* userspace ? -> PP lsb */
447447
#endif
448448
ori r1, r1, 0xe06 /* clear out reserved bits */

arch/powerpc/lib/code-patching.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ void __init poking_init(void)
225225

226226
static unsigned long get_patch_pfn(void *addr)
227227
{
228-
if (IS_ENABLED(CONFIG_MODULES) && is_vmalloc_or_module_addr(addr))
228+
if (IS_ENABLED(CONFIG_EXECMEM) && is_vmalloc_or_module_addr(addr))
229229
return vmalloc_to_pfn(addr);
230230
else
231231
return __pa_symbol(addr) >> PAGE_SHIFT;

arch/powerpc/mm/book3s32/mmu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ unsigned long __init mmu_mapin_ram(unsigned long base, unsigned long top)
184184

185185
static bool is_module_segment(unsigned long addr)
186186
{
187-
if (!IS_ENABLED(CONFIG_MODULES))
187+
if (!IS_ENABLED(CONFIG_EXECMEM))
188188
return false;
189189
if (addr < ALIGN_DOWN(MODULES_VADDR, SZ_256M))
190190
return false;

0 commit comments

Comments
 (0)