stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Thomas Gleixner <tglx@linutronix.de>,
	Andy Lutomirski <luto@kernel.org>,
	Benjamin Gilbert <benjamin.gilbert@coreos.com>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Thomas Garnier <thgarnie@google.com>,
	Alexander Kuleshov <kuleshovmail@gmail.com>
Subject: [PATCH 4.14 02/38] x86/mm: Map cpu_entry_area at the same place on 4/5 level
Date: Mon,  8 Jan 2018 13:58:55 +0100	[thread overview]
Message-ID: <20180108125916.069345699@linuxfoundation.org> (raw)
In-Reply-To: <20180108125915.951963528@linuxfoundation.org>

4.14-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Thomas Gleixner <tglx@linutronix.de>

commit f2078904810373211fb15f91888fba14c01a4acc upstream.

There is no reason for 4 and 5 level pagetables to have a different
layout. It just makes determining vaddr_end for KASLR harder than
necessary.

Fixes: 92a0f81d8957 ("x86/cpu_entry_area: Move it out of the fixmap")
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Benjamin Gilbert <benjamin.gilbert@coreos.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Garnier <thgarnie@google.com>
Cc: Alexander Kuleshov <kuleshovmail@gmail.com>
Link: https://lkml.kernel.org/r/alpine.DEB.2.20.1801041320360.1771@nanos
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 Documentation/x86/x86_64/mm.txt         |    7 ++++---
 arch/x86/include/asm/pgtable_64_types.h |    4 ++--
 arch/x86/mm/dump_pagetables.c           |    2 +-
 3 files changed, 7 insertions(+), 6 deletions(-)

--- a/Documentation/x86/x86_64/mm.txt
+++ b/Documentation/x86/x86_64/mm.txt
@@ -12,8 +12,8 @@ ffffea0000000000 - ffffeaffffffffff (=40
 ... unused hole ...
 ffffec0000000000 - fffffbffffffffff (=44 bits) kasan shadow memory (16TB)
 ... unused hole ...
-fffffe0000000000 - fffffe7fffffffff (=39 bits) LDT remap for PTI
-fffffe8000000000 - fffffeffffffffff (=39 bits) cpu_entry_area mapping
+fffffe0000000000 - fffffe7fffffffff (=39 bits) cpu_entry_area mapping
+fffffe8000000000 - fffffeffffffffff (=39 bits) LDT remap for PTI
 ffffff0000000000 - ffffff7fffffffff (=39 bits) %esp fixup stacks
 ... unused hole ...
 ffffffef00000000 - fffffffeffffffff (=64 GB) EFI region mapping space
@@ -37,7 +37,8 @@ ffd4000000000000 - ffd5ffffffffffff (=49
 ... unused hole ...
 ffdf000000000000 - fffffc0000000000 (=53 bits) kasan shadow memory (8PB)
 ... unused hole ...
-fffffe8000000000 - fffffeffffffffff (=39 bits) cpu_entry_area mapping
+fffffe0000000000 - fffffe7fffffffff (=39 bits) cpu_entry_area mapping
+... unused hole ...
 ffffff0000000000 - ffffff7fffffffff (=39 bits) %esp fixup stacks
 ... unused hole ...
 ffffffef00000000 - fffffffeffffffff (=64 GB) EFI region mapping space
--- a/arch/x86/include/asm/pgtable_64_types.h
+++ b/arch/x86/include/asm/pgtable_64_types.h
@@ -88,7 +88,7 @@ typedef struct { pteval_t pte; } pte_t;
 # define VMALLOC_SIZE_TB	_AC(32, UL)
 # define __VMALLOC_BASE		_AC(0xffffc90000000000, UL)
 # define __VMEMMAP_BASE		_AC(0xffffea0000000000, UL)
-# define LDT_PGD_ENTRY		_AC(-4, UL)
+# define LDT_PGD_ENTRY		_AC(-3, UL)
 # define LDT_BASE_ADDR		(LDT_PGD_ENTRY << PGDIR_SHIFT)
 #endif
 
@@ -110,7 +110,7 @@ typedef struct { pteval_t pte; } pte_t;
 #define ESPFIX_PGD_ENTRY	_AC(-2, UL)
 #define ESPFIX_BASE_ADDR	(ESPFIX_PGD_ENTRY << P4D_SHIFT)
 
-#define CPU_ENTRY_AREA_PGD	_AC(-3, UL)
+#define CPU_ENTRY_AREA_PGD	_AC(-4, UL)
 #define CPU_ENTRY_AREA_BASE	(CPU_ENTRY_AREA_PGD << P4D_SHIFT)
 
 #define EFI_VA_START		( -4 * (_AC(1, UL) << 30))
--- a/arch/x86/mm/dump_pagetables.c
+++ b/arch/x86/mm/dump_pagetables.c
@@ -61,10 +61,10 @@ enum address_markers_idx {
 	KASAN_SHADOW_START_NR,
 	KASAN_SHADOW_END_NR,
 #endif
+	CPU_ENTRY_AREA_NR,
 #if defined(CONFIG_MODIFY_LDT_SYSCALL) && !defined(CONFIG_X86_5LEVEL)
 	LDT_NR,
 #endif
-	CPU_ENTRY_AREA_NR,
 #ifdef CONFIG_X86_ESPFIX64
 	ESPFIX_START_NR,
 #endif

  parent reply	other threads:[~2018-01-08 12:58 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-08 12:58 [PATCH 4.14 00/38] 4.14.13-stable review Greg Kroah-Hartman
2018-01-08 12:58 ` [PATCH 4.14 01/38] x86/mm: Set MODULES_END to 0xffffffffff000000 Greg Kroah-Hartman
2018-01-08 12:58 ` Greg Kroah-Hartman [this message]
2018-01-08 12:58 ` [PATCH 4.14 03/38] x86/kaslr: Fix the vaddr_end mess Greg Kroah-Hartman
2018-01-08 12:58 ` [PATCH 4.14 04/38] x86/events/intel/ds: Use the proper cache flush method for mapping ds buffers Greg Kroah-Hartman
2018-01-08 12:58 ` [PATCH 4.14 05/38] x86/tlb: Drop the _GPL from the cpu_tlbstate export Greg Kroah-Hartman
2018-01-08 12:58 ` [PATCH 4.14 06/38] x86/alternatives: Add missing \n at end of ALTERNATIVE inline asm Greg Kroah-Hartman
2018-01-08 12:59 ` [PATCH 4.14 07/38] x86/pti: Rename BUG_CPU_INSECURE to BUG_CPU_MELTDOWN Greg Kroah-Hartman
2018-01-08 12:59 ` [PATCH 4.14 08/38] kernel/acct.c: fix the acct->needcheck check in check_free_space() Greg Kroah-Hartman
2018-01-08 12:59 ` [PATCH 4.14 09/38] mm/mprotect: add a cond_resched() inside change_pmd_range() Greg Kroah-Hartman
2018-01-08 12:59 ` [PATCH 4.14 10/38] mm/sparse.c: wrong allocation for mem_section Greg Kroah-Hartman
2018-01-08 12:59 ` [PATCH 4.14 11/38] userfaultfd: clear the vma->vm_userfaultfd_ctx if UFFD_EVENT_FORK fails Greg Kroah-Hartman
2018-01-08 12:59 ` [PATCH 4.14 12/38] btrfs: fix refcount_t usage when deleting btrfs_delayed_nodes Greg Kroah-Hartman
2018-01-08 12:59 ` [PATCH 4.14 13/38] efi/capsule-loader: Reinstate virtual capsule mapping Greg Kroah-Hartman
2018-01-08 12:59 ` [PATCH 4.14 14/38] crypto: n2 - cure use after free Greg Kroah-Hartman
2018-01-08 12:59 ` [PATCH 4.14 15/38] crypto: chacha20poly1305 - validate the digest size Greg Kroah-Hartman
2018-01-08 12:59 ` [PATCH 4.14 16/38] crypto: pcrypt - fix freeing pcrypt instances Greg Kroah-Hartman
2018-01-08 12:59 ` [PATCH 4.14 17/38] crypto: chelsio - select CRYPTO_GF128MUL Greg Kroah-Hartman
2018-01-08 12:59 ` [PATCH 4.14 21/38] fscache: Fix the default for fscache_maybe_release_page() Greg Kroah-Hartman
2018-01-08 12:59 ` [PATCH 4.14 22/38] x86 / CPU: Avoid unnecessary IPIs in arch_freq_get_on_cpu() Greg Kroah-Hartman
2018-01-08 12:59 ` [PATCH 4.14 23/38] x86 / CPU: Always show current CPU frequency in /proc/cpuinfo Greg Kroah-Hartman
2018-01-08 12:59 ` [PATCH 4.14 24/38] kernel/signal.c: protect the traced SIGNAL_UNKILLABLE tasks from SIGKILL Greg Kroah-Hartman
2018-01-08 12:59 ` [PATCH 4.14 25/38] kernel/signal.c: protect the SIGNAL_UNKILLABLE tasks from !sig_kernel_only() signals Greg Kroah-Hartman
2018-01-08 12:59 ` [PATCH 4.14 26/38] kernel/signal.c: remove the no longer needed SIGNAL_UNKILLABLE check in complete_signal() Greg Kroah-Hartman
2018-01-08 12:59 ` [PATCH 4.14 27/38] iommu/arm-smmu-v3: Dont free page table ops twice Greg Kroah-Hartman
2018-01-08 12:59 ` [PATCH 4.14 28/38] iommu/arm-smmu-v3: Cope with duplicated Stream IDs Greg Kroah-Hartman
2018-01-08 12:59 ` [PATCH 4.14 29/38] ARC: uaccess: dont use "l" gcc inline asm constraint modifier Greg Kroah-Hartman
2018-01-08 12:59 ` [PATCH 4.14 30/38] powerpc/mm: Fix SEGV on mapped region to return SEGV_ACCERR Greg Kroah-Hartman
2018-01-08 12:59 ` [PATCH 4.14 31/38] Input: elantech - add new icbody type 15 Greg Kroah-Hartman
2018-01-08 12:59 ` [PATCH 4.14 32/38] x86/microcode/AMD: Add support for fam17h microcode loading Greg Kroah-Hartman
2018-01-08 12:59 ` [PATCH 4.14 34/38] parisc: Fix alignment of pa_tlb_lock in assembly on 32-bit SMP kernel Greg Kroah-Hartman
2018-01-08 12:59 ` [PATCH 4.14 35/38] parisc: qemu idle sleep support Greg Kroah-Hartman
2018-01-08 12:59 ` [PATCH 4.14 37/38] KVM: s390: fix cmma migration for multiple memory slots Greg Kroah-Hartman
2018-01-08 12:59 ` [PATCH 4.14 38/38] KVM: s390: prevent buffer overrun on memory hotplug during migration Greg Kroah-Hartman
2018-01-08 20:59 ` [PATCH 4.14 00/38] 4.14.13-stable review Shuah Khan
2018-01-09  9:11   ` Greg Kroah-Hartman
2018-01-09  8:45 ` Naresh Kamboju
2018-01-09  9:27   ` Greg Kroah-Hartman
2018-01-09 13:45 ` Guenter Roeck
2018-01-09 19:07   ` Greg Kroah-Hartman

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=20180108125916.069345699@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=benjamin.gilbert@coreos.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=kuleshovmail@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=peterz@infradead.org \
    --cc=stable@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=thgarnie@google.com \
    /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;
as well as URLs for NNTP newsgroup(s).