x86/pti: Make sure the user/kernel PTEs match
Thomas Gleixner authored
Meelis reported that his K8 Athlon64 emits MCE warnings when PTI is
enabled:

[Hardware Error]: Error Addr: 0x0000ffff81e000e0
[Hardware Error]: MC1 Error: L1 TLB multimatch.
[Hardware Error]: cache level: L1, tx: INSN

The address is in the entry area, which is mapped into kernel _AND_ user
space. That's special because we switch CR3 while we are executing
there. 

User mapping:
0xffffffff81e00000-0xffffffff82000000           2M     ro         PSE     GLB x  pmd

Kernel mapping:
0xffffffff81000000-0xffffffff82000000          16M     ro         PSE         x  pmd

So the K8 is complaining that the TLB entries differ. They differ in the
GLB bit.

Drop the GLB bit when installing the user shared mapping.

Fixes: 6dc72c3c

 ("x86/mm/pti: Share entry text PMD")
Reported-by: default avatarMeelis Roos <mroos@linux.ee>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Tested-by: default avatarMeelis Roos <mroos@linux.ee>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Tom Lendacky <thomas.lendacky@a...
52994c25
Name Last commit Last update
Documentation x86/pti: Put the LDT in its own PGD if PTI is on
arch x86/pti: Make sure the user/kernel PTEs match
block License cleanup: add SPDX GPL-2.0 license identifier to files with no license
certs License cleanup: add SPDX GPL-2.0 license identifier to files with no license
crypto Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
drivers locking/barriers: Convert users of lockless_dereference() to READ_ONCE()
firmware License cleanup: add SPDX GPL-2.0 license identifier to files with no license
fs locking/barriers: Convert users of lockless_dereference() to READ_ONCE()
include x86/mm/pti: Add infrastructure for page table isolation
init x86/mm/pti: Add infrastructure for page table isolation
ipc License cleanup: add SPDX GPL-2.0 license identifier to files with no license
kernel arch, mm: Allow arch_dup_mmap() to fail
lib Merge commit 'upstream-x86-entry' into WIP.x86/mm
mm locking/barriers: Convert users of lockless_dereference() to READ_ONCE()
net vlan: fix a use-after-free in vlan_device_event()
samples Merge tag 'spdx_identifiers-4.14-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
scripts Merge commit 'upstream-x86-entry' into WIP.x86/mm
security x86/pti: Enable PTI by default
sound Merge tag 'sound-4.14' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
tools x86/ldt: Make the LDT mapping RO
usr initramfs: fix initramfs rebuilds w/ compression after disabling
virt Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm
.cocciconfig scripts: add Linux .cocciconfig for coccinelle
.get_maintainer.ignore Add hch to .get_maintainer.ignore
.gitattributes .gitattributes: set git diff driver for C source code files
.gitignore kbuild: Add support to generate LLVM assembly files
.mailmap .mailmap: Add Maciej W. Rozycki's Imagination e-mail address
COPYING [PATCH] update FSF address in COPYING
CREDITS MAINTAINERS: update TPM driver infrastructure changes
Kbuild License cleanup: add SPDX GPL-2.0 license identifier to files with no license
Kconfig License cleanup: add SPDX GPL-2.0 license identifier to files with no license
MAINTAINERS Merge branch 'akpm' (patches from Andrew)
Makefile Merge commit 'upstream-x86-entry' into WIP.x86/mm
README README: add a new README file, pointing to the Documentation/
Linux kernel
============

This file was moved to Documentation/admin-guide/README.rst

Please notice that there are several guides for kernel developers and users.
These guides can be rendered in a number of formats, like HTML and PDF.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.
See Documentation/00-INDEX for a list of what is contained in each file.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.