From: Chong Li <lichong659@gmail.com>
To: xen-devel@lists.xen.org
Cc: Chong Li <chong.li@wustl.edu>,
wei.liu2@citrix.com, Sisu Xi <xisisu@gmail.com>,
george.dunlap@eu.citrix.com, dario.faggioli@citrix.com,
mengxu@cis.upenn.edu, jbeulich@suse.com, lichong659@gmail.com,
dgolomb@seas.upenn.edu
Subject: [PATCH v1 2/4] libxc: enabling XL to set per-VCPU parameters of a domain for RTDS scheduler
Date: Thu, 7 May 2015 12:05:23 -0500 [thread overview]
Message-ID: <1431018326-3239-3-git-send-email-chong.li@wustl.edu> (raw)
In-Reply-To: <1431018326-3239-1-git-send-email-chong.li@wustl.edu>
Add xc_sched_rtds_vcpu_get/set functions to interact with Xen to get/set a domain's
per-VCPU parameters.
Signed-off-by: Chong Li <chong.li@wustl.edu>
Signed-off-by: Meng Xu <mengxu@cis.upenn.edu>
Signed-off-by: Sisu Xi <xisisu@gmail.com>
---
tools/libxc/include/xenctrl.h | 9 ++++++++
tools/libxc/xc_rt.c | 52 +++++++++++++++++++++++++++++++++++++++++++
2 files changed, 61 insertions(+)
diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
index 6994c51..45cbf91 100644
--- a/tools/libxc/include/xenctrl.h
+++ b/tools/libxc/include/xenctrl.h
@@ -892,6 +892,15 @@ int xc_sched_rtds_domain_get(xc_interface *xch,
uint32_t domid,
struct xen_domctl_sched_rtds *sdom);
+int xc_sched_rtds_vcpu_set(xc_interface *xch,
+ uint32_t domid,
+ struct xen_domctl_sched_rtds_params *sdom,
+ uint16_t num_vcpus);
+int xc_sched_rtds_vcpu_get(xc_interface *xch,
+ uint32_t domid,
+ struct xen_domctl_sched_rtds_params *sdom,
+ uint16_t num_vcpus);
+
int
xc_sched_arinc653_schedule_set(
xc_interface *xch,
diff --git a/tools/libxc/xc_rt.c b/tools/libxc/xc_rt.c
index b2d1cc5..e752815 100644
--- a/tools/libxc/xc_rt.c
+++ b/tools/libxc/xc_rt.c
@@ -63,3 +63,55 @@ int xc_sched_rtds_domain_get(xc_interface *xch,
return rc;
}
+
+int xc_sched_rtds_vcpu_set(xc_interface *xch,
+ uint32_t domid,
+ struct xen_domctl_sched_rtds_params *sdom,
+ uint16_t num_vcpus)
+{
+ int rc;
+ DECLARE_DOMCTL;
+ DECLARE_HYPERCALL_BOUNCE(sdom, sizeof(*sdom) * num_vcpus,
+ XC_HYPERCALL_BUFFER_BOUNCE_IN);
+ if ( xc_hypercall_bounce_pre(xch, sdom) )
+ return -1;
+
+ domctl.cmd = XEN_DOMCTL_scheduler_op;
+ domctl.domain = (domid_t) domid;
+ domctl.u.scheduler_op.sched_id = XEN_SCHEDULER_RTDS;
+ domctl.u.scheduler_op.cmd = XEN_DOMCTL_SCHEDOP_putvcpuinfo;
+ domctl.u.scheduler_op.u.rtds.nr_vcpus = num_vcpus;
+ set_xen_guest_handle(domctl.u.scheduler_op.u.rtds.vcpus, sdom);
+
+ rc = do_domctl(xch, &domctl);
+
+ xc_hypercall_bounce_post(xch, sdom);
+ return rc;
+}
+
+int xc_sched_rtds_vcpu_get(xc_interface *xch,
+ uint32_t domid,
+ struct xen_domctl_sched_rtds_params *sdom,
+ uint16_t num_vcpus)
+{
+ int rc;
+ DECLARE_DOMCTL;
+ DECLARE_HYPERCALL_BOUNCE(sdom, sizeof(*sdom) * num_vcpus,
+ XC_HYPERCALL_BUFFER_BOUNCE_OUT);
+
+ if ( xc_hypercall_bounce_pre(xch, sdom) )
+ return -1;
+
+ domctl.cmd = XEN_DOMCTL_scheduler_op;
+ domctl.domain = (domid_t) domid;
+ domctl.u.scheduler_op.sched_id = XEN_SCHEDULER_RTDS;
+ domctl.u.scheduler_op.cmd = XEN_DOMCTL_SCHEDOP_getvcpuinfo;
+ set_xen_guest_handle(domctl.u.scheduler_op.u.rtds.vcpus, sdom);
+
+ rc = do_domctl(xch, &domctl);
+
+ xc_hypercall_bounce_post(xch, sdom);
+ return rc;
+}
+
+
--
1.9.1
next prev parent reply other threads:[~2015-05-07 17:05 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-07 17:05 [PATCH v1 0/4] Enabling XL to set per-VCPU parameters of a domain for RTDS scheduler Chong Li
2015-05-07 17:05 ` [PATCH v1 1/4] xen: enabling " Chong Li
2015-05-08 7:49 ` Jan Beulich
2015-05-10 22:04 ` Chong Li
2015-05-11 6:57 ` Jan Beulich
2015-05-14 22:27 ` Chong Li
2015-05-15 14:42 ` Dario Faggioli
2015-05-11 13:11 ` Dario Faggioli
2015-05-14 22:15 ` Chong Li
2015-05-07 17:05 ` Chong Li [this message]
2015-05-11 13:27 ` [PATCH v1 2/4] libxc: " Dario Faggioli
2015-05-07 17:05 ` [PATCH v1 3/4] libxl: " Chong Li
2015-05-11 14:06 ` Dario Faggioli
2015-05-15 15:24 ` Chong Li
2015-05-15 23:09 ` Dario Faggioli
2015-05-12 10:01 ` Dario Faggioli
2015-05-15 16:35 ` Chong Li
2015-05-15 23:02 ` Dario Faggioli
2015-05-22 17:57 ` Chong Li
2015-05-07 17:05 ` [PATCH v1 4/4] xl: " Chong Li
2015-05-14 14:24 ` Meng Xu
2015-05-14 14:39 ` Dario Faggioli
2015-05-14 14:43 ` Meng Xu
2015-05-11 9:56 ` [PATCH v1 0/4] Enabling " Dario Faggioli
2015-05-14 17:08 ` Chong Li
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=1431018326-3239-3-git-send-email-chong.li@wustl.edu \
--to=lichong659@gmail.com \
--cc=chong.li@wustl.edu \
--cc=dario.faggioli@citrix.com \
--cc=dgolomb@seas.upenn.edu \
--cc=george.dunlap@eu.citrix.com \
--cc=jbeulich@suse.com \
--cc=mengxu@cis.upenn.edu \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xen.org \
--cc=xisisu@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).