From: Rasmus Villemoes <linux@rasmusvillemoes.dk>
To: Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
"H. Peter Anvin" <hpa@zytor.com>,
x86@kernel.org
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>,
linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] x86: mmu.h: move mm_context_t::ia32_compat member a bit down
Date: Wed, 28 Aug 2019 21:38:36 +0200 [thread overview]
Message-ID: <20190828193836.16791-2-linux@rasmusvillemoes.dk> (raw)
In-Reply-To: <20190828193836.16791-1-linux@rasmusvillemoes.dk>
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@rasmusvillemoes.dk>
---
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
next prev parent reply other threads:[~2019-08-28 19:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-28 19:38 [PATCH 1/2] x86: mmu.h: move mm_context_t::lock member inside CONFIG_MODIFY_LDT_SYSCALL Rasmus Villemoes
2019-08-28 19:38 ` Rasmus Villemoes [this message]
2019-10-07 8:56 ` Rasmus Villemoes
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190828193836.16791-2-linux@rasmusvillemoes.dk \
--to=linux@rasmusvillemoes.dk \
--cc=bp@alien8.de \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®