]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
hyperv: Introduce hv_recommend_using_aeoi()
authorNuno Das Neves <nunodasneves@linux.microsoft.com>
Fri, 14 Mar 2025 19:28:50 +0000 (12:28 -0700)
committerWei Liu <wei.liu@kernel.org>
Thu, 20 Mar 2025 21:23:04 +0000 (21:23 +0000)
Factor out the check for enabling auto eoi, to be reused in root
partition code.

No functional changes.

Signed-off-by: Nuno Das Neves <nunodasneves@linux.microsoft.com>
Reviewed-by: Stanislav Kinsburskii <skinsburskii@linux.microsoft.com>
Reviewed-by: Easwar Hariharan <eahariha@linux.microsoft.com>
Reviewed-by: Michael Kelley <mhklinux@outlook.com>
Reviewed-by: Tianyu Lan <tiala@microsoft.com>
Link: https://lore.kernel.org/r/1741980536-3865-5-git-send-email-nunodasneves@linux.microsoft.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Message-ID: <1741980536-3865-5-git-send-email-nunodasneves@linux.microsoft.com>

drivers/hv/hv.c
include/asm-generic/mshyperv.h

index a38f84548bc25d633351e1e3d9126673a1918249..308c8f279df82ceb58f7b7b784faf7a3558416f5 100644 (file)
@@ -313,17 +313,7 @@ void hv_synic_enable_regs(unsigned int cpu)
 
        shared_sint.vector = vmbus_interrupt;
        shared_sint.masked = false;
-
-       /*
-        * On architectures where Hyper-V doesn't support AEOI (e.g., ARM64),
-        * it doesn't provide a recommendation flag and AEOI must be disabled.
-        */
-#ifdef HV_DEPRECATING_AEOI_RECOMMENDED
-       shared_sint.auto_eoi =
-                       !(ms_hyperv.hints & HV_DEPRECATING_AEOI_RECOMMENDED);
-#else
-       shared_sint.auto_eoi = 0;
-#endif
+       shared_sint.auto_eoi = hv_recommend_using_aeoi();
        hv_set_msr(HV_MSR_SINT0 + VMBUS_MESSAGE_SINT, shared_sint.as_uint64);
 
        /* Enable the global synic bit */
index c3697bc0598dcad7cbea60b0f25bbb6038dd20b8..8519b8ec8e9dc2ff987d5cbcf4e50ef351e4b0b0 100644 (file)
@@ -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 = {};