From patchwork Mon Feb 6 18:09:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupinder Thakur X-Patchwork-Id: 93470 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1818339qgi; Mon, 6 Feb 2017 10:11:22 -0800 (PST) X-Received: by 10.36.73.211 with SMTP id e80mr7901005itd.88.1486404682588; Mon, 06 Feb 2017 10:11:22 -0800 (PST) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id m131si5126978itb.119.2017.02.06.10.11.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Feb 2017 10:11:22 -0800 (PST) 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 1canjA-0007fe-91; Mon, 06 Feb 2017 18:09:24 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1canj9-0007fY-3N for xen-devel@lists.xenproject.org; Mon, 06 Feb 2017 18:09:23 +0000 Received: from [85.158.137.68] by server-11.bemta-3.messagelabs.com id 41/BB-01684-2DBB8985; Mon, 06 Feb 2017 18:09:22 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprJIsWRWlGSWpSXmKPExsVyMfTAZt2Lu2d EGKxZoG7xfctkJgdGj8MfrrAEMEaxZuYl5VcksGYs6z7GWnBMpGLXlzvsDYzP+bsYuTiEBGYy Slxq+8QC4rAItDNL3L1/gxHEkRB4xyLRMKmNqYuRA8iJkZiwXLqLkRPILJPYPrWfBcQWEtCSO HpqNivEpBYmiV+nZrGC1LMJmEjM6pAAqRERUJK4t2oyE4jNLBAq8e9ZGzuILSzgK9F8YzEziM 0ioCox8+oZRhCbV8BbYsbK56wQu+Qkbp7rZJ7AyLeAkWEVo0ZxalFZapGukYFeUlFmekZJbmJ mjq6hgbFebmpxcWJ6ak5iUrFecn7uJkZgoNQzMDDuYGw+4XeIUZKDSUmUV2TtjAghvqT8lMqM xOKM+KLSnNTiQ4wyHBxKErwrdgLlBItS01Mr0jJzgCELk5bg4FES4X0JkuYtLkjMLc5Mh0idY rTn6Ok6/ZKJ49QNEPll5xkguWfX5ZdMQix5+XmpUuK8z0DaBEDaMkrz4IbCYuwSo6yUMC8jAw ODEE9BalFuZgmq/CtGcQ5GJWHe8yBTeDLzSuB2vwI6iwnorG1XpoGcVZKIkJJqYGzYuaKCd/v BQu5pJcyuW9Pzo6wmfTGVW3pF+H18T8W8bRP4SuqNTdUKjJZkhzBO0xDZckoh5Ta7wE55xjJZ rQgGCakvt6W93RSrr02XcK8+lXFZfrrrOZvE/tKD9+Q2teetMjmknd1udX9uzoLIVY2Vb/yuy xi61uzuyq6Zsfrf5s0LMue8U2Ipzkg01GIuKk4EAGZTzJ+sAgAA X-Env-Sender: bhupinder.thakur@linaro.org X-Msg-Ref: server-8.tower-31.messagelabs.com!1486404560!84307590!1 X-Originating-IP: [209.85.192.179] X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG X-StarScan-Received: X-StarScan-Version: 9.1.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 32602 invoked from network); 6 Feb 2017 18:09:21 -0000 Received: from mail-pf0-f179.google.com (HELO mail-pf0-f179.google.com) (209.85.192.179) by server-8.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 6 Feb 2017 18:09:21 -0000 Received: by mail-pf0-f179.google.com with SMTP id 189so25715084pfu.3 for ; Mon, 06 Feb 2017 10:09:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=cPLl1CARg+bh48c4VSRpgG3gZlMs8eiAjB2dOL+InEI=; b=BZeTVPgGXfQ06PJCD+947cHAPvjKHe+qDHQWEqYMZ2XokDNYEeA/wsu7cv8q5r+CVY gIvhnbGgQ2ujLfcC4E854uKAuxRx8/WOfymJZP7uPkcpRjNTfokJWIv6XFSHlpamdsw9 G+30MAUuApqkjkHWan4a7WsJrqlZ+d+gsOR/U= 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=cPLl1CARg+bh48c4VSRpgG3gZlMs8eiAjB2dOL+InEI=; b=DT+MRdP7ZA40WWAaedoSgNreV54HbxLKxyMwM/8Z5vG2jdSM2pEynld9eU2dymEt9M lcGSqmHTtgdjpvrGEzUfuFt4OGnfkBotC98PpbpzqZObY2jjsTDjG7JACcggS6NdACMB K9BQaczeF1gOeJF7USJ9vzitXm6xze2t/mT6ssEgXH+UcsxeLZUzUhgdseVcvT4p0VNE 7oj9oy2g2iIR+DMgLjUR9zMTuMGYxKEwZ7b5UN45s/ZQGWBid19XqSPqCSHfRQ42akuc NLJj9zD122vzj6WeaxZU8TrkXWuCAYKZo26LvhGu+LW3irT98Ry/4cwVTkwxBRQj1dHo TOJg== X-Gm-Message-State: AIkVDXIB7NDslTwDIoKvj5+dayNdqam798L54UeWfudDcb2QatqZzE1ZvlliOoGWS+ugW8o2 X-Received: by 10.99.4.71 with SMTP id 68mr15047233pge.77.1486404559803; Mon, 06 Feb 2017 10:09:19 -0800 (PST) Received: from blr-ubuntu-linaro.wlan.qualcomm.com ([103.5.19.18]) by smtp.gmail.com with ESMTPSA id r78sm4334508pfl.63.2017.02.06.10.09.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 06 Feb 2017 10:09:19 -0800 (PST) From: Bhupinder Thakur To: xen-devel@lists.xenproject.org Date: Mon, 6 Feb 2017 23:39:07 +0530 Message-Id: <1486404548-15062-1-git-send-email-bhupinder.thakur@linaro.org> X-Mailer: git-send-email 2.7.4 Cc: Julien Grall , Stefano Stabellini Subject: [Xen-devel] [PATCH 0/1] xen/arm: Add pl011 uart support in Xen for guest domains 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" As per "VM System Specification for ARM Processors", there is a requirement for Xen to support guest console over pl011 UART, which is SBSA compliant. The changes in this patch implement the pl011 emulation in Xen and a new pl011 console support in xenconsoled. The following changes are still pending: 1. Xenconsoled is modified to handle only pl011 console. Changes are required to support another console type "pl011" like "pv" and "serial" so that user can select any of the three (pv/serial/pl011) consoles. 2. The SPI VIRQ for pl011 is getting allocated dynamically currently instead of reserving a specific VIRQ. Changes are required to reserve a range for SPI VIRQs. 3. Currently there is no validation that the hvm APIs for getting the SPI VIRQ, passing the pl011 PFN to Xen are allowed from dom0 only. Those validation checks need to be added so the guests cannot use those APIs. 4. For receiving events from xenconsole, Xen uses the Xen events which are consumed by Xen itself. However, such events (whose consumer is Xen) is not allowed to send events out. Since we need the Xen to send the events to xenconsoled, a check was added to bypass this restriction. This needs to be looked into more detail in terms of whether it is better to introduce a customized evtchn_send() API, which will be used only by Xen core. 5. There are some debug prints still left out in the code, which need to be cleaned up. Bhupinder Thakur (1): xen/arm: Add pl011 uart support in Xen for guest domains tools/console/daemon/io.c | 170 ++++++++++++++--- tools/console/daemon/main.c | 10 + tools/libxc/include/xc_dom.h | 3 + tools/libxc/xc_dom_arm.c | 7 +- tools/libxc/xc_dom_boot.c | 3 + tools/libxc/xc_domain.c | 3 - tools/libxl/libxl.c | 4 + tools/libxl/libxl_arm.c | 50 ++++- tools/libxl/libxl_dom.c | 9 +- tools/libxl/libxl_internal.h | 2 + xen/arch/arm/Makefile | 1 + xen/arch/arm/domain.c | 7 + xen/arch/arm/hvm.c | 22 ++- xen/arch/arm/setup.c | 1 + xen/arch/arm/vgic.c | 7 + xen/arch/arm/vpl011.c | 391 ++++++++++++++++++++++++++++++++++++++++ xen/common/event_channel.c | 11 +- xen/include/asm-arm/domain.h | 14 ++ xen/include/public/arch-arm.h | 5 + xen/include/public/hvm/params.h | 10 +- xen/include/xen/vpl011.h | 146 +++++++++++++++ 21 files changed, 832 insertions(+), 44 deletions(-) create mode 100644 xen/arch/arm/vpl011.c create mode 100644 xen/include/xen/vpl011.h