From patchwork Mon Jul 17 13:06:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupinder Thakur X-Patchwork-Id: 107954 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp4495437qge; Mon, 17 Jul 2017 06:09:39 -0700 (PDT) X-Received: by 10.36.86.139 with SMTP id o133mr5266200itb.50.1500296979514; Mon, 17 Jul 2017 06:09:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500296979; cv=none; d=google.com; s=arc-20160816; b=JOhZp94RWBU+fFYqYj9AR6ccqfpvuAwmI35u4UQ8psKoMBubKksdTwUduPhvdZHHj7 jq9NeYtqFlEPvRfhP3oUMACaLPDiPM+OWrxp4kTn0//O8wn2bZemxUJ3ZV+rKr0W8jfd Cyk8Bg1p1GulLH6b73zPnJr+bHXSLrq1V8JdjKlxD5x1JPz/z82Srbb0DzXgiE03I0dn IVHTRVA/VMqW4K0mfAOyn4N8tVWmcF36QIJcrH/krogCPoTak2tAsLqAiEobU4n/p/KF 9Qtc3QJl3giHEHF0RsX+ysGe6QnyTmWbxrIxN7Fz+y+eNLGExQW4Y+/LYugF9GojQ28M R7fA== 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=8BGq/DBn8VTv/hjSG7e/HGS6h2bkqgmm8FvySAO4c4s=; b=FiRnkgB5e/Yhmc/qlAu7Ag8U6jnuYr+oA/XCkrBjAXJ0jmRshi0dmx//XlpQ0+e9IY 24izqAhyk1WtHWo4Q9cdexdm2gNyLHJS51I73XfpoTCP+rBamDoIYnsLRofCK79+jIEb yxHC0FepA10ryH3mdmpYrS5ortInwtsXV+IgOdYu6e+/2AhcHjWLOyf3nGl42bwNxdpM mbQX9B/Sr1uVb6SmTIHNgnXGhqt74+aSKOCxJWx4XKYSmo71Rx151mwJ4MSK33/LeFMY h1zk9imInTsNXNL2o8ovOqIPU/6S///HuCPKDMIEdVm5h7HeRWxRYZz0Mgjq9ZGSA/zO RSSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=RhB0U9v4; 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 5si9686691itj.50.2017.07.17.06.09.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Jul 2017 06:09:39 -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=RhB0U9v4; 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 1dX5l1-0005DR-Lh; Mon, 17 Jul 2017 13:08:15 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dX5l0-0005Al-AO for xen-devel@lists.xenproject.org; Mon, 17 Jul 2017 13:08:14 +0000 Received: from [85.158.139.211] by server-6.bemta-5.messagelabs.com id 99/5F-02175-DB6BC695; Mon, 17 Jul 2017 13:08:13 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrKIsWRWlGSWpSXmKPExsXiVRtsqLt3W06 kwYMtjBbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8aC9qvsBcdEK9YdWsXSwDhZsIuRi0NIYDqj xOY5u5hAHBaBecwS7378ZgFxJAT6WSUWrbjO1sXICeSkSUx8uIMVwq6SODPxD5gtJKAlcfTUb FaIUa1MEjca+4EaODjYBEwkZnVIgNSICChJ3Fs1GWwDs8B8RommSb1gNcICMRL7u9JBalgEVC WaP7xmBrF5BXwkds7dxwyxS07i5rlOMJsTKH5mw2omiL3eEjePTGSawCiwgJFhFaN6cWpRWWq RrpFeUlFmekZJbmJmjq6hgalebmpxcWJ6ak5iUrFecn7uJkZgYDEAwQ7G73+cDjFKcjApifJe ZMuOFOJLyk+pzEgszogvKs1JLT7EKMPBoSTB6741J1JIsCg1PbUiLTMHGOIwaQkOHiUR3q0ga d7igsTc4sx0iNQpRmOOSQe2f2HieDXh/zcmIZa8/LxUKXFePZBSAZDSjNI8uEGw2LvEKCslzM sIdJoQT0FqUW5mCar8K0ZxDkYlYd7lIFN4MvNK4Pa9AjqFCegUYV+wU0oSEVJSDYwhEcY3dVl fcppkHWj51O7W81jYeFn/tT2KbG+vX+Zmj9BoYmVs3r7AK+T+fSWhhwHLeCs52G042EPzF7Sk rT5tmGpwjm02h/y9VbqZNqu7tOdd/HHiK5/LfTEtbVV/n3dJu591dmYd6p1yOz/gU+0GHmnpJ dujmlNUV8+4sLGi3f1M4L8HhUosxRmJhlrMRcWJAGjYCGO4AgAA X-Env-Sender: bhupinder.thakur@linaro.org X-Msg-Ref: server-15.tower-206.messagelabs.com!1500296891!89221333!1 X-Originating-IP: [74.125.83.49] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.25; banners=-,-,- X-VirusChecked: Checked Received: (qmail 54464 invoked from network); 17 Jul 2017 13:08:12 -0000 Received: from mail-pg0-f49.google.com (HELO mail-pg0-f49.google.com) (74.125.83.49) by server-15.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 17 Jul 2017 13:08:12 -0000 Received: by mail-pg0-f49.google.com with SMTP id u5so17093502pgq.3 for ; Mon, 17 Jul 2017 06:08:12 -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=ephcjrO7kt4QMlplx6Rz9VJrp+MAMSYZdXySOrB8r5s=; b=RhB0U9v4JQdEpljt6BP2xxOnAAFO2kkYPN0wiwCB/n8TwNf2Z6ElRa9gYmElOjKHpB 2shNzaOta35ECs70qBONOTRO699hGG3mp/f54LaLL8O27XxzoBPY2yWJTzRBxeazvW6Q hZfY1ft9dJ3G6wh7BIi46G+VyDbgYGK58EGOo= 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=ephcjrO7kt4QMlplx6Rz9VJrp+MAMSYZdXySOrB8r5s=; b=Fh4cUEQt9MH+daCut3fLSHMj1hY6rE2jlixHOkebdXOFRgQPPG+m6ohtFr+Ft+XDBp 9gQzfsUNvalMl9amCEb8Pop8VnQc428lb7wJ9zSvDtAQDOnGmxmZhBXnwo4q8ClHWVVa 1uvPM/9mVhNueRQNpwEQiWB83LWc9kzsHwrREEZfQ9XLGChtjwZL2wqJOaJxWuQ3iN7v zEDjACzFV3/6IA0WU9Ne1br4JWBAhHuI7sCSQkg59OnveTgsQ1t41fBez5FETf4MSfFz jBzXPunv5htnHqBidghJQqVZL6wRRzgO6G8neDBNKjesSU0ZURu8CFOVeRvnplEL/62W UAfQ== X-Gm-Message-State: AIVw1107/Ru9NUCj05/AYodbOsoD0nhRHU81o3YkbEuawKe89bdKgYvp ZNePxZ+Cm94g/6mDktYn0w== X-Received: by 10.98.26.211 with SMTP id a202mr19411858pfa.30.1500296891263; Mon, 17 Jul 2017 06:08:11 -0700 (PDT) Received: from blr-ubuntu-linaro.wlan.qualcomm.com ([103.5.19.18]) by smtp.gmail.com with ESMTPSA id z69sm15705665pgz.42.2017.07.17.06.08.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Jul 2017 06:08:10 -0700 (PDT) From: Bhupinder Thakur To: xen-devel@lists.xenproject.org Date: Mon, 17 Jul 2017 18:36:53 +0530 Message-Id: <1500296815-10243-24-git-send-email-bhupinder.thakur@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1500296815-10243-1-git-send-email-bhupinder.thakur@linaro.org> References: <1500296815-10243-1-git-send-email-bhupinder.thakur@linaro.org> Cc: Wei Liu , Julien Grall , Stefano Stabellini , Ian Jackson Subject: [Xen-devel] [PATCH 23/25 v6] 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 977779f..f7139b3 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; @@ -343,6 +344,7 @@ int main(int argc, char **argv) char *end; console_type type = CONSOLE_INVAL; bool interactive = 0; + char *console_names = "serial, pv, vuart"; if (isatty(STDIN_FILENO) && isatty(STDOUT_FILENO)) interactive = 1; @@ -361,9 +363,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; @@ -436,6 +441,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