zhang / rpms / kernel

Forked from rpms/kernel 5 years ago
Clone
e293be
The #ifdef around pud_clear() is very weird, but needed to
e293be
compile bootstrapping arch/x86/boot/compressed/error.c,
e293be
which arch/x86/boot/compressed/misc.h does
e293be
#undef CONFIG_PARAVIRT
e293be
and codepath inside arch/x86/include/asm/pgtable.h
e293be
goes into generally unused codepath, which does
e293be
#ifndef __PAGETABLE_PMD_FOLDED	/* never defined */
e293be
#define pud_clear(pud)                  native_pud_clear(pud)
e293be
#endif
e293be
which will duplicate define pud_clear().
e293be
e293be
e293be
e293be
diff -up ./arch/x86/include/asm/pgtable-3level.h.pud ./arch/x86/include/asm/pgtable-3level.h
e293be
--- ./arch/x86/include/asm/pgtable-3level.h.pud	2018-11-02 13:21:03.000000000 +0900
e293be
+++ ./arch/x86/include/asm/pgtable-3level.h	2018-11-02 13:20:08.000000000 +0900
e293be
@@ -129,12 +129,11 @@ static inline void native_pmd_clear(pmd_
e293be
 	*(tmp + 1) = 0;
e293be
 }
e293be
 
e293be
-#ifndef CONFIG_SMP
e293be
 static inline void native_pud_clear(pud_t *pudp)
e293be
 {
e293be
 }
e293be
-#endif
e293be
 
e293be
+#if /*defined(__PAGETABLE_PMD_FOLDED) &&*/ defined(CONFIG_PARAVIRT)
e293be
 static inline void pud_clear(pud_t *pudp)
e293be
 {
e293be
 	mm_track_pud(pudp);
e293be
@@ -151,6 +150,7 @@ static inline void pud_clear(pud_t *pudp
e293be
 	 * pud_clear_bad()), so we don't need TLB flush here.
e293be
 	 */
e293be
 }
e293be
+#endif
e293be
 
e293be
 #ifdef CONFIG_SMP
e293be
 static inline pte_t native_ptep_get_and_clear(pte_t *ptep)