Skip to content

Commit f15d97d

Browse files
committed
Merge tag 'powerpc-6.15-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
Pull powerpc fixes from Madhavan Srinivasan: - fix to handle patchable function entries during module load - fix to align vmemmap start to page size - fixes to handle compilation errors and warnings Thanks to Anthony Iliopoulos, Donet Tom, Ritesh Harjani (IBM), Venkat Rao Bagalkote, and Stephen Rothwell. * tag 'powerpc-6.15-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/boot: Fix dash warning powerpc/boot: Check for ld-option support powerpc: Add check to select PPC_RADIX_BROADCAST_TLBIE powerpc64/ftrace: fix module loading without patchable function entries book3s64/radix : Align section vmemmap start address to PAGE_SIZE book3s64/radix: Fix compile errors when CONFIG_ARCH_WANT_OPTIMIZE_DAX_VMEMMAP=n
2 parents b94f88d + e3f506b commit f15d97d

File tree

5 files changed

+21
-13
lines changed

5 files changed

+21
-13
lines changed

arch/powerpc/boot/wrapper

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -234,10 +234,8 @@ fi
234234

235235
# suppress some warnings in recent ld versions
236236
nowarn="-z noexecstack"
237-
if ! ld_is_lld; then
238-
if [ "$LD_VERSION" -ge "$(echo 2.39 | ld_version)" ]; then
239-
nowarn="$nowarn --no-warn-rwx-segments"
240-
fi
237+
if "${CROSS}ld" -v --no-warn-rwx-segments >/dev/null 2>&1; then
238+
nowarn="$nowarn --no-warn-rwx-segments"
241239
fi
242240

243241
platformo=$object/"$platform".o

arch/powerpc/kernel/module_64.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,10 +258,6 @@ static unsigned long get_stubs_size(const Elf64_Ehdr *hdr,
258258
break;
259259
}
260260
}
261-
if (i == hdr->e_shnum) {
262-
pr_err("%s: doesn't contain __patchable_function_entries.\n", me->name);
263-
return -ENOEXEC;
264-
}
265261
#endif
266262

267263
pr_debug("Looks like a total of %lu stubs, max\n", relocs);

arch/powerpc/mm/book3s64/radix_pgtable.c

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -976,14 +976,15 @@ int __meminit radix__vmemmap_create_mapping(unsigned long start,
976976
return 0;
977977
}
978978

979-
979+
#ifdef CONFIG_ARCH_WANT_OPTIMIZE_DAX_VMEMMAP
980980
bool vmemmap_can_optimize(struct vmem_altmap *altmap, struct dev_pagemap *pgmap)
981981
{
982982
if (radix_enabled())
983983
return __vmemmap_can_optimize(altmap, pgmap);
984984

985985
return false;
986986
}
987+
#endif
987988

988989
int __meminit vmemmap_check_pmd(pmd_t *pmdp, int node,
989990
unsigned long addr, unsigned long next)
@@ -1120,6 +1121,19 @@ int __meminit radix__vmemmap_populate(unsigned long start, unsigned long end, in
11201121
pmd_t *pmd;
11211122
pte_t *pte;
11221123

1124+
/*
1125+
* Make sure we align the start vmemmap addr so that we calculate
1126+
* the correct start_pfn in altmap boundary check to decided whether
1127+
* we should use altmap or RAM based backing memory allocation. Also
1128+
* the address need to be aligned for set_pte operation.
1129+
1130+
* If the start addr is already PMD_SIZE aligned we will try to use
1131+
* a pmd mapping. We don't want to be too aggressive here beacause
1132+
* that will cause more allocations in RAM. So only if the namespace
1133+
* vmemmap start addr is PMD_SIZE aligned we will use PMD mapping.
1134+
*/
1135+
1136+
start = ALIGN_DOWN(start, PAGE_SIZE);
11231137
for (addr = start; addr < end; addr = next) {
11241138
next = pmd_addr_end(addr, end);
11251139

@@ -1145,8 +1159,8 @@ int __meminit radix__vmemmap_populate(unsigned long start, unsigned long end, in
11451159
* in altmap block allocation failures, in which case
11461160
* we fallback to RAM for vmemmap allocation.
11471161
*/
1148-
if (altmap && (!IS_ALIGNED(addr, PMD_SIZE) ||
1149-
altmap_cross_boundary(altmap, addr, PMD_SIZE))) {
1162+
if (!IS_ALIGNED(addr, PMD_SIZE) || (altmap &&
1163+
altmap_cross_boundary(altmap, addr, PMD_SIZE))) {
11501164
/*
11511165
* make sure we don't create altmap mappings
11521166
* covering things outside the device.

arch/powerpc/platforms/powernv/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ config PPC_POWERNV
1717
select MMU_NOTIFIER
1818
select FORCE_SMP
1919
select ARCH_SUPPORTS_PER_VMA_LOCK
20-
select PPC_RADIX_BROADCAST_TLBIE
20+
select PPC_RADIX_BROADCAST_TLBIE if PPC_RADIX_MMU
2121
default y
2222

2323
config OPAL_PRD

arch/powerpc/platforms/pseries/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ config PPC_PSERIES
2323
select FORCE_SMP
2424
select SWIOTLB
2525
select ARCH_SUPPORTS_PER_VMA_LOCK
26-
select PPC_RADIX_BROADCAST_TLBIE
26+
select PPC_RADIX_BROADCAST_TLBIE if PPC_RADIX_MMU
2727
default y
2828

2929
config PARAVIRT

0 commit comments

Comments
 (0)