xen_vector_callback_enabled is x86 specific and supporting evtchn rebind
on others architectures may be different.
Introduce a new helper to check if we can rebind the event channel.
Note that xen_intr_assign_cpu was only checking if
xen_vector_callback_enabled. Although it looks like to me that rebind
should be supported for PVH.
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)
return (pmap_mapdev(pa, size));
}
+static inline bool
+xen_support_evtchn_rebind(void)
+{
+
+ return (!xen_hvm_domain() || xen_vector_callback_enabled == 0);
+}
+
#endif /* !__ASSEMBLY__ */
#endif /* _MACHINE_X86_XEN_XEN_OS_H_ */
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"));
}
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);