From patchwork Tue Jun 6 17:25:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupinder Thakur X-Patchwork-Id: 103182 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp1536791qgd; Tue, 6 Jun 2017 10:28:06 -0700 (PDT) X-Received: by 10.36.209.70 with SMTP id w67mr19149013itg.68.1496770086359; Tue, 06 Jun 2017 10:28:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496770086; cv=none; d=google.com; s=arc-20160816; b=MUAYe5AIIP0mCY7SFzKX6qR4dtiFbdqE7gaz9sfWhVFVjvyfRMbTiaxReg//IrSzj/ SKrekLWoB+yW74umQT1kMa8eHzVE91wc5/jWz2vs14rkXTTmOjyvKvfLoMbzOzFrSWTo 1+0+Rf5/2noI9lgIX9JS9RFBtGp32paPZTQOPjr5jzPayj4GeHRtW4casY9M5vCudMEP eSDnFqgpo2aFXvuxkDzEIZPzWUfnIWztj3iekwId7XPYPJZN3Xum6cqaaU3w5MBPxcDT ABo4X3V0ULvSGr5c/SSt5p3uwle+T1N00g+vu4hhapJRER4xdTcYGLbeDavzS+gl6XBZ PpdA== 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=BIYtki685oTQ9nXom6sG6cmGfk4bgna+9r6Cqq6MnSE=; b=zm14fZziMoF1BK1cbwoP4ysKTortuyQSYq9c4mGUPi/2EovH3aUGL6ZUCi5Aqp68IO 9leib+9nT2Ue92OijGQ8MofmLrPmtzfuRJdNEAJ054GZltyphySO5Id2OUsL2rDGUrJ4 XJCuz3rDMdmmSy4fyXmuePi60jtnrrgYSZXxlzuYMUYdOjHRWDhpbC3nEVU4ezb7PSoW j5lmUKxCg3uGjYXWsFRCvRJ2fjKTFsZkd75bIki9K+oERQVNE7ZGnLYXTOPqF8nPuvMz D9tESrWK0kKiISSf2fyHc5qohOnIZr4qVI+LTGiMLJzltRjwD8E4aw8ZHsbP3gUNu5sU xYdA== 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 g16si4555902iod.30.2017.06.06.10.28.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Jun 2017 10:28:06 -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 1dIIFD-0001yB-HJ; Tue, 06 Jun 2017 17:26:15 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dIIFB-0001wE-RX for xen-devel@lists.xenproject.org; Tue, 06 Jun 2017 17:26:13 +0000 Received: from [193.109.254.147] by server-2.bemta-6.messagelabs.com id 2F/84-03058-5B5E6395; Tue, 06 Jun 2017 17:26:13 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrGIsWRWlGSWpSXmKPExsXiVRusqbvlqVm kwd85Khbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8bWhoXsBfckKyb8OM3WwHhXpIuRi0NIYDqj xKwVi9lAHBaBecwS90+8ZQVxJAT6WSV+Hexm6mLkBHLSJL40vGaGsCslJm48wAZiCwloSRw9N ZsVYlQzk8TGz/1ADgcHm4CJxKwOCZAaEQEliXurJjOB1DALzGeUaJrUC9YsLBAj0di7E2wBi4 CqxLrfz1lAenkFfCQuv9eH2CUncfNcJ9heTqDwzPNLGCH2ekvsaWhjnMAosICRYRWjRnFqUVl qka6hsV5SUWZ6RkluYmaOrqGBmV5uanFxYnpqTmJSsV5yfu4mRmBoMQDBDsYvywIOMUpyMCmJ 8kZeMosU4kvKT6nMSCzOiC8qzUktPsQow8GhJMEb+QQoJ1iUmp5akZaZAwxymLQEB4+SCO/kB 0Bp3uKCxNzizHSI1ClGY44Nq9d/YeKYdGD7FyYhlrz8vFQpcd4VIJMEQEozSvPgBsGi7xKjrJ QwLyPQaUI8BalFuZklqPKvGMU5GJWEeVNApvBk5pXA7XsFdAoT0Cl8l0xATilJREhJNTCyaYe vSbh451xu8vEZG6S38iWLOB0338o14eu1fRxaxzYJaqubxr/YGdh04izXOofjfafnF5gLnZne NOXYoc2m1WqeoVrG67Pkdj7zjHTzmVL1wEhRrfDQNvbXy7aLsTP4VdZf3/reLuR0necF229/u pjqljt+Zr0UYWBQNrdIr/5v5degK4JKLMUZiYZazEXFiQDN/7RzuQIAAA== X-Env-Sender: bhupinder.thakur@linaro.org X-Msg-Ref: server-4.tower-27.messagelabs.com!1496769971!105565060!1 X-Originating-IP: [74.125.83.41] 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 45694 invoked from network); 6 Jun 2017 17:26:12 -0000 Received: from mail-pg0-f41.google.com (HELO mail-pg0-f41.google.com) (74.125.83.41) by server-4.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 6 Jun 2017 17:26:12 -0000 Received: by mail-pg0-f41.google.com with SMTP id k71so4106554pgd.2 for ; Tue, 06 Jun 2017 10:26: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=B/JKyaOTk1zL9Z1BOSMDLeQPFHejwUPS/Kszi0QR7RA=; b=ICwk9O9l6k+ePJQI21Xz5RM/2yWEXEjmrpfq3jZsEN1MxV+VjdLjXDDM5KxvAmxVdO sNci5E7jze76uu6CICtra0RhxkQxzxR7ZGVS6xmRp1Uk2javhg5WNVFfEZAO0k93gcZf 31C3RcirZdEXW7J6UlhB87gx86meFGtGCjixY= 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=B/JKyaOTk1zL9Z1BOSMDLeQPFHejwUPS/Kszi0QR7RA=; b=f1bv0Y3RlD/mVBdEQoLkh6NkZJ0Xz3O2kXWAYqj7tURIVRs0FIT3vNBrYbY90peSrX 8i+9MUuHz8zeMmzaOSCFgqfMCfDi2LKJl1XliYzdL768Wt3MdqLFRqRVfH3l1ZyfABZg G/ZyvnJcIESsO4+fU5EOjGbOcNK8tyWDa/hVkLmU9h8drqDoNpE3Fkv4U2Za4jnwVvJE /db90QYfKqDeFLjBwG9WAJ7zXRWWxatud72fkt2KBom/gDUyWrsdrRxN12oo/ou99Wfy M3I1gKmZKZqr/q5DZsSk5D5g+Holb4V/44f5lc6EarOfk1tVg5EVcNUHkDT55+tbAR7b eYgA== X-Gm-Message-State: AODbwcAPBsASCQa2ikSSTPf5Dfualq+AsuHZJPIqpdPZmVmrc8j6LMrU oVilHN7rzEdHXpMu0zggmQ== X-Received: by 10.84.130.67 with SMTP id 61mr22595103plc.150.1496769970860; Tue, 06 Jun 2017 10:26:10 -0700 (PDT) Received: from blr-ubuntu-linaro.wlan.qualcomm.com ([103.5.19.18]) by smtp.gmail.com with ESMTPSA id 62sm6031632pfr.90.2017.06.06.10.26.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 06 Jun 2017 10:26:10 -0700 (PDT) From: Bhupinder Thakur To: xen-devel@lists.xenproject.org Date: Tue, 6 Jun 2017 22:55:27 +0530 Message-Id: <1496769929-23355-13-git-send-email-bhupinder.thakur@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1496769929-23355-1-git-send-email-bhupinder.thakur@linaro.org> References: <1496769929-23355-1-git-send-email-bhupinder.thakur@linaro.org> 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 --- CC: ij CC: wl CC: ss CC: jg 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