All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrii Anisov <andrii.anisov@gmail.com>
To: xen-devel@lists.xen.org
Cc: "Stefano Stabellini" <sstabellini@kernel.org>,
	"Andrii Anisov" <andrii_anisov@epam.com>,
	"Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>,
	"George Dunlap" <George.Dunlap@eu.citrix.com>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Ian Jackson" <ian.jackson@eu.citrix.com>,
	"Tim Deegan" <tim@xen.org>, "Julien Grall" <julien.grall@arm.com>,
	"Jan Beulich" <jbeulich@suse.com>,
	xen-devel@lists.xenproject.org, "Wei Liu" <wei.liu2@citrix.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>
Subject: [PATCH v2 1/2] xen: introduce VCPUOP_register_runstate_phys_memory_area hypercall
Date: Tue, 23 Apr 2019 11:10:25 +0300	[thread overview]
Message-ID: <1556007026-31057-2-git-send-email-andrii.anisov@gmail.com> (raw)
In-Reply-To: <1556007026-31057-1-git-send-email-andrii.anisov@gmail.com>

From: Andrii Anisov <andrii_anisov@epam.com>

The hypercall employs the same vcpu_register_runstate_memory_area
structure for the interface, but requires registered area to not
cross a page boundary.

Signed-off-by: Andrii Anisov <andrii_anisov@epam.com>
---
 xen/common/domain.c       |  5 ++++-
 xen/include/public/vcpu.h | 15 +++++++++++++++
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index 88bbe98..ae22049 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -1532,10 +1532,13 @@ long do_vcpu_op(int cmd, unsigned int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg)
             vcpu_runstate_get(v, &runstate);
             __copy_to_guest(runstate_guest(v), &runstate, 1);
         }
-
         break;
     }
 
+    case VCPUOP_register_runstate_phys_memory_area:
+        rc = -EOPNOTSUPP;
+        break;
+
 #ifdef VCPU_TRAP_NMI
     case VCPUOP_send_nmi:
         if ( !guest_handle_is_null(arg) )
diff --git a/xen/include/public/vcpu.h b/xen/include/public/vcpu.h
index 3623af9..d7da4a3 100644
--- a/xen/include/public/vcpu.h
+++ b/xen/include/public/vcpu.h
@@ -235,6 +235,21 @@ struct vcpu_register_time_memory_area {
 typedef struct vcpu_register_time_memory_area vcpu_register_time_memory_area_t;
 DEFINE_XEN_GUEST_HANDLE(vcpu_register_time_memory_area_t);
 
+/*
+ * Register a shared memory area from which the guest may obtain its own
+ * runstate information without needing to execute a hypercall.
+ * Notes:
+ *  1. The registered address must be guest's physical address.
+ *  2. The registered runstate area should not cross page boundary.
+ *  3. Only one shared area may be registered per VCPU. The shared area is
+ *     updated by the hypervisor each time the VCPU is scheduled. Thus
+ *     runstate.state will always be RUNSTATE_running and
+ *     runstate.state_entry_time will indicate the system time at which the
+ *     VCPU was last scheduled to run.
+ * @extra_arg == pointer to vcpu_register_runstate_memory_area structure.
+ */
+#define VCPUOP_register_runstate_phys_memory_area 14
+
 #endif /* __XEN_PUBLIC_VCPU_H__ */
 
 /*
-- 
2.7.4


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

WARNING: multiple messages have this Message-ID (diff)
From: Andrii Anisov <andrii.anisov@gmail.com>
To: xen-devel@lists.xen.org
Cc: "Stefano Stabellini" <sstabellini@kernel.org>,
	"Andrii Anisov" <andrii_anisov@epam.com>,
	"Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>,
	"George Dunlap" <George.Dunlap@eu.citrix.com>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Ian Jackson" <ian.jackson@eu.citrix.com>,
	"Tim Deegan" <tim@xen.org>, "Julien Grall" <julien.grall@arm.com>,
	"Jan Beulich" <jbeulich@suse.com>,
	xen-devel@lists.xenproject.org, "Wei Liu" <wei.liu2@citrix.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>
Subject: [Xen-devel] [PATCH v2 1/2] xen: introduce VCPUOP_register_runstate_phys_memory_area hypercall
Date: Tue, 23 Apr 2019 11:10:25 +0300	[thread overview]
Message-ID: <1556007026-31057-2-git-send-email-andrii.anisov@gmail.com> (raw)
Message-ID: <20190423081025.9BH9lsHvvDclPSz7A6ckZ700vEvb8xSrWbsY4Dv1jkU@z> (raw)
In-Reply-To: <1556007026-31057-1-git-send-email-andrii.anisov@gmail.com>

From: Andrii Anisov <andrii_anisov@epam.com>

The hypercall employs the same vcpu_register_runstate_memory_area
structure for the interface, but requires registered area to not
cross a page boundary.

Signed-off-by: Andrii Anisov <andrii_anisov@epam.com>
---
 xen/common/domain.c       |  5 ++++-
 xen/include/public/vcpu.h | 15 +++++++++++++++
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index 88bbe98..ae22049 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -1532,10 +1532,13 @@ long do_vcpu_op(int cmd, unsigned int vcpuid, XEN_GUEST_HANDLE_PARAM(void) arg)
             vcpu_runstate_get(v, &runstate);
             __copy_to_guest(runstate_guest(v), &runstate, 1);
         }
-
         break;
     }
 
+    case VCPUOP_register_runstate_phys_memory_area:
+        rc = -EOPNOTSUPP;
+        break;
+
 #ifdef VCPU_TRAP_NMI
     case VCPUOP_send_nmi:
         if ( !guest_handle_is_null(arg) )
diff --git a/xen/include/public/vcpu.h b/xen/include/public/vcpu.h
index 3623af9..d7da4a3 100644
--- a/xen/include/public/vcpu.h
+++ b/xen/include/public/vcpu.h
@@ -235,6 +235,21 @@ struct vcpu_register_time_memory_area {
 typedef struct vcpu_register_time_memory_area vcpu_register_time_memory_area_t;
 DEFINE_XEN_GUEST_HANDLE(vcpu_register_time_memory_area_t);
 
+/*
+ * Register a shared memory area from which the guest may obtain its own
+ * runstate information without needing to execute a hypercall.
+ * Notes:
+ *  1. The registered address must be guest's physical address.
+ *  2. The registered runstate area should not cross page boundary.
+ *  3. Only one shared area may be registered per VCPU. The shared area is
+ *     updated by the hypervisor each time the VCPU is scheduled. Thus
+ *     runstate.state will always be RUNSTATE_running and
+ *     runstate.state_entry_time will indicate the system time at which the
+ *     VCPU was last scheduled to run.
+ * @extra_arg == pointer to vcpu_register_runstate_memory_area structure.
+ */
+#define VCPUOP_register_runstate_phys_memory_area 14
+
 #endif /* __XEN_PUBLIC_VCPU_H__ */
 
 /*
-- 
2.7.4


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

  reply	other threads:[~2019-04-23  8:10 UTC|newest]

Thread overview: 83+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-23  8:10 [PATCH v2 0/2] Introduce runstate area registration with phys address Andrii Anisov
2019-04-23  8:10 ` Andrii Anisov [this message]
2019-04-23  8:10   ` [Xen-devel] [PATCH v2 1/2] xen: introduce VCPUOP_register_runstate_phys_memory_area hypercall Andrii Anisov
2019-05-08 10:10   ` George Dunlap
2019-05-08 10:10     ` [Xen-devel] " George Dunlap
2019-04-23  8:10 ` [PATCH v2 2/2] xen: implement VCPUOP_register_runstate_phys_memory_area Andrii Anisov
2019-04-23  8:10   ` [Xen-devel] " Andrii Anisov
2019-05-08 15:40   ` Julien Grall
2019-05-08 15:40     ` [Xen-devel] " Julien Grall
2019-05-09  9:27     ` Jan Beulich
2019-05-09  9:27       ` [Xen-devel] " Jan Beulich
2019-05-14  9:35       ` Julien Grall
2019-05-14  9:35         ` [Xen-devel] " Julien Grall
2019-05-14  9:48         ` Jan Beulich
2019-05-14  9:48           ` [Xen-devel] " Jan Beulich
2019-05-14 11:23           ` Julien Grall
2019-05-14 11:23             ` [Xen-devel] " Julien Grall
2019-05-14 11:29             ` Jan Beulich
2019-05-14 11:29               ` [Xen-devel] " Jan Beulich
2019-05-13 12:30     ` Andrii Anisov
2019-05-13 12:30       ` [Xen-devel] " Andrii Anisov
2019-05-14  9:58       ` Julien Grall
2019-05-14  9:58         ` [Xen-devel] " Julien Grall
2019-05-14 10:08         ` Andrii Anisov
2019-05-14 10:08           ` [Xen-devel] " Andrii Anisov
2019-05-14 11:24           ` Julien Grall
2019-05-14 11:24             ` [Xen-devel] " Julien Grall
2019-05-14 11:45             ` Andrii Anisov
2019-05-14 11:45               ` [Xen-devel] " Andrii Anisov
2019-05-14 12:02               ` Jan Beulich
2019-05-14 12:02                 ` [Xen-devel] " Jan Beulich
2019-05-14 13:05                 ` Andrii Anisov
2019-05-14 13:05                   ` [Xen-devel] " Andrii Anisov
2019-05-14 13:49                   ` Julien Grall
2019-05-14 13:49                     ` [Xen-devel] " Julien Grall
2019-05-15  9:04                     ` Andrii Anisov
2019-05-15  9:04                       ` [Xen-devel] " Andrii Anisov
2019-05-15 10:31                       ` Julien Grall
2019-05-15 10:31                         ` [Xen-devel] " Julien Grall
2019-05-14 13:49                   ` Jan Beulich
2019-05-14 13:49                     ` [Xen-devel] " Jan Beulich
2019-05-15  8:44                     ` Andrii Anisov
2019-05-15  8:44                       ` [Xen-devel] " Andrii Anisov
2019-05-15 11:59                       ` Jan Beulich
2019-05-15 11:59                         ` [Xen-devel] " Jan Beulich
2019-05-16 12:09   ` Jan Beulich
2019-05-16 12:09     ` [Xen-devel] " Jan Beulich
2019-05-16 13:30     ` Andrii Anisov
2019-05-16 13:30       ` [Xen-devel] " Andrii Anisov
2019-05-16 13:30     ` Andrii Anisov
2019-05-16 13:30       ` [Xen-devel] " Andrii Anisov
2019-05-16 13:48       ` Julien Grall
2019-05-16 13:48         ` [Xen-devel] " Julien Grall
2019-05-16 14:25         ` Andrii Anisov
2019-05-16 14:25           ` [Xen-devel] " Andrii Anisov
2019-05-16 14:28           ` Julien Grall
2019-05-16 14:28             ` [Xen-devel] " Julien Grall
2019-05-16 14:29             ` Andrii Anisov
2019-05-16 14:29               ` [Xen-devel] " Andrii Anisov
     [not found] ` <fa126315-31af-854e-817a-8640b431c82b@arm.com>
     [not found]   ` <CAC1WxdiMzAq5hRC-mhRQuFDs7z_Hj5w7VAy52ec87SJQOGmp3w@mail.gmail.com>
     [not found]     ` <a28f95a1-d9da-2caf-f4b4-013100176b02@arm.com>
     [not found]       ` <090ce8cc-f329-fe54-4894-b7f12e3cd5a6@gmail.com>
2019-05-08 13:39         ` [PATCH v2 0/2] Introduce runstate area registration with phys address Julien Grall
2019-05-08 13:39           ` [Xen-devel] " Julien Grall
2019-05-08 13:54           ` Andrii Anisov
2019-05-08 13:54             ` [Xen-devel] " Andrii Anisov
2019-05-08 14:31             ` Julien Grall
2019-05-08 14:31               ` [Xen-devel] " Julien Grall
2019-05-08 16:01               ` Andrii Anisov
2019-05-08 16:01                 ` [Xen-devel] " Andrii Anisov
2019-05-13 10:50                 ` Julien Grall
2019-05-13 10:50                   ` [Xen-devel] " Julien Grall
2019-05-13 14:34                   ` Andrii Anisov
2019-05-13 14:34                     ` [Xen-devel] " Andrii Anisov
2019-05-08 13:59 ` Julien Grall
2019-05-13 10:15   ` Andrii Anisov
2019-05-13 11:16     ` Julien Grall
2019-05-13 14:14       ` Andrii Anisov
2019-05-13 14:34         ` Julien Grall
2019-05-13 15:29           ` Andrii Anisov
2019-05-13 15:31             ` Julien Grall
2019-05-13 15:38               ` Andrii Anisov
2019-05-13 15:40                 ` Julien Grall
2019-05-13 15:42                   ` Andrii Anisov
2019-05-13 15:45                     ` Julien Grall
2019-05-13 16:05                       ` Andrii Anisov

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=1556007026-31057-2-git-send-email-andrii.anisov@gmail.com \
    --to=andrii.anisov@gmail.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=andrii_anisov@epam.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jbeulich@suse.com \
    --cc=julien.grall@arm.com \
    --cc=konrad.wilk@oracle.com \
    --cc=roger.pau@citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=tim@xen.org \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.org \
    --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.