From af37bc759f1064cc4dc0a6a12afd3fb25c12fe4d Mon Sep 17 00:00:00 2001 From: Nuno Das Neves Date: Fri, 14 Mar 2025 12:28:50 -0700 Subject: hyperv: Introduce hv_recommend_using_aeoi() Factor out the check for enabling auto eoi, to be reused in root partition code. No functional changes. Signed-off-by: Nuno Das Neves Reviewed-by: Stanislav Kinsburskii Reviewed-by: Easwar Hariharan Reviewed-by: Michael Kelley Reviewed-by: Tianyu Lan Link: https://lore.kernel.org/r/1741980536-3865-5-git-send-email-nunodasneves@linux.microsoft.com Signed-off-by: Wei Liu Message-ID: <1741980536-3865-5-git-send-email-nunodasneves@linux.microsoft.com> --- include/asm-generic/mshyperv.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include') diff --git a/include/asm-generic/mshyperv.h b/include/asm-generic/mshyperv.h index c3697bc0598d..8519b8ec8e9d 100644 --- a/include/asm-generic/mshyperv.h +++ b/include/asm-generic/mshyperv.h @@ -77,6 +77,19 @@ u64 hv_do_fast_hypercall16(u16 control, u64 input1, u64 input2); bool hv_isolation_type_snp(void); bool hv_isolation_type_tdx(void); +/* + * On architectures where Hyper-V doesn't support AEOI (e.g., ARM64), + * it doesn't provide a recommendation flag and AEOI must be disabled. + */ +static inline bool hv_recommend_using_aeoi(void) +{ +#ifdef HV_DEPRECATING_AEOI_RECOMMENDED + return !(ms_hyperv.hints & HV_DEPRECATING_AEOI_RECOMMENDED); +#else + return false; +#endif +} + static inline struct hv_proximity_domain_info hv_numa_node_to_pxm_info(int node) { struct hv_proximity_domain_info pxm_info = {}; -- cgit v1.2.3