1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2 From: Thomas Gleixner <tglx@linutronix.de>
3 Date: Mon, 4 Dec 2017 15:07:46 +0100
4 Subject: [PATCH] x86/entry: Align entry text section to PMD boundary
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
11 The (irq)entry text must be visible in the user space page tables. To allow
12 simple PMD based sharing, make the entry text PMD aligned.
14 Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
15 Cc: Andy Lutomirski <luto@kernel.org>
16 Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
17 Cc: Borislav Petkov <bp@alien8.de>
18 Cc: Brian Gerst <brgerst@gmail.com>
19 Cc: Dave Hansen <dave.hansen@linux.intel.com>
20 Cc: David Laight <David.Laight@aculab.com>
21 Cc: Denys Vlasenko <dvlasenk@redhat.com>
22 Cc: Eduardo Valentin <eduval@amazon.com>
23 Cc: Greg KH <gregkh@linuxfoundation.org>
24 Cc: H. Peter Anvin <hpa@zytor.com>
25 Cc: Josh Poimboeuf <jpoimboe@redhat.com>
26 Cc: Juergen Gross <jgross@suse.com>
27 Cc: Linus Torvalds <torvalds@linux-foundation.org>
28 Cc: Peter Zijlstra <peterz@infradead.org>
29 Cc: Will Deacon <will.deacon@arm.com>
30 Cc: aliguori@amazon.com
31 Cc: daniel.gruss@iaik.tugraz.at
33 Cc: keescook@google.com
34 Signed-off-by: Ingo Molnar <mingo@kernel.org>
35 (cherry picked from commit 2f7412ba9c6af5ab16bdbb4a3fdb1dcd2b4fd3c2)
36 Signed-off-by: Andy Whitcroft <apw@canonical.com>
37 Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
38 (cherry picked from commit 3cf72b14b56834882ebe731d5fa84d249c56a188)
39 Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
41 arch/x86/kernel/vmlinux.lds.S | 8 ++++++++
42 1 file changed, 8 insertions(+)
44 diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S
45 index 423aa36f0150..f505d8dbdccf 100644
46 --- a/arch/x86/kernel/vmlinux.lds.S
47 +++ b/arch/x86/kernel/vmlinux.lds.S
48 @@ -60,11 +60,17 @@ jiffies_64 = jiffies;
49 . = ALIGN(HPAGE_SIZE); \
50 __end_rodata_hpage_align = .;
52 +#define ALIGN_ENTRY_TEXT_BEGIN . = ALIGN(PMD_SIZE);
53 +#define ALIGN_ENTRY_TEXT_END . = ALIGN(PMD_SIZE);
57 #define X64_ALIGN_RODATA_BEGIN
58 #define X64_ALIGN_RODATA_END
60 +#define ALIGN_ENTRY_TEXT_BEGIN
61 +#define ALIGN_ENTRY_TEXT_END
66 @@ -101,8 +107,10 @@ SECTIONS
70 + ALIGN_ENTRY_TEXT_BEGIN
73 + ALIGN_ENTRY_TEXT_END