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: 9720005 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 78D7560236 for ; Wed, 10 May 2017 14:39:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6B555285FE for ; Wed, 10 May 2017 14:39:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6026628602; Wed, 10 May 2017 14:39:56 +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 ED2DC285FE for ; Wed, 10 May 2017 14:39:55 +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 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" X-Virus-Scanned: ClamAV using ClamSMTP 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;