Skip to content

Commit 7353c9b

Browse files
kelleymhtyhicks
authored andcommitted
Drivers: hv: vmbus: Handle auto EOI quirk inline
On x86/x64, Hyper-V provides a flag to indicate auto EOI functionality, but it doesn't on ARM64. Handle this quirk inline instead of calling into code under arch/x86 (and coming, under arch/arm64). No functional change. Signed-off-by: Michael Kelley <mikelley@microsoft.com> Reviewed-by: Boqun Feng <boqun.feng@gmail.com> Link: https://lore.kernel.org/r/1614721102-2241-6-git-send-email-mikelley@microsoft.com Signed-off-by: Wei Liu <wei.liu@kernel.org> (cherry picked from commit 946f4b8) Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
1 parent 99e5c12 commit 7353c9b

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

arch/x86/include/asm/mshyperv.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ static inline u64 hv_get_register(unsigned int reg)
2727
return value;
2828
}
2929

30-
#define hv_recommend_using_aeoi() \
31-
(!(ms_hyperv.hints & HV_DEPRECATING_AEOI_RECOMMENDED))
32-
3330
#define hv_set_clocksource_vdso(val) \
3431
((val).vdso_clock_mode = VDSO_CLOCKMODE_HVCLOCK)
3532
#define hv_enable_vdso_clocksource() \

drivers/hv/hv.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,17 @@ void hv_synic_enable_regs(unsigned int cpu)
219219

220220
shared_sint.vector = hv_get_vector();
221221
shared_sint.masked = false;
222-
shared_sint.auto_eoi = hv_recommend_using_aeoi();
222+
223+
/*
224+
* On architectures where Hyper-V doesn't support AEOI (e.g., ARM64),
225+
* it doesn't provide a recommendation flag and AEOI must be disabled.
226+
*/
227+
#ifdef HV_DEPRECATING_AEOI_RECOMMENDED
228+
shared_sint.auto_eoi =
229+
!(ms_hyperv.hints & HV_DEPRECATING_AEOI_RECOMMENDED);
230+
#else
231+
shared_sint.auto_eoi = 0;
232+
#endif
223233
hv_set_register(HV_REGISTER_SINT0 + VMBUS_MESSAGE_SINT,
224234
shared_sint.as_uint64);
225235

0 commit comments

Comments
 (0)