Skip to contentSkip to conversation

mm, x86: fix native_pud_clear build error

PATCH In review Arnd Bergmann 3 participants 3 messages Mar 14, 2017 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm, x86: fix native_pud_clear build error

We still get a build error in random configurations, after this has been modified a few times:

In file included from include/linux/mm.h:68:0,

                 from include/linux/suspend.h:8,
                 from arch/x86/kernel/asm-offsets.c:12:

arch/x86/include/asm/pgtable.h:66:26: error: redefinition of 'native_pud_clear'
#define pud_clear(pud) native_pud_clear(pud)

My interpretation is that the build error comes from a typo in __PAGETABLE_PUD_FOLDED, so fix that typo now, and remove the incorrect #ifdef around the native_pud_clear definition.

Fixes 3e761a42e19c ("mm, x86: fix HIGHMEM64 && PARAVIRT build config for native_pud_clear()")
Fixes a00cc7d9dd93 ("mm, x86: add support for PUD-sized transparent hugepages")
---
 arch/x86/include/asm/pgtable-3level.h | 3 ---
 arch/x86/include/asm/pgtable.h        | 2 +-
 2 files changed, 1 insertion(+), 4 deletions(-)
arch/x86/include/asm/pgtable-3level.h +0 -3
index 72277b1028a5..50d35e3185f5 100644
@@ -121,12 +121,9 @@ static inline void native_pmd_clear(pmd_t *pmd)
 	*(tmp + 1) = 0;
 }
 
-#if !defined(CONFIG_SMP) || (defined(CONFIG_HIGHMEM64G) && \
-		defined(CONFIG_PARAVIRT))
 static inline void native_pud_clear(pud_t *pudp)
 {
 }
-#endif
 
 static inline void pud_clear(pud_t *pudp)
 {
arch/x86/include/asm/pgtable.h +1 -1
index 1cfb36b8c024..585ee0d42d18 100644
@@ -62,7 +62,7 @@ extern struct mm_struct *pgd_page_get_mm(struct page *page);
 # define set_pud(pudp, pud)		native_set_pud(pudp, pud)
 #endif
 
-#ifndef __PAGETABLE_PMD_FOLDED
+#ifndef __PAGETABLE_PUD_FOLDED
 #define pud_clear(pud)			native_pud_clear(pud)
 #endif
 
Signature · 1 line
2.9.0
#1 lore raw
Quoted 9 lines · Arnd Bergmann

We still get a build error in random configurations, after this has been modified a few times:

In file included from include/linux/mm.h:68:0,

                 from include/linux/suspend.h:8,
                 from arch/x86/kernel/asm-offsets.c:12:

arch/x86/include/asm/pgtable.h:66:26: error: redefinition of 'native_pud_clear'
#define pud_clear(pud) native_pud_clear(pud)

Quoted 7 lines

My interpretation is that the build error comes from a typo in __PAGETABLE_PUD_FOLDED, so fix that typo now, and remove the incorrect #ifdef around the native_pud_clear definition.

Fixes 3e761a42e19c ("mm, x86: fix HIGHMEM64 && PARAVIRT build config for native_pud_clear()")
Fixes a00cc7d9dd93 ("mm, x86: add support for PUD-sized transparent hugepages")

Thanks for catching this Arnd. I built with all the other configs that were failing before and they all passed.

Quoted 38 lines
---
 arch/x86/include/asm/pgtable-3level.h | 3 ---
 arch/x86/include/asm/pgtable.h        | 2 +-
 2 files changed, 1 insertion(+), 4 deletions(-)
arch/x86/include/asm/pgtable-3level.h +0 -3
index 72277b1028a5..50d35e3185f5 100644
@@ -121,12 +121,9 @@ static inline void native_pmd_clear(pmd_t *pmd)
 	*(tmp + 1) = 0;
 }
 
-#if !defined(CONFIG_SMP) || (defined(CONFIG_HIGHMEM64G) && \
-		defined(CONFIG_PARAVIRT))
 static inline void native_pud_clear(pud_t *pudp)
 {
 }
-#endif
 
 static inline void pud_clear(pud_t *pudp)
 {
arch/x86/include/asm/pgtable.h +1 -1
index 1cfb36b8c024..585ee0d42d18 100644
@@ -62,7 +62,7 @@ extern struct mm_struct *pgd_page_get_mm(struct page *page);
 # define set_pud(pudp, pud)		native_set_pud(pudp, pud)
 #endif
 
-#ifndef __PAGETABLE_PMD_FOLDED
+#ifndef __PAGETABLE_PUD_FOLDED
 #define pud_clear(pud)			native_pud_clear(pud)
 #endif
 
Signature · 1 line
2.9.0
Signature · 4 lines
Dave Jiang
Software Engineer, Data Center Group
Intel Corp.
[email protected]
#2 lore raw

[tip:x86/urgent] mm, x86: Fix native_pud_clear build error

In reply to Arnd Bergmann
mm, x86: Fix native_pud_clear build error
Commit-ID:  d434936e4cbb10181463622962f30b989d3e9e19
Gitweb:     http://git.kernel.org/tip/d434936e4cbb10181463622962f30b989d3e9e19
Author:     Arnd Bergmann <[email protected]>
AuthorDate: Tue, 14 Mar 2017 13:12:53 +0100
Committer:  Thomas Gleixner <[email protected]>
CommitDate: Tue, 14 Mar 2017 20:30:30 +0100

mm, x86: Fix native_pud_clear build error

We still get a build error in random configurations, after this has been modified a few times:

In file included from include/linux/mm.h:68:0,

                 from include/linux/suspend.h:8,
                 from arch/x86/kernel/asm-offsets.c:12:

arch/x86/include/asm/pgtable.h:66:26: error: redefinition of 'native_pud_clear'
#define pud_clear(pud) native_pud_clear(pud)

My interpretation is that the build error comes from a typo in __PAGETABLE_PUD_FOLDED, so fix that typo now, and remove the incorrect #ifdef around the native_pud_clear definition.

Fixes 3e761a42e19c ("mm, x86: fix HIGHMEM64 && PARAVIRT build config for native_pud_clear()")
Fixes a00cc7d9dd93 ("mm, x86: add support for PUD-sized transparent hugepages")
Cc Kees Cook <[email protected]>
Cc Dave Hansen <[email protected]>
Cc Hugh Dickins <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc Thomas Garnier <[email protected]>
---
 arch/x86/include/asm/pgtable-3level.h | 3 ---
 arch/x86/include/asm/pgtable.h        | 2 +-
 2 files changed, 1 insertion(+), 4 deletions(-)
arch/x86/include/asm/pgtable-3level.h +0 -3
index 72277b1..50d35e3 100644
@@ -121,12 +121,9 @@ static inline void native_pmd_clear(pmd_t *pmd)
 	*(tmp + 1) = 0;
 }
 
-#if !defined(CONFIG_SMP) || (defined(CONFIG_HIGHMEM64G) && \
-		defined(CONFIG_PARAVIRT))
 static inline void native_pud_clear(pud_t *pudp)
 {
 }
-#endif
 
 static inline void pud_clear(pud_t *pudp)
 {
arch/x86/include/asm/pgtable.h +1 -1
index 1cfb36b..585ee0d 100644
@@ -62,7 +62,7 @@ extern struct mm_struct *pgd_page_get_mm(struct page *page);
 # define set_pud(pudp, pud)		native_set_pud(pudp, pud)
 #endif
 
-#ifndef __PAGETABLE_PMD_FOLDED
+#ifndef __PAGETABLE_PUD_FOLDED
 #define pud_clear(pud)			native_pud_clear(pud)
 #endif