diff options
Diffstat (limited to 'arch/x86/xen')
-rw-r--r-- | arch/x86/xen/enlighten.c | 20 | ||||
-rw-r--r-- | arch/x86/xen/p2m.c | 2 |
2 files changed, 20 insertions, 2 deletions
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index bd8b8459c3d0..5240f563076d 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c | |||
@@ -1070,6 +1070,23 @@ static inline void xen_write_cr8(unsigned long val) | |||
1070 | BUG_ON(val); | 1070 | BUG_ON(val); |
1071 | } | 1071 | } |
1072 | #endif | 1072 | #endif |
1073 | |||
1074 | static u64 xen_read_msr_safe(unsigned int msr, int *err) | ||
1075 | { | ||
1076 | u64 val; | ||
1077 | |||
1078 | val = native_read_msr_safe(msr, err); | ||
1079 | switch (msr) { | ||
1080 | case MSR_IA32_APICBASE: | ||
1081 | #ifdef CONFIG_X86_X2APIC | ||
1082 | if (!(cpuid_ecx(1) & (1 << (X86_FEATURE_X2APIC & 31)))) | ||
1083 | #endif | ||
1084 | val &= ~X2APIC_ENABLE; | ||
1085 | break; | ||
1086 | } | ||
1087 | return val; | ||
1088 | } | ||
1089 | |||
1073 | static int xen_write_msr_safe(unsigned int msr, unsigned low, unsigned high) | 1090 | static int xen_write_msr_safe(unsigned int msr, unsigned low, unsigned high) |
1074 | { | 1091 | { |
1075 | int ret; | 1092 | int ret; |
@@ -1240,7 +1257,7 @@ static const struct pv_cpu_ops xen_cpu_ops __initconst = { | |||
1240 | 1257 | ||
1241 | .wbinvd = native_wbinvd, | 1258 | .wbinvd = native_wbinvd, |
1242 | 1259 | ||
1243 | .read_msr = native_read_msr_safe, | 1260 | .read_msr = xen_read_msr_safe, |
1244 | .write_msr = xen_write_msr_safe, | 1261 | .write_msr = xen_write_msr_safe, |
1245 | 1262 | ||
1246 | .read_tsc = native_read_tsc, | 1263 | .read_tsc = native_read_tsc, |
@@ -1741,6 +1758,7 @@ asmlinkage __visible void __init xen_start_kernel(void) | |||
1741 | #ifdef CONFIG_X86_32 | 1758 | #ifdef CONFIG_X86_32 |
1742 | i386_start_kernel(); | 1759 | i386_start_kernel(); |
1743 | #else | 1760 | #else |
1761 | cr4_init_shadow(); /* 32b kernel does this in i386_start_kernel() */ | ||
1744 | x86_64_start_reservations((char *)__pa_symbol(&boot_params)); | 1762 | x86_64_start_reservations((char *)__pa_symbol(&boot_params)); |
1745 | #endif | 1763 | #endif |
1746 | } | 1764 | } |
diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c index 740ae3026a14..9f93af56a5fc 100644 --- a/arch/x86/xen/p2m.c +++ b/arch/x86/xen/p2m.c | |||
@@ -563,7 +563,7 @@ static bool alloc_p2m(unsigned long pfn) | |||
563 | if (p2m_pfn == PFN_DOWN(__pa(p2m_missing))) | 563 | if (p2m_pfn == PFN_DOWN(__pa(p2m_missing))) |
564 | p2m_init(p2m); | 564 | p2m_init(p2m); |
565 | else | 565 | else |
566 | p2m_init_identity(p2m, pfn); | 566 | p2m_init_identity(p2m, pfn & ~(P2M_PER_PAGE - 1)); |
567 | 567 | ||
568 | spin_lock_irqsave(&p2m_update_lock, flags); | 568 | spin_lock_irqsave(&p2m_update_lock, flags); |
569 | 569 | ||