From: Alex Williamson <alex.williamson@redhat.com>
To: Jason Gunthorpe <jgg@nvidia.com>
Cc: ankita@nvidia.com, aniketa@nvidia.com, cjia@nvidia.com,
kwankhede@nvidia.com, targupta@nvidia.com, vsethi@nvidia.com,
acurrid@nvidia.com, apopple@nvidia.com, jhubbard@nvidia.com,
danw@nvidia.com, kvm@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/1] vfio/nvgpu: Add vfio pci variant module for grace hopper
Date: Tue, 6 Jun 2023 12:13:48 -0600 [thread overview]
Message-ID: <20230606121348.670229ff.alex.williamson@redhat.com> (raw)
In-Reply-To: <ZH9p+giEs6bCYfw8@nvidia.com>
On Tue, 6 Jun 2023 14:16:42 -0300
Jason Gunthorpe <jgg@nvidia.com> wrote:
> On Tue, Jun 06, 2023 at 11:05:10AM -0600, Alex Williamson wrote:
>
> > It actually seems more complicated this way. We're masquerading this
> > region as a BAR, but then QEMU needs to know based on device IDs that
> > it's really not a BAR, it has special size properties, mapping
> > attributes, error handling, etc.
>
> This seems like something has gone wrong then. ie the SIGUBS error
> handling stuff should be totally generic in the qemu side. Mapping
> attributes are set by the kernel, qemu shouldn't know, doesn't need to
> know.
You asked me to look at the v1 posting to see why there's so much more
going on here than a quirk. That's what I read from the first public
posting, a coherent memory region masqueraded as a BAR which requires
different memory mapping and participates in ECC. I agree that the
actual mapping is done by the kernel, but it doesn't really make a
difference if that's a vfio-pci variant driver providing a different
mmap callback for a BAR region or a device specific region handler.
> The size issue is going to a be a problem in future anyhow, I expect
> some new standards coming to support non-power-two sizes and they will
> want to map to PCI devices in VMs still.
Ok, but a PCI BAR has specific constraints and a non-power-of-2 BAR is
not software compatible with those constraints. That's obviously not
to say that a new capability couldn't expose arbitrary resources sizes
on a PCI-like device though. I don't see how a non-power-of-2 BAR at
this stage helps or fits within any spec, which is exactly what's
being proposed through this BAR masquerade.
> It seems OK to me if qemu can do this generically for any "BAR"
> region, at least creating an entire "nvidia only" code path just for
> non power 2 BAR sizing seems like a bad ABI choice.
Have you looked at Ankit's QEMU series? It's entirely NVIDIA-only code
paths. Also nothing here precludes that shared code in QEMU might
expose some known arbitrary sized regions as a BAR, or whatever spec
defined thing allows that in the future. It would only be a slight
modification in the QEMU code to key on the presence of a device
specific region rather than PCI vendor and device IDs, to then register
that region as a PCI BAR and proceed with all this NVIDIA specific
PXM/SRAT setup. IMO it makes a lot more sense to create memory-only
NUMA nodes based on a device specific region than it does a PCI BAR.
> > I'm not privy to a v1, the earliest I see is this (v3):
> >
> > https://lore.kernel.org/all/20230405180134.16932-1-ankita@nvidia.com/
> >
> > That outlines that we have a proprietary interconnect exposing cache
> > coherent memory which requires use of special mapping attributes vs a
> > standard PCI BAR and participates in ECC. All of which seems like it
> > would be easier to setup in QEMU if the vfio-pci representation of the
> > device didn't masquerade this regions as a standard BAR. In fact it
> > also reminds me of NVlink2 coherent RAM on POWER machines that was
> > similarly handled as device specific regions.
>
> It wasn't so good on POWER and if some of that stuff has been done
> more generally we would have been further ahead here..
Specifics? Nothing here explained why masquerading the coherent memory
as a BAR in the vfio-pci ABI is anything more than a hack that QEMU
could assemble on its own with a device specific region. Thanks,
Alex
next prev parent reply other threads:[~2023-06-06 18:14 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-06 2:53 ankita
2023-06-06 14:32 ` Alex Williamson
2023-06-06 15:32 ` Jason Gunthorpe
2023-06-06 17:05 ` Alex Williamson
2023-06-06 17:16 ` Jason Gunthorpe
2023-06-06 18:13 ` Alex Williamson [this message]
2023-06-06 19:05 ` Jason Gunthorpe
2023-06-06 21:30 ` Alex Williamson
2023-06-07 0:14 ` Jason Gunthorpe
2023-06-07 18:23 ` Alex Williamson
2023-06-13 14:35 ` Jason Gunthorpe
2023-06-13 19:24 ` Alex Williamson
2023-06-14 17:55 ` Jason Gunthorpe
2023-06-14 19:20 ` Alex Williamson
2023-06-14 19:32 ` Jason Gunthorpe
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=20230606121348.670229ff.alex.williamson@redhat.com \
--to=alex.williamson@redhat.com \
--cc=acurrid@nvidia.com \
--cc=aniketa@nvidia.com \
--cc=ankita@nvidia.com \
--cc=apopple@nvidia.com \
--cc=cjia@nvidia.com \
--cc=danw@nvidia.com \
--cc=jgg@nvidia.com \
--cc=jhubbard@nvidia.com \
--cc=kvm@vger.kernel.org \
--cc=kwankhede@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=targupta@nvidia.com \
--cc=vsethi@nvidia.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®