evtchn/sched: reject poll requests for unusable ports
authorJan Beulich <jbeulich@suse.com>
Wed, 30 Sep 2020 07:10:46 +0000 (09:10 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 30 Sep 2020 07:10:46 +0000 (09:10 +0200)
commitd4bfa0c78f48e6562667f8e9c898a548be633d77
tree3f606338981c7351a8a88bf9ca64f208cf7dc35b
parentf60ab5337f968e2f10c639ab59db7afb0fe4f7c3
evtchn/sched: reject poll requests for unusable ports

Before and after XSA-342 there has been an asymmetry in how not really
usable ports get treated in do_poll(): Ones beyond a certain boundary
(max_evtchns originally, valid_evtchns subsequently) did get refused
with -EINVAL, while lower ones were accepted despite there potentially
being no way to wake the vCPU again from its polling state. Arrange to
also honor evtchn_usable() output in the decision.

Requested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
Reviewed-by: Dario Faggioli <dfaggioli@suse.com>
Reviewed-by: Paul Durrant <paul@xen.org>
xen/common/sched/core.c
xen/include/xen/event.h