提交 c9fa406f 编写于 作者: J John David Anglin 提交者: Helge Deller

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: NJohn David Anglin <dave.anglin@bell.net>
Signed-off-by: NHelge Deller <deller@gmx.de>
上级 87613bb9
...@@ -513,17 +513,15 @@ static void __init map_pages(unsigned long start_vaddr, ...@@ -513,17 +513,15 @@ static void __init map_pages(unsigned long start_vaddr,
void __init set_kernel_text_rw(int enable_read_write) 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; unsigned long end = (unsigned long)_etext;
map_pages(start, __pa(start), end-start, map_pages(start, __pa(start), end-start,
PAGE_KERNEL_RWX, enable_read_write ? 1:0); PAGE_KERNEL_RWX, enable_read_write ? 1:0);
/* force the kernel to see the new TLB entries */ /* force the kernel to see the new page table entries */
__flush_tlb_range(0, start, end); flush_cache_all();
flush_tlb_all();
/* dump old cached instructions */
flush_icache_range(start, end);
} }
void __ref free_initmem(void) void __ref free_initmem(void)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册