Skip to content

Commit af37bc7

Browse files
NunoDasNevesliuw
authored andcommitted
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 <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>
1 parent feba84c commit af37bc7

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

drivers/hv/hv.c

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -313,17 +313,7 @@ void hv_synic_enable_regs(unsigned int cpu)
313313

314314
shared_sint.vector = vmbus_interrupt;
315315
shared_sint.masked = false;
316-
317-
/*
318-
* On architectures where Hyper-V doesn't support AEOI (e.g., ARM64),
319-
* it doesn't provide a recommendation flag and AEOI must be disabled.
320-
*/
321-
#ifdef HV_DEPRECATING_AEOI_RECOMMENDED
322-
shared_sint.auto_eoi =
323-
!(ms_hyperv.hints & HV_DEPRECATING_AEOI_RECOMMENDED);
324-
#else
325-
shared_sint.auto_eoi = 0;
326-
#endif
316+
shared_sint.auto_eoi = hv_recommend_using_aeoi();
327317
hv_set_msr(HV_MSR_SINT0 + VMBUS_MESSAGE_SINT, shared_sint.as_uint64);
328318

329319
/* Enable the global synic bit */

include/asm-generic/mshyperv.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,19 @@ u64 hv_do_fast_hypercall16(u16 control, u64 input1, u64 input2);
7777
bool hv_isolation_type_snp(void);
7878
bool hv_isolation_type_tdx(void);
7979

80+
/*
81+
* On architectures where Hyper-V doesn't support AEOI (e.g., ARM64),
82+
* it doesn't provide a recommendation flag and AEOI must be disabled.
83+
*/
84+
static inline bool hv_recommend_using_aeoi(void)
85+
{
86+
#ifdef HV_DEPRECATING_AEOI_RECOMMENDED
87+
return !(ms_hyperv.hints & HV_DEPRECATING_AEOI_RECOMMENDED);
88+
#else
89+
return false;
90+
#endif
91+
}
92+
8093
static inline struct hv_proximity_domain_info hv_numa_node_to_pxm_info(int node)
8194
{
8295
struct hv_proximity_domain_info pxm_info = {};

0 commit comments

Comments
 (0)