From patchwork Thu Jun 22 07:38:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupinder Thakur X-Patchwork-Id: 106168 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp2327135qgd; Thu, 22 Jun 2017 00:41:21 -0700 (PDT) X-Received: by 10.36.200.5 with SMTP id w5mr701357itf.118.1498117281092; Thu, 22 Jun 2017 00:41:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498117281; cv=none; d=google.com; s=arc-20160816; b=mU8mwNtRQwoiLfLnqbMEV34ytGQFChrHUk/PDuz0M8w7L5wWZuY02IkGYfVHdxlJHR 7ya3RCiwf86xIkalaABTDgOxQAsWoF8FHFFeR67qJjWT6P8qsyYfncKP55+phxHjqUiC XOkjVXdupOylIgiyMzxWzvyPcA5CaD42atI4mJFYsw1j+UppJIzM6tIV/E8um0JjxYRn DeVGkf0U73mXKOlqOyBMQXt3Gcaqw2b3qagd+4OM1OdvSnroph/P3W8676yjvPLwzpLX scp+mnG7BNTOP29QnVdlMBJVjPO387aoATH48PAg20mcayRQUj/i0F1c1LvDdHcno1At TLEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:cc:references:in-reply-to:message-id:date:to :from:dkim-signature:arc-authentication-results; bh=gNskO8Jm9DOHb+AnNGPQaSpiqlpwMQWA6w7jOb4kOYM=; b=rpRz8pEhMlh2RiR3T4J2rDwCeONrwFyIi9tUvQi6Lr5+JWG4YLQOPKAmkxpwzDUkL3 cx/zmXoag1ld/VGxuiixqsmPa+tZAKe+LMlsUdXjf4rBzUAOFrba+xg+Tdp6WhE9aQn2 yV31LcrO81OHEhRKyV0a0PCPKsivixEo6M8d0yEDFFEO9SMB6mzz9uO1Q9gCSW1jasAJ TIscRztd2/p/73N8ErpKzjUFd2/G6d00LfMmbjcVyz6ycgCp+/s0ynOm99LDL296qhXv rmnoEqRimSV3RpqhxVzmF76ib065urhOOV/hbLdQXZgSO/HtdgHKBpnW+hwkQhGAuILZ uI7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=QuICFmhg; spf=neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) smtp.mailfrom=xen-devel-bounces@lists.xen.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id r82si381504itc.37.2017.06.22.00.41.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Jun 2017 00:41:21 -0700 (PDT) Received-SPF: neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) client-ip=192.237.175.120; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=QuICFmhg; spf=neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) smtp.mailfrom=xen-devel-bounces@lists.xen.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dNwi0-0005U6-I8; Thu, 22 Jun 2017 07:39:20 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dNwhz-0005TJ-UN for xen-devel@lists.xenproject.org; Thu, 22 Jun 2017 07:39:20 +0000 Received: from [193.109.254.147] by server-11.bemta-6.messagelabs.com id 5F/16-03587-7247B495; Thu, 22 Jun 2017 07:39:19 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrKIsWRWlGSWpSXmKPExsXiVRtspKtW4h1 psGirisX3LZOZHBg9Dn+4whLAGMWamZeUX5HAmtG2ZidLwWejirt/v7E3MG7S6GLk4hASmM4o 0dO4nRHEYRGYxyzRf/ATUxcjJ4eEQD+rxJ9mTwg7TaJhWRsbhF0p0brqNzOILSSgJXH01GxWC Hsfk0T7ZPsuRg4ONgETiVkdEiBhEQEliXurJjOBzGcWmM8o0TSpF2yOsICnxLsnW9lBbBYBVY lNf5aD7eUV8Jb4+nYbC8QuOYmb5zrBdnEK+Eis2LGQHWKXt8SuM5NZJjAKLGBkWMWoUZxaVJZ apGtorpdUlJmeUZKbmJmja2hgppebWlycmJ6ak5hUrJecn7uJERhYDECwg/H2xoBDjJIcTEqi vP/zvCOF+JLyUyozEosz4otKc1KLDzHKcHAoSfDOKwLKCRalpqdWpGXmAEMcJi3BwaMkwtsC0 spbXJCYW5yZDpE6xWjMsWH1+i9MHJMObP/CJMSSl5+XKiXOK1oMVCoAUppRmgc3CBZ7lxhlpY R5GYFOE+IpSC3KzSxBlX/FKM7BqCTMqw9yD09mXgncvldApzABnfLiiAfIKSWJCCmpBkYX3Tn flD+fWshzYW+/3okvLP+axOOTqpfM4WBc3xi1+f8KvZUuOYzaa89vKenbdX+J2daYS44qPX+z BENvx5oEz94m4svHqCJy59qUcKZ554O5rm4ws/i0m5X91uOCTy//6HEu9vrpnn5M6/6dssKlS izKlc5rTrk17/efZv/g5Rz5+c7OhvpKLMUZiYZazEXFiQBgFge7uAIAAA== X-Env-Sender: bhupinder.thakur@linaro.org X-Msg-Ref: server-9.tower-27.messagelabs.com!1498117157!109018048!1 X-Originating-IP: [74.125.83.50] X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG X-StarScan-Received: X-StarScan-Version: 9.4.19; banners=-,-,- X-VirusChecked: Checked Received: (qmail 10404 invoked from network); 22 Jun 2017 07:39:18 -0000 Received: from mail-pg0-f50.google.com (HELO mail-pg0-f50.google.com) (74.125.83.50) by server-9.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 22 Jun 2017 07:39:18 -0000 Received: by mail-pg0-f50.google.com with SMTP id u62so4582020pgb.3 for ; Thu, 22 Jun 2017 00:39:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=za749e5OPxqDcF25FG8ySj4s2PVd2DrfzUsMhwQ4CRQ=; b=QuICFmhgqpVClWP9GvFj6WkYkaeUxiY5DlUhy9eJXqxNJ+QP6jS4EHS3EkJgVnDNjd 3l6NUyTxRd2p+BgXORFWAZRAhiL733qm3a9rUOZ92LjW+fU+00CjSeJooBucBCPENjoW 3pKlxBCysNxgrDg3s5Lwx/QRGxkw7Z3MGagbs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=za749e5OPxqDcF25FG8ySj4s2PVd2DrfzUsMhwQ4CRQ=; b=ZmQi6k2heLAfN0ouh0evFBDnUvxQHAfAVHmM1hyrKf9bKXs5GyzAp6Qpfhk7mf+8VB vZaCLSbGRzu6L0HBn4TWS1TIWayCwz36TyzRbeYLQyWTiETo8vnzrv1Ld576K6f3y1oM S3dPUXGqCMKn7nroa7aVdSKNkPU5EQJyfxqg7BC1L2e+ejAD4rr48q2NwL7LmFHN1TU6 FjsgbBFuzNzWmW6zPqcXONdquXf7aBJwkr4J1dzj3T4GiqIHyhNSWrok9a+YOY+MzVi4 m4AtOyIrhvt8Rbj6cxNOFNHahXUuRggCxlAI1IPmaTFsK6EzFcBo6SsK7uFbtmpBTsef YctA== X-Gm-Message-State: AKS2vOy4HPCh7scLq3rjuNwikrYw8qcuNCsJAPRxf6NaZHcMSU9jzgze B6vRMQi0KAHlNeRjVNiHdg== X-Received: by 10.98.32.153 with SMTP id m25mr1270752pfj.111.1498117156717; Thu, 22 Jun 2017 00:39:16 -0700 (PDT) Received: from blr-ubuntu-linaro.wlan.qualcomm.com (blr-bdr-fw-01_globalnat_allzones-outside.qualcomm.com. [103.229.18.19]) by smtp.gmail.com with ESMTPSA id w69sm1883591pfk.107.2017.06.22.00.39.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 22 Jun 2017 00:39:16 -0700 (PDT) From: Bhupinder Thakur To: xen-devel@lists.xenproject.org Date: Thu, 22 Jun 2017 13:08:41 +0530 Message-Id: <1498117132-27139-7-git-send-email-bhupinder.thakur@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1498117132-27139-1-git-send-email-bhupinder.thakur@linaro.org> References: <1498117132-27139-1-git-send-email-bhupinder.thakur@linaro.org> Cc: Wei Liu , Julien Grall , Stefano Stabellini , Ian Jackson Subject: [Xen-devel] [PATCH 06/17 v5] xen/arm: vpl011: Add support for vuart in libxl X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" An option is provided in libxl to enable/disable sbsa vuart while creating a guest domain. Libxl now suppots 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 | 6 ++++++ 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, 33 insertions(+), 2 deletions(-) diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h index cf8687a..bcfbb6c 100644 --- a/tools/libxl/libxl.h +++ b/tools/libxl/libxl.h @@ -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 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 5d914a5..c98af60 100644 --- a/tools/libxl/libxl_dom.c +++ b/tools/libxl/libxl_dom.c @@ -788,6 +788,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 afe6652..d0d50c3 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 2204425..d492b35 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 # @@ -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. diff --git a/tools/xl/xl_cmdtable.c b/tools/xl/xl_cmdtable.c index 30eb93c..9f91651 100644 --- a/tools/xl/xl_cmdtable.c +++ b/tools/xl/xl_cmdtable.c @@ -133,7 +133,7 @@ struct cmd_spec cmd_table[] = { &main_console, 0, 0, "Attach to domain's console", "[options] \n" - "-t console type, pv or serial\n" + "-t console type, pv , serial or vuart\n" "-n console number" }, { "vncviewer", diff --git a/tools/xl/xl_console.c b/tools/xl/xl_console.c index 0508dda..4e65d73 100644 --- a/tools/xl/xl_console.c +++ b/tools/xl/xl_console.c @@ -27,6 +27,7 @@ int main_console(int argc, char **argv) uint32_t domid; int opt = 0, num = 0; libxl_console_type type = 0; + char *console_names = "pv, serial, vuart"; SWITCH_FOREACH_OPT(opt, "n:t:", NULL, "console", 1) { case 't': @@ -34,8 +35,10 @@ int main_console(int argc, char **argv) type = LIBXL_CONSOLE_TYPE_PV; else if (!strcmp(optarg, "serial")) type = LIBXL_CONSOLE_TYPE_SERIAL; + else if (!strcmp(optarg, "vuart")) + type = LIBXL_CONSOLE_TYPE_VUART; else { - fprintf(stderr, "console type supported are: pv, serial\n"); + fprintf(stderr, "console type supported are: %s\n", console_names); return EXIT_FAILURE; } break; diff --git a/tools/xl/xl_parse.c b/tools/xl/xl_parse.c index 856a304..37581ef 100644 --- a/tools/xl/xl_parse.c +++ b/tools/xl/xl_parse.c @@ -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