Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751478AbdCOBCp (ORCPT ); Tue, 14 Mar 2017 21:02:45 -0400 Received: from a2nlsmtp01-04.prod.iad2.secureserver.net ([198.71.225.38]:45848 "EHLO a2nlsmtp01-04.prod.iad2.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751362AbdCOBCn (ORCPT ); Tue, 14 Mar 2017 21:02:43 -0400 x-originating-ip: 107.180.71.197 From: kys@exchange.microsoft.com To: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, devel@linuxdriverproject.org, olaf@aepfle.de, apw@canonical.com, vkuznets@redhat.com, jasowang@redhat.com, leann.ogasawara@canonical.com, marcelo.cerri@canonical.com Cc: "K. Y. Srinivasan" Subject: [PATCH 2/2] Drivers: hv: Base autoeoi enablement based on hypervisor hints Date: Tue, 14 Mar 2017 18:01:39 -0700 Message-Id: <1489539699-2604-2-git-send-email-kys@exchange.microsoft.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1489539667-2561-1-git-send-email-kys@exchange.microsoft.com> References: <1489539667-2561-1-git-send-email-kys@exchange.microsoft.com> Reply-To: kys@microsoft.com X-CMAE-Envelope: MS4wfGS0n884qdXOoCKZ0y7aWrfKNSmGtcS/9l08iywDSucDtVySv0ILlYnOS0tgOojEMj3omAmGLTkIOu5keQKOaza/xQCGkt0UXps8cFsVzZFrOFyqWbkW R4HYQP2F9rUqwWNK0LGFvK/p77UEW30O1DUkckZGCzfPVa9i1yqKKY44bEiGKC3EZSKq7p2dYhslCqw31Wdp3QzaZqKwrZSFtjM6oSGvMO+9for+J/LYwVLs u7pv1h2i36UP2upjcNaFfIm1fTLqeAkTvtfjbfD1mPGTlOHhrU7V1DOLXuqgZjiO3oHdyemwAUIxXvCutfm00QG4Pn+aHAKrcuMKnZ4M1WlNKjAHdBPIwgbk OYP75Y+iQ9PrxsKwk47Dxz/cRu4l3Vx1zW3K8jmwGyPhWCPpUacdFqhoKupLZxweYLoxG+ERs3DX7Wa0ko2XTPx6hfc5gGLu9L5kUbG66fznnGiUMSDewWM4 XzIa8PFla8+CSo7Ny4bkqox0tHBbSWkz3oMELA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1368 Lines: 45 From: K. Y. Srinivasan Don't enable auto-eoi if the hypervisor recommends otherwise. This will enable vAPIC functionality if available. Signed-off-by: K. Y. Srinivasan --- arch/x86/include/uapi/asm/hyperv.h | 5 +++++ drivers/hv/hv.c | 5 ++++- 2 files changed, 9 insertions(+), 1 deletions(-) diff --git a/arch/x86/include/uapi/asm/hyperv.h b/arch/x86/include/uapi/asm/hyperv.h index 32ea7a3..432df4b 100644 --- a/arch/x86/include/uapi/asm/hyperv.h +++ b/arch/x86/include/uapi/asm/hyperv.h @@ -148,6 +148,11 @@ #define HV_X64_RELAXED_TIMING_RECOMMENDED (1 << 5) /* + * Virtual APIC support + */ +#define HV_X64_DEPRECATING_AEOI_RECOMMENDED (1 << 9) + +/* * Crash notification flag. */ #define HV_CRASH_CTL_CRASH_NOTIFY (1ULL << 63) diff --git a/drivers/hv/hv.c b/drivers/hv/hv.c index 665a64f..12e7bae 100644 --- a/drivers/hv/hv.c +++ b/drivers/hv/hv.c @@ -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); -- 1.7.1