From patchwork Mon Apr 3 09:44:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupinder Thakur X-Patchwork-Id: 96595 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp18466qgd; Mon, 3 Apr 2017 02:46:59 -0700 (PDT) X-Received: by 10.36.112.149 with SMTP id f143mr8936217itc.50.1491212819356; Mon, 03 Apr 2017 02:46:59 -0700 (PDT) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id i125si10580855ith.101.2017.04.03.02.46.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Apr 2017 02:46:59 -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 1cuyXj-0001OS-5K; Mon, 03 Apr 2017 09:44:59 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cuyXh-0001Nc-MU for xen-devel@lists.xenproject.org; Mon, 03 Apr 2017 09:44:57 +0000 Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id 89/29-12861-89912E85; Mon, 03 Apr 2017 09:44:56 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprHIsWRWlGSWpSXmKPExsXiVRusqTtD8lG EQWeLtMX3LZOZHBg9Dn+4whLAGMWamZeUX5HAmvFxZz97wUeZiqNX/zI2MC4V72Lk4hASmMEo sfDFAsYuRk4OFoF5zBIPeypAEhIC/awSF1tvsoIkJARiJCaf3sbcxcgBZFdKbGlwAQkLCWhJH D01mxViUCuTxNwLixhBatgETCRmdUiA1IgIKEncWzWZCaSGWWA+o8TenrNgM4UFIiRO3zvCCr FYVeJD5092EJtXwFvi18lWRoi9chI3z3WC7eUU8JG49SoBYq+3xKv709gmMAosYGRYxahRnFp Ullqka2Sil1SUmZ5RkpuYmaNraGCsl5taXJyYnpqTmFSsl5yfu4kRGFb1DAyMOxhfHfc7xCjJ waQkyvvmzsMIIb6k/JTKjMTijPii0pzU4kOMMhwcShK8uRKPIoQEi1LTUyvSMnOAAQ6TluDgU RLhnQSS5i0uSMwtzkyHSJ1i1OX40H/4DZMQS15+XqqUOO9+kCIBkKKM0jy4EbBou8QoKyXMy8 jAwCDEU5BalJtZgir/ilGcg1FJmHceyBSezLwSuE2vgI5gAjriCcj9vMUliQgpqQZG7cyZQZv iE9sXaO4z3PRFsLxWRa3kkBTb7BiWdM33Pw/nsNaEXdvaLChzgWWph4rvLIfpa0KO7LjP1xKT aH/L6Ksi56L3NydIFn9S6Qmb7sW5aYnnes3XihXChvpzP302DF1Q15qR9qlMQCnJeyHbj5ddd /9oumXsmzuj49vtmj8RfWsYcyYqsRRnJBpqMRcVJwIA2YwuB7ECAAA= X-Env-Sender: bhupinder.thakur@linaro.org X-Msg-Ref: server-5.tower-31.messagelabs.com!1491212695!90504530!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.2.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 27307 invoked from network); 3 Apr 2017 09:44:56 -0000 Received: from mail-pg0-f41.google.com (HELO mail-pg0-f41.google.com) (74.125.83.41) by server-5.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 3 Apr 2017 09:44:56 -0000 Received: by mail-pg0-f41.google.com with SMTP id 81so115399155pgh.2 for ; Mon, 03 Apr 2017 02:44:56 -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=Ieow7BdBSn5/m29jMs2mlkpcT6Qq1Ovxh95DaCJaa00=; b=H+MAriWuFMXM3HC4P6sDOk4lEEdNf1caXAFnXNBM6dzMhQqyUHYJDrAt9RKd+O5ExY 0q3fNUlShN4GhGkaI86kyboxb33+fSQhxQe7YvkZ8ZNdPT+NDtWA5Mfxhy5BUkrJF578 wStTCyUXb3bSeyjhMjWmJRf1fzVuCn1ATCOvo= 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=Ieow7BdBSn5/m29jMs2mlkpcT6Qq1Ovxh95DaCJaa00=; b=UQFl2fIkGc0GQdlqDExuUy6mO2l3Hfx3/yCzMjKQRFzIE9+/JG79mMNx0oXqFXAKTK LrNp0ZWWHK9CSRtrmC85XO3JKtob8abumjeX2o6IqcUh2YyAHaXwphFQ+R73nsjiLbR9 UO813H/W4X2yjM9N2SmlMMuv3t8r7wfko+iKtVuDGLbjhUspEq4vUUJYi0pf9fgqsx7u jkYn+2a1iJhmrjAJGCj1ecrSCLQ0cc8vsspiXPg0yp0L7+0pIV3wGU7WSNMJY7JwMtyc gUCY0YVa/sdBfZm0MQczEcOgq7oI7WZ8ghswcNg6CapKCp+JcD/ONQMJtf68c3L1sggI VMag== X-Gm-Message-State: AFeK/H1yM/E1ox9bs4pLafbBbeue835mojXLTsOp/lFsFkldJgrEM+hTQ03T9p/pLgYCnLvR X-Received: by 10.99.96.68 with SMTP id u65mr17255260pgb.159.1491212694661; Mon, 03 Apr 2017 02:44:54 -0700 (PDT) Received: from blr-ubuntu-linaro.wlan.qualcomm.com ([202.46.23.54]) by smtp.gmail.com with ESMTPSA id y7sm24751844pfk.93.2017.04.03.02.44.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 03 Apr 2017 02:44:54 -0700 (PDT) From: Bhupinder Thakur To: xen-devel@lists.xenproject.org Date: Mon, 3 Apr 2017 15:14:26 +0530 Message-Id: <1491212673-13476-4-git-send-email-bhupinder.thakur@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1491212673-13476-1-git-send-email-bhupinder.thakur@linaro.org> References: <1491212673-13476-1-git-send-email-bhupinder.thakur@linaro.org> Cc: Wei Liu , Julien Grall , Stefano Stabellini , Ian Jackson Subject: [Xen-devel] [PATCH 03/10] xen/arm: vpl011: Enable pl011 emulation for a guest domain in Xen 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" Vpl011 emulation is enabled for a guest domain in Xen only when it is enabled through an option in libxl provided by the user through guest configuration. The pl011 enable/disable knob in libxl is introduced in the following patch: xen/arm: vpl011: Provide a knob in libxl to enable/disable pl011 emulation Signed-off-by: Bhupinder Thakur --- xen/arch/arm/domain.c | 11 +++++++++++ xen/common/domctl.c | 3 +++ xen/include/public/domctl.h | 2 ++ xen/include/xen/sched.h | 4 ++++ 4 files changed, 20 insertions(+) diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c index 7e43691..8e383d0 100644 --- a/xen/arch/arm/domain.c +++ b/xen/arch/arm/domain.c @@ -36,6 +36,9 @@ #include #include "vtimer.h" #include "vuart.h" +#ifdef CONFIG_VPL011_CONSOLE +#include +#endif DEFINE_PER_CPU(struct vcpu *, curr_vcpu); @@ -626,6 +629,11 @@ int arch_domain_create(struct domain *d, unsigned int domcr_flags, if ( (rc = domain_vtimer_init(d, config)) != 0 ) goto fail; + if ( domcr_flags & DOMCRF_vconsole ) +#ifdef CONFIG_VPL011_CONSOLE + if ( (rc = domain_vpl011_init(d, config)) != 0 ) +#endif + goto fail; update_domain_wallclock_time(d); /* @@ -660,6 +668,9 @@ fail: void arch_domain_destroy(struct domain *d) { +#ifdef CONFIG_VPL011_CONSOLE + domain_vpl011_deinit(d); +#endif /* IOMMU page table is shared with P2M, always call * iommu_domain_destroy() before p2m_teardown(). */ diff --git a/xen/common/domctl.c b/xen/common/domctl.c index 12cf4a9..3385479 100644 --- a/xen/common/domctl.c +++ b/xen/common/domctl.c @@ -506,6 +506,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl) | XEN_DOMCTL_CDF_hap | XEN_DOMCTL_CDF_s3_integrity | XEN_DOMCTL_CDF_oos_off + | XEN_DOMCTL_VCONSOLE_enable | XEN_DOMCTL_CDF_xs_domain)) ) break; @@ -550,6 +551,8 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl) domcr_flags |= DOMCRF_oos_off; if ( op->u.createdomain.flags & XEN_DOMCTL_CDF_xs_domain ) domcr_flags |= DOMCRF_xs_domain; + if ( op->u.createdomain.flags & XEN_DOMCTL_VCONSOLE_enable ) + domcr_flags |= DOMCRF_vconsole; d = domain_create(dom, domcr_flags, op->u.createdomain.ssidref, &op->u.createdomain.config); diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h index 85cbb7c..1fca180 100644 --- a/xen/include/public/domctl.h +++ b/xen/include/public/domctl.h @@ -66,6 +66,8 @@ struct xen_domctl_createdomain { /* Is this a xenstore domain? */ #define _XEN_DOMCTL_CDF_xs_domain 5 #define XEN_DOMCTL_CDF_xs_domain (1U<<_XEN_DOMCTL_CDF_xs_domain) +#define _XEN_DOMCTL_VCONSOLE_enable 6 +#define XEN_DOMCTL_VCONSOLE_enable (1U<<_XEN_DOMCTL_VCONSOLE_enable) uint32_t flags; struct xen_arch_domainconfig config; }; diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h index 063efe6..4efdc48 100644 --- a/xen/include/xen/sched.h +++ b/xen/include/xen/sched.h @@ -555,6 +555,10 @@ struct domain *domain_create(domid_t domid, unsigned int domcr_flags, #define _DOMCRF_xs_domain 6 #define DOMCRF_xs_domain (1U<<_DOMCRF_xs_domain) + /* DOMCRF_vconsole: enable virtual console emulation. Used for aarach64. */ +#define _DOMCRF_vconsole 7 +#define DOMCRF_vconsole (1U<<_DOMCRF_vconsole) + /* * rcu_lock_domain_by_id() is more efficient than get_domain_by_id(). * This is the preferred function if the returned domain reference