xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Bhupinder Thakur <bhupinder.thakur@linaro.org>
To: xen-devel@lists.xenproject.org
Cc: Julien Grall <julien.grall@arm.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH 07/11] xen/arm: vpl011: Add two new vpl011 parameters to xenstore
Date: Tue, 21 Feb 2017 16:56:04 +0530	[thread overview]
Message-ID: <1487676368-22356-8-git-send-email-bhupinder.thakur@linaro.org> (raw)
In-Reply-To: <1487676368-22356-1-git-send-email-bhupinder.thakur@linaro.org>

Add two new parameters to the xen store:
    - newly allocated PFN to be used as IN/OUT ring buffer by xenconsoled
    - a new event channel read from Xen using a hvm call to be used by xenconsoled
      for eventing

Signed-off-by: Bhupinder Thakur <bhupinder.thakur@linaro.org>
---
 tools/libxl/libxl.c          |  6 ++++++
 tools/libxl/libxl_dom.c      | 18 +++++++++++++++++-
 tools/libxl/libxl_internal.h |  4 ++++
 3 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index d400fa2..cc00235 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -3159,6 +3159,12 @@ int libxl__device_console_add(libxl__gc *gc, uint32_t domid,
         flexarray_append(ro_front, GCSPRINTF("%"PRIu32, state->console_port));
         flexarray_append(ro_front, "ring-ref");
         flexarray_append(ro_front, GCSPRINTF("%lu", state->console_mfn));
+#if defined(__arm__) || defined(__aarch64__)
+        flexarray_append(ro_front, "vpl011-port");
+        flexarray_append(ro_front, GCSPRINTF("%"PRIu32, state->vpl011_console_port));
+        flexarray_append(ro_front, "vpl011-ring-ref");
+        flexarray_append(ro_front, GCSPRINTF("%lu", state->vpl011_console_mfn));
+#endif
     } else {
         flexarray_append(front, "state");
         flexarray_append(front, GCSPRINTF("%d", XenbusStateInitialising));
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index d519c8d..39eaff6 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -302,7 +302,7 @@ int libxl__build_pre(libxl__gc *gc, uint32_t domid,
     libxl_ctx *ctx = libxl__gc_owner(gc);
     char *xs_domid, *con_domid;
     int rc;
-    uint64_t size;
+    uint64_t size, val=-1;
 
     if (xc_domain_max_vcpus(ctx->xch, domid, info->max_vcpus) != 0) {
         LOG(ERROR, "Couldn't set max vcpu count");
@@ -432,6 +432,16 @@ int libxl__build_pre(libxl__gc *gc, uint32_t domid,
     state->store_port = xc_evtchn_alloc_unbound(ctx->xch, domid, state->store_domid);
     state->console_port = xc_evtchn_alloc_unbound(ctx->xch, domid, state->console_domid);
 
+#if defined(__arm__) || defined(__aarch64__)
+    /* get the vpl011 event channel from Xen */
+    rc = xc_hvm_param_get(ctx->xch, domid, HVM_PARAM_VPL011_CONSOLE_EVTCHN,
+            &val);
+    if ( rc )
+        state->vpl011_console_port = -1;
+    else
+        state->vpl011_console_port = (uint32_t)val;
+#endif
+
     if (info->type == LIBXL_DOMAIN_TYPE_HVM) {
         hvm_set_conf_params(ctx->xch, domid, info);
 #if defined(__i386__) || defined(__x86_64__)
@@ -727,6 +737,9 @@ int libxl__build_pv(libxl__gc *gc, uint32_t domid,
 
     dom->flags = flags;
     dom->console_evtchn = state->console_port;
+#if defined(__arm__) || defined(__aarch64__)
+    dom->vpl011_console_evtchn = state->vpl011_console_port;
+#endif
     dom->console_domid = state->console_domid;
     dom->xenstore_evtchn = state->store_port;
     dom->xenstore_domid = state->store_domid;
@@ -771,6 +784,9 @@ int libxl__build_pv(libxl__gc *gc, uint32_t domid,
     if (xc_dom_feature_translated(dom)) {
         state->console_mfn = dom->console_pfn;
         state->store_mfn = dom->xenstore_pfn;
+#if defined(__arm__) || defined(__aarch64__)
+        state->vpl011_console_mfn = dom->vpl011_console_pfn;
+#endif
     } else {
         state->console_mfn = xc_dom_p2m(dom, dom->console_pfn);
         state->store_mfn = xc_dom_p2m(dom, dom->xenstore_pfn);
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 5f46578..10e262e 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -1128,6 +1128,10 @@ typedef struct {
     uint32_t num_vmemranges;
 
     xc_domain_configuration_t config;
+#if defined(__arm__) || defined(__aarch64__)
+    unsigned long vpl011_console_mfn;
+    uint32_t    vpl011_console_port;
+#endif
 } libxl__domain_build_state;
 
 _hidden int libxl__build_pre(libxl__gc *gc, uint32_t domid,
-- 
2.7.4


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

  parent reply	other threads:[~2017-02-21 11:26 UTC|newest]

Thread overview: 82+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-21 11:25 [PATCH 00/11] pl011 emulation support in Xen Bhupinder Thakur
2017-02-21 11:25 ` [PATCH 01/11] xen/arm: vpl011: Add pl011 uart emulation " Bhupinder Thakur
2017-02-26 21:37   ` Julien Grall
2017-03-03 19:19     ` Julien Grall
2017-03-21 13:27     ` Bhupinder Thakur
2017-03-21 19:38       ` Julien Grall
2017-03-23  9:44         ` Bhupinder Thakur
2017-03-23 13:51           ` Julien Grall
2017-03-03 19:59   ` Konrad Rzeszutek Wilk
2017-03-05  1:04     ` Julien Grall
2017-03-06 14:22       ` Konrad Rzeszutek Wilk
2017-03-05  1:15     ` Julien Grall
2017-03-05 11:59     ` Julien Grall
2017-03-22  5:50     ` Bhupinder Thakur
2017-03-05 12:12   ` Julien Grall
2017-03-23  9:14     ` Bhupinder Thakur
2017-03-23 14:16       ` Julien Grall
2017-03-24 10:39         ` Bhupinder Thakur
2017-02-21 11:25 ` [PATCH 02/11] xen/arm: vpl011: Add new hvm params in Xen for ring buffer/event setup Bhupinder Thakur
2017-03-03 20:02   ` Konrad Rzeszutek Wilk
2017-03-24  6:58     ` Bhupinder Thakur
2017-03-05 12:35   ` Julien Grall
2017-03-06  8:06     ` Jan Beulich
2017-03-06 11:42       ` Julien Grall
2017-03-06 12:41         ` Jan Beulich
2017-03-06 13:21           ` Julien Grall
2017-03-06 13:48             ` Jan Beulich
2017-03-08 14:45               ` Julien Grall
2017-03-08 15:21                 ` Jan Beulich
2017-03-08 18:22                   ` Stefano Stabellini
2017-04-11 14:38                     ` Bhupinder Thakur
2017-04-11 22:07                       ` Stefano Stabellini
2017-04-14  7:12                         ` Bhupinder Thakur
2017-04-19 18:43                           ` Stefano Stabellini
2017-03-06 14:48             ` George Dunlap
2017-03-08 13:52               ` Julien Grall
2017-03-24  7:31     ` Bhupinder Thakur
2017-02-21 11:26 ` [PATCH 03/11] xen/arm: vpl011: Refactor evtchn_send in Xen to allow sending events from a xen bound channel Bhupinder Thakur
2017-03-03 21:13   ` Konrad Rzeszutek Wilk
2017-03-06 10:16     ` Bhupinder Thakur
2017-03-06 10:35       ` Jan Beulich
2017-03-05 12:39   ` Julien Grall
2017-03-06  8:15     ` Jan Beulich
2017-03-06 10:44       ` Bhupinder Thakur
2017-03-06 10:54         ` Jan Beulich
2017-03-06 11:12           ` Bhupinder Thakur
2017-03-28  9:43             ` Bhupinder Thakur
2017-02-21 11:26 ` [PATCH 04/11] xen/arm: vpl011: Enable vpl011 emulation for a domain in Xen Bhupinder Thakur
2017-03-03 21:47   ` Konrad Rzeszutek Wilk
2017-03-05 12:46   ` Julien Grall
2017-03-06  8:27     ` Jan Beulich
2017-02-21 11:26 ` [PATCH 05/11] xen/arm: vpl011: Initialize nr_spis in vgic_init in Xen to atleast 1 Bhupinder Thakur
2017-03-03 20:49   ` Konrad Rzeszutek Wilk
2017-03-05 12:51   ` Julien Grall
2017-03-16  6:50     ` Bhupinder Thakur
2017-03-16  8:24       ` Julien Grall
2017-03-16 10:31         ` Bhupinder Thakur
2017-03-16 13:24           ` Julien Grall
2017-03-20 16:29             ` Bhupinder Thakur
2017-02-21 11:26 ` [PATCH 06/11] xen/arm: vpl011: Add a new pl011 uart node in the guest DT in the toolstack Bhupinder Thakur
2017-03-03 20:15   ` Konrad Rzeszutek Wilk
2017-03-03 21:03   ` Konrad Rzeszutek Wilk
2017-03-05 12:59     ` Julien Grall
2017-03-05 13:04   ` Julien Grall
2017-03-14 13:00     ` Wei Liu
2017-02-21 11:26 ` Bhupinder Thakur [this message]
2017-03-03 20:58   ` [PATCH 07/11] xen/arm: vpl011: Add two new vpl011 parameters to xenstore Konrad Rzeszutek Wilk
2017-03-28  7:49     ` Bhupinder Thakur
2017-02-21 11:26 ` [PATCH 08/11] xen/arm: vpl011: Allocate a new PFN in the toolstack and pass to Xen using a hvm call Bhupinder Thakur
2017-03-03 20:51   ` Konrad Rzeszutek Wilk
2017-03-05 13:07     ` Julien Grall
2017-02-21 11:26 ` [PATCH 09/11] xen/arm: vpl011: Modify domain_create_ring in xenconsole to map the ring buffer and event channel Bhupinder Thakur
2017-03-03 21:46   ` Konrad Rzeszutek Wilk
2017-02-21 11:26 ` [PATCH 10/11] xen/arm: vpl011: Modify handle_ring_read and buffer_append to read/append vpl011 data Bhupinder Thakur
2017-03-03 21:06   ` Konrad Rzeszutek Wilk
2017-02-21 11:26 ` [PATCH 11/11] xen/arm: vpl011: Modify handle_tty_read in xenconsole to redirect user data to vpl011 IN ring buffer Bhupinder Thakur
2017-03-03 21:17   ` Konrad Rzeszutek Wilk
2017-03-03 20:23 ` [PATCH 00/11] pl011 emulation support in Xen Konrad Rzeszutek Wilk
2017-03-03 21:15   ` Konrad Rzeszutek Wilk
2017-03-14  7:44   ` Bhupinder Thakur
2017-03-05 11:46 ` Julien Grall
2017-03-14  7:47   ` Bhupinder Thakur

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=1487676368-22356-8-git-send-email-bhupinder.thakur@linaro.org \
    --to=bhupinder.thakur@linaro.org \
    --cc=julien.grall@arm.com \
    --cc=sstabellini@kernel.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 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).