Skip to content
/ linux Public
forked from torvalds/linux

Commit

Permalink
sparc64: use the generic get_user_pages_fast code
Browse files Browse the repository at this point in the history
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/[email protected]
Signed-off-by: Christoph Hellwig <[email protected]>
Reviewed-by: Khalid Aziz <[email protected]>
Cc: David Miller <[email protected]>
Cc: Andrey Konovalov <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: James Hogan <[email protected]>
Cc: Jason Gunthorpe <[email protected]>
Cc: Michael Ellerman <[email protected]>
Cc: Nicholas Piggin <[email protected]>
Cc: Paul Burton <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Ralf Baechle <[email protected]>
Cc: Rich Felker <[email protected]>
Cc: Yoshinori Sato <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Christoph Hellwig authored and torvalds committed Jul 12, 2019
1 parent 5875509 commit 7b9afb8
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 341 deletions.
1 change: 1 addition & 0 deletions arch/sparc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ config SPARC
select RTC_DRV_M48T59
select RTC_SYSTOHC
select HAVE_ARCH_JUMP_LABEL if SPARC64
select HAVE_GENERIC_GUP if SPARC64
select GENERIC_IRQ_SHOW
select ARCH_WANT_IPC_PARSE_VERSION
select GENERIC_PCI_IOMAP
Expand Down
18 changes: 18 additions & 0 deletions arch/sparc/include/asm/pgtable_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
2 changes: 1 addition & 1 deletion arch/sparc/mm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
asflags-y := -ansi
ccflags-y := -Werror

obj-$(CONFIG_SPARC64) += ultra.o tlb.o tsb.o gup.o
obj-$(CONFIG_SPARC64) += ultra.o tlb.o tsb.o
obj-y += fault_$(BITS).o
obj-y += init_$(BITS).o
obj-$(CONFIG_SPARC32) += extable.o srmmu.o iommu.o io-unit.o
Expand Down
340 changes: 0 additions & 340 deletions arch/sparc/mm/gup.c

This file was deleted.

0 comments on commit 7b9afb8

Please sign in to comment.