Lines Matching +full:port +full:- +full:level

1 // SPDX-License-Identifier: GPL-2.0
3 * Xen event channels (2-level ABI)
19 #include <xen/xen-ops.h>
62 static void evtchn_2l_clear_pending(evtchn_port_t port) in evtchn_2l_clear_pending() argument
65 sync_clear_bit(port, BM(&s->evtchn_pending[0])); in evtchn_2l_clear_pending()
68 static void evtchn_2l_set_pending(evtchn_port_t port) in evtchn_2l_set_pending() argument
71 sync_set_bit(port, BM(&s->evtchn_pending[0])); in evtchn_2l_set_pending()
74 static bool evtchn_2l_is_pending(evtchn_port_t port) in evtchn_2l_is_pending() argument
77 return sync_test_bit(port, BM(&s->evtchn_pending[0])); in evtchn_2l_is_pending()
80 static void evtchn_2l_mask(evtchn_port_t port) in evtchn_2l_mask() argument
83 sync_set_bit(port, BM(&s->evtchn_mask[0])); in evtchn_2l_mask()
86 static void evtchn_2l_unmask(evtchn_port_t port) in evtchn_2l_unmask() argument
96 if (unlikely((cpu != cpu_from_evtchn(port)))) in evtchn_2l_unmask()
107 sync_clear_bit(port, BM(&s->evtchn_mask[0])); in evtchn_2l_unmask()
108 evtchn_pending = sync_test_bit(port, BM(&s->evtchn_pending[0])); in evtchn_2l_unmask()
111 sync_set_bit(port, BM(&s->evtchn_mask[0])); in evtchn_2l_unmask()
116 /* Slow path (hypercall) if this is a non-local port or if this is in evtchn_2l_unmask()
120 struct evtchn_unmask unmask = { .port = port }; in evtchn_2l_unmask()
127 * 'hw_resend_irq'. Just like a real IO-APIC we 'lose in evtchn_2l_unmask()
131 !sync_test_and_set_bit(port / BITS_PER_EVTCHN_WORD, in evtchn_2l_unmask()
132 BM(&vcpu_info->evtchn_pending_sel))) in evtchn_2l_unmask()
133 vcpu_info->evtchn_upcall_pending = 1; in evtchn_2l_unmask()
151 return sh->evtchn_pending[idx] & in active_evtchns()
153 ~sh->evtchn_mask[idx]; in active_evtchns()
160 * Xen uses a two-level bitmap to speed searching. The first level is
162 * level is a bitset of pending events themselves.
178 if (irq != -1) { in evtchn_2l_handle_events()
190 pending_words = xchg_xen_ulong(&vcpu_info->evtchn_pending_sel, 0); in evtchn_2l_handle_events()
221 * parts skipped in the first pass) -- if an in evtchn_2l_handle_events()
233 evtchn_port_t port; in evtchn_2l_handle_events() local
243 /* Process port. */ in evtchn_2l_handle_events()
244 port = (word_idx * BITS_PER_EVTCHN_WORD) + bit_idx; in evtchn_2l_handle_events()
245 handle_irq_for_port(port, ctrl); in evtchn_2l_handle_events()
283 : v->evtchn_upcall_mask; in xen_debug_interrupt()
285 pending, v->evtchn_upcall_pending, in xen_debug_interrupt()
286 (int)(sizeof(v->evtchn_pending_sel)*2), in xen_debug_interrupt()
287 v->evtchn_pending_sel); in xen_debug_interrupt()
292 for (i = ARRAY_SIZE(sh->evtchn_pending)-1; i >= 0; i--) in xen_debug_interrupt()
294 (int)sizeof(sh->evtchn_pending[0])*2, in xen_debug_interrupt()
295 sh->evtchn_pending[i], in xen_debug_interrupt()
298 for (i = ARRAY_SIZE(sh->evtchn_mask)-1; i >= 0; i--) in xen_debug_interrupt()
300 (int)(sizeof(sh->evtchn_mask[0])*2), in xen_debug_interrupt()
301 sh->evtchn_mask[i], in xen_debug_interrupt()
305 for (i = ARRAY_SIZE(sh->evtchn_mask)-1; i >= 0; i--) in xen_debug_interrupt()
307 (int)(sizeof(sh->evtchn_mask[0])*2), in xen_debug_interrupt()
308 sh->evtchn_pending[i] & ~sh->evtchn_mask[i], in xen_debug_interrupt()
312 for (i = (EVTCHN_2L_NR_CHANNELS/BITS_PER_EVTCHN_WORD)-1; i >= 0; i--) in xen_debug_interrupt()
318 for (i = ARRAY_SIZE(sh->evtchn_mask)-1; i >= 0; i--) { in xen_debug_interrupt()
319 xen_ulong_t pending = sh->evtchn_pending[i] in xen_debug_interrupt()
320 & ~sh->evtchn_mask[i] in xen_debug_interrupt()
323 (int)(sizeof(sh->evtchn_mask[0])*2), in xen_debug_interrupt()
329 if (sync_test_bit(i, BM(sh->evtchn_pending))) { in xen_debug_interrupt()
331 printk(" %d: event %d -> irq %u%s%s%s\n", in xen_debug_interrupt()
334 sync_test_bit(word_idx, BM(&v->evtchn_pending_sel)) in xen_debug_interrupt()
335 ? "" : " l2-clear", in xen_debug_interrupt()
336 !sync_test_bit(i, BM(sh->evtchn_mask)) in xen_debug_interrupt()
337 ? "" : " globally-masked", in xen_debug_interrupt()
339 ? "" : " locally-masked"); in xen_debug_interrupt()
382 pr_info("Using 2-level ABI\n"); in xen_evtchn_2l_init()