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: 9924871 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 A4E6E60383 for ; Mon, 28 Aug 2017 08:59:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 95CBB28531 for ; Mon, 28 Aug 2017 08:59:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8AA5128671; Mon, 28 Aug 2017 08:59:27 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,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 2197028671 for ; Mon, 28 Aug 2017 08:59:27 +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 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" 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 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