Skip to contentSkip to conversation

generic gup fixups

PATCH In review Christoph Hellwig 2 participants 5 messages Jul 1, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Hi Andrew,

below two fixups for the generic GUP series, as reported by Guenter.

#1 lore raw

PATCH 1/2 sh: stub out pud_page

There wasn't any actual need to add a real pud_page, as pud_huge always returns false on sh. Just stub it out to fix the sh3 compile failure.

Fixes 937b4e1d6471 ("sh: add the missing pud_page definition")
---
 arch/sh/include/asm/pgtable-3level.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
arch/sh/include/asm/pgtable-3level.h +3 -1
index 3c7ff20f3f94..779260b721ca 100644
@@ -37,7 +37,9 @@ static inline unsigned long pud_page_vaddr(pud_t pud)
 {
 	return pud_val(pud);
 }
-#define pud_page(pud)		pfn_to_page(pud_pfn(pud))
+
+/* only used by the stubbed out hugetlb gup code, should never be called */
+#define pud_page(pud)		NULL
 
 #define pmd_index(address)	(((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1))
 static inline pmd_t *pmd_offset(pud_t *pud, unsigned long address)
Signature · 1 line
2.20.1
Tested-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] sh: stub out pud_page

Quoted 7 lines · Christoph Hellwig

There wasn't any actual need to add a real pud_page, as pud_huge always returns false on sh. Just stub it out to fix the sh3 compile failure.

Fixes 937b4e1d6471 ("sh: add the missing pud_page definition")
Quoted 22 lines
---
 arch/sh/include/asm/pgtable-3level.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
arch/sh/include/asm/pgtable-3level.h +3 -1
index 3c7ff20f3f94..779260b721ca 100644
@@ -37,7 +37,9 @@ static inline unsigned long pud_page_vaddr(pud_t pud)
 {
 	return pud_val(pud);
 }
-#define pud_page(pud)		pfn_to_page(pud_pfn(pud))
+
+/* only used by the stubbed out hugetlb gup code, should never be called */
+#define pud_page(pud)		NULL
 
 #define pmd_index(address)	(((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1))
 static inline pmd_t *pmd_offset(pud_t *pud, unsigned long address)
Signature · 1 line
2.20.1
#3 lore raw

PATCH 2/2 MIPS: don't select ARCH_HAS_PTE_SPECIAL

In reply to Christoph Hellwig

MIPS doesn't really have a proper pte_special implementation, just stubs. It turns out they were not enough to make get_user_pages_fast work, so drop the select. This means get_user_pages_fast won't actually use the fast path for non-hugepage mappings, so someone who actually knows about mips page table management should look into adding real pte_special support.

Fixes eb9488e58bbc ("MIPS: use the generic get_user_pages_fast code")
---
 arch/mips/Kconfig | 1 -
 1 file changed, 1 deletion(-)
arch/mips/Kconfig +0 -1
index b1e42f0e4ed0..7957d3457156 100644
@@ -6,7 +6,6 @@ config MIPS
 	select ARCH_BINFMT_ELF_STATE if MIPS_FP_SUPPORT
 	select ARCH_CLOCKSOURCE_DATA
 	select ARCH_HAS_ELF_RANDOMIZE
-	select ARCH_HAS_PTE_SPECIAL
 	select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
 	select ARCH_HAS_UBSAN_SANITIZE_ALL
 	select ARCH_SUPPORTS_UPROBES
Signature · 1 line
2.20.1
Tested-by on v1 2/2
#4 lore raw

Re: [PATCH 2/2] MIPS: don't select ARCH_HAS_PTE_SPECIAL

Quoted 10 lines · Christoph Hellwig

MIPS doesn't really have a proper pte_special implementation, just stubs. It turns out they were not enough to make get_user_pages_fast work, so drop the select. This means get_user_pages_fast won't actually use the fast path for non-hugepage mappings, so someone who actually knows about mips page table management should look into adding real pte_special support.

Fixes eb9488e58bbc ("MIPS: use the generic get_user_pages_fast code")
Quoted 19 lines
---
 arch/mips/Kconfig | 1 -
 1 file changed, 1 deletion(-)
arch/mips/Kconfig +0 -1
index b1e42f0e4ed0..7957d3457156 100644
@@ -6,7 +6,6 @@ config MIPS
 	select ARCH_BINFMT_ELF_STATE if MIPS_FP_SUPPORT
 	select ARCH_CLOCKSOURCE_DATA
 	select ARCH_HAS_ELF_RANDOMIZE
-	select ARCH_HAS_PTE_SPECIAL
 	select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
 	select ARCH_HAS_UBSAN_SANITIZE_ALL
 	select ARCH_SUPPORTS_UPROBES
Signature · 1 line
2.20.1