From patchwork Tue Jun 6 10:04:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupinder Thakur X-Patchwork-Id: 103154 Delivered-To: patch@linaro.org Received: by 10.182.29.35 with SMTP id g3csp1186416obh; Tue, 6 Jun 2017 03:06:54 -0700 (PDT) X-Received: by 10.36.124.67 with SMTP id a64mr16974244itd.25.1496743614819; Tue, 06 Jun 2017 03:06:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496743614; cv=none; d=google.com; s=arc-20160816; b=Y+2QFkfyXHgkRmfCUtlSsaf49daar4Q1T4aFVR614c4C9/mdHhOJkqecfcLVShg4Jm H9LtkSChkJRHHZ7ImFeq0pDLFcyC8uVTSRf6YwIGunnRCAftW8WkbEjhB9L0Kxa907L/ jFBf4xfk3DrsiK0H6V4EYhbA3JEDlyjYzy2tmGp5fEHdyzWCF/cjA2cYYJWDIVIMm49c nUJ6lbS2VqzYyp8cX1TBrhHW/Sj60bTUMNdeenhBWsxN1bq45o/6vZbjjJGC+sriIpnB 4uWYkLxMyLoaoOxE6MquRtIt05ti9TKKud2R9pXpO77oocY6ibx4I8IqxBVoB/dL9bbo jsJA== 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:message-id:date:to:from:dkim-signature :arc-authentication-results; bh=mSWlnTsgKvrE/LqP4qvd1pY7q4Mhm5nWOkg0yMNYRlM=; b=MSorlfJlLZjdPRiGI3pdWpNXgkv6IMTr3EJ7oQrJGf4VdWLxAozoLi46rskxaqvqSH o1GImISsMajk0QFUrR5eguBefAUPwZIuLrDRedgzGkzDiWCmVqwxAyw3JPtUs5G/ByvY 9d7Qb9onFk5GZq/oIheFUWN8J5Y6+jCg8/9qub/egUf7QM5X5LI61CxPt4fOPIOfchqF qnwc1Fje5CDkUWK27sc2lJJNpeK4hSxt4eSfXqYfvn4u/N6WAN9vNzEgLCEX7N1qBDSm VYye8JUrMI3tAW4Q0HLI/A+g7LS/imk8GT1bHP5k2g53DeVci8WZ1S3lyGJCLBkhMbop SSjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; 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 z199si14220775itb.85.2017.06.06.03.06.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Jun 2017 03:06:54 -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; 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 1dIBM6-0004Jd-C4; Tue, 06 Jun 2017 10:04:54 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dIBM5-0004Iy-7Y for xen-devel@lists.xenproject.org; Tue, 06 Jun 2017 10:04:53 +0000 Received: from [85.158.137.68] by server-9.bemta-3.messagelabs.com id F5/72-26749-44E76395; Tue, 06 Jun 2017 10:04:52 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprKIsWRWlGSWpSXmKPExsVyMfTAal2XOrN Ig4X/GS2+b5nM5MDocfjDFZYAxijWzLyk/IoE1oy95x6zFRySrLj+ajZbA+NJkS5GLg4hgZmM Ei+37GcGcVgE2pkl7v9/ww7iSAi8Y5F4tusnUIYTyEmT2H9iAiOEXSaxtHEFC4gtJKAlcfTUb FaIUXuZJJbcP8HUxcjBwSZgIjGrQwKkRkRASeLeqslMIDXMAvMZJZom9bKBJIQFYiQae3cygd gsAqoSD27vBlvAK+AtMWvCMyaIZXISN891Mk9g5FvAyLCKUaM4tagstUjXyFwvqSgzPaMkNzE zR9fQwFgvN7W4ODE9NScxqVgvOT93EyMwWOoZGBh3MLbs9TvEKMnBpCTKW5tgFinEl5SfUpmR WJwRX1Sak1p8iFGGg0NJglegFignWJSanlqRlpkDDFuYtAQHj5IIr3IlUJq3uCAxtzgzHSJ1i tGS48qVdV+YODasXg8kpxzY/oVJiCUvPy9VSpyXA2SeAEhDRmke3DhYbF1ilJUS5mVkYGAQ4i lILcrNLEGVf8UozsGoJMz7rQZoCk9mXgnc1ldABzEBHcR3yQTkoJJEhJRUA+OkU5dl1SRXFv8 +ui/2tqftFPPcrRtUlAyl/zBsZsl961Eq5/S/5N8qHh8v+7CHnpZPG7u2qhguDnnwN184WJA1 b2eexL4fosfE3GpilmjsXS8wM+tt/PpTIqIb9mX/YeHfcWXObr3tBzd3cJ5R79g8PeeZumWPr 3TjHW0VCd/Vd7expc9Y+lWJpTgj0VCLuag4EQBTeD6WqAIAAA== X-Env-Sender: bhupinder.thakur@linaro.org X-Msg-Ref: server-5.tower-31.messagelabs.com!1496743490!101042020!1 X-Originating-IP: [209.85.192.171] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.19; banners=-,-,- X-VirusChecked: Checked Received: (qmail 47314 invoked from network); 6 Jun 2017 10:04:51 -0000 Received: from mail-pf0-f171.google.com (HELO mail-pf0-f171.google.com) (209.85.192.171) by server-5.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 6 Jun 2017 10:04:51 -0000 Received: by mail-pf0-f171.google.com with SMTP id l89so21934979pfi.2 for ; Tue, 06 Jun 2017 03:04:51 -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; bh=Yr9GFW60qCsEnh/qHxNyGdny33erUtflwSmcq7kDLj4=; b=G2b9oiCrYgMqTy9BxsrpNmXpY93utfQjuwuBEz2VItl8UGRpWgG8GD0AkOtaVnJqpg 39BdndfOm4q4dg1HC0U+D6L4l+BZinxyzwo/UgNWRFd+fIGzRh3MMFDCfn8aRIt1cPQs daxZrL9XFqVuvHFmIwvhN+U/BVoJsxkma5VCc= 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; bh=Yr9GFW60qCsEnh/qHxNyGdny33erUtflwSmcq7kDLj4=; b=aeRYPYAgLX7PSqLP8WTf31jLyERSn4mK5uwLXd15Xj7XRHO2PYmcP4wP8swufMSXkP Ol+WUnBLrzZpb1NxpCCbeftT7PjWM2Ou2l72rENedmF3wh/OVPM0WmGCXVjaH3zkT5BN 1u1gwvc3TNWNEfhjybg7BYOGEWuumEZByzOF4FLusCzHOgA8zgyOeYTMCkqSbMXRR0ia vjGfvbu82EXZeJFwFpKG2R69+kqzmCi0C0WpFKR0XaDuMLfY0E0QPj9Tmh1vkqG12n2p cFO3SB4L3Kk2tdBAqTi6bPgHMLKKSUgwvOEQ4F6AHThWNTb+LknDK1eN/K2TMjXmag3p 5sDw== X-Gm-Message-State: AODbwcCzbWtN2P1lAVzVpTiJFmeu+b9e5u++N3t7tD+eiE3agiHmJPke a3Mqsn4Ovh9bjXZEQcScGw== X-Received: by 10.99.65.7 with SMTP id o7mr24987565pga.90.1496743490075; Tue, 06 Jun 2017 03:04:50 -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 71sm38421389pgd.57.2017.06.06.03.04.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 06 Jun 2017 03:04:49 -0700 (PDT) From: Bhupinder Thakur To: xen-devel@lists.xenproject.org Date: Tue, 6 Jun 2017 15:34:44 +0530 Message-Id: <1496743484-16037-1-git-send-email-bhupinder.thakur@linaro.org> X-Mailer: git-send-email 2.7.4 Cc: Wei Liu , Julien Grall , Stefano Stabellini , Ian Jackson Subject: [Xen-devel] [PATCH 12/14 v4] 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 --- 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/Makefile | 1 + tools/console/client/main.c | 25 ++++++++++++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/tools/console/Makefile b/tools/console/Makefile index fcee313..49c02d4 100644 --- a/tools/console/Makefile +++ b/tools/console/Makefile @@ -34,6 +34,7 @@ xenconsoled: $(patsubst %.c,%.o,$(wildcard daemon/*.c)) $(CC) $(LDFLAGS) $^ -o $@ $(LDLIBS) $(LDLIBS_libxenevtchn) $(LDLIBS_libxengnttab) $(LDLIBS_xenconsoled) $(APPEND_LDFLAGS) client/main.o: client/_paths.h +client/main.o: CFLAGS += $(VUART_CFLAGS-y) xenconsole: $(patsubst %.c,%.o,$(wildcard client/*.c)) $(CC) $(LDFLAGS) $^ -o $@ $(LDLIBS) $(LDLIBS_xenconsole) $(APPEND_LDFLAGS) diff --git a/tools/console/client/main.c b/tools/console/client/main.c index 977779f..8d31fe9 100644 --- a/tools/console/client/main.c +++ b/tools/console/client/main.c @@ -76,7 +76,11 @@ static void usage(const char *program) { "\n" " -h, --help display this help and exit\n" " -n, --num N use console number N\n" +#ifdef CONFIG_VUART_CONSOLE + " --type TYPE console type. must be 'pv', 'serial' or 'vuart'\n" +#else " --type TYPE console type. must be 'pv' or 'serial'\n" +#endif " --start-notify-fd N file descriptor used to notify parent\n" , program); } @@ -264,6 +268,9 @@ typedef enum { CONSOLE_INVAL, CONSOLE_PV, CONSOLE_SERIAL, +#ifdef CONFIG_VUART_CONSOLE + CONSOLE_VUART, +#endif } console_type; static struct termios stdin_old_attr; @@ -343,6 +350,11 @@ int main(int argc, char **argv) char *end; console_type type = CONSOLE_INVAL; bool interactive = 0; +#ifdef CONFIG_VUART_CONSOLE + char *console_names = "serial, pv, vuart"; +#else + char *console_names = "serial, pv"; +#endif if (isatty(STDIN_FILENO) && isatty(STDOUT_FILENO)) interactive = 1; @@ -361,9 +373,14 @@ int main(int argc, char **argv) type = CONSOLE_SERIAL; else if (!strcmp(optarg, "pv")) type = CONSOLE_PV; +#ifdef CONFIG_VUART_CONSOLE + else if (!strcmp(optarg, "vuart")) + type = CONSOLE_VUART; +#endif 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 +453,12 @@ 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); } +#ifdef CONFIG_VUART_CONSOLE + if (type == CONSOLE_VUART) { + snprintf(path, strlen(dom_path) + strlen("/vuart/0/tty") + 1, + "%s/vuart/0/tty", dom_path); + } +#endif /* 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