x86/mm: Split read_cr3() into read_cr3_pa() and __read_cr3()
authorAndy Lutomirski <luto@kernel.org>
Mon, 12 Jun 2017 17:26:14 +0000 (10:26 -0700)
committerIngo Molnar <mingo@kernel.org>
Tue, 13 Jun 2017 06:48:09 +0000 (08:48 +0200)
commit6c690ee1039b251e583fc65b28da30e97d6a7385
tree44898545622f632411caf72c54cd3ffd1ff107b3
parent3f365cf304ba3d316b3df2474af8d7df6edd2455
x86/mm: Split read_cr3() into read_cr3_pa() and __read_cr3()

The kernel has several code paths that read CR3.  Most of them assume that
CR3 contains the PGD's physical address, whereas some of them awkwardly
use PHYSICAL_PAGE_MASK to mask off low bits.

Add explicit mask macros for CR3 and convert all of the CR3 readers.
This will keep them from breaking when PCID is enabled.

Signed-off-by: Andy Lutomirski <luto@kernel.org>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: xen-devel <xen-devel@lists.xen.org>
Link: http://lkml.kernel.org/r/883f8fb121f4616c1c1427ad87350bb2f5ffeca1.1497288170.git.luto@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
20 files changed:
arch/x86/boot/compressed/pagetable.c
arch/x86/include/asm/efi.h
arch/x86/include/asm/mmu_context.h
arch/x86/include/asm/paravirt.h
arch/x86/include/asm/processor-flags.h
arch/x86/include/asm/processor.h
arch/x86/include/asm/special_insns.h
arch/x86/include/asm/tlbflush.h
arch/x86/kernel/head64.c
arch/x86/kernel/paravirt.c
arch/x86/kernel/process_32.c
arch/x86/kernel/process_64.c
arch/x86/kvm/vmx.c
arch/x86/mm/fault.c
arch/x86/mm/ioremap.c
arch/x86/platform/efi/efi_64.c
arch/x86/platform/olpc/olpc-xo1-pm.c
arch/x86/power/cpu.c
arch/x86/power/hibernate_64.c
arch/x86/xen/mmu_pv.c