Drivers: hv: Move AEOI determination to architecture dependent code
authorMichael Kelley <mikelley@microsoft.com>
Mon, 20 Apr 2020 16:49:26 +0000 (09:49 -0700)
committerWei Liu <wei.liu@kernel.org>
Tue, 21 Apr 2020 09:02:38 +0000 (10:02 +0100)
Hyper-V on ARM64 doesn't provide a flag for the AEOI recommendation
in ms_hyperv.hints, so having the test in architecture independent
code doesn't work. Resolve this by moving the check of the flag
to an architecture dependent helper function. No functionality is
changed.

Signed-off-by: Michael Kelley <mikelley@microsoft.com>
Link: https://lore.kernel.org/r/20200420164926.24471-1-mikelley@microsoft.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
arch/x86/include/asm/mshyperv.h
drivers/hv/hv.c

index 6b79515abb82373af6f30c1297de88a3ddbdeb41..7c2bbd6675dca2d2ee2bb76ea72ed9580bac63c5 100644 (file)
@@ -34,6 +34,8 @@ typedef int (*hyperv_fill_flush_list_func)(
        rdmsrl(HV_X64_MSR_SINT0 + int_num, val)
 #define hv_set_synint_state(int_num, val) \
        wrmsrl(HV_X64_MSR_SINT0 + int_num, val)
+#define hv_recommend_using_aeoi() \
+       (!(ms_hyperv.hints & HV_DEPRECATING_AEOI_RECOMMENDED))
 
 #define hv_get_crash_ctl(val) \
        rdmsrl(HV_X64_MSR_CRASH_CTL, val)
index 6098e0cbdb4b0ad36f22fd214d2f0f59d08fec31..533c8b82b344d1b035a2cc78ff80476beab87701 100644 (file)
@@ -184,11 +184,7 @@ void hv_synic_enable_regs(unsigned int cpu)
 
        shared_sint.vector = HYPERVISOR_CALLBACK_VECTOR;
        shared_sint.masked = false;
-       if (ms_hyperv.hints & HV_DEPRECATING_AEOI_RECOMMENDED)
-               shared_sint.auto_eoi = false;
-       else
-               shared_sint.auto_eoi = true;
-
+       shared_sint.auto_eoi = hv_recommend_using_aeoi();
        hv_set_synint_state(VMBUS_MESSAGE_SINT, shared_sint.as_uint64);
 
        /* Enable the global synic bit */