Skip to contentSkip to conversation

parisc: Remap hugepage-aligned pages in set_kernel_text_rw()

PATCH New Helge Deller 1 participant 1 message Jan 4, 2019 PA-RISC architecture

lore
Share & tools
lore

Helge Deller

author maintainer
#0 lore raw

PATCH 1/1 parisc: Remap hugepage-aligned pages in set_kernel_text_rw()

The alternative coding patch for parisc in kernel 4.20 broke booting machines with PA8500-PA8700 CPUs. The problem is, that for such machines the parisc kernel automatically utilizes huge pages to access kernel text code, but the set_kernel_text_rw() function, which is used shortly before applying any alternative patches, didn't used the correctly hugepage-aligned addresses to remap the kernel text read-writeable.

Fixes 3847dab77421 ("parisc: Add alternative coding infrastructure")
Cc <[email protected]> [4.20]
arch/parisc/mm/init.c +2 -2
index 2d7cffc..059187a 100644
@@ -512,8 +512,8 @@ static void __init map_pages(unsigned long start_vaddr,
 
 void __init set_kernel_text_rw(int enable_read_write)
 {
-	unsigned long start = (unsigned long)__init_begin;
-	unsigned long end   = (unsigned long)_etext;
+	unsigned long start = (unsigned long) _text;
+	unsigned long end   = (unsigned long) &data_start;
 
 	map_pages(start, __pa(start), end-start,
 		PAGE_KERNEL_RWX, enable_read_write ? 1:0);