From 6dc2a774cb4fdb524b7eb0b8db74198a1b4815ea Mon Sep 17 00:00:00 2001 From: Sunil Muthuswamy Date: Tue, 23 Mar 2021 18:47:16 +0000 Subject: x86/Hyper-V: Support for free page reporting Linux has support for free page reporting now (36e66c554b5c) for virtualized environment. On Hyper-V when virtually backed VMs are configured, Hyper-V will advertise cold memory discard capability, when supported. This patch adds the support to hook into the free page reporting infrastructure and leverage the Hyper-V cold memory discard hint hypercall to report/free these pages back to the host. Signed-off-by: Sunil Muthuswamy Tested-by: Matheus Castello Reviewed-by: Michael Kelley Tested-by: Nathan Chancellor Link: https://lore.kernel.org/r/SN4PR2101MB0880121FA4E2FEC67F35C1DCC0649@SN4PR2101MB0880.namprd21.prod.outlook.com Signed-off-by: Wei Liu --- include/asm-generic/mshyperv.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include/asm-generic/mshyperv.h') diff --git a/include/asm-generic/mshyperv.h b/include/asm-generic/mshyperv.h index 2d1b6cd9f000..63c0e579bf6d 100644 --- a/include/asm-generic/mshyperv.h +++ b/include/asm-generic/mshyperv.h @@ -27,7 +27,7 @@ struct ms_hyperv_info { u32 features; - u32 features_b; + u32 priv_high; u32 misc_features; u32 hints; u32 nested_features; @@ -179,6 +179,7 @@ bool hv_is_hibernation_supported(void); enum hv_isolation_type hv_get_isolation_type(void); bool hv_is_isolation_supported(void); void hyperv_cleanup(void); +bool hv_query_ext_cap(u64 cap_query); #else /* CONFIG_HYPERV */ static inline bool hv_is_hyperv_initialized(void) { return false; } static inline bool hv_is_hibernation_supported(void) { return false; } -- cgit v1.2.3