summaryrefslogtreecommitdiff
path: root/drivers/xen/events/events_internal.h
diff options
context:
space:
mode:
authorJuergen Gross <jgross@suse.com>2021-03-06 17:18:31 +0100
committerBoris Ostrovsky <boris.ostrovsky@oracle.com>2021-03-10 07:25:18 -0600
commit9e77d96b8e2724ed00380189f7b0ded61113b39f (patch)
tree1d305c89d12cdaf042bc381fb18f1c6217867e0e /drivers/xen/events/events_internal.h
parent882213990d32fd224340a4533f6318dd152be4b2 (diff)
downloadlwn-9e77d96b8e2724ed00380189f7b0ded61113b39f.tar.gz
lwn-9e77d96b8e2724ed00380189f7b0ded61113b39f.zip
xen/events: reset affinity of 2-level event when tearing it down
When creating a new event channel with 2-level events the affinity needs to be reset initially in order to avoid using an old affinity from earlier usage of the event channel port. So when tearing an event channel down reset all affinity bits. The same applies to the affinity when onlining a vcpu: all old affinity settings for this vcpu must be reset. As percpu events get initialized before the percpu event channel hook is called, resetting of the affinities happens after offlining a vcpu (this is working, as initial percpu memory is zeroed out). Cc: stable@vger.kernel.org Reported-by: Julien Grall <julien@xen.org> Signed-off-by: Juergen Gross <jgross@suse.com> Reviewed-by: Julien Grall <jgrall@amazon.com> Link: https://lore.kernel.org/r/20210306161833.4552-2-jgross@suse.com Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Diffstat (limited to 'drivers/xen/events/events_internal.h')
-rw-r--r--drivers/xen/events/events_internal.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/xen/events/events_internal.h b/drivers/xen/events/events_internal.h
index 0a97c0549db7..18a4090d0709 100644
--- a/drivers/xen/events/events_internal.h
+++ b/drivers/xen/events/events_internal.h
@@ -14,6 +14,7 @@ struct evtchn_ops {
unsigned (*nr_channels)(void);
int (*setup)(evtchn_port_t port);
+ void (*remove)(evtchn_port_t port, unsigned int cpu);
void (*bind_to_cpu)(evtchn_port_t evtchn, unsigned int cpu,
unsigned int old_cpu);
@@ -54,6 +55,13 @@ static inline int xen_evtchn_port_setup(evtchn_port_t evtchn)
return 0;
}
+static inline void xen_evtchn_port_remove(evtchn_port_t evtchn,
+ unsigned int cpu)
+{
+ if (evtchn_ops->remove)
+ evtchn_ops->remove(evtchn, cpu);
+}
+
static inline void xen_evtchn_port_bind_to_cpu(evtchn_port_t evtchn,
unsigned int cpu,
unsigned int old_cpu)