diff options
| author | Julien Grall <julien@xen.org> | 2015-10-10 19:40:06 +0000 |
|---|---|---|
| committer | Roger Pau Monné <royger@FreeBSD.org> | 2021-07-28 15:27:05 +0000 |
| commit | ac959cf54421bc560c93748b227f05f9b6583678 (patch) | |
| tree | af7182c4032c991d53cb38336f9a475e07ca50f6 /sys/x86 | |
| parent | 46c46edd18894e75a51b004f1abc1894c78864fe (diff) | |
Diffstat (limited to 'sys/x86')
| -rw-r--r-- | sys/x86/include/xen/xen-os.h | 7 | ||||
| -rw-r--r-- | sys/x86/xen/xen_intr.c | 4 |
2 files changed, 9 insertions, 2 deletions
diff --git a/sys/x86/include/xen/xen-os.h b/sys/x86/include/xen/xen-os.h index 5b3b912e0891..9d0964c6631d 100644 --- a/sys/x86/include/xen/xen-os.h +++ b/sys/x86/include/xen/xen-os.h @@ -50,6 +50,13 @@ extern int xen_disable_pv_disks; extern int xen_disable_pv_nics; static inline bool +xen_has_percpu_evtchn(void) +{ + + return (!xen_hvm_domain() || xen_vector_callback_enabled); +} + +static inline bool xen_pv_shutdown_handler(void) { diff --git a/sys/x86/xen/xen_intr.c b/sys/x86/xen/xen_intr.c index bab86ccd295a..a3d84965f0f2 100644 --- a/sys/x86/xen/xen_intr.c +++ b/sys/x86/xen/xen_intr.c @@ -510,7 +510,7 @@ xen_intr_handle_upcall(struct trapframe *trap_frame) s = HYPERVISOR_shared_info; v = DPCPU_GET(vcpu_info); - if (xen_hvm_domain() && !xen_vector_callback_enabled) { + if (!xen_has_percpu_evtchn()) { KASSERT((cpu == 0), ("Fired PCI event callback on wrong CPU")); } @@ -859,7 +859,7 @@ xen_intr_assign_cpu(struct intsrc *base_isrc, u_int apic_id) u_int to_cpu, vcpu_id; int error, masked; - if (xen_vector_callback_enabled == 0) + if (!xen_has_percpu_evtchn()) return (EOPNOTSUPP); to_cpu = apic_cpuid(apic_id); |
