]> git.baikalelectronics.ru Git - kernel.git/commit
m68k: mm: Restructure Motorola MMU page-table layout
authorPeter Zijlstra <peterz@infradead.org>
Fri, 31 Jan 2020 12:45:36 +0000 (13:45 +0100)
committerGeert Uytterhoeven <geert@linux-m68k.org>
Mon, 10 Feb 2020 09:57:48 +0000 (10:57 +0100)
commitef22d8abd876e805b604e8f655127de2beee2869
treed5a4ba746cf6d03a129d13183934f0a20dd1ee95
parent5ad272abee9fe0a781d49b03f334c0a3b3e418c1
m68k: mm: Restructure Motorola MMU page-table layout

The Motorola 68xxx MMUs, 040 (and later) have a fixed 7,7,{5,6}
page-table setup, where the last depends on the page-size selected (8k
vs 4k resp.), and head.S selects 4K pages. For 030 (and earlier) we
explicitly program 7,7,6 and 4K pages in %tc.

However, the current code implements this mightily weird. What it does
is group 16 of those (6 bit) pte tables into one 4k page to not waste
space. The down-side is that that forces pmd_t to be a 16-tuple
pointing to consecutive pte tables.

This breaks the generic code which assumes READ_ONCE(*pmd) will be
word sized.

Therefore implement a straight forward 7,7,6 3 level page-table setup,
with the addition (for 020/030) of (partial) large-page support. For
now this increases the memory footprint for pte-tables 15 fold.

Tested with ARAnyM/68040 emulation.

Suggested-by: Will Deacon <will@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Will Deacon <will@kernel.org>
Acked-by: Greg Ungerer <gerg@linux-m68k.org>
Tested-by: Michael Schmitz <schmitzmic@gmail.com>
Tested-by: Greg Ungerer <gerg@linux-m68k.org>
Link: https://lore.kernel.org/r/20200131125403.711478295@infradead.org
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
arch/m68k/include/asm/motorola_pgtable.h
arch/m68k/include/asm/page.h
arch/m68k/include/asm/pgtable_mm.h
arch/m68k/mm/kmap.c
arch/m68k/mm/motorola.c