From: Alex Williamson <alex.williamson@redhat.com>
To: <ankita@nvidia.com>
Cc: <jgg@nvidia.com>, <yishaih@nvidia.com>,
<shameerali.kolothum.thodi@huawei.com>, <kevin.tian@intel.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>,
<anuaggarwal@nvidia.com>, <kvm@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v12 1/1] vfio/nvgpu: Add vfio pci variant module for grace hopper
Date: Tue, 17 Oct 2023 16:54:37 -0600 [thread overview]
Message-ID: <20231017165437.69a84f0c.alex.williamson@redhat.com> (raw)
In-Reply-To: <20231015163047.20391-1-ankita@nvidia.com>
On Sun, 15 Oct 2023 22:00:47 +0530
<ankita@nvidia.com> wrote:
> +static ssize_t nvgrace_gpu_vfio_pci_read(struct vfio_device *core_vdev,
> + char __user *buf, size_t count, loff_t *ppos)
> +{
> + unsigned int index = VFIO_PCI_OFFSET_TO_INDEX(*ppos);
> + struct nvgrace_gpu_vfio_pci_core_device *nvdev = container_of(
> + core_vdev, struct nvgrace_gpu_vfio_pci_core_device, core_device.vdev);
> + int ret;
> +
> + if (index == VFIO_PCI_BAR2_REGION_INDEX) {
> + ret = nvgrace_gpu_memmap(nvdev);
> + if (ret)
> + return ret;
> +
> + return nvgrace_gpu_read_mem(buf, count, ppos, nvdev);
> + }
After looking at Yishai's virtio-vfio-pci driver where BAR0 is emulated
as an IO Port BAR, it occurs to me that there's no config space
emulation of BAR2 (or BAR3) here. Doesn't this mean that QEMU registers
the BAR as 32-bit, non-prefetchable? ie. VFIOBAR.type & .mem64 are
wrong?
I'd certainly expect this to be emulated as a 64-bit, prefetchable BAR
and the commit log indicates the intention is that this is exposed as a
64-bit BAR.
We also need to decide how strictly variant drivers need to emulate
vfio_pci_config_rw with respect to BAR sizing, where the core code
provides emulation of sizing and Yishai's virtio driver only emulates
the IO port indicator bit. QEMU doesn't really need this, but the
vfio-pci implementation sets the precedent that this behavior is
provided and could be used by other userspace drivers. It's essentially
just providing a masked buffer to service reads and writes to the BAR2
and BAR3 config address here. Thanks,
Alex
> +
> + return vfio_pci_core_read(core_vdev, buf, count, ppos);
> +}
next prev parent reply other threads:[~2023-10-17 22:55 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-15 16:30 [PATCH v12 1/1] vfio/nvgpu: Add vfio pci variant module for grace hopper ankita
2023-10-17 22:54 ` Alex Williamson [this message]
2023-10-23 12:48 ` Ankit Agrawal
2023-10-23 14:43 ` Alex Williamson
2023-10-24 14:03 ` Ankit Agrawal
2023-10-24 14:28 ` Alex Williamson
2023-10-25 8:28 ` Tian, Kevin
2023-10-25 12:43 ` Ankit Agrawal
2023-10-25 14:20 ` Alex Williamson
2023-10-25 17:15 ` Ankit Agrawal
2023-11-09 4:27 ` Ankit Agrawal
2023-10-25 14:29 ` Alex Williamson
2023-11-04 9:35 ` kernel test robot
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=20231017165437.69a84f0c.alex.williamson@redhat.com \
--to=alex.williamson@redhat.com \
--cc=acurrid@nvidia.com \
--cc=aniketa@nvidia.com \
--cc=ankita@nvidia.com \
--cc=anuaggarwal@nvidia.com \
--cc=apopple@nvidia.com \
--cc=cjia@nvidia.com \
--cc=danw@nvidia.com \
--cc=jgg@nvidia.com \
--cc=jhubbard@nvidia.com \
--cc=kevin.tian@intel.com \
--cc=kvm@vger.kernel.org \
--cc=kwankhede@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=shameerali.kolothum.thodi@huawei.com \
--cc=targupta@nvidia.com \
--cc=vsethi@nvidia.com \
--cc=yishaih@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 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.