evtchn: slightly defer lock acquire where possible
authorJan Beulich <jbeulich@suse.com>
Tue, 8 Jun 2021 12:46:06 +0000 (14:46 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 8 Jun 2021 12:46:06 +0000 (14:46 +0200)
commit411076f4d635f6cba5e74e8173d0ac4c576024e8
tree994047cd1366be1b411e6cdce19b764ee268d6bb
parentaad7b5c11d51d57659978e04702ac970906894e8
evtchn: slightly defer lock acquire where possible

port_is_valid() and evtchn_from_port() are fine to use without holding
any locks. Accordingly acquire the per-domain lock slightly later in
evtchn_close() and evtchn_bind_vcpu(). Especially for the use by the
former (but there are pre-existing uses) add a comment about
port_is_valid()'s guarantees.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Julien Grall <julien@xen.org>
xen/common/event_channel.c
xen/include/xen/event.h