diff options
author | Toshi Kani <toshi.kani@hpe.com> | 2016-03-23 17:42:02 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2016-03-29 06:23:27 -0400 |
commit | 88ba281108ed0c25c9d292b48bd3f272fcb90dd0 (patch) | |
tree | ce2d80c323fc16c934de6296221084158ede87e3 | |
parent | ad025a73f0e9344ac73ffe1b74c184033e08e7d5 (diff) |
x86/xen, pat: Remove PAT table init code from Xen
Xen supports PAT without MTRRs for its guests. In order to
enable WC attribute, it was necessary for xen_start_kernel()
to call pat_init_cache_modes() to update PAT table before
starting guest kernel.
Now that the kernel initializes PAT table to the BIOS handoff
state when MTRR is disabled, this Xen-specific PAT init code
is no longer necessary. Delete it from xen_start_kernel().
Also change __init_cache_modes() to a static function since
PAT table should not be tweaked by other modules.
Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Juergen Gross <jgross@suse.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Borislav Petkov <bp@suse.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Luis R. Rodriguez <mcgrof@suse.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Toshi Kani <toshi.kani@hp.com>
Cc: elliott@hpe.com
Cc: paul.gortmaker@windriver.com
Cc: xen-devel@lists.xenproject.org
Link: http://lkml.kernel.org/r/1458769323-24491-7-git-send-email-toshi.kani@hpe.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r-- | arch/x86/include/asm/pat.h | 1 | ||||
-rw-r--r-- | arch/x86/mm/pat.c | 2 | ||||
-rw-r--r-- | arch/x86/xen/enlighten.c | 9 |
3 files changed, 1 insertions, 11 deletions
diff --git a/arch/x86/include/asm/pat.h b/arch/x86/include/asm/pat.h index 0ad356c066ef..0b1ff4c1c14e 100644 --- a/arch/x86/include/asm/pat.h +++ b/arch/x86/include/asm/pat.h | |||
@@ -7,7 +7,6 @@ | |||
7 | bool pat_enabled(void); | 7 | bool pat_enabled(void); |
8 | void pat_disable(const char *reason); | 8 | void pat_disable(const char *reason); |
9 | extern void pat_init(void); | 9 | extern void pat_init(void); |
10 | void __init_cache_modes(u64); | ||
11 | 10 | ||
12 | extern int reserve_memtype(u64 start, u64 end, | 11 | extern int reserve_memtype(u64 start, u64 end, |
13 | enum page_cache_mode req_pcm, enum page_cache_mode *ret_pcm); | 12 | enum page_cache_mode req_pcm, enum page_cache_mode *ret_pcm); |
diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c index 59ec038b9833..c4c3ddcc9069 100644 --- a/arch/x86/mm/pat.c +++ b/arch/x86/mm/pat.c | |||
@@ -192,7 +192,7 @@ static enum page_cache_mode pat_get_cache_mode(unsigned pat_val, char *msg) | |||
192 | * configuration. | 192 | * configuration. |
193 | * Using lower indices is preferred, so we start with highest index. | 193 | * Using lower indices is preferred, so we start with highest index. |
194 | */ | 194 | */ |
195 | void __init_cache_modes(u64 pat) | 195 | static void __init_cache_modes(u64 pat) |
196 | { | 196 | { |
197 | enum page_cache_mode cache; | 197 | enum page_cache_mode cache; |
198 | char pat_msg[33]; | 198 | char pat_msg[33]; |
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index c469a7c7c309..d8cca75e3b3e 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c | |||
@@ -75,7 +75,6 @@ | |||
75 | #include <asm/mach_traps.h> | 75 | #include <asm/mach_traps.h> |
76 | #include <asm/mwait.h> | 76 | #include <asm/mwait.h> |
77 | #include <asm/pci_x86.h> | 77 | #include <asm/pci_x86.h> |
78 | #include <asm/pat.h> | ||
79 | #include <asm/cpu.h> | 78 | #include <asm/cpu.h> |
80 | 79 | ||
81 | #ifdef CONFIG_ACPI | 80 | #ifdef CONFIG_ACPI |
@@ -1511,7 +1510,6 @@ asmlinkage __visible void __init xen_start_kernel(void) | |||
1511 | { | 1510 | { |
1512 | struct physdev_set_iopl set_iopl; | 1511 | struct physdev_set_iopl set_iopl; |
1513 | unsigned long initrd_start = 0; | 1512 | unsigned long initrd_start = 0; |
1514 | u64 pat; | ||
1515 | int rc; | 1513 | int rc; |
1516 | 1514 | ||
1517 | if (!xen_start_info) | 1515 | if (!xen_start_info) |
@@ -1618,13 +1616,6 @@ asmlinkage __visible void __init xen_start_kernel(void) | |||
1618 | xen_start_info->nr_pages); | 1616 | xen_start_info->nr_pages); |
1619 | xen_reserve_special_pages(); | 1617 | xen_reserve_special_pages(); |
1620 | 1618 | ||
1621 | /* | ||
1622 | * Modify the cache mode translation tables to match Xen's PAT | ||
1623 | * configuration. | ||
1624 | */ | ||
1625 | rdmsrl(MSR_IA32_CR_PAT, pat); | ||
1626 | __init_cache_modes(pat); | ||
1627 | |||
1628 | /* keep using Xen gdt for now; no urgent need to change it */ | 1619 | /* keep using Xen gdt for now; no urgent need to change it */ |
1629 | 1620 | ||
1630 | #ifdef CONFIG_X86_32 | 1621 | #ifdef CONFIG_X86_32 |