[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20251121140842.30884fc2.alex@shazbot.org>
Date: Fri, 21 Nov 2025 14:08:42 -0700
From: Alex Williamson <alex@...zbot.org>
To: Donald Dutile <ddutile@...hat.com>
Cc: ankita@...dia.com, jgg@...pe.ca, yishaih@...dia.com,
skolothumtho@...dia.com, kevin.tian@...el.com, aniketa@...dia.com,
vsethi@...dia.com, mochs@...dia.com, Yunxiang.Li@....com,
yi.l.liu@...el.com, zhangdongdong@...incomputing.com, avihaih@...dia.com,
bhelgaas@...gle.com, peterx@...hat.com, pstanner@...hat.com,
apopple@...dia.com, kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
cjia@...dia.com, kwankhede@...dia.com, targupta@...dia.com,
zhiw@...dia.com, danw@...dia.com, dnigam@...dia.com, kjaju@...dia.com
Subject: Re: [PATCH v3 5/7] vfio: move barmap to a separate function and
export
On Fri, 21 Nov 2025 15:58:19 -0500
Donald Dutile <ddutile@...hat.com> wrote:
> On 11/21/25 11:39 AM, Alex Williamson wrote:
> > On Fri, 21 Nov 2025 14:11:39 +0000
> > <ankita@...dia.com> wrote:
> >> +
> >> int vfio_pci_core_mmap(struct vfio_device *core_vdev, struct vm_area_struct *vma)
> >> {
> >> struct vfio_pci_core_device *vdev =
> >> @@ -1761,18 +1784,9 @@ int vfio_pci_core_mmap(struct vfio_device *core_vdev, struct vm_area_struct *vma
> >> * Even though we don't make use of the barmap for the mmap,
> >> * we need to request the region and the barmap tracks that.
> >> */
> >> - if (!vdev->barmap[index]) {
> >> - ret = pci_request_selected_regions(pdev,
> >> - 1 << index, "vfio-pci");
> >> - if (ret)
> >> - return ret;
> >> -
> >> - vdev->barmap[index] = pci_iomap(pdev, index, 0);
> >> - if (!vdev->barmap[index]) {
> >> - pci_release_selected_regions(pdev, 1 << index);
> >> - return -ENOMEM;
> >> - }
> >> - }
> >> + ret = vfio_pci_core_barmap(vdev, index);
> >> + if (ret)
> >> + return ret;
> >>
> so, vfio_pci_core_mmap() should be calling vfio_pci_core_setup_barmap() vs. what it does above currently?
Yeah, it probably should have happened in 8bccc5b80678 ("vfio/pci:
Expose vfio_pci_core_setup_barmap()") when the static function in
vfio_pci_rdwr.c was exported. Better late than never. Thanks,
Alex
Powered by blists - more mailing lists