Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754439AbcL3Tji (ORCPT ); Fri, 30 Dec 2016 14:39:38 -0500 Received: from p3plsmtps2ded01.prod.phx3.secureserver.net ([208.109.80.58]:50606 "EHLO p3plsmtps2ded01.prod.phx3.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754150AbcL3Tjd (ORCPT ); Fri, 30 Dec 2016 14:39:33 -0500 x-originating-ip: 72.167.245.219 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, rkagan@virtuozzo.com, x86@kernel.org, tglx@linutronix.de, hpa@zytor.com Cc: "K. Y. Srinivasan" Subject: [PATCH 16/18] Drivers: hv: vmbus: Define an API to retrieve virtual processor index Date: Fri, 30 Dec 2016 13:36:10 -0800 Message-Id: <1483133772-29776-16-git-send-email-kys@exchange.microsoft.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1483133772-29776-1-git-send-email-kys@exchange.microsoft.com> References: <1483133701-29738-1-git-send-email-kys@exchange.microsoft.com> <1483133772-29776-1-git-send-email-kys@exchange.microsoft.com> Reply-To: kys@microsoft.com X-CMAE-Envelope: MS4wfJyCvOq87Qb2yhlAoLNt1HTnchhKI9aXZX1tvnreTT8i9HztgcjwSEC3FgzgX5YXOD0n5DF/3BqB4LjnNNDNJ2OsCid7H8UWX/gP8NJ2vnZkPyOKkyVq HhXYUVrpiElfzLhKLFEoZUTfN/Q4G/AtnnYvoaVRmsQSOgdIqZAT4LUMw+a7RWOZ8J90xcTqIF3XVJDaUjLe/f3yYvOzu8tQM80PUfiyH9hQSr27aeAIU1/5 z4SwieBzgFqOIw+YmLn61eUoC0wftORl48wPqSDSY9lQ79FHnJIdhqZuhbzlYuVaRNxRDrdu3HhgGzVadySG9yZrV+y6jEmssLOiLha9tjGvEL/xxW8rb40B 3HmH+y1G9O0gxw/YtDapK90dCw3jA8Glwv3tOuD2UkLm9AD5+XE0W296vfYcRkFU4faag2GiSwqB643d0ob/yR9rlPXENDXFAKTd7PnNHj8BoXhe8s80lIJX +nCfY+QRxiP75T6vAc/TtgK47LNxYEtKXDDXQQdQdWu/dunBefdkPBz7ii/2xL8vyPribgj2SarNeCX4R2YRgJ/MPpxTZOvRtAtSOQ== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1358 Lines: 39 From: K. Y. Srinivasan As part of cleaning up architecture specific code, define an API to retrieve the virtual procesor index. Signed-off-by: K. Y. Srinivasan --- arch/x86/include/asm/mshyperv.h | 2 ++ drivers/hv/hv.c | 2 +- 2 files changed, 3 insertions(+), 1 deletions(-) diff --git a/arch/x86/include/asm/mshyperv.h b/arch/x86/include/asm/mshyperv.h index 1ea19a5..2d40bfc 100644 --- a/arch/x86/include/asm/mshyperv.h +++ b/arch/x86/include/asm/mshyperv.h @@ -149,6 +149,8 @@ static inline void vmbus_signal_eom(struct hv_message *msg, u32 old_msg_type) #define hv_get_synic_state(val) rdmsrl(HV_X64_MSR_SCONTROL, val) #define hv_set_synic_state(val) wrmsrl(HV_X64_MSR_SCONTROL, val) +#define hv_get_vp_index(index) rdmsrl(HV_X64_MSR_VP_INDEX, index) + void hyperv_callback_vector(void); #ifdef CONFIG_TRACING #define trace_hyperv_callback_vector hyperv_callback_vector diff --git a/drivers/hv/hv.c b/drivers/hv/hv.c index 3c9a819..9b2630b 100644 --- a/drivers/hv/hv.c +++ b/drivers/hv/hv.c @@ -306,7 +306,7 @@ int hv_synic_init(unsigned int cpu) * of cpuid and Linux' notion of cpuid. * This array will be indexed using Linux cpuid. */ - rdmsrl(HV_X64_MSR_VP_INDEX, vp_index); + hv_get_vp_index(vp_index); hv_context.vp_index[cpu] = (u32)vp_index; /* -- 1.7.4.1