All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Liu <wl@xen.org>
To: Xen Development List <xen-devel@lists.xenproject.org>
Cc: "Wei Liu" <liuwe@microsoft.com>, "Wei Liu" <wl@xen.org>,
	"Paul Durrant" <paul@xen.org>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Paul Durrant" <pdurrant@amazon.com>,
	"Michael Kelley" <mikelley@microsoft.com>,
	"Jan Beulich" <jbeulich@suse.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>
Subject: [Xen-devel] [PATCH v7 09/10] x86/hyperv: retrieve vp_index from Hyper-V
Date: Tue,  4 Feb 2020 15:37:03 +0000	[thread overview]
Message-ID: <20200204153704.15934-10-liuwe@microsoft.com> (raw)
In-Reply-To: <20200204153704.15934-1-liuwe@microsoft.com>

This will be useful when invoking hypercall that targets specific
vcpu(s).

Signed-off-by: Wei Liu <liuwe@microsoft.com>
Reviewed-by: Paul Durrant <paul@xen.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
v5:
1. Add Jan's Ack.

v4:
1. Use private.h
2. Add Paul's review tag

v2:
1. Fold into setup_pcpu_arg function
---
 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 6b58065c78..e31c4b30b8 100644
--- a/xen/arch/x86/guest/hyperv/hyperv.c
+++ b/xen/arch/x86/guest/hyperv/hyperv.c
@@ -31,6 +31,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)
 {
@@ -135,6 +136,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;
 
@@ -146,6 +149,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__  */
-- 
2.20.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  parent reply	other threads:[~2020-02-04 15:38 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-04 15:36 [Xen-devel] [PATCH v7 00/10] More Hyper-V infrastructures Wei Liu
2020-02-04 15:36 ` [Xen-devel] [PATCH v7 01/10] x86/hypervisor: make hypervisor_ap_setup return an error code Wei Liu
2020-02-04 16:48   ` Wei Liu
2020-02-04 16:56     ` Roger Pau Monné
2020-02-04 17:03       ` Wei Liu
2020-02-05 11:12   ` Jan Beulich
2020-02-05 12:09     ` Wei Liu
2020-02-05 12:42       ` Jan Beulich
2020-02-04 15:36 ` [Xen-devel] [PATCH v7 02/10] x86/smp: don't online cpu if hypervisor_ap_setup fails Wei Liu
2020-02-04 15:36 ` [Xen-devel] [PATCH v7 03/10] x86: provide executable fixmap facility Wei Liu
2020-02-05 11:15   ` Jan Beulich
2020-02-04 15:36 ` [Xen-devel] [PATCH v7 04/10] x86/hypervisor: provide hypervisor_fixup_e820 Wei Liu
2020-02-04 15:36 ` [Xen-devel] [PATCH v7 05/10] x86/hyperv: setup hypercall page Wei Liu
2020-02-05 14:04   ` Roger Pau Monné
2020-02-05 15:00     ` Wei Liu
2020-02-05 15:03       ` Wei Liu
2020-02-05 15:52   ` Durrant, Paul
2020-02-04 15:37 ` [Xen-devel] [PATCH v7 06/10] x86/hyperv: provide Hyper-V hypercall functions Wei Liu
2020-02-05 11:17   ` Jan Beulich
2020-02-04 15:37 ` [Xen-devel] [PATCH v7 07/10] DO NOT APPLY: x86/hyperv: issue an hypercall Wei Liu
2020-02-04 15:37 ` [Xen-devel] [PATCH v7 08/10] x86/hyperv: provide percpu hypercall input page Wei Liu
2020-02-04 15:37 ` Wei Liu [this message]
2020-02-04 15:37 ` [Xen-devel] [PATCH v7 10/10] x86/hyperv: setup VP assist page Wei Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200204153704.15934-10-liuwe@microsoft.com \
    --to=wl@xen.org \
    --cc=andrew.cooper3@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=liuwe@microsoft.com \
    --cc=mikelley@microsoft.com \
    --cc=paul@xen.org \
    --cc=pdurrant@amazon.com \
    --cc=roger.pau@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.