From: Christoph Hellwig <hch@infradead.org>
To: Nicolin Chen <nicolinc@nvidia.com>
Cc: mjrosato@linux.ibm.com, linux-doc@vger.kernel.org,
airlied@linux.ie, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org, kwankhede@nvidia.com,
vneethv@linux.ibm.com, agordeev@linux.ibm.com,
linux-s390@vger.kernel.org, kvm@vger.kernel.org, corbet@lwn.net,
pasic@linux.ibm.com, jgg@nvidia.com, borntraeger@linux.ibm.com,
intel-gfx@lists.freedesktop.org, jjherne@linux.ibm.com,
farman@linux.ibm.com, jchrist@linux.ibm.com, gor@linux.ibm.com,
hca@linux.ibm.com, freude@linux.ibm.com, rodrigo.vivi@intel.com,
intel-gvt-dev@lists.freedesktop.org, akrowiak@linux.ibm.com,
cohuck@redhat.com, oberpar@linux.ibm.com, svens@linux.ibm.com
Subject: Re: [Intel-gfx] [RFT][PATCH v1 6/6] vfio: Replace phys_pfn with phys_page for vfio_pin_pages()
Date: Fri, 17 Jun 2022 01:54:05 -0700 [thread overview]
Message-ID: <YqxBLbu8yPJiwK6Z@infradead.org> (raw)
In-Reply-To: <20220616235212.15185-7-nicolinc@nvidia.com>
There is a bunch of code an comments in the iommu type1 code that
suggest we can pin memory that is not page backed.
> int vfio_pin_pages(struct vfio_device *device, dma_addr_t iova,
> + int npage, int prot, struct page **phys_page)
I don't think phys_page makes much sense as an argument name.
I'd just call this pages.
> + phys_page[i] = pfn_to_page(vpfn->pfn);
Please store the actual page pointer in the vfio_pfn structure.
> remote_vaddr = dma->vaddr + (iova - dma->iova);
> - ret = vfio_pin_page_external(dma, remote_vaddr, &phys_pfn[i],
> + ret = vfio_pin_page_external(dma, remote_vaddr, &phys_pfn,
> do_accounting);
Please just return the actual page from vaddr_get_pfns through
vfio_pin_pages_remote and vfio_pin_page_external, maybe even as a prep
patch as that is a fair amount of churn.
next prev parent reply other threads:[~2022-06-17 8:54 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20220616235212.15185-1-nicolinc@nvidia.com>
[not found] ` <20220616235212.15185-4-nicolinc@nvidia.com>
2022-06-17 8:42 ` [Intel-gfx] [RFT][PATCH v1 3/6] vfio: Pass in starting IOVA to vfio_pin/unpin_pages API Christoph Hellwig
2022-06-22 1:18 ` Nicolin Chen
[not found] ` <20220616235212.15185-6-nicolinc@nvidia.com>
2022-06-17 8:44 ` [Intel-gfx] [RFT][PATCH v1 5/6] vfio/ccw: Add kmap_local_page() for memcpy Christoph Hellwig
2022-06-20 2:57 ` Jason Gunthorpe
2022-06-20 6:32 ` Christoph Hellwig
2022-06-20 15:39 ` Jason Gunthorpe
2022-06-21 21:21 ` Nicolin Chen
2022-06-24 13:56 ` Jason Gunthorpe
[not found] ` <YrYO/KAa2bqmxEIu@Asurada-Nvidia>
2022-06-24 19:30 ` Jason Gunthorpe
[not found] ` <YrYayPvA7XlCZLQ2@Asurada-Nvidia>
2022-06-24 22:42 ` Jason Gunthorpe
[not found] ` <20220616235212.15185-7-nicolinc@nvidia.com>
2022-06-17 8:54 ` Christoph Hellwig [this message]
[not found] ` <Yqz64VK1IQ0QzXEe@Asurada-Nvidia>
2022-06-19 6:18 ` [Intel-gfx] [RFT][PATCH v1 6/6] vfio: Replace phys_pfn with phys_page for vfio_pin_pages() Christoph Hellwig
2022-06-20 3:00 ` Jason Gunthorpe
2022-06-20 5:51 ` Christoph Hellwig
2022-06-20 6:37 ` Christoph Hellwig
2022-06-20 15:36 ` Jason Gunthorpe
2022-06-21 21:47 ` Nicolin Chen
[not found] ` <20220616235212.15185-2-nicolinc@nvidia.com>
[not found] ` <fd564e6270a4bfcd9249559a797365ae@linux.ibm.com>
2022-06-21 21:01 ` [Intel-gfx] [RFT][PATCH v1 1/6] vfio/ap: Pass in physical address of ind to ap_aqic() Nicolin Chen
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=YqxBLbu8yPJiwK6Z@infradead.org \
--to=hch@infradead.org \
--cc=agordeev@linux.ibm.com \
--cc=airlied@linux.ie \
--cc=akrowiak@linux.ibm.com \
--cc=borntraeger@linux.ibm.com \
--cc=cohuck@redhat.com \
--cc=corbet@lwn.net \
--cc=dri-devel@lists.freedesktop.org \
--cc=farman@linux.ibm.com \
--cc=freude@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-gvt-dev@lists.freedesktop.org \
--cc=jchrist@linux.ibm.com \
--cc=jgg@nvidia.com \
--cc=jjherne@linux.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=kwankhede@nvidia.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=mjrosato@linux.ibm.com \
--cc=nicolinc@nvidia.com \
--cc=oberpar@linux.ibm.com \
--cc=pasic@linux.ibm.com \
--cc=rodrigo.vivi@intel.com \
--cc=svens@linux.ibm.com \
--cc=vneethv@linux.ibm.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