All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Wei Liu" <wei.liu2@citrix.com>,
	"Jan Beulich" <jbeulich@suse.com>,
	"Anthony Liguori" <anthony@codemonkey.ws>,
	"Roger Pau Monné" <roger.pau@citrix.com>
Subject: [PATCH 9/9] x86/shim: pass through vcpu runstate to L0 Xen
Date: Thu, 18 Jan 2018 18:16:52 +0000	[thread overview]
Message-ID: <20180118181652.26397-10-wei.liu2@citrix.com> (raw)
In-Reply-To: <20180118181652.26397-1-wei.liu2@citrix.com>

So that we can have accurate stolen time accounting. Idea taken from
Vixen work from Amazon.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
Cc: Roger Pau Monné <roger.pau@citrix.com>
Cc: Anthony Liguori <anthony@codemonkey.ws>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/common/domain.c                   | 10 ++++++++++
 xen/include/asm-x86/guest/hypercall.h |  7 +++++++
 2 files changed, 17 insertions(+)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index 558318e852..189ffac9b1 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -45,6 +45,7 @@
 
 #ifdef CONFIG_X86
 #include <asm/guest.h>
+#include <asm/guest/hypercall.h>
 #endif
 
 /* Linux config option: propageted to domain0 */
@@ -1425,6 +1426,15 @@ long do_vcpu_op(int cmd, unsigned int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( !guest_handle_okay(area.addr.h, 1) )
             break;
 
+#if CONFIG_X86
+        if ( pv_shim )
+        {
+            rc = xen_hypercall_vcpu_op(VCPUOP_register_runstate_memory_area,
+                                       vcpuid, &area);
+            break;
+        }
+#endif
+
         rc = 0;
         runstate_guest(v) = area.addr.h;
 
diff --git a/xen/include/asm-x86/guest/hypercall.h b/xen/include/asm-x86/guest/hypercall.h
index e9e626b474..07b9302263 100644
--- a/xen/include/asm-x86/guest/hypercall.h
+++ b/xen/include/asm-x86/guest/hypercall.h
@@ -192,6 +192,13 @@ static inline long xen_hypercall_shutdown(unsigned int reason)
     return 0;
 }
 
+static inline int xen_hypercall_vcpu_op(unsigned int cmd, unsigned int vcpu,
+                                        void *arg)
+{
+    ASSERT_UNREACHABLE();
+    return 0;
+}
+
 #endif /* CONFIG_XEN_GUEST */
 #endif /* __X86_XEN_HYPERCALL_H__ */
 
-- 
2.11.0


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

  parent reply	other threads:[~2018-01-18 18:19 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-18 18:16 [PATCH 0/9] Fix and improvements to pvshim Wei Liu
2018-01-18 18:16 ` [PATCH 1/9] Update shim.config Wei Liu
2018-01-18 18:26   ` Andrew Cooper
2018-01-18 18:28     ` Wei Liu
2018-01-18 18:30       ` Andrew Cooper
2018-01-19 10:16         ` Roger Pau Monné
2018-01-18 18:16 ` [PATCH 2/9] libxl: remove whitespaces introduced in 62982da926 Wei Liu
2018-01-19 10:18   ` Roger Pau Monné
2018-01-18 18:16 ` [PATCH 3/9] x86/guest: clean up guest/xen.h Wei Liu
2018-01-18 18:26   ` Andrew Cooper
2018-01-19 10:21   ` Roger Pau Monné
2018-01-19 12:22     ` Wei Liu
2018-01-19 12:29       ` Roger Pau Monné
2018-01-19 12:34         ` Wei Liu
2018-01-18 18:16 ` [PATCH 4/9] Remove sched=null from shim cmdline and doc Wei Liu
2018-01-18 18:27   ` Andrew Cooper
2018-01-19 10:28   ` Roger Pau Monné
2018-01-19 11:40     ` Wei Liu
2018-01-18 18:16 ` [PATCH 5/9] x86: relocate pvh_info Wei Liu
2018-01-19 10:07   ` Jan Beulich
2018-01-19 10:10   ` Andrew Cooper
2018-01-19 10:20     ` Jan Beulich
2018-01-19 10:53   ` Roger Pau Monné
2018-01-19 11:48     ` Jan Beulich
2018-01-18 18:16 ` [PATCH 6/9] Revert "x86/boot: Map more than the first 16MB" Wei Liu
2018-01-19 10:07   ` Jan Beulich
2018-01-18 18:16 ` [PATCH 7/9] libxl: lower shim related message to level info Wei Liu
2018-01-19 10:57   ` Roger Pau Monné
2018-01-18 18:16 ` [PATCH 8/9] xen/consoled: discard NUL from guest Wei Liu
2018-01-19 11:03   ` Roger Pau Monné
2018-01-19 15:25     ` Wei Liu
2018-01-18 18:16 ` Wei Liu [this message]
2018-01-19 11:18   ` [PATCH 9/9] x86/shim: pass through vcpu runstate to L0 Xen Roger Pau Monné
2018-01-19 15:18     ` 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=20180118181652.26397-10-wei.liu2@citrix.com \
    --to=wei.liu2@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=anthony@codemonkey.ws \
    --cc=jbeulich@suse.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.