From: David Vrabel <david.vrabel@citrix.com>
To: Chen Gang <gang.chen.5i5j@gmail.com>, <konrad.wilk@oracle.com>,
<boris.ostrovsky@oracle.com>
Cc: <xen-devel@lists.xenproject.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] drivers/xen/evtchn.c: Check failure for evtchn_make_refcounted()
Date: Fri, 29 Aug 2014 14:43:11 +0100 [thread overview]
Message-ID: <5400836F.1090508@citrix.com> (raw)
In-Reply-To: <5400817E.6060500@gmail.com>
On 29/08/14 14:34, Chen Gang wrote:
>
>
> On 8/28/14 23:49, David Vrabel wrote:
>> On 28/08/14 16:13, Chen Gang wrote:
>>> evtchn_make_refcounted() may return failure, so need process the failure
>>> case. In failure case, it need call unbind_from_irqhandler() just like
>>> evtchn_unbind_from_user() has done.
>>>
>>> irq_from_evtchn() must be OK when bind_evtchn_to_irqhandler() succeed,
>>> so need not check it again.
>>>
>>> Also still need remain the closing port code, because when the failure
>>> occurs, unbind_from_irqhandler() will not close port internally.
>>
>> None of the evtchn_make_refcounted() failures can occur since we know we
>> have a valid irq and info at the single call site.
>>
>
> OK, thanks. I guess what you said is correct.
>
> But only according to the code, for me, I am not quite sure about 'info'
> must be always valid. If bind_evtchn_to_irqhandler() succeeds, I can not
> find any related code to prove 'info' must be valid.
>
> - for a new irq, it will allocate 'info' for it.
>
> - but for an existing irq, the code assumes it may has no 'info'.
> (so several areas check 'info' whether valid, although irq is OK).
>
> So could you give some additional related proofs for it? And if 'info'
> must be always OK, can we remove all the related check about 'info'?
I'm not sure what you mean by an existing irq. If it's an irq for an
event channel it will have had info set when it was allocated. the
irq_mapping_update_lock protects against seeing partially setup irqs.
So, the checks for !info can be removed, yes.
David
next prev parent reply other threads:[~2014-08-29 13:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-28 15:13 [PATCH] drivers/xen/evtchn.c: Check failure for evtchn_make_refcounted() Chen Gang
2014-08-28 15:49 ` David Vrabel
2014-08-29 13:34 ` Chen Gang
2014-08-29 13:43 ` David Vrabel [this message]
2014-08-30 3:39 ` Chen Gang
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=5400836F.1090508@citrix.com \
--to=david.vrabel@citrix.com \
--cc=boris.ostrovsky@oracle.com \
--cc=gang.chen.5i5j@gmail.com \
--cc=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox