mirror of
https://github.com/torvalds/linux.git
synced 2024-11-01 13:03:25 +01:00
232ca1eeca
hash_page() needs to read page tables from kernel memory. When entire
kernel memory is mapped by BATs, which is normally the case when
CONFIG_STRICT_KERNEL_RWX is not set, it works even if the page hosting
the page table is not referenced in the MMU hash table.
However, if the page where the page table resides is not covered by
a BAT, a DSI fault can be encountered from hash_page(), and it loops
forever. This can happen when CONFIG_STRICT_KERNEL_RWX is selected
and the alignment of the different regions is too small to allow
covering the entire memory with BATs. This also happens when
CONFIG_DEBUG_PAGEALLOC is selected or when booting with 'nobats'
flag.
Also, if the page containing the kernel stack is not present in the
MMU hash table, registers cannot be saved and a recursive DSI fault
is encountered.
To allow hash_page() to properly do its job at all time and load the
MMU hash table whenever needed, it must run with data MMU disabled.
This means it must be called before re-enabling data MMU. To allow
this, registers clobbered by hash_page() and create_hpte() have to
be saved in the thread struct together with SRR0, SSR1, DAR and DSISR.
It is also necessary to ensure that DSI prolog doesn't overwrite
regs saved by prolog of the current running exception. That means:
- DSI can only use SPRN_SPRG_SCRATCH0
- Exceptions must free SPRN_SPRG_SCRATCH0 before writing to the stack.
This also fixes the Oops reported by Erhard when create_hpte() is
called by add_hash_page().
Due to prolog size increase, a few more exceptions had to get split
in two parts.
Fixes:
|
||
---|---|---|
.. | ||
book3s32 | ||
book3s64 | ||
kasan | ||
nohash | ||
ptdump | ||
copro_fault.c | ||
dma-noncoherent.c | ||
drmem.c | ||
fault.c | ||
highmem.c | ||
hugetlbpage.c | ||
init-common.c | ||
init_32.c | ||
init_64.c | ||
ioremap.c | ||
ioremap_32.c | ||
ioremap_64.c | ||
Makefile | ||
mem.c | ||
mmap.c | ||
mmu_context.c | ||
mmu_decl.h | ||
numa.c | ||
pgtable-frag.c | ||
pgtable.c | ||
pgtable_32.c | ||
pgtable_64.c | ||
slice.c |