summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorJohn David Anglin <dave.anglin@bell.net>2018-10-27 18:03:25 -0400
committerHelge Deller <deller@gmx.de>2018-10-28 10:51:07 +0100
commitc9fa406f62ec952bc4689b5120a02759ce42a68d (patch)
treeeafce52eebd87b450230d9d3ae83a3f49d0ca2c2 /arch
parent87613bb9d20c556b5eeae04f4caf40701189f07b (diff)
parisc: Fix A500 boot crash
I believe the following change will fix the cache/TLB inconsistency observed by Meelis. After changing the page table entries, we need to flush the cache and TLB to ensure that we don't have any stale PTE values in the cache or TLB. The alternative patching is done after all CPUs are running. Thus, we need to flush the whole cache and TLB. I included the init section in the range modified by map_pages as suggested by Helge. Some routines in the init section may require patching. Signed-off-by: John David Anglin <dave.anglin@bell.net> Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/parisc/mm/init.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c
index e7e626bcd0be..f88a52b8531c 100644
--- a/arch/parisc/mm/init.c
+++ b/arch/parisc/mm/init.c
@@ -513,17 +513,15 @@ static void __init map_pages(unsigned long start_vaddr,
void __init set_kernel_text_rw(int enable_read_write)
{
- unsigned long start = (unsigned long)_stext;
+ unsigned long start = (unsigned long)__init_begin;
unsigned long end = (unsigned long)_etext;
map_pages(start, __pa(start), end-start,
PAGE_KERNEL_RWX, enable_read_write ? 1:0);
- /* force the kernel to see the new TLB entries */
- __flush_tlb_range(0, start, end);
-
- /* dump old cached instructions */
- flush_icache_range(start, end);
+ /* force the kernel to see the new page table entries */
+ flush_cache_all();
+ flush_tlb_all();
}
void __ref free_initmem(void)