All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joby Poriyath <joby.poriyath@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: andrew.cooper3@citrix.com, malcolm.crossley@citrix.com,
	keir@xen.org, xen-devel@lists.xenproject.org
Subject: Re: [PATCH v6] interrupts: allow guest to set/clear MSI-X mask bit
Date: Fri, 16 Aug 2013 12:16:09 +0100	[thread overview]
Message-ID: <20130816111609.GB3388@citrix.com> (raw)
In-Reply-To: <520E133B02000078000EC87B@nat28.tlf.novell.com>

On Fri, Aug 16, 2013 at 10:55:39AM +0100, Jan Beulich wrote:
> >>> On 15.08.13 at 17:47, Joby Poriyath <joby.poriyath@citrix.com> wrote:
> > @@ -404,7 +436,7 @@ int msixtbl_pt_register(struct domain *d, struct pirq *pirq, uint64_t gtable)
> >  
> >      entry = new_entry;
> >      new_entry = NULL;
> > -    add_msixtbl_entry(d, pdev, gtable, entry);
> > +    add_msixtbl_entry(d, pdev, gtable, entry, pirq);
> >  
> >  found:
> >      atomic_inc(&entry->refcnt);
> 
> Just noticed this "found" label here, which made me go back and
> look at the whole function: Did you consider the case of there
> already being an entry, and hence add_msixtbl_entry() not
> getting called, and thus entry->pirq not getting set to what got
> passed in here? I'm assuming that this is only ever the case if
> for the entry found entry->pirq == pirq, but if I'm right with
> this, adding a respective ASSERT() here would seem desirable.

If there was an entry, that was there only because it was added using 
"add_msixtbl_entry" function, and hence entry->pirq would have been 
initialized with a valid pirq. And modification of msixtbl_list is 
protected with a spinlock on msixtbl_list_lock. So in any case (adding
for the first time, or finding an entry), "entry" would have been 
correctly initialized. So looks like it's safe.

Or, am I getting this wrong? 

Thanks,
Joby

  reply	other threads:[~2013-08-16 11:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-15 15:47 [PATCH v6] interrupts: allow guest to set/clear MSI-X mask bit Joby Poriyath
2013-08-16  9:55 ` Jan Beulich
2013-08-16 11:16   ` Joby Poriyath [this message]
2013-08-16 13:10     ` 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=20130816111609.GB3388@citrix.com \
    --to=joby.poriyath@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=keir@xen.org \
    --cc=malcolm.crossley@citrix.com \
    --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.