From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: george.dunlap@eu.citrix.com, xen-devel@lists.xenproject.org,
keir@xen.org
Subject: Re: [PATCH 2/2] x86/pci: Remove unnecessary check in VF value computation
Date: Tue, 18 Feb 2014 11:56:50 -0500 [thread overview]
Message-ID: <530390D2.6020000@oracle.com> (raw)
In-Reply-To: <53039B61020000780011D68B@nat28.tlf.novell.com>
On 02/18/2014 11:41 AM, Jan Beulich wrote:
>>>> On 18.02.14 at 16:49, Boris Ostrovsky <boris.ostrovsky@oracle.com> wrote:
>> On 02/18/2014 05:16 AM, Jan Beulich wrote:
>>>>>> On 13.02.14 at 10:48, "Jan Beulich" <JBeulich@suse.com> wrote:
>>>>>>> On 12.02.14 at 22:05, Boris Ostrovsky <boris.ostrovsky@oracle.com> wrote:
>>>>> This test is already performed a couple of lines above.
>>>> Except that it's the wrong code you remove:
>>> No opinion on this alternative at all?
>> Sorry Jan, I didn't realize you were waiting for me on this.
>>
>> Yes, your version is fine although to be honest I don't see how the
>> original patch had any issues with division by zero since we'd still be
>> inside the 'if (stride)' clause.
> It's the very division that this patch removes:
>
>>>> --- a/xen/arch/x86/msi.c
>>>> +++ b/xen/arch/x86/msi.c
>>>> @@ -635,7 +635,7 @@ static u64 read_pci_mem_bar(u16 seg, u8
>>>> return 0;
>>>> base = pos + PCI_SRIOV_BAR;
>>>> vf -= PCI_BDF(bus, slot, func) + offset;
>>>> - if ( vf < 0 || (vf && vf % stride) )
>>>> + if ( vf < 0 )
>>>> return 0;
>>>> if ( stride )
>>>> {
> Which isn't inside the if(stride).
Yes, I see it now. I was staring at a wrong line.
This actually now looks like a bug. You do check above for '(num_vf > 1
&& !stride) ' but presumably if things are really messed up num_vf can
be 1 but vf is 0. And then if stride is zero too then we are not doing
particularly well.
So probably this should go into 4.4 as well?
-boris
next prev parent reply other threads:[~2014-02-18 16:55 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-12 21:05 [PATCH 0/2] A couple of SR-IOV-related patches Boris Ostrovsky
2014-02-12 21:05 ` [PATCH 1/2] x86/pci: Store VF's memory space displacement in a 64-bit value Boris Ostrovsky
2014-02-12 21:05 ` [PATCH 2/2] x86/pci: Remove unnecessary check in VF value computation Boris Ostrovsky
2014-02-13 9:48 ` Jan Beulich
2014-02-18 10:16 ` Jan Beulich
2014-02-18 15:49 ` Boris Ostrovsky
2014-02-18 16:41 ` Jan Beulich
2014-02-18 16:56 ` Boris Ostrovsky [this message]
2014-02-18 17:04 ` Jan Beulich
2014-02-18 17:10 ` Boris Ostrovsky
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=530390D2.6020000@oracle.com \
--to=boris.ostrovsky@oracle.com \
--cc=JBeulich@suse.com \
--cc=george.dunlap@eu.citrix.com \
--cc=keir@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.