]> git.proxmox.com Git - pve-kernel.git/blame - patches/kernel/0204-x86-mm-64-Make-a-full-PGD-entry-size-hole-in-the-mem.patch
build: reformat existing patches
[pve-kernel.git] / patches / kernel / 0204-x86-mm-64-Make-a-full-PGD-entry-size-hole-in-the-mem.patch
CommitLineData
59d5af67 1From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
321d628a
FG
2From: Andy Lutomirski <luto@kernel.org>
3Date: Tue, 12 Dec 2017 07:56:44 -0800
59d5af67 4Subject: [PATCH] x86/mm/64: Make a full PGD-entry size hole in the memory map
321d628a
FG
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9CVE-2017-5754
10
11Shrink vmalloc space from 16384TiB to 12800TiB to enlarge the hole starting
12at 0xff90000000000000 to be a full PGD entry.
13
14A subsequent patch will use this hole for the pagetable isolation LDT
15alias.
16
17Signed-off-by: Andy Lutomirski <luto@kernel.org>
18Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
19Cc: Borislav Petkov <bp@alien8.de>
20Cc: Brian Gerst <brgerst@gmail.com>
21Cc: Dave Hansen <dave.hansen@intel.com>
22Cc: Dave Hansen <dave.hansen@linux.intel.com>
23Cc: David Laight <David.Laight@aculab.com>
24Cc: H. Peter Anvin <hpa@zytor.com>
25Cc: Josh Poimboeuf <jpoimboe@redhat.com>
26Cc: Juergen Gross <jgross@suse.com>
27Cc: Kees Cook <keescook@chromium.org>
28Cc: Kirill A. Shutemov <kirill@shutemov.name>
29Cc: Linus Torvalds <torvalds@linux-foundation.org>
30Cc: Peter Zijlstra <peterz@infradead.org>
31Signed-off-by: Ingo Molnar <mingo@kernel.org>
32(cherry picked from commit 9f449772a3106bcdd4eb8fdeb281147b0e99fb30)
33Signed-off-by: Andy Whitcroft <apw@canonical.com>
34Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
35(cherry picked from commit 29b1c137d449dfc8fdcb476158f236625691fd28)
36Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
37---
38 Documentation/x86/x86_64/mm.txt | 4 ++--
39 arch/x86/include/asm/pgtable_64_types.h | 4 ++--
40 2 files changed, 4 insertions(+), 4 deletions(-)
41
42diff --git a/Documentation/x86/x86_64/mm.txt b/Documentation/x86/x86_64/mm.txt
43index 51101708a03a..496a1dbf139d 100644
44--- a/Documentation/x86/x86_64/mm.txt
45+++ b/Documentation/x86/x86_64/mm.txt
46@@ -29,8 +29,8 @@ Virtual memory map with 5 level page tables:
47 hole caused by [56:63] sign extension
48 ff00000000000000 - ff0fffffffffffff (=52 bits) guard hole, reserved for hypervisor
49 ff10000000000000 - ff8fffffffffffff (=55 bits) direct mapping of all phys. memory
50-ff90000000000000 - ff91ffffffffffff (=49 bits) hole
51-ff92000000000000 - ffd1ffffffffffff (=54 bits) vmalloc/ioremap space
52+ff90000000000000 - ff9fffffffffffff (=52 bits) hole
53+ffa0000000000000 - ffd1ffffffffffff (=54 bits) vmalloc/ioremap space (12800 TB)
54 ffd2000000000000 - ffd3ffffffffffff (=49 bits) hole
55 ffd4000000000000 - ffd5ffffffffffff (=49 bits) virtual memory map (512TB)
56 ... unused hole ...
57diff --git a/arch/x86/include/asm/pgtable_64_types.h b/arch/x86/include/asm/pgtable_64_types.h
58index 42e2750da525..5932dead34ee 100644
59--- a/arch/x86/include/asm/pgtable_64_types.h
60+++ b/arch/x86/include/asm/pgtable_64_types.h
61@@ -78,8 +78,8 @@ typedef struct { pteval_t pte; } pte_t;
62 #define MAXMEM _AC(__AC(1, UL) << MAX_PHYSMEM_BITS, UL)
63
64 #ifdef CONFIG_X86_5LEVEL
65-# define VMALLOC_SIZE_TB _AC(16384, UL)
66-# define __VMALLOC_BASE _AC(0xff92000000000000, UL)
67+# define VMALLOC_SIZE_TB _AC(12800, UL)
68+# define __VMALLOC_BASE _AC(0xffa0000000000000, UL)
69 # define __VMEMMAP_BASE _AC(0xffd4000000000000, UL)
70 #else
71 # define VMALLOC_SIZE_TB _AC(32, UL)
72--
732.14.2
74