On Tue, 14 Nov 2017 13:29:02 +1100 Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx> wrote: > On Tue, 2017-11-14 at 13:23 +1100, David Gibson wrote: > > > >> 1. Allow msix mapping to the userspace (to address non-64k-aligned msix bar) > > > > We have a new plan on this - I'll discuss it over IRC. > > > > > >> 2. Allow write combining in vfio for the userspace (kvm guest is kinda > > > >> special and may simply ignore mapping flags in some configs but PPC radix > > > >> guests still rely on this) > > > > AIUI this isn't for radix, but for DPDK things that we need this. Ben > > talked about it a bit, but I don't know what the outcome was. > > So this is not a powerpc specific issue. Other archs similarily want to > be able to do write combine mappings. > > The way sysfs does it is that for prefetchable BARs, it exposes both > a resourceN and a resourceN_wc file. > > For VFIO it's a bit more tricky, maybe we need to game the offset using > some of it as flags but that's very fishy, or maybe we do some kind of > ioctl that selects the attributes used for that fd instance for > subsequent mappings... > > I'll let Alex chose what he feels most appropriate here. My order of preference would be something like: - mmap flags provide some way for the user to specify a wc mapping within existing regions - some other mechanism of using the existing regions - additional regions provided for use exclusively with wc attributes (generalizing PCI BAR wc regions within device specific regions) - additional file descriptors provided for wc access This isn't at the top of my priority list to figure out the solution, so whoever implements it will need to provide justification as they move down the list from more to less preferred solutions. Thanks, Alex