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: 9844957 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A3AA76037F for ; Mon, 17 Jul 2017 13:10:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9649F284FF for ; Mon, 17 Jul 2017 13:10:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8B04128503; Mon, 17 Jul 2017 13:10:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_SPAM, RCVD_IN_SORBS_WEB, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 34213284FF for ; Mon, 17 Jul 2017 13:10:06 +0000 (UTC) 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" X-Virus-Scanned: ClamAV using ClamSMTP 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