From patchwork Mon Aug 7 08:52:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupinder Thakur X-Patchwork-Id: 9884739 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 9272F60364 for ; Mon, 7 Aug 2017 08:55:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8588F285D1 for ; Mon, 7 Aug 2017 08:55:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 78D19285DC; Mon, 7 Aug 2017 08:55:52 +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.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_SPAM, 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 1BA04285D1 for ; Mon, 7 Aug 2017 08:55:52 +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 1dednB-0004IS-IL; Mon, 07 Aug 2017 08:53:41 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dednA-0004I2-Ur for xen-devel@lists.xenproject.org; Mon, 07 Aug 2017 08:53:41 +0000 Received: from [193.109.254.147] by server-4.bemta-6.messagelabs.com id EA/9F-02962-49A28895; Mon, 07 Aug 2017 08:53:40 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrKIsWRWlGSWpSXmKPExsXiVRusoztZqyP S4OdhOYvvWyYzOTB6HP5whSWAMYo1My8pvyKBNWP7izPsBa8kK6as2cTcwHhHtIuRi0NIYDqj xLbrP1i6GDk5WATmMUvMna8EkpAQ6GeVmH29hwkkISGQJrF07wk2CLtKouXjbUYQW0hAS+Loq dmsEJPamCT+b5sPNImDg03ARGJWhwRIjYiAksS9VZOZQGqYBeYzSjRN6gUbJCwQIbHs/XMmiM 2qEvePzWIHsXkFvCXOXJrJArFMTuLmuU5mEJtTwEfi/KU3LBCLvSVuH+tjnMAosICRYRWjenF qUVlqka6JXlJRZnpGSW5iZo6uoYGZXm5qcXFiempOYlKxXnJ+7iZGYGAxAMEOxu7L/ocYJTmY lER541e0RQrxJeWnVGYkFmfEF5XmpBYfYpTh4FCS4E3Q7IgUEixKTU+tSMvMAYY4TFqCg0dJh PeFOlCat7ggMbc4Mx0idYrRmGPSge1fmDheTfj/jUmIJS8/L1VKnPccyCQBkNKM0jy4QbDYu8 QoKyXMywh0mhBPQWpRbmYJqvwrRnEORiVh3jCQKTyZeSVw+14BncIEdMqbxFaQU0oSEVJSDYy 5RZMd7ite7HfekX1Vb9Jz5Wzlmty9b/2ls191heySN65e7mSm+15LvTbVPSn9+Nu8v35NJ7S+ inQ//vOXL8TlgsZzh0cb/sc8050bybg4Oeb4ksgZz+wLl8ist/p3KcNLy41RhbPXQbSTbfp7Z bEVWq5VGWnXZPrfLGjluLzm77Wd5y6v91ViKc5INNRiLipOBACItC4PuAIAAA== X-Env-Sender: bhupinder.thakur@linaro.org X-Msg-Ref: server-6.tower-27.messagelabs.com!1502096018!110814068!1 X-Originating-IP: [74.125.83.44] 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 14007 invoked from network); 7 Aug 2017 08:53:39 -0000 Received: from mail-pg0-f44.google.com (HELO mail-pg0-f44.google.com) (74.125.83.44) by server-6.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 7 Aug 2017 08:53:39 -0000 Received: by mail-pg0-f44.google.com with SMTP id u5so31658935pgn.0 for ; Mon, 07 Aug 2017 01:53:39 -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=l6qPJ2j2XHzH4tm5SO40ctm3ZgjV1/opafjwCKIt+cs=; b=IMF8O629+wVkJk8+rBS5IrYoasBXJs0CGNe9lcDG9evxGp4j2h16kQ2a21+2VBQiPk 1v6A2GIjAN/PtIW6lwgMPp0sgFzafvInqZpqXRDM2NZmcqdNkbFjdzTeeFJzSDDsupzT tvuGcyE2qJ2Ww5f7Vn7jKbGPLhtHRRXYHnVk4= 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=l6qPJ2j2XHzH4tm5SO40ctm3ZgjV1/opafjwCKIt+cs=; b=k32eZfOQvdH007fkZs8VekqrnBYQAGeaUOqMDwLWhW+n6VfckqygLvLEP8jwWAlkyO WQeUrECDESqUiu623Fo2IfavyIk6nRXwFBBCrEdwNumomXtM+mVK3nzMI5RY6SPSnbBl RcMDVwuXp+DZMQeHohliY3fQtdaKZKQELnvjMGcOnt8wCIdHzdnHwwO3AmarwIWTa42z Xsigj2f4fx26cXfnnoUxNxP/DfcYh/woH0MKpf1/hisJeSahhXHGeDkUwGj4EJnRXpxw gKBU7gKqrqw81HkFrqqdTVqlyil5KHHItfofBtcLlmzFGRKHLLoYya9LTp/PyIM4Nr52 dpxw== X-Gm-Message-State: AIVw111bXUGRwd/oEHRiFELV/K2QKNwA7UN3xlF01pNuVoi27t8ycBwz hdmwLwlaxqmpsQohSBZl6Q== X-Received: by 10.99.151.17 with SMTP id n17mr10701590pge.157.1502096016700; Mon, 07 Aug 2017 01:53:36 -0700 (PDT) Received: from blr-ubuntu-linaro.wlan.qualcomm.com ([103.5.19.18]) by smtp.gmail.com with ESMTPSA id p77sm12604047pfi.153.2017.08.07.01.53.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 07 Aug 2017 01:53:36 -0700 (PDT) From: Bhupinder Thakur To: xen-devel@lists.xenproject.org Date: Mon, 7 Aug 2017 14:22:55 +0530 Message-Id: <1502095997-31219-4-git-send-email-bhupinder.thakur@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1502095997-31219-1-git-send-email-bhupinder.thakur@linaro.org> References: <1502095997-31219-1-git-send-email-bhupinder.thakur@linaro.org> Cc: Wei Liu , Julien Grall , Stefano Stabellini , Ian Jackson Subject: [Xen-devel] [PATCH 03/25 v7] 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 e7d4bd0..c981b7a 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 )