sparc64: use the generic get_user_pages_fast code

The sparc64 code is mostly equivalent to the generic one, minus various
bugfixes and two arch overrides that this patch adds to pgtable.h.

Link: http://lkml.kernel.org/r/20190625143715.1689-10-hch@lst.de
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Khalid Aziz <khalid.aziz@oracle.com>
Cc: David Miller <davem@davemloft.net>
Cc: Andrey Konovalov <andreyknvl@google.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: James Hogan <jhogan@kernel.org>
Cc: Jason Gunthorpe <jgg@mellanox.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Paul Burton <paul.burton@mips.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Rich Felker <dalias@libc.org>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Christoph Hellwig
2019-07-11 20:57:11 -07:00
committed by Linus Torvalds
parent 5875509d2f
commit 7b9afb86b6
4 changed files with 20 additions and 341 deletions

View File

@@ -1100,6 +1100,24 @@ static inline unsigned long untagged_addr(unsigned long start)
}
#define untagged_addr untagged_addr
static inline bool pte_access_permitted(pte_t pte, bool write)
{
u64 prot;
if (tlb_type == hypervisor) {
prot = _PAGE_PRESENT_4V | _PAGE_P_4V;
if (write)
prot |= _PAGE_WRITE_4V;
} else {
prot = _PAGE_PRESENT_4U | _PAGE_P_4U;
if (write)
prot |= _PAGE_WRITE_4U;
}
return (pte_val(pte) & (prot | _PAGE_SPECIAL)) == prot;
}
#define pte_access_permitted pte_access_permitted
#include <asm/tlbflush.h>
#include <asm-generic/pgtable.h>