Re: [Xen-devel] [PATCH 06/10] xen/arm: vpl011: Add new parameters to xenstore for the virtual console

2017-04-25 Thread Wei Liu
On Tue, Apr 25, 2017 at 03:48:47PM +0530, Bhupinder Thakur wrote:
> Hi Wei,
> 
> 
> >>  }
> >> @@ -3159,6 +3162,13 @@ 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 (state->vconsole_enabled)
> >> +{
> >> +flexarray_append(ro_front, "vcon-port");
> >> +flexarray_append(ro_front, GCSPRINTF("%"PRIu32, 
> >> state->vconsole_port));
> >> +flexarray_append(ro_front, "vcon-ring-ref");
> >> +flexarray_append(ro_front, GCSPRINTF("%lu", 
> >> state->vconsole_mfn));
> >> +}
> >
> > Please try to document these new xenstore paths. See
> > docs/misc/xenstore-paths.md.
> 
> I will add the vuart console details in console.txt which is
> referenced in xenstore-paths.md.
> 

Yes that's good.

> Regards,
> Bhupinder

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


Re: [Xen-devel] [PATCH 06/10] xen/arm: vpl011: Add new parameters to xenstore for the virtual console

2017-04-25 Thread Bhupinder Thakur
Hi Wei,


>>  }
>> @@ -3159,6 +3162,13 @@ 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 (state->vconsole_enabled)
>> +{
>> +flexarray_append(ro_front, "vcon-port");
>> +flexarray_append(ro_front, GCSPRINTF("%"PRIu32, 
>> state->vconsole_port));
>> +flexarray_append(ro_front, "vcon-ring-ref");
>> +flexarray_append(ro_front, GCSPRINTF("%lu", 
>> state->vconsole_mfn));
>> +}
>
> Please try to document these new xenstore paths. See
> docs/misc/xenstore-paths.md.

I will add the vuart console details in console.txt which is
referenced in xenstore-paths.md.

Regards,
Bhupinder

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


Re: [Xen-devel] [PATCH 06/10] xen/arm: vpl011: Add new parameters to xenstore for the virtual console

2017-04-19 Thread Stefano Stabellini
On Mon, 3 Apr 2017, Bhupinder Thakur wrote:
> 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
> 
> Signed-off-by: Bhupinder Thakur 

please use vuart instead of vcon


> ---
>  tools/libxl/libxl.c | 10 ++
>  tools/libxl/libxl_dom.c | 13 -
>  2 files changed, 22 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
> index d400fa2..5fa1e41 100644
> --- a/tools/libxl/libxl.c
> +++ b/tools/libxl/libxl.c
> @@ -1791,6 +1791,9 @@ int libxl_console_exec(libxl_ctx *ctx, uint32_t domid, 
> int cons_num,
>  case LIBXL_CONSOLE_TYPE_SERIAL:
>  cons_type_s = "serial";
>  break;
> +case LIBXL_CONSOLE_TYPE_VCON:
> +cons_type_s = "vcon";
> +break;
>  default:
>  goto out;
>  }
> @@ -3159,6 +3162,13 @@ 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 (state->vconsole_enabled)
> +{
> +flexarray_append(ro_front, "vcon-port");
> +flexarray_append(ro_front, GCSPRINTF("%"PRIu32, 
> state->vconsole_port));
> +flexarray_append(ro_front, "vcon-ring-ref");
> +flexarray_append(ro_front, GCSPRINTF("%lu", 
> state->vconsole_mfn));

it makes more sense to add a new sub-directory such as:

  ro_front/vuart/port
  ro_front/vuart/ring-ref

Even better, with the idea of supporting more than one in the future:

  ro_front/vuart/0/port
  ro_front/vuart/0/ring-ref


> +}
>  } 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..8df1e10 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;
>  
>  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);
>  
> +state->vconsole_port = -1;
> +
> +if (state->vconsole_enabled)
> +{
> +rc = xc_hvm_param_get(ctx->xch, domid, HVM_PARAM_VCONSOLE_EVTCHN,
> +  );
> +if ( !rc )
> +state->vconsole_port = val;
> +}
> +
>  if (info->type == LIBXL_DOMAIN_TYPE_HVM) {
>  hvm_set_conf_params(ctx->xch, domid, info);
>  #if defined(__i386__) || defined(__x86_64__)
> @@ -771,6 +781,7 @@ 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;
> +state->vconsole_mfn = dom->vconsole_pfn;
>  } else {
>  state->console_mfn = xc_dom_p2m(dom, dom->console_pfn);
>  state->store_mfn = xc_dom_p2m(dom, dom->xenstore_pfn);
> -- 
> 2.7.4
> 

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


Re: [Xen-devel] [PATCH 06/10] xen/arm: vpl011: Add new parameters to xenstore for the virtual console

2017-04-12 Thread Wei Liu
On Mon, Apr 03, 2017 at 03:14:29PM +0530, Bhupinder Thakur wrote:
> 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
> 
> Signed-off-by: Bhupinder Thakur 
> ---
>  tools/libxl/libxl.c | 10 ++
>  tools/libxl/libxl_dom.c | 13 -
>  2 files changed, 22 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
> index d400fa2..5fa1e41 100644
> --- a/tools/libxl/libxl.c
> +++ b/tools/libxl/libxl.c
> @@ -1791,6 +1791,9 @@ int libxl_console_exec(libxl_ctx *ctx, uint32_t domid, 
> int cons_num,
>  case LIBXL_CONSOLE_TYPE_SERIAL:
>  cons_type_s = "serial";
>  break;
> +case LIBXL_CONSOLE_TYPE_VCON:
> +cons_type_s = "vcon";
> +break;
>  default:
>  goto out;
>  }
> @@ -3159,6 +3162,13 @@ 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 (state->vconsole_enabled)
> +{
> +flexarray_append(ro_front, "vcon-port");
> +flexarray_append(ro_front, GCSPRINTF("%"PRIu32, 
> state->vconsole_port));
> +flexarray_append(ro_front, "vcon-ring-ref");
> +flexarray_append(ro_front, GCSPRINTF("%lu", 
> state->vconsole_mfn));
> +}

Please try to document these new xenstore paths. See
docs/misc/xenstore-paths.md.

Wei.

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


[Xen-devel] [PATCH 06/10] xen/arm: vpl011: Add new parameters to xenstore for the virtual console

2017-04-03 Thread Bhupinder Thakur
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

Signed-off-by: Bhupinder Thakur 
---
 tools/libxl/libxl.c | 10 ++
 tools/libxl/libxl_dom.c | 13 -
 2 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index d400fa2..5fa1e41 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -1791,6 +1791,9 @@ int libxl_console_exec(libxl_ctx *ctx, uint32_t domid, 
int cons_num,
 case LIBXL_CONSOLE_TYPE_SERIAL:
 cons_type_s = "serial";
 break;
+case LIBXL_CONSOLE_TYPE_VCON:
+cons_type_s = "vcon";
+break;
 default:
 goto out;
 }
@@ -3159,6 +3162,13 @@ 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 (state->vconsole_enabled)
+{
+flexarray_append(ro_front, "vcon-port");
+flexarray_append(ro_front, GCSPRINTF("%"PRIu32, 
state->vconsole_port));
+flexarray_append(ro_front, "vcon-ring-ref");
+flexarray_append(ro_front, GCSPRINTF("%lu", state->vconsole_mfn));
+}
 } 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..8df1e10 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;
 
 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);
 
+state->vconsole_port = -1;
+
+if (state->vconsole_enabled)
+{
+rc = xc_hvm_param_get(ctx->xch, domid, HVM_PARAM_VCONSOLE_EVTCHN,
+  );
+if ( !rc )
+state->vconsole_port = val;
+}
+
 if (info->type == LIBXL_DOMAIN_TYPE_HVM) {
 hvm_set_conf_params(ctx->xch, domid, info);
 #if defined(__i386__) || defined(__x86_64__)
@@ -771,6 +781,7 @@ 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;
+state->vconsole_mfn = dom->vconsole_pfn;
 } else {
 state->console_mfn = xc_dom_p2m(dom, dom->console_pfn);
 state->store_mfn = xc_dom_p2m(dom, dom->xenstore_pfn);
-- 
2.7.4


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