From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: David Vrabel <david.vrabel@citrix.com>,
xen-devel <xen-devel@lists.xenproject.org>,
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
Juergen Gross <JGross@suse.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] xen-pciback: return proper values during BAR sizing
Date: Mon, 6 Jun 2016 10:28:54 -0400 [thread overview]
Message-ID: <575588A6.8070205@oracle.com> (raw)
In-Reply-To: <57559C1D02000078000F20DF@prv-mh.provo.novell.com>
On 06/06/2016 09:51 AM, Jan Beulich wrote:
>>>> On 06.06.16 at 15:03, <boris.ostrovsky@oracle.com> wrote:
>> On 06/06/2016 04:11 AM, Jan Beulich wrote:
>>> @@ -225,38 +225,42 @@ static inline void read_dev_bar(struct p
>>> (PCI_BASE_ADDRESS_SPACE_MEMORY |
>>> PCI_BASE_ADDRESS_MEM_TYPE_64))) {
>>> bar_info->val = res[pos - 1].start >> 32;
>>> - bar_info->len_val = res[pos - 1].end >> 32;
>>> + bar_info->len_val = -resource_size(&res[pos - 1]) >> 32;
>>> return;
>>> }
>>> }
>>>
>>> + if (!res[pos].flags ||
>>> + (res[pos].flags & (IORESOURCE_DISABLED | IORESOURCE_UNSET |
>>> + IORESOURCE_BUSY)))
>>> + return;
>> Why are you not making this check first thing in the routine?
> For one, pos isn't set there yet. And I'd also rather avoid the
> complications resulting from 64-bit memory resources spanning
> two entries.
I thought that both words of a 64-bit BAR would result in a return under
this check so both would be zero. But yes, pos needs to be initialized
anyway (I didn't see this in the diff).
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
WARNING: multiple messages have this Message-ID (diff)
From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Juergen Gross <JGross@suse.com>,
xen-devel <xen-devel@lists.xenproject.org>,
David Vrabel <david.vrabel@citrix.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] xen-pciback: return proper values during BAR sizing
Date: Mon, 6 Jun 2016 10:28:54 -0400 [thread overview]
Message-ID: <575588A6.8070205@oracle.com> (raw)
In-Reply-To: <57559C1D02000078000F20DF@prv-mh.provo.novell.com>
On 06/06/2016 09:51 AM, Jan Beulich wrote:
>>>> On 06.06.16 at 15:03, <boris.ostrovsky@oracle.com> wrote:
>> On 06/06/2016 04:11 AM, Jan Beulich wrote:
>>> @@ -225,38 +225,42 @@ static inline void read_dev_bar(struct p
>>> (PCI_BASE_ADDRESS_SPACE_MEMORY |
>>> PCI_BASE_ADDRESS_MEM_TYPE_64))) {
>>> bar_info->val = res[pos - 1].start >> 32;
>>> - bar_info->len_val = res[pos - 1].end >> 32;
>>> + bar_info->len_val = -resource_size(&res[pos - 1]) >> 32;
>>> return;
>>> }
>>> }
>>>
>>> + if (!res[pos].flags ||
>>> + (res[pos].flags & (IORESOURCE_DISABLED | IORESOURCE_UNSET |
>>> + IORESOURCE_BUSY)))
>>> + return;
>> Why are you not making this check first thing in the routine?
> For one, pos isn't set there yet. And I'd also rather avoid the
> complications resulting from 64-bit memory resources spanning
> two entries.
I thought that both words of a 64-bit BAR would result in a return under
this check so both would be zero. But yes, pos needs to be initialized
anyway (I didn't see this in the diff).
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-06-06 14:34 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-06 8:08 [PATCH 0/2] xen-pciback: correct and clean up BAR handling Jan Beulich
2016-06-06 8:11 ` [PATCH 1/2] xen-pciback: return proper values during BAR sizing Jan Beulich
2016-06-06 8:11 ` Jan Beulich
2016-06-06 13:03 ` Boris Ostrovsky
2016-06-06 13:03 ` Boris Ostrovsky
2016-06-06 13:51 ` Jan Beulich
2016-06-06 13:51 ` Jan Beulich
2016-06-06 14:28 ` Boris Ostrovsky [this message]
2016-06-06 14:28 ` Boris Ostrovsky
2016-06-06 8:12 ` [PATCH 2/2] xen-pciback: clean up read_dev_bar() Jan Beulich
2016-06-06 13:04 ` Boris Ostrovsky
2016-06-06 13:04 ` Boris Ostrovsky
2016-06-06 8:12 ` Jan Beulich
2016-06-06 8:47 ` [PATCH 3/2] xen-pciback: drop rom_init() Jan Beulich
2016-06-06 13:09 ` Boris Ostrovsky
2016-06-06 13:09 ` Boris Ostrovsky
2016-06-06 13:54 ` Jan Beulich
2016-06-06 13:54 ` Jan Beulich
2016-06-06 14:35 ` Boris Ostrovsky
2016-06-06 14:35 ` Boris Ostrovsky
2016-06-06 8:47 ` 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=575588A6.8070205@oracle.com \
--to=boris.ostrovsky@oracle.com \
--cc=JBeulich@suse.com \
--cc=JGross@suse.com \
--cc=david.vrabel@citrix.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 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.