Thread (79 messages) 79 messages, 3 authors, 2025-06-06

Re: [PATCH v5 14/29] iommufd/viommu: Add IOMMUFD_CMD_HW_QUEUE_ALLOC ioctl

From: Nicolin Chen <hidden>
Date: 2025-05-30 18:40:00
Also in: linux-doc, linux-iommu, linux-kselftest, linux-patches, linux-tegra, lkml

On Fri, May 30, 2025 at 03:25:19PM -0300, Jason Gunthorpe wrote:
On Fri, May 30, 2025 at 11:23:02AM -0700, Nicolin Chen wrote:
quoted
On Fri, May 30, 2025 at 02:40:37PM -0300, Jason Gunthorpe wrote:
quoted
On Fri, May 30, 2025 at 10:38:24AM -0700, Nicolin Chen wrote:
quoted
On Fri, May 30, 2025 at 01:14:55PM -0300, Jason Gunthorpe wrote:
quoted
On Sat, May 17, 2025 at 08:21:31PM -0700, Nicolin Chen wrote:
quoted
+	offset =
+		cmd->nesting_parent_iova - PAGE_ALIGN(cmd->nesting_parent_iova);
+	max_npages = DIV_ROUND_UP(offset + cmd->length, PAGE_SIZE);
This should probably be capped to PAGE_SIZE/sizeof(void *), return
EINVAL if not
Hmm, mind elaborating where this PAGE_SIZE/sizeof comes from?
We can usually allocate up to a PAGE_SIZE without too much
trouble. Beyond that it gets more likely to fail.
If PAGE_SIZE=4096, the upper limit for max_npages is 512, i.e. the
max size of a guest queue is 2MB? It seems to be too small, as the
VMM can use a larger huge page size to back the guest queue?
May need to make a new API that returns a bio_vec or something else
more efficient then :\
Hmm, that sounds like a rabbit hole :-\

Let me leave a FIXME at this max_npages calculation instead..

Thanks
Nicolin
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help