From patchwork Fri Sep 22 08:23:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupinder Thakur X-Patchwork-Id: 113977 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp3011067qgf; Fri, 22 Sep 2017 01:26:01 -0700 (PDT) X-Received: by 10.36.29.199 with SMTP id 190mr5107263itj.78.1506068760996; Fri, 22 Sep 2017 01:26:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506068760; cv=none; d=google.com; s=arc-20160816; b=bufPdBC2rkKIGJn6piNtC3/qVGhzL0Rl+cCs8J/p0ZYSXcgtoLIXSzTrB90MEczMMM pcNP4MTeXpXfoN8x2sryvO5/mnoK3mg9Cfgh1L4/TD9aQVPhnBufEnhKOaMoaAR3xOOF 866P2ywtsWu2GTEwC9/Tqku3kQzGPec8exsOXTSLv3/6X3AgQ7Bzsb60y3Wncrlgq52S 1HggNZLYlph3egmAlntkoLeuj+K4VbQYKRPte/9E8d8wcbZ9lP15eBpVncgpdWFVWLTY NtrnmbGxB7jHTQ2nZzWkSxa6Y6Xj7tR5peQdh7aJnLiHm3gW/k6IvaYbAqZTHvE0ULra MjZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:cc:references:in-reply-to:message-id:date:to :from:dkim-signature:arc-authentication-results; bh=0ao0R4TUMt/NZk0LNAGseeON7682MI1gnH9Au+puTTU=; b=klGr0wjt/cRXEvifSj+NZKMDEuao7tXzg8ZLaQPXQPEMF8kjM/ZzBRAgu22RuJaJem SSnxi7191Cz6Iisk8B9sjfBbacgYVcnsK+wSRwLO0dzSmyqyZl/rFBUrLLZ9S7SxcGlm aSd+yHcBG2XSegmJlrWokivDSbKp1CXa1eapTIqFez5KJHg8xWFhWzRzq8Ct1MTtivTi Iv3rszu5eg1Ltcf9UXadEzlJygyY7x0MNJYcto2Rb/aryBpjDvKO1aMMNpOjj08BlX2V MgP1L5UzA2Q9c2QF/nWXH+/xlhjoloNMXWf1SZH6F6MsNCddCew8xsrTdCUhOwpTiI7z EMKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=B5WnlwJl; 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 Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id e198si3423503ite.80.2017.09.22.01.26.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Sep 2017 01:26:00 -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 header.s=google header.b=B5WnlwJl; 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 1dvJFU-0003er-NZ; Fri, 22 Sep 2017 08:23:48 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dvJFT-0003eG-JF for xen-devel@lists.xenproject.org; Fri, 22 Sep 2017 08:23:47 +0000 Received: from [193.109.254.147] by server-2.bemta-6.messagelabs.com id 18/62-20972-298C4C95; Fri, 22 Sep 2017 08:23:46 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrEIsWRWlGSWpSXmKPExsXiVRtsoDvhxJF Ig1+fFC2+b5nM5MDocfjDFZYAxijWzLyk/IoE1ozfNxrYC15JVhy+sIStgfGOaBcjF4eQwFRG ieczbrGAOCwC85glNhx8xAziSAj0s0q8vtHE1MXICeTkSTyavYQFwk6T2Lb/LZRdIfFz0TJmE FtIQEvi6KnZrBD2DiaJc5N9uhg5ONgETCRmdUiAhEUElCTurZrMBDKfWWA+o0TTpF42kISwQK TErAWNjCA2i4CqxKUdfWBxXgFviSMHXkDtkpO4ea4TbBengI/E2v8bWCB2eUtsvXGVZQKj4AJ GhlWMGsWpRWWpRbpGhnpJRZnpGSW5iZk5uoYGZnq5qcXFiempOYlJxXrJ+bmbGIEhxwAEOxj/ LAs4xCjJwaQkyvv4yJFIIb6k/JTKjMTijPii0pzU4kOMMhwcShK89seBcoJFqempFWmZOcDgh 0lLcPAoifCGg6R5iwsSc4sz0yFSpxiNOfbtufWHiaPj5t0/TEIsefl5qVLivAEgpQIgpRmleX CDYFF5iVFWSpiXEeg0IZ6C1KLczBJU+VeM4hyMSsK8iiBTeDLzSuD2vQI6hQnolPLVYKeUJCK kpBoYHZKehLVmOdgk25gzHuis/8QuGS6TvC1WJ/kF79QX3Yfn/U/vOaH+TZ2pq26raIib3/VZ jkcq3ier/3/TavGu084uqaPPekYeZ3/KxAnO/8TaVuqoM3ZxJuzhvvy77IjVBM93zodKxdw28 N/+EGh2K3bzKqFpVWddDiZvY9wqlVtoonLFRluJpTgj0VCLuag4EQAxhH6vxQIAAA== X-Env-Sender: bhupinder.thakur@linaro.org X-Msg-Ref: server-2.tower-27.messagelabs.com!1506068623!58454576!1 X-Originating-IP: [74.125.83.48] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 12289 invoked from network); 22 Sep 2017 08:23:44 -0000 Received: from mail-pg0-f48.google.com (HELO mail-pg0-f48.google.com) (74.125.83.48) by server-2.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 22 Sep 2017 08:23:44 -0000 Received: by mail-pg0-f48.google.com with SMTP id 7so238532pgd.13 for ; Fri, 22 Sep 2017 01:23:44 -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=1SnejLuK1E7QinOqF2LtaUIP1aM9kOWy3HE1yvqUZqQ=; b=B5WnlwJlaSxYPcojLmUFf2c81f6B+IZ7JbfbqmTbqqmDC/NmX8Z/h3K44UsQ7bQt+3 Lsj8rZsbU1sAaBAjQJ2rTSdH5PrY1A6MutD10daVQ8sOVStF0h+Af5Kdq953xPVE6BC2 8obZTJDmNYOp9SBQLrQA/O0QT80DAlglPJ4WA= 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=1SnejLuK1E7QinOqF2LtaUIP1aM9kOWy3HE1yvqUZqQ=; b=JUhPWO1GV3TdD4gHT3jlITQGVdiv+kAomx3V8w8Zlg2P5UqvUlpBUZO8N+PAAjlEDf hp9TgQTmWM/sv2HzUoKPpK+gqlCqYmtH4dADG8Aa1qD3tplaS/bksPTR3FLKTE8NLPk3 JzN55XnSZF4kxpfa76knk/m8dFl7ted1QeqLgHzOw3fVnz9eGQALIOBld34+g2vH28Hj 99D14HFN9UdtEshP8q8re0p3J0pbRR7ftrUna+/7fdWlfOzU5sJJd15UUz0xdCz4ef37 vxSe9WbBM/BlZ/m1xuzIrf9HWWgBv7BNKuHjnHH0nR7/Zllclj8cbCL9WOayO57wHB+x 2Mmw== X-Gm-Message-State: AHPjjUgdG18F1AO66AbYP0sPcBIdi5QsOENY3mcYRlVuYMZ/5mQLC2Lm Imz4oC32aNUQbn9OPeEjNeeC2f6xjk0= X-Google-Smtp-Source: AOwi7QBqd3KGhJUIepJmq4WoT+bs2KW4ZF+cTMFfjs6EYROv9kVc90GB3j2DksaIYfI16hF8M6mOaQ== X-Received: by 10.84.133.66 with SMTP id 60mr8380825plf.386.1506068622923; Fri, 22 Sep 2017 01:23:42 -0700 (PDT) Received: from blr-ubuntu-linaro.qualcomm.com (blr-bdr-fw-01_globalnat_allzones-outside.qualcomm.com. [103.229.18.19]) by smtp.gmail.com with ESMTPSA id f74sm5569284pfa.36.2017.09.22.01.23.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 22 Sep 2017 01:23:42 -0700 (PDT) From: Bhupinder Thakur To: xen-devel@lists.xenproject.org Date: Fri, 22 Sep 2017 13:53:02 +0530 Message-Id: <1506068606-17066-4-git-send-email-bhupinder.thakur@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1506068606-17066-1-git-send-email-bhupinder.thakur@linaro.org> References: <1506068606-17066-1-git-send-email-bhupinder.thakur@linaro.org> Cc: Wei Liu , Julien Grall , Stefano Stabellini , Ian Jackson Subject: [Xen-devel] [PATCH 03/27 v10] xen/arm: vpl011: Allocate a new GFN 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" Allocate a new gfn to be used as a ring buffer between xenconsole and Xen for sending/receiving pl011 console data. Signed-off-by: Bhupinder Thakur Acked-by: Stefano Stabellini Acked-by: Wei Liu --- CC: Ian Jackson CC: Wei Liu CC: Stefano Stabellini CC: Julien Grall Changes since v4: - Removed xc_get_vuart_gfn() as it is not required since the vpl011 initialization function which used this API has been moved to after gfn is allocated. - I have included the reviewed-by and acked-by tags as there is no change in the logic. Changes since v3: - Added a new helper function xc_get_vuart_gfn() to return the GFN allocated for vpl011. - Since a new function has been added in this patch, I have not included Stefano's reviewed-by and Wei's acked-by tags. Changes since v2: - Removed the DOMCTL call to set the GFN as now this information is passed in the DOMCTL call to initialize vpl011 emulation. tools/libxc/include/xc_dom.h | 2 ++ tools/libxc/xc_dom_arm.c | 5 ++++- tools/libxc/xc_dom_boot.c | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xc_dom.h index ce47058..6e06ef1 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_gfn; }; /* --- pluggable kernel loader ------------------------------------- */ diff --git a/tools/libxc/xc_dom_arm.c b/tools/libxc/xc_dom_arm.c index e669fb0..98200ae 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,10 +86,12 @@ 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_gfn = 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, diff --git a/tools/libxc/xc_dom_boot.c b/tools/libxc/xc_dom_boot.c index c3b44dd..8a376d0 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_gfn)) != 0 ) + return rc; /* start info page */ if ( dom->arch_hooks->start_info )