[PATCH 2/2] x86: mmu.h: move mm_context_t::ia32_compat member a bit down

From: Rasmus Villemoes
Date: Wed Aug 28 2019 - 15:38:50 EST


For CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS=n, there's both a
6-byte hole after ia32_compat as well as a 4-byte hole after
perf_rdpmc_allowed. So rearranging things a bit we cut 8 bytes of
sizeof(struct mm_struct).

For a CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS=y kernel, this patch
just moves the 6-byte hole to another place in mm_context_t.

Putting the ia32_compat member after the pkey members is deliberate to
keep the latter two (when present) in the same 4-byte unit.

Signed-off-by: Rasmus Villemoes <linux@xxxxxxxxxxxxxxxxxx>
---
arch/x86/include/asm/mmu.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/x86/include/asm/mmu.h b/arch/x86/include/asm/mmu.h
index b1bb47a3577b..ba3d22fcd507 100644
--- a/arch/x86/include/asm/mmu.h
+++ b/arch/x86/include/asm/mmu.h
@@ -32,10 +32,6 @@ typedef struct {
struct ldt_struct *ldt;
struct mutex lock;
#endif
-#ifdef CONFIG_X86_64
- /* True if mm supports a task running in 32 bit compatibility mode. */
- unsigned short ia32_compat;
-#endif

void __user *vdso; /* vdso base address */
const struct vdso_image *vdso_image; /* vdso image in use */
@@ -49,6 +45,10 @@ typedef struct {
u16 pkey_allocation_map;
s16 execute_only_pkey;
#endif
+#ifdef CONFIG_X86_64
+ /* True if mm supports a task running in 32 bit compatibility mode. */
+ unsigned short ia32_compat;
+#endif
#ifdef CONFIG_X86_INTEL_MPX
/* address of the bounds directory */
void __user *bd_addr;
--
2.20.1