From patchwork Fri Apr 28 16:01:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupinder Thakur X-Patchwork-Id: 9705019 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 EA8BA60225 for ; Fri, 28 Apr 2017 16:04:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DC67B28688 for ; Fri, 28 Apr 2017 16:04:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CFF7128692; Fri, 28 Apr 2017 16:04:02 +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=-2.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_WEB, 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 7950828688 for ; Fri, 28 Apr 2017 16:04:02 +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 1d48LD-0000BC-AX; Fri, 28 Apr 2017 16:01:55 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d48LC-0000AE-0g for xen-devel@lists.xenproject.org; Fri, 28 Apr 2017 16:01:54 +0000 Received: from [193.109.254.147] by server-5.bemta-6.messagelabs.com id 5B/F8-03371-17763095; Fri, 28 Apr 2017 16:01:53 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrKIsWRWlGSWpSXmKPExsVyMfTAGt2CdOZ Ig79XtCy+b5nM5MDocfjDFZYAxijWzLyk/IoE1oz1lxtYC/6IVnxqfcrYwLhMqIuRi0NIYCaj xIv2CywgDovAPGaJhq/rmEAcCYF+VolzaxtZuxg5gZw4iZ9nn7N1MXIA2ZUSxyeVgISFBLQkj p6azQoxqZlJ4vGm40wgNWwCJhKzOiRAakQElCTurZoMNpNZ4C2jRP/HU2AzhQUiJE61X2IBsV kEVCUetPYwg9i8At4S065/ZIPYKydx81wnWJxTwEfiWv8ydojF3hLdDfNYJjAKLGBkWMWoXpx aVJZapGukl1SUmZ5RkpuYmaNraGCml5taXJyYnpqTmFSsl5yfu4kRGFgMQLCDcdlfp0OMkhxM SqK8le7MkUJ8SfkplRmJxRnxRaU5qcWHGGU4OJQkeKemAeUEi1LTUyvSMnOAIQ6TluDgURLhl QBJ8xYXJOYWZ6ZDpE4xGnO8uPz+PRPHk5U/3jMJseTl56VKifMeACkVACnNKM2DGwSLvUuMsl LCvIxApwnxFKQW5WaWoMq/YhTnYFQS5p0GMoUnM68Ebt8roFOYgE5hcWEAOaUkESEl1cCo7CH /z7h7lt7z7rDZ1ierEu83JU8qjqrYVxN3z2wGR0ewwdP9qreuVhzQdr/oHM2g9inaND5+hikf x6foGXu+fXMNWR2Q2Gag2rZDV7DzU8iNqeHLF2+qkxb54ZZ8dKZV++zOJ47nTLaKna+vOv989 fuDZR1NntOLFq+IcOZ8teJPe9Q/ZgElluKMREMt5qLiRAAQY2R8uAIAAA== X-Env-Sender: bhupinder.thakur@linaro.org X-Msg-Ref: server-8.tower-27.messagelabs.com!1493395311!89252860!1 X-Originating-IP: [209.85.192.172] 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 63166 invoked from network); 28 Apr 2017 16:01:52 -0000 Received: from mail-pf0-f172.google.com (HELO mail-pf0-f172.google.com) (209.85.192.172) by server-8.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 28 Apr 2017 16:01:52 -0000 Received: by mail-pf0-f172.google.com with SMTP id e64so13271140pfd.1 for ; Fri, 28 Apr 2017 09:01:52 -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=jXBisWG55AUiIV/FKhhGyK5ZsUDhrr6RA8bRgYsactI=; b=UQPypOdWX1UCq+y9qH1YO8NBkti5YJdOVgBIV/e3jBSsYUPvQUerWW1Bd+q5oQiq/O N6RgrZWviw8+oPjp06EXdNkXoMkPihOmT40YoflJSqTqnDSamtteBxjMORXFKr97Kew1 PckznYWijpkzeCnowdIlzewB+PSeF9FmoOpkE= 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=jXBisWG55AUiIV/FKhhGyK5ZsUDhrr6RA8bRgYsactI=; b=Rxn9M3suvIIbypYxKGyfcQx1nRndrLf83EOmyz91XN87RrTNHh5chcKSELmcQ0WnF1 d2vX1FM2wRYgnmI2h98kgqQ62OPvoIeBTiwbOVtW36tQWbklS4Wdb8BE9sgenyR8ZTK4 WUS+zaxHncSRXNiJ4YOR2OfRT/yMlMmbNAxSlHuPbV7GfMublzl0H3tfO2IB7dm2ue+H lcP70Xx8OnWU5evBST1t7J4L5s5YZNuTFRqgRAy8sjP/gFbeCuYKt+govAjjDqiwanYh Hm1JU+h2wpXUiw6g9C9EkVRdnkdJJr/aBXfw10w6NFYFF+EAwt0fLcqExi63u5SQ6Mb6 t0Ag== X-Gm-Message-State: AN3rC/7QIcAM9Vr8MBwUD9F8yIHZSoUmRZkykZGShlOrI95pn0nVdQe4 l9bwOxaGBGpdI++Q X-Received: by 10.84.224.136 with SMTP id s8mr16121233plj.93.1493395311147; Fri, 28 Apr 2017 09:01:51 -0700 (PDT) Received: from blr-ubuntu-linaro.wlan.qualcomm.com ([103.5.19.18]) by smtp.gmail.com with ESMTPSA id n65sm9870239pga.8.2017.04.28.09.01.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 28 Apr 2017 09:01:50 -0700 (PDT) From: Bhupinder Thakur To: xen-devel@lists.xenproject.org Date: Fri, 28 Apr 2017 21:31:19 +0530 Message-Id: <1493395284-18430-6-git-send-email-bhupinder.thakur@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1493395284-18430-1-git-send-email-bhupinder.thakur@linaro.org> References: <1493395284-18430-1-git-send-email-bhupinder.thakur@linaro.org> Cc: Stefano Stabellini , Wei Liu , Andrew Cooper , Ian Jackson , Julien Grall , Jan Beulich Subject: [Xen-devel] [PATCH 05/10 v2] xen/arm: vpl011: Allocate a new PFN in the toolstack for vuart 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 Allocate a new pfn and pass on to Xen using a domctl call. Signed-off-by: Bhupinder Thakur Reviewed-by: Stefano Stabellini --- Changes since v1: - Replaced the hvm call with the domctl call to set the pfn. tools/libxc/include/xc_dom.h | 2 ++ tools/libxc/xc_dom_arm.c | 7 ++++++- tools/libxc/xc_dom_boot.c | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xc_dom.h index ce47058..ca8bc23 100644 --- a/tools/libxc/include/xc_dom.h +++ b/tools/libxc/include/xc_dom.h @@ -216,6 +216,8 @@ struct xc_dom_image { /* Extra SMBIOS structures passed to HVMLOADER */ struct xc_hvm_firmware_module smbios_module; + + xen_pfn_t vuart_pfn; }; /* --- pluggable kernel loader ------------------------------------- */ diff --git a/tools/libxc/xc_dom_arm.c b/tools/libxc/xc_dom_arm.c index e7d4bd0..ad805d1 100644 --- a/tools/libxc/xc_dom_arm.c +++ b/tools/libxc/xc_dom_arm.c @@ -26,10 +26,11 @@ #include "xg_private.h" #include "xc_dom.h" -#define NR_MAGIC_PAGES 3 +#define NR_MAGIC_PAGES 4 #define CONSOLE_PFN_OFFSET 0 #define XENSTORE_PFN_OFFSET 1 #define MEMACCESS_PFN_OFFSET 2 +#define VUART_PFN_OFFSET 3 #define LPAE_SHIFT 9 @@ -85,16 +86,20 @@ static int alloc_magic_pages(struct xc_dom_image *dom) dom->console_pfn = base + CONSOLE_PFN_OFFSET; dom->xenstore_pfn = base + XENSTORE_PFN_OFFSET; + dom->vuart_pfn = base + VUART_PFN_OFFSET; xc_clear_domain_page(dom->xch, dom->guest_domid, dom->console_pfn); xc_clear_domain_page(dom->xch, dom->guest_domid, dom->xenstore_pfn); xc_clear_domain_page(dom->xch, dom->guest_domid, base + MEMACCESS_PFN_OFFSET); + xc_clear_domain_page(dom->xch, dom->guest_domid, base + VUART_PFN_OFFSET); xc_hvm_param_set(dom->xch, dom->guest_domid, HVM_PARAM_CONSOLE_PFN, dom->console_pfn); xc_hvm_param_set(dom->xch, dom->guest_domid, HVM_PARAM_STORE_PFN, dom->xenstore_pfn); xc_hvm_param_set(dom->xch, dom->guest_domid, HVM_PARAM_MONITOR_RING_PFN, base + MEMACCESS_PFN_OFFSET); + xc_domain_vuart_set_pfn(dom->xch, dom->guest_domid, base + VUART_PFN_OFFSET); + /* allocated by toolstack */ xc_hvm_param_set(dom->xch, dom->guest_domid, HVM_PARAM_CONSOLE_EVTCHN, dom->console_evtchn); diff --git a/tools/libxc/xc_dom_boot.c b/tools/libxc/xc_dom_boot.c index c3b44dd..5e4b322 100644 --- a/tools/libxc/xc_dom_boot.c +++ b/tools/libxc/xc_dom_boot.c @@ -226,6 +226,8 @@ int xc_dom_boot_image(struct xc_dom_image *dom) return rc; if ( (rc = clear_page(dom, dom->xenstore_pfn)) != 0 ) return rc; + if ( (rc = clear_page(dom, dom->vuart_pfn)) != 0 ) + return rc; /* start info page */ if ( dom->arch_hooks->start_info )