From patchwork Mon Sep 18 10:31:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupinder Thakur X-Patchwork-Id: 9956345 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 2601260208 for ; Mon, 18 Sep 2017 10:35:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1523128C17 for ; Mon, 18 Sep 2017 10:35:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 09AF228C29; Mon, 18 Sep 2017 10:35:01 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,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 847A028C17 for ; Mon, 18 Sep 2017 10:35:00 +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 1dttLu-0001d6-Rh; Mon, 18 Sep 2017 10:32:34 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dttLt-0001bm-At for xen-devel@lists.xenproject.org; Mon, 18 Sep 2017 10:32:33 +0000 Received: from [85.158.139.211] by server-6.bemta-5.messagelabs.com id A7/21-27708-0C0AFB95; Mon, 18 Sep 2017 10:32:32 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrIIsWRWlGSWpSXmKPExsXiVRusp7t3wf5 Ig/YTFhbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8bvGw3sBa8kKw5fWMLWwHhHtIuRi0NIYAqj xKb7E5lBHBaBecwSR9ceY+xi5OSQEOhnlXj6IxPCTpN4vOsjWxcjB5j97LI4RLhK4t3WFhYQW 0hAS+LoqdmsEEN3MElcmn6WBaSeTcBEYlaHBEiNiICSxL1Vk5lAapgF5jNKNE3qZQNJCAtESM yYtoUVxGYRUJW49bgJ7AZeAW+Jrj2NrBDL5CRunutkBrE5BXwkzq9/wAqx2Fti3q8rjBMYBRc wMqxi1ChOLSpLLdI1NNdLKspMzyjJTczM0TU0MNXLTS0uTkxPzUlMKtZLzs/dxAgMOAYg2MF4 8bTnIUZJDiYlUV7RyP2RQnxJ+SmVGYnFGfFFpTmpxYcYZTg4lCR4V88HygkWpaanVqRl5gBDH yYtwcGjJMK7DiTNW1yQmFucmQ6ROsVozLFvz60/TBwdN+/+YRJiycvPS5US560DKRUAKc0ozY MbBIvJS4yyUsK8jECnCfEUpBblZpagyr9iFOdgVBLmXQYyhSczrwRu3yugU5iATmnZsQfklJJ EhJRUA6NjTtnqDxsXdbzIild7f/hmsZjqtFebTzFlBHLrnAt9euGUyScpl5l81hXfZrw/I3rh juD/sGMBlZUxnbNK1u76PZ1BKstk+k42h9p5Xhe0v/o4zNYqcYztMd4+t37eg43tB8V9tCdlc W4ROzJpnufzXeJp27j+vq0ru86y1k5Daech+7LuzrdKLMUZiYZazEXFiQDAXFLdxAIAAA== X-Env-Sender: bhupinder.thakur@linaro.org X-Msg-Ref: server-15.tower-206.messagelabs.com!1505730748!98014943!1 X-Originating-IP: [74.125.83.46] 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 25858 invoked from network); 18 Sep 2017 10:32:29 -0000 Received: from mail-pg0-f46.google.com (HELO mail-pg0-f46.google.com) (74.125.83.46) by server-15.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 18 Sep 2017 10:32:29 -0000 Received: by mail-pg0-f46.google.com with SMTP id 7so22323pgd.13 for ; Mon, 18 Sep 2017 03:32:29 -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=TYLrvL3cWtg6BfqLUvKVR2OMXb+9bKwmwgvQM2t7/A+qlDp0a1/UsIzqFrPfvHOmpT KwV1wxjLHgAuUuSzmG77UkAOHpB2cRqcYiRFHZGl2MbVDsLz5JXU9HXsZ/jBXFfgtS3F G8zWhTn2Ld54FGWySTBdKrljfB2qXru4eizkA= 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=Gyi+M5izpLavEPgWhnZlel+kB+JivzC6EOungFhcuL83mIDLKRp2qWC+omYcIjW19h uL1kXB02fmYN8EfF952QbG6NWT+4sasUMqIXmucfejNXCB3n6oM8FVVY3qvSSADTJ9Ag 0y62t+zuCi8SzI0dK060SM+aeWjK1RmhGin5Ip87Y2DOQdF2M1ttfsKYHNFbYjutyQfF mGL0T+JRvd/RjipIK2/lAE1lSwz8n8TdRIo2KPn4UMXD46M0EXR8VNgq61SGU7UBPPym VAIaSHahOHc69Vi4op56ETOOFmuAQKqRHX0lK0KmM6WlhzHFySm4nls5EE0Uw7i4psD+ rkyw== X-Gm-Message-State: AHPjjUiqBfE8CfeuWltvoaAELVyo9Eqrn8mkLZsP1cXxmMUhueJ6OOac c649CDG379Dj7fOZ9l7UQQ== X-Google-Smtp-Source: ADKCNb5SLJWo93rMCgP9HQyycMrgW/FrzxQCm4Y6Yu9Uec3VjH6yqjBtnQgNY8b3OhPGiAFwoOvr8Q== X-Received: by 10.99.160.100 with SMTP id u36mr31934714pgn.22.1505730747732; Mon, 18 Sep 2017 03:32:27 -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 b7sm12937845pge.79.2017.09.18.03.32.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 18 Sep 2017 03:32:27 -0700 (PDT) From: Bhupinder Thakur To: xen-devel@lists.xenproject.org Date: Mon, 18 Sep 2017 16:01:47 +0530 Message-Id: <1505730731-10947-4-git-send-email-bhupinder.thakur@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1505730731-10947-1-git-send-email-bhupinder.thakur@linaro.org> References: <1505730731-10947-1-git-send-email-bhupinder.thakur@linaro.org> Cc: Wei Liu , Julien Grall , Stefano Stabellini , Ian Jackson Subject: [Xen-devel] [PATCH 03/27 v9] 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" X-Virus-Scanned: ClamAV using ClamSMTP 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 )