Index: sys/dev/xen/debug/debug.c =================================================================== --- sys/dev/xen/debug/debug.c +++ sys/dev/xen/debug/debug.c @@ -97,7 +97,7 @@ KASSERT(xen_domain(), ("Trying to add Xen debug device to non-xen guest")); - if (xen_hvm_domain() && !xen_vector_callback_enabled) + if (!xen_support_evtchn_rebind()) return; if (BUS_ADD_CHILD(parent, 0, "debug", 0) == NULL) Index: sys/x86/include/xen/xen-os.h =================================================================== --- sys/x86/include/xen/xen-os.h +++ sys/x86/include/xen/xen-os.h @@ -39,6 +39,13 @@ /* If non-zero, the hypervisor has been configured to use a direct vector */ extern int xen_vector_callback_enabled; +static inline bool +xen_support_evtchn_rebind(void) +{ + + return (!xen_hvm_domain() || xen_vector_callback_enabled); +} + #endif /* !__ASSEMBLY__ */ #endif /* _MACHINE_X86_XEN_XEN_OS_H_ */ Index: sys/x86/xen/xen_intr.c =================================================================== --- sys/x86/xen/xen_intr.c +++ sys/x86/xen/xen_intr.c @@ -540,7 +540,7 @@ s = HYPERVISOR_shared_info; v = DPCPU_GET(vcpu_info); - if (xen_hvm_domain() && !xen_vector_callback_enabled) { + if (!xen_support_evtchn_rebind()) { KASSERT((cpu == 0), ("Fired PCI event callback on wrong CPU")); } @@ -901,7 +901,7 @@ u_int to_cpu, vcpu_id; int error, masked; - if (xen_vector_callback_enabled == 0) + if (!xen_support_evtchn_rebind()) return (EOPNOTSUPP); to_cpu = apic_cpuid(apic_id);