]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
mm: add pmd_t initializer __pmd() to work around a GCC bug.
authorZi Yan <zi.yan@cs.rutgers.edu>
Thu, 3 Aug 2017 13:17:21 +0000 (09:17 -0400)
committerDavid S. Miller <davem@davemloft.net>
Thu, 10 Aug 2017 22:03:57 +0000 (15:03 -0700)
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>
arch/sparc/include/asm/page_32.h

index 0efd0583a8c9da1afc2acc508f2e2e1a5388441d..6249214148c24bb44f2203117200768a410cee2d 100644 (file)
@@ -68,6 +68,7 @@ typedef struct { unsigned long iopgprot; } iopgprot_t;
 #define iopgprot_val(x)        ((x).iopgprot)
 
 #define __pte(x)       ((pte_t) { (x) } )
+#define __pmd(x)       ((pmd_t) { { (x) }, })
 #define __iopte(x)     ((iopte_t) { (x) } )
 #define __pgd(x)       ((pgd_t) { (x) } )
 #define __ctxd(x)      ((ctxd_t) { (x) } )
@@ -95,6 +96,7 @@ typedef unsigned long iopgprot_t;
 #define iopgprot_val(x)        (x)
 
 #define __pte(x)       (x)
+#define __pmd(x)       ((pmd_t) { { (x) }, })
 #define __iopte(x)     (x)
 #define __pgd(x)       (x)
 #define __ctxd(x)      (x)