Thread (77 messages) 77 messages, 5 authors, 2025-06-26

RE: [PATCH v6 10/25] iommufd/viommu: Add IOMMUFD_CMD_HW_QUEUE_ALLOC ioctl

From: "Tian, Kevin" <kevin.tian@intel.com>
Date: 2025-06-25 03:45:11
Also in: linux-doc, linux-iommu, linux-kselftest, linux-patches, linux-tegra, lkml

From: Nicolin Chen <redacted>
Sent: Saturday, June 14, 2025 3:15 PM
+
+	offset =
+		cmd->nesting_parent_iova - PAGE_ALIGN(cmd-
quoted
nesting_parent_iova);
+	max_npages = DIV_ROUND_UP(offset + cmd->length, PAGE_SIZE);
+
+	/*
+	 * FIXME allocation may fail when sizeof(*pages) * max_npages is
+	 * larger than PAGE_SIZE. This might need a new API returning a
+	 * bio_vec or something more efficient.
+	 */
+	pages = kcalloc(max_npages, sizeof(*pages), GFP_KERNEL);
+	if (!pages)
+		return ERR_PTR(-ENOMEM);
+
any allocation may fail... can you elaborate more here? How does
PAGE_SIZE become a boundary?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help