From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: keir@xen.org, ian.campbell@citrix.com, andrew.cooper3@citrix.com,
tim@xen.org, xen-devel@lists.xenproject.org,
ian.jackson@eu.citrix.com
Subject: Re: [PATCH v8 for-xen-4.5 1/2] dpci: Move from an hvm_irq_dpci (and struct domain) to an hvm_dirq_dpci model.
Date: Fri, 24 Oct 2014 15:09:41 -0400 [thread overview]
Message-ID: <20141024190941.GA17894@laptop.dumpdata.com> (raw)
In-Reply-To: <544A3CCC0200007800041D22@mail.emea.novell.com>
On Fri, Oct 24, 2014 at 10:49:32AM +0100, Jan Beulich wrote:
> >>> On 24.10.14 at 03:58, <konrad.wilk@oracle.com> wrote:
> > On Thu, Oct 23, 2014 at 09:58:34AM +0100, Jan Beulich wrote:
> >> >>> On 21.10.14 at 19:19, <konrad.wilk@oracle.com> wrote:
> >> > @@ -156,6 +165,7 @@ int pt_irq_create_bind(
> >> > {
> >> > pirq_dpci->gmsi.gflags = 0;
> >> > pirq_dpci->gmsi.gvec = 0;
> >> > + pirq_dpci->dom = NULL;
> >> > pirq_dpci->flags = 0;
> >> > pirq_cleanup_check(info, d);
> >> > spin_unlock(&d->event_lock);
> >>
> >> Just like this error path needing adjustment, the other one following
> >> failure of pirq_guest_bind() (after
> >>
> >> > @@ -232,7 +242,6 @@ int pt_irq_create_bind(
> >> > {
> >> > unsigned int share;
> >> >
> >> > - pirq_dpci->dom = d;
> >> > if ( pt_irq_bind->irq_type == PT_IRQ_TYPE_MSI_TRANSLATE )
> >> > {
> >> > pirq_dpci->flags = HVM_IRQ_DPCI_MAPPED |
> >>
> >> ) would seem to need adjustment too.
> >
> > However I am at lost of what you mean here. If by adjustment you mean
> > leave it alone I concur on the later.
>
> Indeed I managed to overlook that ->dom is being cleared there
> already. Over time I've been trying to make the code in this file at
> least a little more legible, but it's still lacking (i.e. in the case here
> proper grouping of the cleanup done on the different data
> structures would probably have made this more obvious, e.g. in
> the case at hand having the clearing of pirq_dpci->dom and
> pirq_dpci->flags side by side).
>
> > @@ -144,6 +141,18 @@ int pt_irq_create_bind(
> > HVM_IRQ_DPCI_GUEST_MSI;
> > pirq_dpci->gmsi.gvec = pt_irq_bind->u.msi.gvec;
> > pirq_dpci->gmsi.gflags = pt_irq_bind->u.msi.gflags;
> > + /*
> > + * 'pt_irq_create_bind' can be called after 'pt_irq_destroy_bind'.
> > + * The 'pirq_cleanup_check' which would free the structure is only
> > + * called if the event channel for the PIRQ is active. However
> > + * OS-es that use event channels usually bind PIRQs to eventds
> > + * and unbind them before calling 'pt_irq_destroy_bind' - with the
> > + * result that we re-use the 'dpci' structure. This can be
> > + * reproduced with unloading and loading the driver for a device.
> > + *
> > + * As such on every 'pt_irq_create_bind' call we MUST set it.
> > + */
> > + pirq_dpci->dom = d;
> > /* bind after hvm_irq_dpci is setup to avoid race with irq handler*/
> > rc = pirq_guest_bind(d->vcpu[0], info, 0);
> > if ( rc == 0 && pt_irq_bind->u.msi.gtable )
> > @@ -156,6 +165,7 @@ int pt_irq_create_bind(
> > {
> > pirq_dpci->gmsi.gflags = 0;
> > pirq_dpci->gmsi.gvec = 0;
> > + pirq_dpci->dom = NULL;
> > pirq_dpci->flags = 0;
> > pirq_cleanup_check(info, d);
> > spin_unlock(&d->event_lock);
>
> Wait - is this correct even when pirq_guest_bind() succeeded but
> msixtbl_pt_register() failed? At the first glance I would say no. But
Keep in mind that if 'msixtbl_pt_register' fails we immediately call
'pirq_guest_unbind' and then land in here.
> apart from that needing sorting out I think the patch is fine now
> (and I hope the latest re-shuffling didn't break anything).
Wheew. I think so too.
>
> Jan
>
next prev parent reply other threads:[~2014-10-24 19:09 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-21 17:19 [PATCH v8 for-xen-4.5] Fix interrupt latency of HVM PCI passthrough devices Konrad Rzeszutek Wilk
2014-10-21 17:19 ` [PATCH v8 for-xen-4.5 1/2] dpci: Move from an hvm_irq_dpci (and struct domain) to an hvm_dirq_dpci model Konrad Rzeszutek Wilk
2014-10-23 8:58 ` Jan Beulich
2014-10-24 1:58 ` Konrad Rzeszutek Wilk
2014-10-24 9:49 ` Jan Beulich
2014-10-24 19:09 ` Konrad Rzeszutek Wilk [this message]
2014-10-27 9:25 ` Jan Beulich
2014-10-27 16:36 ` Konrad Rzeszutek Wilk
2014-10-27 16:57 ` Jan Beulich
2014-10-21 17:19 ` [PATCH v8 for-xen-4.5 2/2] dpci: Replace tasklet with an softirq (v8) Konrad Rzeszutek Wilk
2014-10-23 9:36 ` Jan Beulich
2014-10-24 1:58 ` Konrad Rzeszutek Wilk
2014-10-24 10:09 ` Jan Beulich
2014-10-24 20:55 ` Konrad Rzeszutek Wilk
2014-10-25 0:39 ` Konrad Rzeszutek Wilk
2014-10-27 9:36 ` Jan Beulich
2014-10-27 16:36 ` Konrad Rzeszutek Wilk
2014-10-27 9:32 ` Jan Beulich
2014-10-27 10:40 ` Andrew Cooper
2014-10-27 10:59 ` Jan Beulich
2014-10-27 11:09 ` Andrew Cooper
2014-10-27 11:24 ` Jan Beulich
2014-10-27 17:01 ` Konrad Rzeszutek Wilk
2014-10-27 17:36 ` Andrew Cooper
2014-10-27 18:00 ` Konrad Rzeszutek Wilk
2014-10-27 21:13 ` Konrad Rzeszutek Wilk
2014-10-28 10:43 ` Jan Beulich
2014-10-28 20:07 ` Konrad Rzeszutek Wilk
2014-10-29 8:28 ` Jan Beulich
2014-10-29 21:11 ` Konrad Rzeszutek Wilk
2014-10-30 9:04 ` Jan Beulich
2014-11-02 20:09 ` Konrad Rzeszutek Wilk
2014-11-03 8:46 ` Jan Beulich
2014-10-28 7:58 ` Jan Beulich
2014-10-28 7:53 ` Jan Beulich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20141024190941.GA17894@laptop.dumpdata.com \
--to=konrad.wilk@oracle.com \
--cc=JBeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=ian.campbell@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=keir@xen.org \
--cc=tim@xen.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.