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,
Meng Xu <mengxu@cis.upenn.edu>,
lichong659@gmail.com, dgolomb@seas.upenn.edu
Subject: [PATCH v8 for Xen 4.7 2/4] libxc: enable per-VCPU parameter for RTDS
Date: Fri, 18 Mar 2016 16:26:23 -0500 [thread overview]
Message-ID: <1458336385-2606-3-git-send-email-lichong659@gmail.com> (raw)
In-Reply-To: <1458336385-2606-1-git-send-email-lichong659@gmail.com>
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>
---
Changes on PATCH v6:
1) Resolve some coding sytle issues
Changes on PATCH v5:
1) In xc_sched_rtds_vcpu_get/set, re-issueing the hypercall
if it is preempted.
Changes on PATCH v4:
1) Minor modifications on the function parameters.
Changes on PATCH v2:
1) Minor modifications due to the change of struct xen_domctl_scheduler_op.
CC: <dario.faggioli@citrix.com>
CC: <george.dunlap@eu.citrix.com>
CC: <dgolomb@seas.upenn.edu>
CC: <mengxu@cis.upenn.edu>
CC: <wei.liu2@citrix.com>
CC: <lichong659@gmail.com>
---
tools/libxc/include/xenctrl.h | 8 +++++
tools/libxc/xc_rt.c | 68 +++++++++++++++++++++++++++++++++++++++++++
2 files changed, 76 insertions(+)
diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
index 01a6dda..4567585 100644
--- a/tools/libxc/include/xenctrl.h
+++ b/tools/libxc/include/xenctrl.h
@@ -893,6 +893,14 @@ int xc_sched_rtds_domain_set(xc_interface *xch,
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_schedparam_vcpu *vcpus,
+ uint32_t num_vcpus);
+int xc_sched_rtds_vcpu_get(xc_interface *xch,
+ uint32_t domid,
+ struct xen_domctl_schedparam_vcpu *vcpus,
+ uint32_t num_vcpus);
int
xc_sched_arinc653_schedule_set(
diff --git a/tools/libxc/xc_rt.c b/tools/libxc/xc_rt.c
index d59e5ce..221d17f 100644
--- a/tools/libxc/xc_rt.c
+++ b/tools/libxc/xc_rt.c
@@ -62,3 +62,71 @@ 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_schedparam_vcpu *vcpus,
+ uint32_t num_vcpus)
+{
+ int rc;
+ unsigned processed = 0;
+ DECLARE_DOMCTL;
+ DECLARE_HYPERCALL_BOUNCE(vcpus, sizeof(*vcpus) * num_vcpus,
+ XC_HYPERCALL_BUFFER_BOUNCE_IN);
+
+ if ( xc_hypercall_bounce_pre(xch, vcpus) )
+ 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;
+
+ while ( processed < num_vcpus )
+ {
+ domctl.u.scheduler_op.u.v.nr_vcpus = num_vcpus - processed;
+ set_xen_guest_handle_offset(domctl.u.scheduler_op.u.v.vcpus, vcpus,
+ processed);
+ if ( (rc = do_domctl(xch, &domctl)) != 0 )
+ break;
+ processed += domctl.u.scheduler_op.u.v.nr_vcpus;
+ }
+
+ xc_hypercall_bounce_post(xch, vcpus);
+
+ return rc;
+}
+
+int xc_sched_rtds_vcpu_get(xc_interface *xch,
+ uint32_t domid,
+ struct xen_domctl_schedparam_vcpu *vcpus,
+ uint32_t num_vcpus)
+{
+ int rc;
+ unsigned processed = 0;
+ DECLARE_DOMCTL;
+ DECLARE_HYPERCALL_BOUNCE(vcpus, sizeof(*vcpus) * num_vcpus,
+ XC_HYPERCALL_BUFFER_BOUNCE_BOTH);
+
+ if ( xc_hypercall_bounce_pre(xch, vcpus) )
+ 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;
+
+ while ( processed < num_vcpus )
+ {
+ domctl.u.scheduler_op.u.v.nr_vcpus = num_vcpus - processed;
+ set_xen_guest_handle_offset(domctl.u.scheduler_op.u.v.vcpus, vcpus,
+ processed);
+ if ( (rc = do_domctl(xch, &domctl)) != 0 )
+ break;
+ processed += domctl.u.scheduler_op.u.v.nr_vcpus;
+ }
+
+ xc_hypercall_bounce_post(xch, vcpus);
+
+ return rc;
+}
--
1.9.1
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-03-18 21:26 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-18 21:26 [PATCH v8 for Xen 4.7 0/4] Enable per-VCPU parameter for RTDS Chong Li
2016-03-18 21:26 ` [PATCH v8 for Xen 4.7 1/4] xen: enable " Chong Li
2016-03-21 13:35 ` Jan Beulich
2016-03-21 15:18 ` Chong Li
2016-03-21 15:39 ` George Dunlap
2016-03-21 15:49 ` Jan Beulich
2016-03-21 16:03 ` Chong Li
2016-03-21 16:25 ` Jan Beulich
2016-03-25 18:07 ` Chong Li
2016-03-29 10:58 ` Dario Faggioli
2016-03-29 16:59 ` Dario Faggioli
2016-03-29 17:13 ` Konrad Rzeszutek Wilk
2016-03-29 17:36 ` Dario Faggioli
2016-03-18 21:26 ` Chong Li [this message]
2016-03-29 17:08 ` [PATCH v8 for Xen 4.7 2/4] libxc: " Dario Faggioli
2016-03-31 16:59 ` Wei Liu
2016-03-18 21:26 ` [PATCH v8 for Xen 4.7 3/4] libxl: " Chong Li
2016-03-30 17:04 ` Dario Faggioli
2016-03-31 16:59 ` Wei Liu
2016-03-18 21:26 ` [PATCH v8 for Xen 4.7 4/4] xl: " Chong Li
2016-03-31 17:00 ` Wei Liu
2016-03-31 17:22 ` Dario Faggioli
2016-03-31 17:17 ` Dario Faggioli
2016-03-31 20:16 ` 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=1458336385-2606-3-git-send-email-lichong659@gmail.com \
--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=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).