aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/xen/enlighten.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/xen/enlighten.c')
-rw-r--r--arch/x86/xen/enlighten.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 94578efd3067..46957ead3060 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -1760,6 +1760,9 @@ static struct notifier_block xen_hvm_cpu_notifier = {
1760 1760
1761static void __init xen_hvm_guest_init(void) 1761static void __init xen_hvm_guest_init(void)
1762{ 1762{
1763 if (xen_pv_domain())
1764 return;
1765
1763 init_hvm_pv_info(); 1766 init_hvm_pv_info();
1764 1767
1765 xen_hvm_init_shared_info(); 1768 xen_hvm_init_shared_info();
@@ -1775,6 +1778,7 @@ static void __init xen_hvm_guest_init(void)
1775 xen_hvm_init_time_ops(); 1778 xen_hvm_init_time_ops();
1776 xen_hvm_init_mmu_ops(); 1779 xen_hvm_init_mmu_ops();
1777} 1780}
1781#endif
1778 1782
1779static bool xen_nopv = false; 1783static bool xen_nopv = false;
1780static __init int xen_parse_nopv(char *arg) 1784static __init int xen_parse_nopv(char *arg)
@@ -1784,14 +1788,11 @@ static __init int xen_parse_nopv(char *arg)
1784} 1788}
1785early_param("xen_nopv", xen_parse_nopv); 1789early_param("xen_nopv", xen_parse_nopv);
1786 1790
1787static uint32_t __init xen_hvm_platform(void) 1791static uint32_t __init xen_platform(void)
1788{ 1792{
1789 if (xen_nopv) 1793 if (xen_nopv)
1790 return 0; 1794 return 0;
1791 1795
1792 if (xen_pv_domain())
1793 return 0;
1794
1795 return xen_cpuid_base(); 1796 return xen_cpuid_base();
1796} 1797}
1797 1798
@@ -1809,11 +1810,19 @@ bool xen_hvm_need_lapic(void)
1809} 1810}
1810EXPORT_SYMBOL_GPL(xen_hvm_need_lapic); 1811EXPORT_SYMBOL_GPL(xen_hvm_need_lapic);
1811 1812
1812const struct hypervisor_x86 x86_hyper_xen_hvm __refconst = { 1813static void xen_set_cpu_features(struct cpuinfo_x86 *c)
1813 .name = "Xen HVM", 1814{
1814 .detect = xen_hvm_platform, 1815 if (xen_pv_domain())
1816 clear_cpu_bug(c, X86_BUG_SYSRET_SS_ATTRS);
1817}
1818
1819const struct hypervisor_x86 x86_hyper_xen = {
1820 .name = "Xen",
1821 .detect = xen_platform,
1822#ifdef CONFIG_XEN_PVHVM
1815 .init_platform = xen_hvm_guest_init, 1823 .init_platform = xen_hvm_guest_init,
1824#endif
1816 .x2apic_available = xen_x2apic_para_available, 1825 .x2apic_available = xen_x2apic_para_available,
1826 .set_cpu_features = xen_set_cpu_features,
1817}; 1827};
1818EXPORT_SYMBOL(x86_hyper_xen_hvm); 1828EXPORT_SYMBOL(x86_hyper_xen);
1819#endif