Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 Apr 2016 12:48:24 -0400
From:      Ryan Stone <rysto32@gmail.com>
To:        John Baldwin <jhb@freebsd.org>
Cc:        Luigi Rizzo <rizzo@iet.unipi.it>, Jim Harris <jim.harris@gmail.com>,  FreeBSD Current <freebsd-current@freebsd.org>, Giuseppe Lettieri <g.lettieri@iet.unipi.it>,  Vincenzo Maffione <v.maffione@gmail.com>
Subject:   Re: accessing a PCIe register from userspace through kmem or other ways ?
Message-ID:  <CAFMmRNxJDuQoC-YuwbaWkj7MGVw9UgPEANOX6bN=i8%2Bp_9vm5w@mail.gmail.com>
In-Reply-To: <5045119.GKNSyI10vh@ralph.baldwin.cx>
References:  <CA%2BhQ2%2BiU4odjhaNicFA4QjvSZR2OZOOy%2BFu4LTqsibdoK4M8zg@mail.gmail.com> <CAFMmRNxCHgRD4bUWwZiG%2B6HiLD2DxagFgHTGmH5jtRj%2BUEtJNA@mail.gmail.com> <CA%2BhQ2%2BjeyVFp-bHckuLtBQ1VBkk%2BA86EvUyC%2BCB2ZZFiye6k1g@mail.gmail.com> <5045119.GKNSyI10vh@ralph.baldwin.cx>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Apr 1, 2016 at 12:31 PM, John Baldwin <jhb@freebsd.org> wrote:

> Sorry, I mapped PCIe registers to the PCI-e config space register set.  I
> am
> not sure exactly how libpciaccess handles register access (perhaps it reads
> raw bars and maps them via /dev/mem)?  However, it would not be hard to a
> new ioctl to /dev/pci to allow one to mmap a specific BAR of a given
> device.
>

That is actually a really good question.  I know that with some recent
BIOSes if I enabled allocating 64-bit addresses to BARs, the BAR would
actually be mapped outside of the range of /dev/mem.  From a quick glance
at libpciaccess, I don't think that it handles this case.  A specific
mechanism for allowing mmaping of BARs would be useful, I think.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFMmRNxJDuQoC-YuwbaWkj7MGVw9UgPEANOX6bN=i8%2Bp_9vm5w>