aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/vmw_vmci/vmci_host.c6
-rw-r--r--drivers/misc/vmw_vmci/vmci_queue_pair.c21
2 files changed, 7 insertions, 20 deletions
diff --git a/drivers/misc/vmw_vmci/vmci_host.c b/drivers/misc/vmw_vmci/vmci_host.c
index d4722b3dc8ec..1723a6e4f2e8 100644
--- a/drivers/misc/vmw_vmci/vmci_host.c
+++ b/drivers/misc/vmw_vmci/vmci_host.c
@@ -243,11 +243,7 @@ static int vmci_host_setup_notify(struct vmci_ctx *context,
243 /* 243 /*
244 * Lock physical page backing a given user VA. 244 * Lock physical page backing a given user VA.
245 */ 245 */
246 down_read(&current->mm->mmap_sem); 246 retval = get_user_pages_fast(PAGE_ALIGN(uva), 1, 1, &page);
247 retval = get_user_pages(current, current->mm,
248 PAGE_ALIGN(uva),
249 1, 1, 0, &page, NULL);
250 up_read(&current->mm->mmap_sem);
251 if (retval != 1) 247 if (retval != 1)
252 return VMCI_ERROR_GENERIC; 248 return VMCI_ERROR_GENERIC;
253 249
diff --git a/drivers/misc/vmw_vmci/vmci_queue_pair.c b/drivers/misc/vmw_vmci/vmci_queue_pair.c
index a0515a6d6ebd..1b7b303085d2 100644
--- a/drivers/misc/vmw_vmci/vmci_queue_pair.c
+++ b/drivers/misc/vmw_vmci/vmci_queue_pair.c
@@ -732,13 +732,9 @@ static int qp_host_get_user_memory(u64 produce_uva,
732 int retval; 732 int retval;
733 int err = VMCI_SUCCESS; 733 int err = VMCI_SUCCESS;
734 734
735 down_write(&current->mm->mmap_sem); 735 retval = get_user_pages_fast((uintptr_t) produce_uva,
736 retval = get_user_pages(current, 736 produce_q->kernel_if->num_pages, 1,
737 current->mm, 737 produce_q->kernel_if->u.h.header_page);
738 (uintptr_t) produce_uva,
739 produce_q->kernel_if->num_pages,
740 1, 0,
741 produce_q->kernel_if->u.h.header_page, NULL);
742 if (retval < produce_q->kernel_if->num_pages) { 738 if (retval < produce_q->kernel_if->num_pages) {
743 pr_warn("get_user_pages(produce) failed (retval=%d)", retval); 739 pr_warn("get_user_pages(produce) failed (retval=%d)", retval);
744 qp_release_pages(produce_q->kernel_if->u.h.header_page, 740 qp_release_pages(produce_q->kernel_if->u.h.header_page,
@@ -747,12 +743,9 @@ static int qp_host_get_user_memory(u64 produce_uva,
747 goto out; 743 goto out;
748 } 744 }
749 745
750 retval = get_user_pages(current, 746 retval = get_user_pages_fast((uintptr_t) consume_uva,
751 current->mm, 747 consume_q->kernel_if->num_pages, 1,
752 (uintptr_t) consume_uva, 748 consume_q->kernel_if->u.h.header_page);
753 consume_q->kernel_if->num_pages,
754 1, 0,
755 consume_q->kernel_if->u.h.header_page, NULL);
756 if (retval < consume_q->kernel_if->num_pages) { 749 if (retval < consume_q->kernel_if->num_pages) {
757 pr_warn("get_user_pages(consume) failed (retval=%d)", retval); 750 pr_warn("get_user_pages(consume) failed (retval=%d)", retval);
758 qp_release_pages(consume_q->kernel_if->u.h.header_page, 751 qp_release_pages(consume_q->kernel_if->u.h.header_page,
@@ -763,8 +756,6 @@ static int qp_host_get_user_memory(u64 produce_uva,
763 } 756 }
764 757
765 out: 758 out:
766 up_write(&current->mm->mmap_sem);
767
768 return err; 759 return err;
769} 760}
770 761