From patchwork Wed May 10 14:28:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupinder Thakur X-Patchwork-Id: 98999 Delivered-To: patch@linaro.org Received: by 10.182.142.97 with SMTP id rv1csp230784obb; Wed, 10 May 2017 07:32:08 -0700 (PDT) X-Received: by 10.36.2.145 with SMTP id 139mr1600787itu.69.1494426728797; Wed, 10 May 2017 07:32:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1494426728; cv=none; d=google.com; s=arc-20160816; b=MASFg1tfvjv3p5Dqv/M+k7N9Ax3HLjNn/c4yyAoL0hJffe+HS5gGwylz6mjQ2YUlLi gOovTnCpIrPTKxmvZYP8BNDhommiXt/6e10znu8GtBStqcMGLePnXN5bzgx4NgfrNDRL hExLpUsgUXV1eE8hRRJ2e83iiNWnwleTF7JRx4aR0xDq/uaJGaP4S/vJIrcEdQI7HRVj NJ75ZenlJFw8XUo9EnRcJHIoLRC3VDt19K6jgVrkwuKB1nPlfkZPZo0ictLQwMAI+PZK GyjUH7NsCcv/fZKYEizhHZzBSUH3Lvoff4ESSWT2jJMSR9ImaoiCKMgKGNU+e7TXXIUh whYQ== 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:message-id:date:to:from:dkim-signature :arc-authentication-results; bh=uVP4czm5hFzYWZ/6l3x4XuBgT//xmoNInkcN3bnTRkw=; b=dsmhLHIXdYOUf6xgOB6uyveNmXvMDxY5wqsdHHiw+7uZWB2GDLU1drYdpYXIqb2KoI pOg+RSibxoQG8paiF3UKyJJS6LpHXN7dOEuVxCqPomDFl7PU2cWomAqIscYbOsrGLd8G 0MptIiQIAButub4EhE7q1B3inA2W/LVxgTz8GUVoDFT6mhsvqm5NlcIfq81z54A7367f luzlC4eHS6ZgH4pjVYIm24x3ZdtVfWKq4z1ByvTFNT90agMFgKszlRw6yHjj2jmEvrzE G4dxvNPRkGTEA5/xf7EzFz+/8B2lyQDdZ1EqaDw7WJItlDM9H1hqQoyanWz4qiF28OHS K7Ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; 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 69si2225937ios.118.2017.05.10.07.32.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 May 2017 07:32:08 -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; 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 1d8SdB-0003h4-5q; Wed, 10 May 2017 14:30:21 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d8SdA-0003gl-3g for xen-devel@lists.xenproject.org; Wed, 10 May 2017 14:30:20 +0000 Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id 55/3E-01992-BF323195; Wed, 10 May 2017 14:30:19 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprCIsWRWlGSWpSXmKPExsVyMfTANt1fysK RBu3HTSy+b5nM5MDocfjDFZYAxijWzLyk/IoE1ozzb38zFnRqVLx928rewNit0MXIxSEkMJNR YsHJ1YwgDotAO7PE1xP/2EEcCYF3LBJd37YzdzFyAjlxEnsmLIeyKyU29HSxgNhCAloSR0/NZ oUY1cwkse3qQyCHg4NNwERiVocESI2IgJLEvVWTmUBsZgFviQ9HQBZwcggLeErsmL+GFcRmEV CV+HNyAZjNC1Sz6t9qFohdchI3z3UyT2DkW8DIsIpRozi1qCy1SNfQSC+pKDM9oyQ3MTNH19D AVC83tbg4MT01JzGpWC85P3cTIzBUGIBgB2PfLOdDjJIcTEqivLq7hCKF+JLyUyozEosz4otK c1KLDzHKcHAoSfBWKQlHCgkWpaanVqRl5gCDFiYtwcGjJMKbBpLmLS5IzC3OTIdInWK05Hhx+ f17Jo53Sz8AyScrf7xnEmLJy89LlRLndQRpEABpyCjNgxsHi6xLjLJSwryMQAcK8RSkFuVmlq DKv2IU52BUEuYtA5nCk5lXArf1FdBBTEAHBTIIgBxUkoiQkmpg5Ki+MUH7vbVVVFzPxMWzWWM j/vdmbuy+6DVF5L7mppIKt9fcj2KKvwVO8FpW39f0Z+7li1Yq7TfMzjywvPDzLs++CyvmzZUN iWYJ6X4iE7g4+PJEcRurtaoXIqeKBLHZnw6RbOEo/Nty2mGR5/116S8vpeedMP4lz2TmFzDV5 vRxj6MRApWhSizFGYmGWsxFxYkA1glLLKcCAAA= X-Env-Sender: bhupinder.thakur@linaro.org X-Msg-Ref: server-11.tower-206.messagelabs.com!1494426617!77528532!1 X-Originating-IP: [209.85.192.182] X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG X-StarScan-Received: X-StarScan-Version: 9.4.12; banners=-,-,- X-VirusChecked: Checked Received: (qmail 50268 invoked from network); 10 May 2017 14:30:18 -0000 Received: from mail-pf0-f182.google.com (HELO mail-pf0-f182.google.com) (209.85.192.182) by server-11.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 10 May 2017 14:30:18 -0000 Received: by mail-pf0-f182.google.com with SMTP id e64so16806949pfd.1 for ; Wed, 10 May 2017 07:30: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; bh=RUv5IXzi4tvukMDS1Ws1d7FbB+sIz+n/tSEcnmSlblI=; b=XMVMSlz0uPXDYJ3TGS25zvwOr7Bq5agH3/YOmOVbF8u4FMv3SYOAlABVuyznNHRqVG f0OdMbxDMEbT4tZOJEGIfPv1Qcrfkfr02WSwR8eII8SGg3YXgJBX86126Z6lufld5Hiw kLSaxWZY4BrNm3qB8sdizlaXPyS8FOm7dwoW0= 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; bh=RUv5IXzi4tvukMDS1Ws1d7FbB+sIz+n/tSEcnmSlblI=; b=rbXGBycFVIznZL2u8RY+ftCxJ6wq/kwwgzZOtPw4u3XEgnnI/d61JN3ZMO87eI+CTw U1x1hUPy5cCBFQODwammCudANNlqPr9ALy1eMW+5EeYvjB9YjmsLV3B/zUoUwO7+TDis Iio9e1tw0ROmSoF7YcRDP6l8JoYQL2K7ldBZoULEb7X3aF0IT6k/P0eF8lqvW7inrZcV dVZrSaAExGfMqX631PJvioE+O+rvstQ82FtxDiBhK+yXdvSPgixJmt+v+eAHQ+DaR91J C4eby4XBPkDyQd4hmO2Yz5G7Yf7796kotKnERbHgqurph/OAAeEfrase7F7FUbNkmq3v pC2Q== X-Gm-Message-State: AODbwcA5UQzApaiH/Z3FRhpkDdcA0leNErlFtQasXY0dzW6m32AZ0Ooe 0K9K9yE9Hg04i2UI X-Received: by 10.84.217.20 with SMTP id o20mr8606271pli.103.1494426617048; Wed, 10 May 2017 07:30:17 -0700 (PDT) Received: from blr-ubuntu-linaro.wlan.qualcomm.com ([61.0.91.57]) by smtp.gmail.com with ESMTPSA id k23sm6342827pgn.11.2017.05.10.07.30.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 10 May 2017 07:30:16 -0700 (PDT) From: Bhupinder Thakur To: xen-devel@lists.xenproject.org Date: Wed, 10 May 2017 19:58:01 +0530 Message-Id: <1494426481-32562-1-git-send-email-bhupinder.thakur@linaro.org> X-Mailer: git-send-email 2.7.4 Cc: Wei Liu , Ian Jackson Subject: [Xen-devel] [PATCH 04/12 v3] 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 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 Acked-by: Wei Liu Acked-by: Stefano Stabellini --- 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_create.c | 2 ++ tools/libxl/libxl_internal.h | 3 +++ tools/libxl/libxl_types.idl | 7 +++++++ tools/xl/xl_console.c | 4 +++- tools/xl/xl_parse.c | 8 ++++++++ 7 files changed, 32 insertions(+), 1 deletion(-) 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_create.c b/tools/libxl/libxl_create.c index bffbc45..29daa35 100644 --- a/tools/libxl/libxl_create.c +++ b/tools/libxl/libxl_create.c @@ -918,6 +918,8 @@ static void initiate_domain_create(libxl__egc *egc, goto error_out; } + state->config.console_domid = state->console_domid; + ret = libxl__domain_make(gc, d_config, &domid, &state->config); if (ret) { LOGD(ERROR, domid, "cannot make domain: %d", ret); diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h index 5d082c5..4e2c247 100644 --- a/tools/libxl/libxl_internal.h +++ b/tools/libxl/libxl_internal.h @@ -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, diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl index 2204425..f5dc62c 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, "pl011"), + ]) + # # Complex libxl types # @@ -470,6 +476,7 @@ libxl_domain_build_info = Struct("domain_build_info",[ ("disable_migrate", libxl_defbool), ("cpuid", libxl_cpuid_policy_list), ("blkdev_start", string), + ("vuart", libxl_vuart_type), ("vnuma_nodes", Array(libxl_vnode_info, "num_vnuma_nodes")), diff --git a/tools/xl/xl_console.c b/tools/xl/xl_console.c index 0508dda..6f3cd7f 100644 --- a/tools/xl/xl_console.c +++ b/tools/xl/xl_console.c @@ -34,8 +34,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: pv, serial, vuart\n"); return EXIT_FAILURE; } break; diff --git a/tools/xl/xl_parse.c b/tools/xl/xl_parse.c index 856a304..504ca7c 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->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