Re: [PATCH v2 2/2] xen/evtchn: rework per event channel lock

2020-10-16 Thread Julien Grall
Hi Juergen, On 12/10/2020 10:27, Juergen Gross wrote: Currently the lock for a single event channel needs to be taken with interrupts off, which causes deadlocks in some cases. Rework the per event channel lock to be non-blocking for the case of sending an event and removing the need for disabl

Re: [PATCH v2 2/2] xen/evtchn: rework per event channel lock

2020-10-14 Thread Jürgen Groß
On 14.10.20 08:52, Jan Beulich wrote: On 14.10.2020 08:00, Jürgen Groß wrote: On 13.10.20 17:28, Jan Beulich wrote: On 12.10.2020 11:27, Juergen Gross wrote: --- a/xen/include/xen/event.h +++ b/xen/include/xen/event.h @@ -105,6 +105,45 @@ void notify_via_xen_event_channel(struct domain *ld, in

Re: [PATCH v2 2/2] xen/evtchn: rework per event channel lock

2020-10-13 Thread Jan Beulich
On 14.10.2020 08:00, Jürgen Groß wrote: > On 13.10.20 17:28, Jan Beulich wrote: >> On 12.10.2020 11:27, Juergen Gross wrote: >>> --- a/xen/include/xen/event.h >>> +++ b/xen/include/xen/event.h >>> @@ -105,6 +105,45 @@ void notify_via_xen_event_channel(struct domain *ld, >>> int lport); >>> #defi

Re: [PATCH v2 2/2] xen/evtchn: rework per event channel lock

2020-10-13 Thread Jürgen Groß
On 13.10.20 17:28, Jan Beulich wrote: On 12.10.2020 11:27, Juergen Gross wrote: @@ -798,9 +786,11 @@ void send_guest_vcpu_virq(struct vcpu *v, uint32_t virq) d = v->domain; chn = evtchn_from_port(d, port); -spin_lock(&chn->lock); -evtchn_port_set_pending(d, v->vcpu_id, ch

Re: [PATCH v2 2/2] xen/evtchn: rework per event channel lock

2020-10-13 Thread Jan Beulich
On 13.10.2020 16:13, Jürgen Groß wrote: > On 13.10.20 16:02, Jan Beulich wrote: >> On 12.10.2020 11:27, Juergen Gross wrote: >>> Currently the lock for a single event channel needs to be taken with >>> interrupts off, which causes deadlocks in some cases. >>> >>> Rework the per event channel lock t

Re: [PATCH v2 2/2] xen/evtchn: rework per event channel lock

2020-10-13 Thread Jan Beulich
On 12.10.2020 11:27, Juergen Gross wrote: > @@ -798,9 +786,11 @@ void send_guest_vcpu_virq(struct vcpu *v, uint32_t virq) > > d = v->domain; > chn = evtchn_from_port(d, port); > -spin_lock(&chn->lock); > -evtchn_port_set_pending(d, v->vcpu_id, chn); > -spin_unlock(&chn->lock

Re: [PATCH v2 2/2] xen/evtchn: rework per event channel lock

2020-10-13 Thread Jürgen Groß
On 13.10.20 16:02, Jan Beulich wrote: On 12.10.2020 11:27, Juergen Gross wrote: Currently the lock for a single event channel needs to be taken with interrupts off, which causes deadlocks in some cases. Rework the per event channel lock to be non-blocking for the case of sending an event and re

Re: [PATCH v2 2/2] xen/evtchn: rework per event channel lock

2020-10-13 Thread Jan Beulich
On 12.10.2020 11:27, Juergen Gross wrote: > Currently the lock for a single event channel needs to be taken with > interrupts off, which causes deadlocks in some cases. > > Rework the per event channel lock to be non-blocking for the case of > sending an event and removing the need for disabling i

[PATCH v2 2/2] xen/evtchn: rework per event channel lock

2020-10-12 Thread Juergen Gross
Currently the lock for a single event channel needs to be taken with interrupts off, which causes deadlocks in some cases. Rework the per event channel lock to be non-blocking for the case of sending an event and removing the need for disabling interrupts for taking the lock. The lock is needed f