Drivers: hv: vmbus: Define an API to retrieve virtual processor index
authorK. Y. Srinivasan <kys@microsoft.com>
Thu, 19 Jan 2017 18:51:57 +0000 (11:51 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 20 Jan 2017 13:52:48 +0000 (14:52 +0100)
As part of cleaning up architecture specific code, define an API
to retrieve the virtual procesor index.

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

index 1ea19a57cf4c34905e0e176e80f8c6f32d93207b..2d40bfc57e7a18c006d8fb1cd0176cb8f76e2ece 100644 (file)
@@ -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
index 7cb036d4b2435623bfead59d8adecbefe4aa5607..945719026223487f163b8ce844597df90b10f71e 100644 (file)
@@ -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;
 
        /*