From patchwork Wed May 10 14:35: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: 99004 Delivered-To: patch@linaro.org Received: by 10.182.142.97 with SMTP id rv1csp234277obb; Wed, 10 May 2017 07:39:39 -0700 (PDT) X-Received: by 10.107.129.232 with SMTP id l101mr3527618ioi.194.1494427179015; Wed, 10 May 2017 07:39:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1494427179; cv=none; d=google.com; s=arc-20160816; b=if20hyVnlHs8W5xM+1IaWqbn0C2EiumJiU62MprMX8CzrMGmnrwFxqDDLbS+vu/aHL IAzW9HkTMyMKvQHL0TLbNyFVfTxGPDNjtKBG6jMSHTEpVX/j0DMyTEM9AVSo2mOUAjb8 7B5n6I55SGCfqqIuhymMlCZlwGe4FF5n1JGBTTkYGUygEO/VHX5EgQoE+W+J7GCyRt0h znxrDH3RVhd5FaMtHeZ5fkfJOm88aDfRSrUHzfE7lULFK3F6GDlFVMFGP7Uoiqfx4f2w oLUpw///5McQ2vNiTu8G9GxA7KCs/HHCtkjHo/QUOF3U9JmA9HRPYzFh4zWNrqPATgYe uc9g== 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=9575YpikiLaS0t1oo/Vc3ajV7T4TG735UFHtKxWxTrk=; b=bMqHIycBfNIrMyAQKkOJPTww3BTu2n57o4bq+pM3TytIB5G3gm/gx4zV3+tnQO9L6Z Fgo/bQbON1ohU5/jzAw5Yd2hUFPLFbTu/b4+PrShqJtkJTomYzAqGwQ8TFDlL+VZNqNg lHEXca+rQx2vTohS7DrwZYd8lxoZnjFQwa9WXZ6vrMRYD1E7aD9nFjPicq555tMSbw1K wKkzEEFvwWBsbzeacqwnEbz9r6Pt38kmyrcUbGWD8kYgiaQQvnu5+xKPHIY9Vm5UW827 yZob/49b/XXRPYh9712uQ5DkUJRM51qxPB7BK2dBP6BVB80E79HvOR7K6l49Td9MiRkZ zoDg== 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 f35si2287096ioj.122.2017.05.10.07.39.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 May 2017 07:39:39 -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 1d8SkX-0004tI-ER; Wed, 10 May 2017 14:37:57 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d8SkW-0004qG-1Y for xen-devel@lists.xenproject.org; Wed, 10 May 2017 14:37:56 +0000 Received: from [193.109.254.147] by server-10.bemta-6.messagelabs.com id 7D/22-03613-3C523195; Wed, 10 May 2017 14:37:55 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrKIsWRWlGSWpSXmKPExsVyMfTAJt3DqsK RBmuuCVt83zKZyYHR4/CHKywBjFGsmXlJ+RUJrBl7Nl1mLjjJV7Fr+k3mBsb33F2MXBxCAjMZ JbbsP8oC4rAIzGOWOPD0PTOIIyHQzyrxrWkaUIYTyImTmPNiCxOEXS7xdfoOZhBbSEBL4uip2 awQo5qZJGY3PABKcHCwCZhIzOqQAKkREVCSuLdqMlgvs4C3xIcj/9hBbGEBP4nDR1eAzWcRUJ V42P0WLM4LVPNmzQJ2iF1yEjfPdYLt4hTwkVj06iULxF5viUef/7BMYBRYwMiwilG9OLWoLLV I11AvqSgzPaMkNzEzR9fQwEwvN7W4ODE9NScxqVgvOT93EyMwsBiAYAfjzudOhxglOZiURHl1 dwlFCvEl5adUZiQWZ8QXleakFh9ilOHgUJLgjVIRjhQSLEpNT61Iy8wBhjhMWoKDR0mEtxkkz VtckJhbnJkOkTrFaMzx4vL790wcT1b+eM8kxJKXn5cqJc4rDVIqAFKaUZoHNwgWe5cYZaWEeR mBThPiKUgtys0sQZV/xSjOwagkzHsBZApPZl4J3L5XQKcwAZ0SyCAAckpJIkJKqoFR5t/bk4m Bu9xkkuxn3bFRWmk9WbVxAvtvzuw6/ZOP9rnVxSefCOBdNZenpXcdx4wbR1exWWQcW8nxd/Zs 6apDMzj+1AYk8i9MP5xzoOtYds7zhT+YHfu+db+uXb6/5hejh5Ip/3XZT8mKsYdvNh9J/sLio Ov4kVXZfZuEsqEA664SqZS+TceUWIozEg21mIuKEwGlgmY7uAIAAA== X-Env-Sender: bhupinder.thakur@linaro.org X-Msg-Ref: server-8.tower-27.messagelabs.com!1494427074!91082874!1 X-Originating-IP: [209.85.192.178] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.12; banners=-,-,- X-VirusChecked: Checked Received: (qmail 57849 invoked from network); 10 May 2017 14:37:55 -0000 Received: from mail-pf0-f178.google.com (HELO mail-pf0-f178.google.com) (209.85.192.178) by server-8.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 10 May 2017 14:37:55 -0000 Received: by mail-pf0-f178.google.com with SMTP id v14so16876786pfd.2 for ; Wed, 10 May 2017 07:37:55 -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=Qa+jlV2xAWOW0IE9+jTCxltG+mZz9lMM/Jwv52ahi+c=; b=JVUiEJsNeJgqqiW2Ff8ViCasF1d1UcBBYK5HEApivv4PPxAHKDcAo6+YiG/88wVigv jgOcHn3iBnj7LuA21+Yo3PfJqKZghA+GP0QD5LskEmV+941hN2YTIGORbPoURaYExkNX X1uwwrDuuQkUzK1tQQFPBiKxIyhx/5FcSu3sM= 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=Qa+jlV2xAWOW0IE9+jTCxltG+mZz9lMM/Jwv52ahi+c=; b=XFQGXG27iZ0aziKBcxd0B4K2L1WGLlovXUai3p+f5fpPjapFXDfpkGj8Sa7W55EXa2 Qz2nUcpuWaWUwzD/gD6evT3yHJqWHalNjFBnYOZpWefnujA57G5s4F/qj5yY2OC7giql kQ6z9MFfRV55OVMEEiEMmi13ewxr9NPWOO1gDm65yFmhRvqaIRbyafqhoBdQ17KD+PML e6FOOoNWIkmZbuNdvUQBI23KryY2MrJ/yh8orWajm7qo7qx0ml7SFgIL9do61/Wk/blJ Yx/RT3LMRBs7Ueciccx4zov6XxJ45Gd+Z5Gvvj5CSLSScZUUgsWjo5/2qYUML4VKZfXS KezA== X-Gm-Message-State: AODbwcDg/fr20IRCPURrePPq6tDvvzfSbI3b9PTUY4YQljMrPEZS8aja QZuydE6gkbitaFjX X-Received: by 10.84.254.65 with SMTP id a1mr1573391pln.64.1494427073598; Wed, 10 May 2017 07:37:53 -0700 (PDT) Received: from blr-ubuntu-linaro.wlan.qualcomm.com ([61.0.91.57]) by smtp.gmail.com with ESMTPSA id r73sm6167781pfa.65.2017.05.10.07.37.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 10 May 2017 07:37:53 -0700 (PDT) From: Bhupinder Thakur To: xen-devel@lists.xenproject.org Date: Wed, 10 May 2017 20:05:15 +0530 Message-Id: <1494426918-32737-4-git-send-email-bhupinder.thakur@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1494426918-32737-1-git-send-email-bhupinder.thakur@linaro.org> References: <1494426918-32737-1-git-send-email-bhupinder.thakur@linaro.org> Cc: Wei Liu , Ian Jackson Subject: [Xen-devel] [PATCH 09/12 v3] xen/arm: vpl011: Add support for vuart in xenconsole 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" Xenconsole supports only PV console currently. This patch adds support for vuart console, which allows emulated pl011 UART to be accessed as a console. Signed-off-by: Bhupinder Thakur --- One review comment was to keep the vuart code under CONFIG_ARM64 && CONFIG_ACPI flags. This code review could not be incorporated as I could not find out the appropriate flags unders which this code can be kept. Are the CONFIG* flags exported to xenconsole? tools/console/daemon/io.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/tools/console/daemon/io.c b/tools/console/daemon/io.c index 9bb14de..19a2f35 100644 --- a/tools/console/daemon/io.c +++ b/tools/console/daemon/io.c @@ -115,6 +115,7 @@ struct console_data { }; static int map_pvcon_ring_ref(struct console *, int ); +static int map_vuartcon_ring_ref(struct console *, int ); static struct console_data console_data[] = { @@ -124,6 +125,12 @@ static struct console_data console_data[] = { .mapfunc = map_pvcon_ring_ref, .mandatory = true }, + { + .xsname = "/vuart/0", + .ttyname = "tty", + .mapfunc = map_vuartcon_ring_ref, + .mandatory = false + } }; #define MAX_CONSOLE (sizeof(console_data)/sizeof(struct console_data)) @@ -751,6 +758,28 @@ out: return err; } +static int map_vuartcon_ring_ref(struct console *con, int ring_ref) +{ + int err = 0; + struct domain *dom = con->d; + + if (!con->interface) { + con->interface = xc_map_foreign_range(xc, + dom->domid, + XC_PAGE_SIZE, + PROT_READ|PROT_WRITE, + (unsigned long)ring_ref); + if (con->interface == NULL) { + err = EINVAL; + goto out; + } + con->ring_ref = ring_ref; + } + +out: + return err; +} + static int console_create_ring(struct console *con) { int err, remote_port, ring_ref;