Skip to content

Commit c8980fc

Browse files
roygerjgross1
authored andcommitted
xen/x2apic: enable x2apic mode when supported for HVM
There's no point in disabling x2APIC mode when running as a Xen HVM guest, just enable it when available. Remove some unneeded wrapping around the detection functions, and simply provide a xen_x2apic_available helper that's a wrapper around x2apic_supported. Signed-off-by: Roger Pau Monné <[email protected]> Reviewed-by: Boris Ostrovsky <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Juergen Gross <[email protected]>
1 parent e783362 commit c8980fc

File tree

2 files changed

+4
-23
lines changed

2 files changed

+4
-23
lines changed

arch/x86/include/asm/xen/hypervisor.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,20 +43,6 @@ static inline uint32_t xen_cpuid_base(void)
4343
return hypervisor_cpuid_base("XenVMMXenVMM", 2);
4444
}
4545

46-
#ifdef CONFIG_XEN
47-
extern bool __init xen_hvm_need_lapic(void);
48-
49-
static inline bool __init xen_x2apic_para_available(void)
50-
{
51-
return xen_hvm_need_lapic();
52-
}
53-
#else
54-
static inline bool __init xen_x2apic_para_available(void)
55-
{
56-
return (xen_cpuid_base() != 0);
57-
}
58-
#endif
59-
6046
struct pci_dev;
6147

6248
#ifdef CONFIG_XEN_PV_DOM0

arch/x86/xen/enlighten_hvm.c

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <xen/events.h>
1010
#include <xen/interface/memory.h>
1111

12+
#include <asm/apic.h>
1213
#include <asm/cpu.h>
1314
#include <asm/smp.h>
1415
#include <asm/io_apic.h>
@@ -242,15 +243,9 @@ static __init int xen_parse_no_vector_callback(char *arg)
242243
}
243244
early_param("xen_no_vector_callback", xen_parse_no_vector_callback);
244245

245-
bool __init xen_hvm_need_lapic(void)
246+
static __init bool xen_x2apic_available(void)
246247
{
247-
if (xen_pv_domain())
248-
return false;
249-
if (!xen_hvm_domain())
250-
return false;
251-
if (xen_feature(XENFEAT_hvm_pirqs) && xen_have_vector_callback)
252-
return false;
253-
return true;
248+
return x2apic_supported();
254249
}
255250

256251
static __init void xen_hvm_guest_late_init(void)
@@ -312,7 +307,7 @@ struct hypervisor_x86 x86_hyper_xen_hvm __initdata = {
312307
.detect = xen_platform_hvm,
313308
.type = X86_HYPER_XEN_HVM,
314309
.init.init_platform = xen_hvm_guest_init,
315-
.init.x2apic_available = xen_x2apic_para_available,
310+
.init.x2apic_available = xen_x2apic_available,
316311
.init.init_mem_mapping = xen_hvm_init_mem_mapping,
317312
.init.guest_late_init = xen_hvm_guest_late_init,
318313
.runtime.pin_vcpu = xen_pin_vcpu,

0 commit comments

Comments
 (0)