@@ -1,5 +1,6 @@
CONFIG_ARM := y
CONFIG_ARM_32 := y
+CONFIG_VUART_CONSOLE := y
CONFIG_ARM_$(XEN_OS) := y
CONFIG_XEN_INSTALL_SUFFIX :=
@@ -1,5 +1,6 @@
CONFIG_ARM := y
CONFIG_ARM_64 := y
+CONFIG_VUART_CONSOLE := y
CONFIG_ARM_$(XEN_OS) := y
CONFIG_XEN_INSTALL_SUFFIX :=
@@ -306,6 +306,12 @@
#define LIBXL_HAVE_BUILDINFO_HVM_ACPI_LAPTOP_SLATE 1
/*
+ * LIBXL_HAVE_VUART indicates that xenconsole/client supports
+ * virtual uart.
+ */
+#define LIBXL_HAVE_VUART 1
+
+/*
* libxl ABI compatibility
*
* The only guarantee which libxl makes regarding ABI compatibility
@@ -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;
}
@@ -1135,6 +1135,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,
@@ -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, "pl011"),
+ ])
+
#
# Complex libxl types
#
@@ -580,6 +586,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.
@@ -15,6 +15,10 @@ LDFLAGS += $(PTHREAD_LDFLAGS)
CFLAGS_XL += $(CFLAGS_libxenlight)
CFLAGS_XL += -Wshadow
+ifeq ($(CONFIG_VUART_CONSOLE),y)
+CFLAGS_XL += -DCONFIG_VUART_CONSOLE
+endif
+
XL_OBJS = xl.o xl_cmdtable.o xl_sxp.o xl_utils.o
XL_OBJS += xl_tmem.o xl_parse.o xl_cpupool.o xl_flask.o
XL_OBJS += xl_vtpm.o xl_block.o xl_nic.o xl_usb.o
@@ -133,7 +133,11 @@ struct cmd_spec cmd_table[] = {
&main_console, 0, 0,
"Attach to domain's console",
"[options] <Domain>\n"
+#ifdef CONFIG_VUART_CONSOLE
+ "-t <type> console type, pv , serial or vuart\n"
+#else
"-t <type> console type, pv or serial\n"
+#endif
"-n <number> console number"
},
{ "vncviewer",
@@ -27,6 +27,11 @@ int main_console(int argc, char **argv)
uint32_t domid;
int opt = 0, num = 0;
libxl_console_type type = 0;
+#ifdef CONFIG_VUART_CONSOLE
+ char *console_names = "pv, serial, vuart";
+#else
+ char *console_names = "pv, serial";
+#endif
SWITCH_FOREACH_OPT(opt, "n:t:", NULL, "console", 1) {
case 't':
@@ -34,8 +39,12 @@ int main_console(int argc, char **argv)
type = LIBXL_CONSOLE_TYPE_PV;
else if (!strcmp(optarg, "serial"))
type = LIBXL_CONSOLE_TYPE_SERIAL;
+#ifdef CONFIG_VUART_CONSOLE
+ else if (!strcmp(optarg, "vuart"))
+ type = LIBXL_CONSOLE_TYPE_VUART;
+#endif
else {
- fprintf(stderr, "console type supported are: pv, serial\n");
+ fprintf(stderr, "console type supported are: %s\n", console_names);
return EXIT_FAILURE;
}
break;
@@ -916,6 +916,14 @@ void parse_config_data(const char *config_source,
if (!xlu_cfg_get_long (config, "maxvcpus", &l, 0))
b_info->max_vcpus = l;
+ if (!xlu_cfg_get_string(config, "vuart", &buf, 0)) {
+ if (libxl_vuart_type_from_string(buf, &b_info->arch_arm.vuart)) {
+ fprintf(stderr, "ERROR: invalid value \"%s\" for \"vuart\"\n",
+ buf);
+ exit(1);
+ }
+ }
+
parse_vnuma_config(config, b_info);
/* Set max_memkb to target_memkb and max_vcpus to avail_vcpus if
An option is provided in libxl to enable/disable pl011 vuart while creating a guest domain. Libxl now suppots a generic vuart console and pl011 is a specific type. In future support can be added for multiple vuart of different types. User can enable pl011 vuart by adding the following line in the guest configuration file: vuart = "pl011" Signed-off-by: Bhupinder Thakur <bhupinder.thakur@linaro.org> --- 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. config/arm32.mk | 1 + config/arm64.mk | 1 + tools/libxl/libxl.h | 6 ++++++ tools/libxl/libxl_console.c | 3 +++ tools/libxl/libxl_internal.h | 3 +++ tools/libxl/libxl_types.idl | 7 +++++++ tools/xl/Makefile | 4 ++++ tools/xl/xl_cmdtable.c | 4 ++++ tools/xl/xl_console.c | 11 ++++++++++- tools/xl/xl_parse.c | 8 ++++++++ 10 files changed, 47 insertions(+), 1 deletion(-)