On Thu, Sep 07, 2017 at 03:53:07AM -0600, Jan Beulich wrote:
> >>> On 14.08.17 at 16:28, <roger....@citrix.com> wrote:
> > +
> > +    /*
> > +     * The PCI Local Bus Specification suggests writing ~0 to both the high
> > +     * and the low part of the BAR registers before attempting to read back
> > +     * the size.
> > +     *
> > +     * However real device BARs registers (at least the ones I've tried)
> > +     * will return the size of the BAR just by having written ~0 to one 
> > half
> > +     * of it, independently of the value of the other half of the register.
> > +     * Hence here Xen will switch to returning the size as soon as one half
> > +     * of the BAR register has been written with ~0.
> > +     */
> 
> I don't believe this is correct behavior (but I'd have to play with
> some hardware to see whether I can confirm the behavior you
> describe): How would you place a BAR at, say, 0x1ffffff0?

I don't think it's 'correct' behavior either, but FreeBSD has been
sizing BARs like that, and nobody noticed any issues. I just fixed it
recently:

https://svnweb.freebsd.org/base/head/sys/dev/pci/pci.c?r1=312250&r2=321863

Roger.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

Reply via email to