aboutsummaryrefslogtreecommitdiff
path: root/arch/x86/hyperv/hv_init.c
diff options
context:
space:
mode:
authorGravatar Himadri Pandya <himadrispandya@gmail.com> 2019-07-30 09:49:43 +0000
committerGravatar Sasha Levin <sashal@kernel.org> 2019-11-21 20:10:45 -0500
commitfa36dcdf8b200f4c175d0a00a8c99439ee0df95d (patch)
tree088bc92d51b2fc65f434b2c9b6cab3257b573d66 /arch/x86/hyperv/hv_init.c
parentDrivers: hv: util: Specify ring buffer size using Hyper-V page size (diff)
downloadlinux-fa36dcdf8b200f4c175d0a00a8c99439ee0df95d.tar.gz
linux-fa36dcdf8b200f4c175d0a00a8c99439ee0df95d.tar.bz2
linux-fa36dcdf8b200f4c175d0a00a8c99439ee0df95d.zip
x86: hv: Add function to allocate zeroed page for Hyper-V
Hyper-V assumes page size to be 4K. While this assumption holds true on x86 architecture, it might not be true for ARM64 architecture. Hence define hyper-v specific function to allocate a zeroed page which can have a different implementation on ARM64 architecture to handle the conflict between hyper-v's assumed page size and actual guest page size. 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 'arch/x86/hyperv/hv_init.c')
-rw-r--r--arch/x86/hyperv/hv_init.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c
index 2db3972c0e0f..b2daf0ebdb19 100644
--- a/arch/x86/hyperv/hv_init.c
+++ b/arch/x86/hyperv/hv_init.c
@@ -45,6 +45,14 @@ void *hv_alloc_hyperv_page(void)
}
EXPORT_SYMBOL_GPL(hv_alloc_hyperv_page);
+void *hv_alloc_hyperv_zeroed_page(void)
+{
+ BUILD_BUG_ON(PAGE_SIZE != HV_HYP_PAGE_SIZE);
+
+ return (void *)__get_free_page(GFP_KERNEL | __GFP_ZERO);
+}
+EXPORT_SYMBOL_GPL(hv_alloc_hyperv_zeroed_page);
+
void hv_free_hyperv_page(unsigned long addr)
{
free_page(addr);