Drivers: hv: Base autoeoi enablement based on hypervisor hints
authorK. Y. Srinivasan <kys@microsoft.com>
Wed, 15 Mar 2017 01:01:39 +0000 (18:01 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Mar 2017 06:10:49 +0000 (15:10 +0900)
Don't enable auto-eoi if the hypervisor recommends otherwise. This will
enable vAPIC functionality if available.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/include/uapi/asm/hyperv.h
drivers/hv/hv.c

index 32ea7a3ad5b40adad0fd9f20ed01df8b49fbb533..432df4b1baecc59162d69f6307383d46166e1cb7 100644 (file)
  */
 #define HV_X64_RELAXED_TIMING_RECOMMENDED      (1 << 5)
 
+/*
+ * Virtual APIC support
+ */
+#define HV_X64_DEPRECATING_AEOI_RECOMMENDED    (1 << 9)
+
 /*
  * Crash notification flag.
  */
index 665a64f1611e31fe3650f6d030aa373ca1301c03..12e7baecb84ef4ac2becfd29040421a891e06f98 100644 (file)
@@ -254,7 +254,10 @@ int hv_synic_init(unsigned int cpu)
        shared_sint.as_uint64 = 0;
        shared_sint.vector = HYPERVISOR_CALLBACK_VECTOR;
        shared_sint.masked = false;
-       shared_sint.auto_eoi = true;
+       if (ms_hyperv.hints & HV_X64_DEPRECATING_AEOI_RECOMMENDED)
+               shared_sint.auto_eoi = false;
+       else
+               shared_sint.auto_eoi = true;
 
        hv_set_synint_state(HV_X64_MSR_SINT0 + VMBUS_MESSAGE_SINT,
                            shared_sint.as_uint64);