[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] x86/hyperv: retrieve vp_index from Hyper-V



commit a37007356cd5f6f4fd4550e315cfd2e6d5a785a0
Author:     Wei Liu <liuwe@xxxxxxxxxxxxx>
AuthorDate: Sun Dec 29 17:16:40 2019 +0000
Commit:     Wei Liu <wl@xxxxxxx>
CommitDate: Wed Feb 5 16:05:06 2020 +0000

    x86/hyperv: retrieve vp_index from Hyper-V
    
    This will be useful when invoking hypercall that targets specific
    vcpu(s).
    
    Signed-off-by: Wei Liu <liuwe@xxxxxxxxxxxxx>
    Reviewed-by: Paul Durrant <paul@xxxxxxx>
    Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
---
 xen/arch/x86/guest/hyperv/hyperv.c  | 6 ++++++
 xen/arch/x86/guest/hyperv/private.h | 1 +
 2 files changed, 7 insertions(+)

diff --git a/xen/arch/x86/guest/hyperv/hyperv.c 
b/xen/arch/x86/guest/hyperv/hyperv.c
index ce0a02a3b1..507082a00a 100644
--- a/xen/arch/x86/guest/hyperv/hyperv.c
+++ b/xen/arch/x86/guest/hyperv/hyperv.c
@@ -30,6 +30,7 @@
 
 struct ms_hyperv_info __read_mostly ms_hyperv;
 DEFINE_PER_CPU_READ_MOSTLY(void *, hv_input_page);
+DEFINE_PER_CPU_READ_MOSTLY(unsigned int, hv_vp_index);
 
 static uint64_t generate_guest_id(void)
 {
@@ -121,6 +122,8 @@ static void __init setup_hypercall_page(void)
 
 static int setup_hypercall_pcpu_arg(void)
 {
+    uint64_t vp_index_msr;
+
     if ( this_cpu(hv_input_page) )
         return 0;
 
@@ -132,6 +135,9 @@ static int setup_hypercall_pcpu_arg(void)
         return -ENOMEM;
     }
 
+    rdmsrl(HV_X64_MSR_VP_INDEX, vp_index_msr);
+    this_cpu(hv_vp_index) = vp_index_msr;
+
     return 0;
 }
 
diff --git a/xen/arch/x86/guest/hyperv/private.h 
b/xen/arch/x86/guest/hyperv/private.h
index 093985a94b..d1765d4f23 100644
--- a/xen/arch/x86/guest/hyperv/private.h
+++ b/xen/arch/x86/guest/hyperv/private.h
@@ -25,5 +25,6 @@
 #include <xen/percpu.h>
 
 DECLARE_PER_CPU(void *, hv_input_page);
+DECLARE_PER_CPU(unsigned int, hv_vp_index);
 
 #endif /* __XEN_HYPERV_PRIVIATE_H__  */
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.