diff options
author | Himadri Pandya <himadrispandya@gmail.com> | 2019-07-30 12:49:44 +0300 |
---|---|---|
committer | Sasha Levin <sashal@kernel.org> | 2019-11-22 04:10:45 +0300 |
commit | 53edce00ceb7443b6f4615b5c8ad71671723d8f5 (patch) | |
tree | d8cae17ac3c4e76b7a62e755a98d1efe0cc5fc97 /drivers/hv/connection.c | |
parent | fa36dcdf8b200f4c175d0a00a8c99439ee0df95d (diff) | |
download | linux-53edce00ceb7443b6f4615b5c8ad71671723d8f5.tar.xz |
Drivers: hv: vmbus: Remove dependencies on guest page size
Hyper-V assumes page size to be 4K. This might not be the case for ARM64
architecture. Hence use hyper-v page size and page allocation function
to avoid conflicts between different host and guest page size on ARM64.
Signed-off-by: Himadri Pandya <himadri18.07@gmail.com>
Reviewed-by: Michael Kelley <mikelley@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/hv/connection.c')
-rw-r--r-- | drivers/hv/connection.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/hv/connection.c b/drivers/hv/connection.c index e947c39d4cc7..74e77de89b4f 100644 --- a/drivers/hv/connection.c +++ b/drivers/hv/connection.c @@ -208,7 +208,7 @@ int vmbus_connect(void) * abstraction stuff */ vmbus_connection.int_page = - (void *)__get_free_pages(GFP_KERNEL|__GFP_ZERO, 0); + (void *)hv_alloc_hyperv_zeroed_page(); if (vmbus_connection.int_page == NULL) { ret = -ENOMEM; goto cleanup; @@ -217,14 +217,14 @@ int vmbus_connect(void) vmbus_connection.recv_int_page = vmbus_connection.int_page; vmbus_connection.send_int_page = (void *)((unsigned long)vmbus_connection.int_page + - (PAGE_SIZE >> 1)); + (HV_HYP_PAGE_SIZE >> 1)); /* * Setup the monitor notification facility. The 1st page for * parent->child and the 2nd page for child->parent */ - vmbus_connection.monitor_pages[0] = (void *)__get_free_pages((GFP_KERNEL|__GFP_ZERO), 0); - vmbus_connection.monitor_pages[1] = (void *)__get_free_pages((GFP_KERNEL|__GFP_ZERO), 0); + vmbus_connection.monitor_pages[0] = (void *)hv_alloc_hyperv_zeroed_page(); + vmbus_connection.monitor_pages[1] = (void *)hv_alloc_hyperv_zeroed_page(); if ((vmbus_connection.monitor_pages[0] == NULL) || (vmbus_connection.monitor_pages[1] == NULL)) { ret = -ENOMEM; @@ -297,12 +297,12 @@ void vmbus_disconnect(void) destroy_workqueue(vmbus_connection.work_queue); if (vmbus_connection.int_page) { - free_pages((unsigned long)vmbus_connection.int_page, 0); + hv_free_hyperv_page((unsigned long)vmbus_connection.int_page); vmbus_connection.int_page = NULL; } - free_pages((unsigned long)vmbus_connection.monitor_pages[0], 0); - free_pages((unsigned long)vmbus_connection.monitor_pages[1], 0); + hv_free_hyperv_page((unsigned long)vmbus_connection.monitor_pages[0]); + hv_free_hyperv_page((unsigned long)vmbus_connection.monitor_pages[1]); vmbus_connection.monitor_pages[0] = NULL; vmbus_connection.monitor_pages[1] = NULL; } |