aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZi Yan <zi.yan@cs.rutgers.edu>2017-08-03 09:17:21 -0400
committerDavid S. Miller <davem@davemloft.net>2017-08-10 18:03:57 -0400
commit9157259d16a8ee8116a98d32f29b797689327e8d (patch)
tree9e6be0a3afafd94057c375dc241ccee9179313c4
parent26273939ace935dd7553b31d279eab30b40f7b9a (diff)
mm: add pmd_t initializer __pmd() to work around a GCC bug.
THP migration is added but only supports x86_64 at the moment. For all other architectures, swp_entry_to_pmd() only returns a zero pmd_t. Due to a GCC zero initializer bug #53119, the standard (pmd_t){0} initializer is not accepted by all GCC versions. __pmd() is a feasible workaround. In addition, sparc32's pmd_t is an array instead of a single value, so we need (pmd_t){ {0}, } instead of (pmd_t){0}. Thus, a different __pmd() definition is needed in sparc32. Signed-off-by: Zi Yan <zi.yan@cs.rutgers.edu> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--arch/sparc/include/asm/page_32.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/sparc/include/asm/page_32.h b/arch/sparc/include/asm/page_32.h
index 0efd0583a8c9..6249214148c2 100644
--- a/arch/sparc/include/asm/page_32.h
+++ b/arch/sparc/include/asm/page_32.h
@@ -68,6 +68,7 @@ typedef struct { unsigned long iopgprot; } iopgprot_t;
68#define iopgprot_val(x) ((x).iopgprot) 68#define iopgprot_val(x) ((x).iopgprot)
69 69
70#define __pte(x) ((pte_t) { (x) } ) 70#define __pte(x) ((pte_t) { (x) } )
71#define __pmd(x) ((pmd_t) { { (x) }, })
71#define __iopte(x) ((iopte_t) { (x) } ) 72#define __iopte(x) ((iopte_t) { (x) } )
72#define __pgd(x) ((pgd_t) { (x) } ) 73#define __pgd(x) ((pgd_t) { (x) } )
73#define __ctxd(x) ((ctxd_t) { (x) } ) 74#define __ctxd(x) ((ctxd_t) { (x) } )
@@ -95,6 +96,7 @@ typedef unsigned long iopgprot_t;
95#define iopgprot_val(x) (x) 96#define iopgprot_val(x) (x)
96 97
97#define __pte(x) (x) 98#define __pte(x) (x)
99#define __pmd(x) ((pmd_t) { { (x) }, })
98#define __iopte(x) (x) 100#define __iopte(x) (x)
99#define __pgd(x) (x) 101#define __pgd(x) (x)
100#define __ctxd(x) (x) 102#define __ctxd(x) (x)