nios2/mm: refactor swap PTE layout
authorDavid Hildenbrand <david@redhat.com>
Fri, 13 Jan 2023 17:10:13 +0000 (18:10 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 3 Feb 2023 06:33:08 +0000 (22:33 -0800)
commit0a9ad8273ff4643dd50ff6b3ec991ab270e87a89
treee9beec3b782f365ca7063c6a772fe3adfa7e3bb5
parent83d3b2b46ea3f8fa542fb7528b3bca6f476d0fab
nios2/mm: refactor swap PTE layout

nios2 disables swap for a good reason: it doesn't even provide sufficient
type bits as required by core MM.  However, swap entries are nowadays also
used for other purposes (migration entries, PTE markers, HWPoison, ...),
and accidential use could be problematic.

Let's properly use 5 bits for the swap type and document the layout.  Bits
26--31 should get ignored by hardware completely, so they can be used.

Link: https://lkml.kernel.org/r/20230113171026.582290-14-david@redhat.com
Signed-off-by: David Hildenbrand <david@redhat.com>
Cc: Dinh Nguyen <dinguyen@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
arch/nios2/include/asm/pgtable.h