Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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é <roger.pau@citrix.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Link: https://lore.kernel.org/r/20220121090146.13697-1-roger.pau@citrix.com
Signed-off-by: Juergen Gross <jgross@suse.com>

authored by

Roger Pau Monne and committed by
Juergen Gross
c8980fcb e783362e

+4 -23
-14
arch/x86/include/asm/xen/hypervisor.h
··· 43 43 return hypervisor_cpuid_base("XenVMMXenVMM", 2); 44 44 } 45 45 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 - 60 46 struct pci_dev; 61 47 62 48 #ifdef CONFIG_XEN_PV_DOM0
+4 -9
arch/x86/xen/enlighten_hvm.c
··· 9 9 #include <xen/events.h> 10 10 #include <xen/interface/memory.h> 11 11 12 + #include <asm/apic.h> 12 13 #include <asm/cpu.h> 13 14 #include <asm/smp.h> 14 15 #include <asm/io_apic.h> ··· 243 242 } 244 243 early_param("xen_no_vector_callback", xen_parse_no_vector_callback); 245 244 246 - bool __init xen_hvm_need_lapic(void) 245 + static __init bool xen_x2apic_available(void) 247 246 { 248 - if (xen_pv_domain()) 249 - return false; 250 - if (!xen_hvm_domain()) 251 - return false; 252 - if (xen_feature(XENFEAT_hvm_pirqs) && xen_have_vector_callback) 253 - return false; 254 - return true; 247 + return x2apic_supported(); 255 248 } 256 249 257 250 static __init void xen_hvm_guest_late_init(void) ··· 307 312 .detect = xen_platform_hvm, 308 313 .type = X86_HYPER_XEN_HVM, 309 314 .init.init_platform = xen_hvm_guest_init, 310 - .init.x2apic_available = xen_x2apic_para_available, 315 + .init.x2apic_available = xen_x2apic_available, 311 316 .init.init_mem_mapping = xen_hvm_init_mem_mapping, 312 317 .init.guest_late_init = xen_hvm_guest_late_init, 313 318 .runtime.pin_vcpu = xen_pin_vcpu,