Thread (180 messages) 180 messages, 3 authors, 2022-01-31
STALE1605d
Revisions (6)
  1. v1 [diff vs current]
  2. v2 [diff vs current]
  3. v4 current
  4. v5 [diff vs current]
  5. v7 [diff vs current]
  6. v8 [diff vs current]

[PATCH v4 18/66] xen: Use vma_lookup() in privcmd_ioctl_mmap()

From: Liam Howlett <hidden>
Date: 2021-12-01 14:32:42
Also in: lkml
Subsystem: the rest, xen hypervisor interface · Maintainers: Linus Torvalds, Juergen Gross, Stefano Stabellini

From: "Liam R. Howlett" <redacted>

vma_lookup() walks the VMA tree for a specific value, find_vma() will
search the tree after walking to a specific value.  It is more efficient
to only walk to the requested value as this case requires the address to
equal the vm_start.

Signed-off-by: Liam R. Howlett <redacted>
---
 drivers/xen/privcmd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/xen/privcmd.c b/drivers/xen/privcmd.c
index 3369734108af..ad17166b0ef6 100644
--- a/drivers/xen/privcmd.c
+++ b/drivers/xen/privcmd.c
@@ -282,7 +282,7 @@ static long privcmd_ioctl_mmap(struct file *file, void __user *udata)
 						     struct page, lru);
 		struct privcmd_mmap_entry *msg = page_address(page);
 
-		vma = find_vma(mm, msg->va);
+		vma = vma_lookup(mm, msg->va);
 		rc = -EINVAL;
 
 		if (!vma || (msg->va != vma->vm_start) || vma->vm_private_data)
-- 
2.30.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help