riscv: Add pte bit to distinguish swap from invalid
authorStefan O'Rear <sorear2@gmail.com>
Sun, 16 Dec 2018 18:03:36 +0000 (13:03 -0500)
committerPalmer Dabbelt <palmer@sifive.com>
Mon, 11 Feb 2019 23:24:45 +0000 (15:24 -0800)
commite3613bb8afc2a9474c9214d65c8326c5ac02135e
tree0d6154dd8b888012626472436e12cc33da1565d9
parentd13937116f1e82bf508a6325111b322c30c85eb9
riscv: Add pte bit to distinguish swap from invalid

Previously, invalid PTEs and swap PTEs had the same binary
representation, causing errors when attempting to unmap PROT_NONE
mappings, including implicit unmap on exit.

Typical error:

swap_info_get: Bad swap file entry 40000000007a9879
BUG: Bad page map in process a.out  pte:3d4c3cc0 pmd:3e521401

Cc: stable@vger.kernel.org
Signed-off-by: Stefan O'Rear <sorear2@gmail.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
arch/riscv/include/asm/pgtable-bits.h
arch/riscv/include/asm/pgtable.h