From patchwork Mon Sep 18 10:32:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupinder Thakur X-Patchwork-Id: 9956377 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 2DF4C60208 for ; Mon, 18 Sep 2017 10:35:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D6BF28C09 for ; Mon, 18 Sep 2017 10:35:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 124D328C17; Mon, 18 Sep 2017 10:35:25 +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 AD71328C4E for ; Mon, 18 Sep 2017 10:35:24 +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 1dttMo-0002lj-UI; Mon, 18 Sep 2017 10:33:30 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dttMn-0002jV-UV for xen-devel@lists.xenproject.org; Mon, 18 Sep 2017 10:33:30 +0000 Received: from [85.158.137.68] by server-11.bemta-3.messagelabs.com id AD/AE-01812-9F0AFB95; Mon, 18 Sep 2017 10:33:29 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrGIsWRWlGSWpSXmKPExsVyMfTAZt0fC/Z HGvx6J2nxfctkJgdGj8MfrrAEMEaxZuYl5VcksGY0zlrNXnBZtOLc0g3sDYyzBbsYuTiEBKYx Skw5spwJxGERmMcs8ezCAlYQR0Kgn1Xi0dq9QBlOICdN4lvnYpYuRg4w+9kXHohwlcTz5yfZQ GwhAS2Jo6dms0JM3cEk0TC9jwmknk3ARGJWhwRIjYiAksS9VZPBljELzGeUaJrUC9YsLBAj8X f+b1aQehYBVYnfV/1AwrwCPhKvF7axQOySk7h5rpMZxOYEip9f/4AVYq+3xLxfVxgnMAouYGR YxahenFpUllqka6yXVJSZnlGSm5iZo2toYKyXm1pcnJiempOYVKyXnJ+7iREYbgxAsIOx+YvT IUZJDiYlUV7RyP2RQnxJ+SmVGYnFGfFFpTmpxYcYZTg4lCR4380HygkWpaanVqRl5gADHyYtw cGjJMKbAgx+Id7igsTc4sx0iNQpRkuOC3cu/WHiOLDnFpDsuHn3D5MQS15+XqqUOMQ8AZCGjN I8uHGw6LzEKCslzMsIdKAQT0FqUW5mCar8K0ZxDkYlYV45kLU8mXklcFtfAR3EBHRQy449IAe VJCKkpBoYZ2y+uVtx95Il57K7D65YkPh9T7OFHet6g7+HZ16On7K9d1a6U//SlkOnpq/0u+4m UJkQP8mSQVJjZ6frrKv1DkIanG5bXq23FD6hfaeU/2vTokTVlKYDlx6nfHm31qnT6py3nC/T0 pbgbAdVuUc3j5XxN3Q7P3vQk1eY6n24Q0vCOb7yqbauEktxRqKhFnNRcSIA96s3kckCAAA= X-Env-Sender: bhupinder.thakur@linaro.org X-Msg-Ref: server-14.tower-31.messagelabs.com!1505730807!115127721!1 X-Originating-IP: [209.85.192.179] 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 62668 invoked from network); 18 Sep 2017 10:33:28 -0000 Received: from mail-pf0-f179.google.com (HELO mail-pf0-f179.google.com) (209.85.192.179) by server-14.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 18 Sep 2017 10:33:28 -0000 Received: by mail-pf0-f179.google.com with SMTP id q76so35570pfq.2 for ; Mon, 18 Sep 2017 03:33:28 -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=H229b+2Jdrk+ZMUQ5y+af84pyXhM8Ix2mUUnjnewhYS4qDQB2u7to6t8XrMNREXXBA IzZQb+dQsv7zdw1btt6DgHSd74WSZGO//RSHDQa2s+JZwR55eczi2r2ZJjED0nYQ2Ntp 3ezMkyQq6uUrEPIiR+cPSEh7wWgj6iJ4xhViE= 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=ju2cZJL8kG6ApOvbCHNP73j6kK3ZZdmixcsx+9pTGxnjV6louwY/ibTVt3sQvBmS/X q7rJtniFI04SuR9qRX2Qkg/Rpj3XSL5ld4x29HgwG3pITFC6OPfXwbVrutkguq+resxh 3OPDgTQz45kLd/64HjRNS7f8uGnTglRlVj9r1KXppS7Jg6t2zqWvfEoC8cMRC9Bcq+LL 0aW+Bw8eDldPemaCikZaJbtU8daptAJNI2Lr2HacswcYLv9fGcT3Pi/83/KVXfWqi03X h92es7RzKWXOtO4SMycVoom4GZfJojnxqO8UqTDMX0cpFllk1v8C2DViV1iOUArXCIbU lhag== X-Gm-Message-State: AHPjjUgUmYqo9OC2K8cn9Nkzvld/W6Se2EQDv5uw0Rpp8+PrMa47AVHH pktrU1nXQcOzfpt3rAbm+w== X-Google-Smtp-Source: ADKCNb6fmhoJ4RDwxMiqrPJNREouD+kA2mDiUMPanrxVvzhcz84IHdcIaQ2i0zjhyqc/S5uZ1+/POg== X-Received: by 10.99.117.91 with SMTP id f27mr31357575pgn.376.1505730806723; Mon, 18 Sep 2017 03:33:26 -0700 (PDT) Received: from blr-ubuntu-linaro.qualcomm.com (blr-bdr-fw-01_globalnat_allzones-outside.qualcomm.com. [103.229.18.19]) by smtp.gmail.com with ESMTPSA id b7sm12937845pge.79.2017.09.18.03.33.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 18 Sep 2017 03:33:26 -0700 (PDT) From: Bhupinder Thakur To: xen-devel@lists.xenproject.org Date: Mon, 18 Sep 2017 16:02:07 +0530 Message-Id: <1505730731-10947-24-git-send-email-bhupinder.thakur@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1505730731-10947-1-git-send-email-bhupinder.thakur@linaro.org> References: <1505730731-10947-1-git-send-email-bhupinder.thakur@linaro.org> Cc: Wei Liu , Julien Grall , Stefano Stabellini , Ian Jackson Subject: [Xen-devel] [PATCH 23/27 v9] 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