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>
This commit is contained in:
parent
0541a22594
commit
fa36dcdf8b
@ -45,6 +45,14 @@ void *hv_alloc_hyperv_page(void)
|
|||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(hv_alloc_hyperv_page);
|
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)
|
void hv_free_hyperv_page(unsigned long addr)
|
||||||
{
|
{
|
||||||
free_page(addr);
|
free_page(addr);
|
||||||
|
@ -219,6 +219,7 @@ static inline struct hv_vp_assist_page *hv_get_vp_assist_page(unsigned int cpu)
|
|||||||
void __init hyperv_init(void);
|
void __init hyperv_init(void);
|
||||||
void hyperv_setup_mmu_ops(void);
|
void hyperv_setup_mmu_ops(void);
|
||||||
void *hv_alloc_hyperv_page(void);
|
void *hv_alloc_hyperv_page(void);
|
||||||
|
void *hv_alloc_hyperv_zeroed_page(void);
|
||||||
void hv_free_hyperv_page(unsigned long addr);
|
void hv_free_hyperv_page(unsigned long addr);
|
||||||
void hyperv_reenlightenment_intr(struct pt_regs *regs);
|
void hyperv_reenlightenment_intr(struct pt_regs *regs);
|
||||||
void set_hv_tscchange_cb(void (*cb)(void));
|
void set_hv_tscchange_cb(void (*cb)(void));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user