summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/hv/mshv_root_main.c8
-rw-r--r--include/uapi/linux/mshv.h2
2 files changed, 3 insertions, 7 deletions
diff --git a/drivers/hv/mshv_root_main.c b/drivers/hv/mshv_root_main.c
index a8f3c5f3ce34..3f73c468e975 100644
--- a/drivers/hv/mshv_root_main.c
+++ b/drivers/hv/mshv_root_main.c
@@ -1188,12 +1188,8 @@ static int mshv_partition_create_region(struct mshv_partition *partition,
/* Reject overlapping regions */
hlist_for_each_entry(rg, &partition->pt_mem_regions, hnode) {
- u64 rg_size = rg->nr_pages << HV_HYP_PAGE_SHIFT;
-
- if ((mem->guest_pfn + nr_pages <= rg->start_gfn ||
- rg->start_gfn + rg->nr_pages <= mem->guest_pfn) &&
- (mem->userspace_addr + mem->size <= rg->start_uaddr ||
- rg->start_uaddr + rg_size <= mem->userspace_addr))
+ if (mem->guest_pfn + nr_pages <= rg->start_gfn ||
+ rg->start_gfn + rg->nr_pages <= mem->guest_pfn)
continue;
return -EEXIST;
diff --git a/include/uapi/linux/mshv.h b/include/uapi/linux/mshv.h
index 876bfe4e4227..374f75e198bc 100644
--- a/include/uapi/linux/mshv.h
+++ b/include/uapi/linux/mshv.h
@@ -89,7 +89,7 @@ enum {
* @rsvd: MBZ
*
* Map or unmap a region of userspace memory to Guest Physical Addresses (GPA).
- * Mappings can't overlap in GPA space or userspace.
+ * Mappings can't overlap in GPA space.
* To unmap, these fields must match an existing mapping.
*/
struct mshv_user_mem_region {