From patchwork Mon Aug 7 08:53:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupinder Thakur X-Patchwork-Id: 109537 Delivered-To: patch@linaro.org Received: by 10.182.109.195 with SMTP id hu3csp2482107obb; Mon, 7 Aug 2017 01:56:01 -0700 (PDT) X-Received: by 10.36.7.65 with SMTP id f62mr175264itf.28.1502096161895; Mon, 07 Aug 2017 01:56:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502096161; cv=none; d=google.com; s=arc-20160816; b=UAqgOCIOMBXm6iBwtOXFzTRd+dBok+WGTRxZ8GugWJfK4na6591RX3t/Pnxh4INRRx RBMa+uaWib4yRqwUx8wcyZPoIV/7f5J2Pz2JL7eX2FPSOoEWisIVDFnJSRQEFZwn0/sW +nRHxQev09M79rJQaA2tqLWbqu4f6jMH51w9CD/VWM+zjiRRmFJLf6aA0SY+RzMzD1m8 GGiX7SGhio0beZpV7Q5zm7BZ+5KdiHxd0pusdcEl1BNCzqOnjLmKUnWjW3e0jSMgQr8m QS9tV3Z//V55N/8M01nByUKlgZEPdIo47V1ShlFIwchVZmmqi4aWumV1Dnqn/bdhXDH8 7law== 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=pJyNIWfhAVo2E2CgMcfI/HHFeP51uQR9/ksH+7RgARQ=; b=ja6Z6BexAER72TfQ9yEz2MJ0oIUfHNs0U1su+9WFsK+agtR7BOEmi6LGjojqHVRhgG dqFg0vOrFy9rBp8FuQoLVboTbg6FFLuzyreiAKnkFmIdWFBxG9neKRjii5kjbOWbIBQJ CKEOuZ50hTIjur/bgGmAiTCgxPHaNPaV5mb1oAnp4CtaIayrAS3boa+rFA7J14+0hnrt uRZqwKMaAiehCi3Cy9h/M85QJ2f8nLRPkjD2lgDjEaVoVNLRlV/8S2I2VHvs7y6Hj1SW s/aB0Ch0aznBqyB3nlwxFroX0jmFiy4dGj55Wd1i2CgKJMD5hWENrPWGnhi/2h3Iuoo7 l/8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=kGgfdwsE; 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 n102si8474829ioo.9.2017.08.07.01.56.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Aug 2017 01:56:01 -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 header.b=kGgfdwsE; 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 1dedoA-0005Sm-2S; Mon, 07 Aug 2017 08:54:42 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dedo8-0005Qi-SU for xen-devel@lists.xenproject.org; Mon, 07 Aug 2017 08:54:40 +0000 Received: from [193.109.254.147] by server-9.bemta-6.messagelabs.com id 63/2B-03406-0DA28895; Mon, 07 Aug 2017 08:54:40 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrCIsWRWlGSWpSXmKPExsXiVRtsqHteqyP S4OtrZYvvWyYzOTB6HP5whSWAMYo1My8pvyKBNaNx1mr2gsuiFeeWbmBvYJwt2MXIySEkMJNR 4uFV/S5GLg4WgXnMEk9e9DCBOBIC/awSk1+3AjkcQE6axJbtSiANEgLVEi3PJzFDNGtJHD01m xWkXkigjUli3+4ZYPVsAiYSszokQGpEBJQk7q2aDDaTWWA+o0TTpF42kISwQIzEzeuNjCA2i4 CqxLa+32A2r4CPxO31+9kglslJ3DzXCbaMEyh+/tIbFojF3hK3j/UxTmAUWMDIsIpRvTi1qCy 1SNdEL6koMz2jJDcxM0fX0MBMLze1uDgxPTUnMalYLzk/dxMjMKwYgGAHY/dl/0OMkhxMSqK8 8SvaIoX4kvJTKjMSizPii0pzUosPMcpwcChJ8CZodkQKCRalpqdWpGXmAAMcJi3BwaMkwvtCH SjNW1yQmFucmQ6ROsVozDHpwPYvTByvJvz/xiTEkpeflyolznsOZJIASGlGaR7cIFjkXWKUlR LmZQQ6TYinILUoN7MEVf4VozgHo5IwbxjIFJ7MvBK4fa+ATmECOuVNYivIKSWJCCmpBsbIPvN FK0/ds21quqD5e/k179Nr2b9OnjCDq+m0glt/AtukfwYnxFP5rI8ccq4PXvLp1NLsv8s9rDod np3bvlI+5pJPybIcx2YvX6PsqJW7rFe/MFh26W3i1XkzHf03LNQ+Mv/p9zfHC7dcduuMPtJtc ycny/xR88vd3Y+X3zxwPTOtqLVPJG+GEktxRqKhFnNRcSIA/01g5bcCAAA= X-Env-Sender: bhupinder.thakur@linaro.org X-Msg-Ref: server-16.tower-27.messagelabs.com!1502096078!110307531!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.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 4982 invoked from network); 7 Aug 2017 08:54:39 -0000 Received: from mail-pg0-f49.google.com (HELO mail-pg0-f49.google.com) (74.125.83.49) by server-16.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 7 Aug 2017 08:54:39 -0000 Received: by mail-pg0-f49.google.com with SMTP id y129so31673896pgy.4 for ; Mon, 07 Aug 2017 01:54:39 -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=kGgfdwsE9sqNvN/buQoPv1v1h81W6ainbfNSL9O5djLbY0ZlVDcO9UHCal/XwAK3va 20hOVCzYdcm7xlur/gY+ljP4hKREjt89zJurR/DgM4pdYgWNXUiHi8vsA+eUgNx77nMs Dg/8/XyCRgeWYEQ4DAoYUd469XQCivQRiaZsI= 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=ssG7Iiw7RECgv5QPMbRZOltt7gy6oERHjhPVvdGG8OK6mcZG2iAmLwKisa4rSBn80b gKfkckPeTCxe8FcaR86rtSFuFd6T4XPNZ0avw170KVehqd0Y6uArt+J4/y7UoHtNlAwp 6y45VhnBj9sw9Zj8nKkALy8vk5n56l2zdEu6uYlUTsS3Z6nEdu9dIuQhWrX8UFxEgYYX um6sebb/ZMfyL+gh3WLQ6k7S8fl5LdFVUHNfapBKIkrhptkMfR/Ybt6ykIoXt5rwyysb P3BhQl5BVxyJopLvetk6zqQ8OESmDlxxAXovHzw4DrCbd9G31dn+iQuBJ7LVgPr8ZzRL qo4w== X-Gm-Message-State: AIVw1138Ii+vy9cyaVmeuGOXiLmF+c6r1glLCT2ly42Q3o9wGAb6T6GX JR/Q4rmjD5IxMcyMLMWH/w== X-Received: by 10.99.97.129 with SMTP id v123mr10651258pgb.337.1502096077823; Mon, 07 Aug 2017 01:54:37 -0700 (PDT) Received: from blr-ubuntu-linaro.wlan.qualcomm.com ([103.5.19.18]) by smtp.gmail.com with ESMTPSA id p77sm12604047pfi.153.2017.08.07.01.54.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 07 Aug 2017 01:54:37 -0700 (PDT) From: Bhupinder Thakur To: xen-devel@lists.xenproject.org Date: Mon, 7 Aug 2017 14:23:15 +0530 Message-Id: <1502095997-31219-24-git-send-email-bhupinder.thakur@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1502095997-31219-1-git-send-email-bhupinder.thakur@linaro.org> References: <1502095997-31219-1-git-send-email-bhupinder.thakur@linaro.org> Cc: Wei Liu , Julien Grall , Stefano Stabellini , Ian Jackson Subject: [Xen-devel] [PATCH 23/25 v7] 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 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