Re: [Xen-devel] [PATCH 04/25 v7] xen/arm: vpl011: Add support for vuart in libxl

2017-08-08 Thread Julien Grall



On 08/08/17 14:38, Julien Grall wrote:

Hi Bhupinder,

On 07/08/17 09:52, Bhupinder Thakur wrote:

diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 229e289..90eaa20 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -306,6 +306,11 @@
 #define LIBXL_HAVE_BUILDINFO_HVM_ACPI_LAPTOP_SLATE 1

 /*
+ * LIBXL_HAVE_VUART indicates that the toolstack supports virtual UART.
+ */
+#define LIBXL_HAVE_VUART 1


Now that we decide to implement vUART only for ARM, I think the comment
I made on v1 still stands. I.e that you give the impression this is
supported for all architectures. But this is not true.


To complete, I would follow what we did for gic_version:

LIBXL_HAVE_BUILDINFO_ARM_VUART


--
Julien Grall

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


Re: [Xen-devel] [PATCH 04/25 v7] xen/arm: vpl011: Add support for vuart in libxl

2017-08-08 Thread Julien Grall

Hi Bhupinder,

On 07/08/17 09:52, Bhupinder Thakur wrote:

diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 229e289..90eaa20 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -306,6 +306,11 @@
 #define LIBXL_HAVE_BUILDINFO_HVM_ACPI_LAPTOP_SLATE 1

 /*
+ * LIBXL_HAVE_VUART indicates that the toolstack supports virtual UART.
+ */
+#define LIBXL_HAVE_VUART 1


Now that we decide to implement vUART only for ARM, I think the comment 
I made on v1 still stands. I.e that you give the impression this is 
supported for all architectures. But this is not true.


Cheers,

--
Julien Grall

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


[Xen-devel] [PATCH 04/25 v7] xen/arm: vpl011: Add support for vuart in libxl

2017-08-07 Thread Bhupinder Thakur
An option is provided in libxl to enable/disable SBSA vuart while
creating a guest domain.

Libxl now supports a generic vuart console and SBSA uart is a specific type.
In future support can be added for multiple vuart of different types.

User can enable SBSA vuart by adding the following line in the guest
configuration file:

vuart = "sbsa_uart"

Signed-off-by: Bhupinder Thakur 
Acked-by: Stefano Stabellini 
Acked-by: Wei Liu 
---
CC: Ian Jackson 
CC: Wei Liu 
CC: Stefano Stabellini 
CC: Julien Grall 

Changes since v4:
- Renamed "pl011" to "sbsa_uart".

Changes since v3:
- Added a new config option CONFIG_VUART_CONSOLE to enable/disable vuart console
  support.
- Moved libxl_vuart_type to arch-arm part of libxl_domain_build_info
- Updated xl command help to mention new console type - vuart.

Changes since v2:
- Defined vuart option as an enum instead of a string.
- Removed the domain creation flag defined for vuart and the related code
  to pass on the information while domain creation. Now vpl011 is initialized
  independent of domain creation through new DOMCTL APIs.

 tools/libxl/libxl.h  | 5 +
 tools/libxl/libxl_console.c  | 3 +++
 tools/libxl/libxl_dom.c  | 1 +
 tools/libxl/libxl_internal.h | 3 +++
 tools/libxl/libxl_types.idl  | 7 +++
 tools/xl/xl_cmdtable.c   | 2 +-
 tools/xl/xl_console.c| 5 -
 tools/xl/xl_parse.c  | 8 
 8 files changed, 32 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 229e289..90eaa20 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -306,6 +306,11 @@
 #define LIBXL_HAVE_BUILDINFO_HVM_ACPI_LAPTOP_SLATE 1
 
 /*
+ * LIBXL_HAVE_VUART indicates that the toolstack supports virtual UART.
+ */
+#define LIBXL_HAVE_VUART 1
+
+/*
  * libxl ABI compatibility
  *
  * The only guarantee which libxl makes regarding ABI compatibility
diff --git a/tools/libxl/libxl_console.c b/tools/libxl/libxl_console.c
index 446e766..853be15 100644
--- a/tools/libxl/libxl_console.c
+++ b/tools/libxl/libxl_console.c
@@ -67,6 +67,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_VUART:
+cons_type_s = "vuart";
+break;
 default:
 goto out;
 }
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index f54fd49..e0f0d78 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -803,6 +803,7 @@ int libxl__build_pv(libxl__gc *gc, uint32_t domid,
 if (xc_dom_translated(dom)) {
 state->console_mfn = dom->console_pfn;
 state->store_mfn = dom->xenstore_pfn;
+state->vuart_gfn = dom->vuart_gfn;
 } 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 7247509..6b38453 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -1139,6 +1139,9 @@ typedef struct {
 uint32_t num_vmemranges;
 
 xc_domain_configuration_t config;
+
+xen_pfn_t vuart_gfn;
+evtchn_port_t vuart_port;
 } libxl__domain_build_state;
 
 _hidden int libxl__build_pre(libxl__gc *gc, uint32_t domid,
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 6e80d36..9959efb 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -105,6 +105,7 @@ libxl_console_type = Enumeration("console_type", [
 (0, "UNKNOWN"),
 (1, "SERIAL"),
 (2, "PV"),
+(3, "VUART"),
 ])
 
 libxl_disk_format = Enumeration("disk_format", [
@@ -240,6 +241,11 @@ libxl_checkpointed_stream = 
Enumeration("checkpointed_stream", [
 (2, "COLO"),
 ])
 
+libxl_vuart_type = Enumeration("vuart_type", [
+(0, "unknown"),
+(1, "sbsa_uart"),
+])
+
 #
 # Complex libxl types
 #
@@ -581,6 +587,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
 
 
 ("arch_arm", Struct(None, [("gic_version", libxl_gic_version),
+   ("vuart", libxl_vuart_type),
   ])),
 # Alternate p2m is not bound to any architecture or guest type, as it is
 # supported by x86 HVM and ARM support is planned.
diff --git a/tools/xl/xl_cmdtable.c b/tools/xl/xl_cmdtable.c
index 2c71a9f..3094bce 100644
--- a/tools/xl/xl_cmdtable.c
+++ b/tools/xl/xl_cmdtable.c
@@ -133,7 +133,7 @@ struct cmd_spec cmd_table[] = {
   _console, 0, 0,
   "Attach to domain's console",
   "[options] \n"
-  "-tconsole type, pv or serial\n"
+  "-tconsole type, pv , serial or vuart\n"
   "-n  console number"
 },
 { "vncviewer",
diff --git a/tools/xl/xl_console.c