From patchwork Tue Feb 21 11:26:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupinder Thakur X-Patchwork-Id: 94255 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp396464qgi; Tue, 21 Feb 2017 03:28:15 -0800 (PST) X-Received: by 10.107.16.208 with SMTP id 77mr19609298ioq.25.1487676494976; Tue, 21 Feb 2017 03:28:14 -0800 (PST) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id o4si10936390iti.126.2017.02.21.03.28.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Feb 2017 03:28:14 -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 1cg8aV-0002lx-Ge; Tue, 21 Feb 2017 11:26:31 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cg8aT-0002kb-O3 for xen-devel@lists.xenproject.org; Tue, 21 Feb 2017 11:26:29 +0000 Received: from [85.158.143.35] by server-10.bemta-6.messagelabs.com id CA/C1-13192-5E32CA85; Tue, 21 Feb 2017 11:26:29 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprHIsWRWlGSWpSXmKPExsXiVRuspftEeU2 EwcZ94hbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8bZzg2sBQuEKuZMWsPYwNjA38XIxSEkMI1R 4uK0w+wgDovAPGaJ84feMII4EgL9rBL3Z6wEcjiBnBiJz5sOMkHYFRIL9/wCs4UEtCSOnprNC jGqlUniy62LLF2MHBxsAiYSszokQGpEBJQk7q2aDFbPLBAq8e9ZGzuILSwQLPH0wVdmEJtFQF Vi2befzCCtvALeEm072SBWyUncPNcJVsIp4CPxd99Ldoi13hLT7qxgm8AosICRYRWjenFqUVl qka6hXlJRZnpGSW5iZo6uoYGZXm5qcXFiempOYlKxXnJ+7iZGYFgxAMEOxp3PnQ4xSnIwKYny ZkutiRDiS8pPqcxILM6ILyrNSS0+xCjDwaEkwTtHCSgnWJSanlqRlpkDDHCYtAQHj5II7xFFo DRvcUFibnFmOkTqFKMux65dl18yCbHk5eelSonzloHMEAApyijNgxsBi7ZLjLJSwryMQEcJ8R SkFuVmlqDKv2IU52BUEubtBJnCk5lXArfpFdARTEBH3PRYCXJESSJCSqqBscJ/6ub13U/3MM9 P8vhoylLPsOKEkeafjhbZSK9HAabp/SvjdtirzZ+du9q7YJ2KiSnnijMfFhp+Ltvwft7Gw+Uv eyStUsVXLF5pHs7xzHdR6Q8Bh8+R7wOefDpX6fJrjUig6dU1LGyHa79NrNwbsSDf5hy/hLfbl ka967MPTozQT454aDHlgRJLcUaioRZzUXEiAN+5fdGxAgAA X-Env-Sender: bhupinder.thakur@linaro.org X-Msg-Ref: server-7.tower-21.messagelabs.com!1487676387!58785882!1 X-Originating-IP: [74.125.83.42] 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 15075 invoked from network); 21 Feb 2017 11:26:28 -0000 Received: from mail-pg0-f42.google.com (HELO mail-pg0-f42.google.com) (74.125.83.42) by server-7.tower-21.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 21 Feb 2017 11:26:28 -0000 Received: by mail-pg0-f42.google.com with SMTP id 1so16555103pgi.1 for ; Tue, 21 Feb 2017 03:26:28 -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:in-reply-to:references; bh=Z8YomainCsJcOV2QYn0R4tQly77A8VFssvyoNnV+hJ0=; b=S9GeOOccfCjf3YSx7m6g98EuUYxy8XVA4p29eSWyFgvVEPiQKmNgIOeT2KyzCOetxP 97IGnkFDEiFTQ3KbgyG8wanwz50Mm+xGedgdVgnDFvtGUJq4xa6GtA/bw4z23sFLQ0Bu rpBwBYz2fGZwNZULr5SnGveDf1hVybjb4b/ac= 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=Z8YomainCsJcOV2QYn0R4tQly77A8VFssvyoNnV+hJ0=; b=EUtPKeDsvf3YekaT0g/+8faVTiISEDESu8BokS68ew92lrH+yhBe5bFF265UxiLAH4 Kz9nQjbGhP+ix7WZHA9GTfnwQwZ2huGhKMRSGuyt2+4xUe5qKQ9+UpQf5qQVQSGi6XbW t8yUCbZwaBSrGPl6ClMA9JiQ8O1BrEq6ZvNYHloItkZHqV8Lv5rXYaTAIe69QmEqJZju b6wu2XLjObrsaLwDixkYdfVSoMg4lmzXoVccmwEnbqNpMubop3RFXL6SWNRMZ/O8NhNV ViRZqlOYd6HfvN/EwagyBJ0pcEJ4h6mWXTlrl9eE71bJrdPwlGmweSE9+HBsHZR/kOMa kvag== X-Gm-Message-State: AMke39nVzVEX/FM5U2pBUOYJu0P/5qNvnYsQ0ieQFlo6GGpmEKm2M16oECctrqIkDvlBOpZ6 X-Received: by 10.84.229.9 with SMTP id b9mr39309309plk.175.1487676386964; Tue, 21 Feb 2017 03:26:26 -0800 (PST) Received: from blr-ubuntu-linaro.wlan.qualcomm.com ([103.5.19.18]) by smtp.gmail.com with ESMTPSA id p66sm40508627pfb.88.2017.02.21.03.26.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 21 Feb 2017 03:26:26 -0800 (PST) From: Bhupinder Thakur To: xen-devel@lists.xenproject.org Date: Tue, 21 Feb 2017 16:56:01 +0530 Message-Id: <1487676368-22356-5-git-send-email-bhupinder.thakur@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1487676368-22356-1-git-send-email-bhupinder.thakur@linaro.org> References: <1487676368-22356-1-git-send-email-bhupinder.thakur@linaro.org> Cc: Julien Grall , Stefano Stabellini Subject: [Xen-devel] [PATCH 04/11] xen/arm: vpl011: Enable vpl011 emulation for a 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" Based on one of the domain creation flags, the vpl011 emulation will be enabled for the domain. This flag is currently set always but finally it needs to be controlled by the user through some configuration option. Signed-off-by: Bhupinder Thakur --- xen/arch/arm/domain.c | 8 ++++++++ xen/common/domctl.c | 2 ++ xen/include/xen/sched.h | 4 ++++ 3 files changed, 14 insertions(+) diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c index 7e43691..6fee541 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 "vpl011.h" +#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; +#ifdef CONFIG_VPL011_CONSOLE + if ( domcr_flags & DOMCRF_vpl011_console ) + if ( (rc = domain_vpl011_init(d)) != 0 ) + goto fail; +#endif update_domain_wallclock_time(d); /* diff --git a/xen/common/domctl.c b/xen/common/domctl.c index 12cf4a9..fafc506 100644 --- a/xen/common/domctl.c +++ b/xen/common/domctl.c @@ -551,6 +551,8 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl) if ( op->u.createdomain.flags & XEN_DOMCTL_CDF_xs_domain ) domcr_flags |= DOMCRF_xs_domain; + domcr_flags |= DOMCRF_vpl011_console; + d = domain_create(dom, domcr_flags, op->u.createdomain.ssidref, &op->u.createdomain.config); if ( IS_ERR(d) ) diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h index 063efe6..9e03a60 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_vpl011_console: create domain with pl011 emulation enabled */ +#define _DOMCRF_vpl011_console 7 +#define DOMCRF_vpl011_console (1U<<_DOMCRF_vpl011_console) + /* * rcu_lock_domain_by_id() is more efficient than get_domain_by_id(). * This is the preferred function if the returned domain reference