From patchwork Mon Aug 28 08:56:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupinder Thakur X-Patchwork-Id: 111123 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp4548201qge; Mon, 28 Aug 2017 01:58:59 -0700 (PDT) X-Received: by 10.36.163.140 with SMTP id p134mr5913823ite.64.1503910739617; Mon, 28 Aug 2017 01:58:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503910739; cv=none; d=google.com; s=arc-20160816; b=Rp6wYHPsNYnjldQYNn5KKe3zrIak7A4rmDAQ6+oy8F9S5Mic9/FFtBWQ1sfLiYnu1K /ZEyZgGag4esxDmUV4hYgbfSe5WBF6UvbpLl04dP7kculS0ZPJIN/KZSul8VAVi1pjGy 703ObPhn5OtQa6KvVixYtgKgBcHXluh56ZO1IQ7r/KX4ax2Q0GbuXGFhS0eYR3FvKGux yKOMTr01ZPddJaehT/SiapdyKI3SAv5ENy+dB3+deWkv4fovuqbMt1FtmDiRqCOqWxha yKmTfEybDp1ynpNrJcSleQjdNawE3Hb2GcCjvPVJNdsaK2zG2EImg1uc0bV1ZGt0KvyI YcwQ== 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=pJyNIWfhAVo2E2CgMcfI/HHFeP51uQR9/ksH+7RgARQ=; b=sRxX4cyNUBYEkLQbQfr1K4f/P/ykWaImLRPK555q28KMM3XR5bRIRJ0tkxy7TjCTCM 6k0kwPDHPbvw2Gc5IkLq6rQovjP2tRALZ5WUirwOybzgz2D/s85nB32qdae1fVmOrC32 uxD9jdJZx4wyS/O4ysXRjrgHjDTMmYVfYjXwt4GZZZmYv6udqq9dt97iL8V7l70yDDZF TYOO5sZSAua/dnZ9rQaubwtqDcp26Ge7n8pFHm9UI/51WdYKRjwuaqSWg98VeLcBjxKB t2C7HzNx/0OJpWyYgLI0N5p/8r/9eDigOIQ6o2dF1VUeWduO2ejMg3MQOROpQtyAQUSb /pSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=A7kLQhVL; 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 n63si12137480iod.303.2017.08.28.01.58.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Aug 2017 01:58:59 -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.s=google header.b=A7kLQhVL; 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 1dmFrY-0005uu-UK; Mon, 28 Aug 2017 08:57:40 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dmFrX-0005s9-DL for xen-devel@lists.xenproject.org; Mon, 28 Aug 2017 08:57:39 +0000 Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id B7/19-01994-20BD3A95; Mon, 28 Aug 2017 08:57:38 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprHIsWRWlGSWpSXmKPExsXiVRusq/v/1uJ Ig81XWSy+b5nM5MDocfjDFZYAxijWzLyk/IoE1ozGWavZCy6LVpxbuoG9gXG2YBcjF4eQwHRG iXNnFjKCOCwC85glnn25CuZICPSzSpzpOQfkcAA5aRKbd9p1MXICmVUSj7dPZQSxhQS0JI6em s0KMWk/k8T0CXdYQOrZBEwkZnVIgNSICChJ3Fs1mQmkhllgPqNE06ReNpCEsECMxO35H5hBbB YBVYkra+aD9fIK+EhMfpQMsUtO4ua5TrASTqDwjrV32SH2ekt0vf7AOoFRYAEjwypG9eLUorL UIl0jvaSizPSMktzEzBxdQwNTvdzU4uLE9NScxKRiveT83E2MwLBiAIIdjN//OB1ilORgUhLl 3VmxOFKILyk/pTIjsTgjvqg0J7X4EKMMB4eSBO+Zm0A5waLU9NSKtMwcYIDDpCU4eJREeD+Ap HmLCxJzizPTIVKnGHU5Jh3Y/oVJiCUvPy9VSpz3IUiRAEhRRmke3AhYtF1ilJUS5mUEOkqIpy C1KDezBFX+FaM4B6OSMO9fkCk8mXklcJteAR3BBHSEouBCkCNKEhFSUg2Mkmwf92xYvfzZgW4 fjwmlIpyMe6yvxkqe1EqRD0+tFnS83LZlqX7GjWlWix42Xs86/mRex18Vt+IFW5xlj6oeNG/g +uPdPyWTLWx1W8jbA9MfTi/96cEt8be058/i9TuqQvS0LiycfrLnaXIhn+u3NYuO/t2QqXGO+ +68GGE2/Y0+Jm3Nb/t3KLEUZyQaajEXFScCAP+h5zmxAgAA X-Env-Sender: bhupinder.thakur@linaro.org X-Msg-Ref: server-14.tower-206.messagelabs.com!1503910653!70320157!1 X-Originating-IP: [74.125.83.45] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 64234 invoked from network); 28 Aug 2017 08:57:34 -0000 Received: from mail-pg0-f45.google.com (HELO mail-pg0-f45.google.com) (74.125.83.45) by server-14.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 28 Aug 2017 08:57:34 -0000 Received: by mail-pg0-f45.google.com with SMTP id 63so22245386pgc.2 for ; Mon, 28 Aug 2017 01:57:34 -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=HWroLNIkhQjYUcAWyd7ghBserWIB9IYYwUwfhZwGLVc=; b=A7kLQhVLzwmJ68Agz3vBd2BRWmjq3FEfUHoFsAaVhNL+nTqQ2nMSYInvwF8dmtd6us 3M2qCFjFN/kWPu3cpPU/YeI7vFjh7YGHLULJ9vYlL7XnaDB773vzBcuGFWdPR0bwen8q a9Z3EJYeH6QaWFMMkzbF53hNOZ8+NCDhWcN6I= 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=HWroLNIkhQjYUcAWyd7ghBserWIB9IYYwUwfhZwGLVc=; b=GfFg4aIngJkA/yduBVRC9dmFC1clfxq41j3mGBxHLsSNN5jI25j/dB63oKph8Fxjqn hsZOTh/NDJda7b+S4H+SxCzkyFyO9fdJ6E0MxPZQKk3qzASlDR9RFnZH/xGIoPKv8t+F M8Nk9CN/6d+HFJW9D6KrsZ0b9ZffMgyCys3E6hvkKbcxmcYp9763qgzeoW7ku8mS79Bc YGWSuV/4cmRN6m84crJkKf/yvVeX2Q5+Q7oEPipDDWTVwMPvR74YN6PUwMg0CVW3uSdX fIYmtW4xQ4jpxhdQh+xTsZ1/Iu77MUzZdWbhPRX8lRUEk46Y86noQh7H6zzYcUE4NQUZ m7Fg== X-Gm-Message-State: AHYfb5jyOX8B1sfmyYRwnPPIvCQFgRbswVnTbwIrvL4Q4K3uGzdckvsC 7AjGBcacg3p7lL/S1Lhddw== X-Received: by 10.98.198.210 with SMTP id x79mr6700743pfk.115.1503910653261; Mon, 28 Aug 2017 01:57:33 -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 d88sm21713569pfl.158.2017.08.28.01.57.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 28 Aug 2017 01:57:32 -0700 (PDT) From: Bhupinder Thakur To: xen-devel@lists.xenproject.org Date: Mon, 28 Aug 2017 14:26:06 +0530 Message-Id: <1503910570-24427-24-git-send-email-bhupinder.thakur@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503910570-24427-1-git-send-email-bhupinder.thakur@linaro.org> References: <1503910570-24427-1-git-send-email-bhupinder.thakur@linaro.org> Cc: Wei Liu , Julien Grall , Stefano Stabellini , Ian Jackson Subject: [Xen-devel] [PATCH 23/27 v8] xen/arm: vpl011: Add a new vuart console type to xenconsole client 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" Add a new console type VUART to connect to guest's emualated vuart console. Signed-off-by: Bhupinder Thakur Reviewed-by: Stefano Stabellini Acked-by: Wei Liu --- CC: Ian Jackson CC: Wei Liu CC: Stefano Stabellini CC: Julien Grall Changes since v4: - Removed the vuart compile time flag so that vuart code is compiled always. Changes since v3: - The vuart console support is under CONFIG_VUART_CONSOLE option. - Since there is a change from last review, I have not included reviewed-by tag from Stefano and acked-by tag from Wei. tools/console/client/main.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tools/console/client/main.c b/tools/console/client/main.c index c340cb7..f92ad3d 100644 --- a/tools/console/client/main.c +++ b/tools/console/client/main.c @@ -76,7 +76,7 @@ static void usage(const char *program) { "\n" " -h, --help display this help and exit\n" " -n, --num N use console number N\n" - " --type TYPE console type. must be 'pv' or 'serial'\n" + " --type TYPE console type. must be 'pv', 'serial' or 'vuart'\n" " --start-notify-fd N file descriptor used to notify parent\n" , program); } @@ -264,6 +264,7 @@ typedef enum { CONSOLE_INVAL, CONSOLE_PV, CONSOLE_SERIAL, + CONSOLE_VUART, } console_type; static struct termios stdin_old_attr; @@ -344,6 +345,7 @@ int main(int argc, char **argv) char *end; console_type type = CONSOLE_INVAL; bool interactive = 0; + char *console_names = "serial, pv, vuart"; while((ch = getopt_long(argc, argv, sopt, lopt, &opt_ind)) != -1) { switch(ch) { @@ -359,9 +361,12 @@ int main(int argc, char **argv) type = CONSOLE_SERIAL; else if (!strcmp(optarg, "pv")) type = CONSOLE_PV; + else if (!strcmp(optarg, "vuart")) + type = CONSOLE_VUART; else { fprintf(stderr, "Invalid type argument\n"); - fprintf(stderr, "Console types supported are: serial, pv\n"); + fprintf(stderr, "Console types supported are: %s\n", + console_names); exit(EINVAL); } break; @@ -437,6 +442,10 @@ int main(int argc, char **argv) else snprintf(path, strlen(dom_path) + strlen("/device/console/%d/tty") + 5, "%s/device/console/%d/tty", dom_path, num); } + if (type == CONSOLE_VUART) { + snprintf(path, strlen(dom_path) + strlen("/vuart/0/tty") + 1, + "%s/vuart/0/tty", dom_path); + } /* FIXME consoled currently does not assume domain-0 doesn't have a console which is good when we break domain-0 up. To keep us