From patchwork Thu Jun 22 07:38:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupinder Thakur X-Patchwork-Id: 106165 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp2327112qgd; Thu, 22 Jun 2017 00:41:15 -0700 (PDT) X-Received: by 10.36.211.69 with SMTP id n66mr692577itg.36.1498117275887; Thu, 22 Jun 2017 00:41:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498117275; cv=none; d=google.com; s=arc-20160816; b=bhbU0f89j5lbqe0hO9lFWrPyZYiiZDa6mZx0k+hDncolGZuEU8wbnwEANccFKv0MdT fDEYLv0fWsSA9PQo98VEywqjRDlYHnrGBvUUj0zgwh2qDXnmMkUkUVgRfcoCjoJK+kXX e2REVleufJvuuY2VN5vxx+4woAAn7Y3InqqBOg28f+lzcuvrDE6+Eg6vcbXvBPD0tQt7 Hxh+o7Nt0c9jUfWsr5ZxIWnn3MGuivATz27S4y5Mur8LP8HD2Ig82GyZoIJ9Tm5OJR9G pk4r7USf0Wn/2Fi3fO2Rz+ArIbAWVcgoC/dfSchS7HbFgpMsgJJrK/B4tp0c3EBc0L4Q OA2w== 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=d23F1O6qb/I6F+2OFIqAHgS6mjWuJ06gCWICNNt5+jg=; b=OSwzg/DeDMFg2t33LUvAGMgu0IAnJboOURL9aVIvv+tS98hVNjH1HjTptN/efZ8UY1 cexz7dMY0F6GPrRG+Qn5BdOPSNHPj5rB788O8ttHF+dJe1FV4kAJnAE14gs5VS/NrbaI eIiVAzLu1e1ydTXb7YX5TTx7epA/ee9AZuQrQrzEiT7ue/H6dLRBsAQbdcCUeps9qVyZ cLJCsZBelcfcQ2WoixnqSrYamV/tF2f6LHFJQ4pGmSUJEp4iw4t4H6h6GVFKE3/7sWSz qFZVK9got+w7c50RH7oS/AvwvrhVXe21Sx3U9OCfhPdRdCuUD5tV5hAW5nqsxeMYlqCS jAtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=L3aG+0AU; 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 v66si712786iof.177.2017.06.22.00.41.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Jun 2017 00:41:15 -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.b=L3aG+0AU; 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 1dNwhx-0005RQ-As; Thu, 22 Jun 2017 07:39:17 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dNwhw-0005Pg-DI for xen-devel@lists.xenproject.org; Thu, 22 Jun 2017 07:39:16 +0000 Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id B2/9A-02022-3247B495; Thu, 22 Jun 2017 07:39:15 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrAIsWRWlGSWpSXmKPExsXiVRtsqqtc4h1 p8GQri8X3LZOZHBg9Dn+4whLAGMWamZeUX5HAmrH9xRn2gleSFVPWbGJuYLwj2sXIxSEkMJ1R Yve5N0wgDovAPGaJJ/fesoI4EgL9rBITDz9h6WLkBHLSJLZseMcMYVdIrJq4hRHEFhLQkjh6a jYrxKh9TBL7Vt1j62Lk4GATMJGY1SEBUiMioCRxb9VksA3MAvMZJZom9bKBJIQFIiQWLtnDCm KzCKhKfO1uYAbp5RXwlph3Lh5il5zEzXOdYHs5BXwkVuxYyA6x11ti15nJLBMYBRYwMqxi1Ch OLSpLLdI1NtBLKspMzyjJTczM0TU0MNXLTS0uTkxPzUlMKtZLzs/dxAgMrXoGBsYdjBNW+R1i lORgUhLl/Z/nHSnEl5SfUpmRWJwRX1Sak1p8iFGGg0NJgle5GCgnWJSanlqRlpkDDHKYtAQHj 5IIbwtIK29xQWJucWY6ROoUoy7HpAPbvzAJseTl56VKifOKgswQACnKKM2DGwGLuEuMslLCvI wMDAxCPAWpRbmZJajyrxjFORiVhHn1i4Cm8GTmlcBtegV0BBPQES+OeIAcUZKIkJJqYFyvLxs 3nWdulPrBLcazX36Kaps0STNcRfKXBvOkvkRvMfOCF68Euxe4dcvbVqRPbUhQ/DupXoDRN0Tg 0etL7bkvzT/1X0/Till8nSE2yDn0hfdp+RfH/iQavLm9iiVgSmPyI8cXU1I5w+IfTRa6uEFBz zD47S1Bjtnz/L+vbTC7sPsw6wEeLSWW4oxEQy3mouJEAHRdepizAgAA X-Env-Sender: bhupinder.thakur@linaro.org X-Msg-Ref: server-10.tower-206.messagelabs.com!1498117154!76094795!1 X-Originating-IP: [74.125.83.53] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.19; banners=-,-,- X-VirusChecked: Checked Received: (qmail 18348 invoked from network); 22 Jun 2017 07:39:14 -0000 Received: from mail-pg0-f53.google.com (HELO mail-pg0-f53.google.com) (74.125.83.53) by server-10.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 22 Jun 2017 07:39:14 -0000 Received: by mail-pg0-f53.google.com with SMTP id u62so4581647pgb.3 for ; Thu, 22 Jun 2017 00:39:14 -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=L3aG+0AUs3ZIO7f+qOpxTGAZFrOjChgcRTboNevDNa0cX3EFanw/X6bXJ/iF2UOolZ rTxl5PGeOglNYKUMNMALWKB+VpT+jMWjzDHt75Krx8V5pjFzRoNM3m2NySwD5vSudcIA V71t9WZI65BGZip6MJLjbC1O7mjH2YHwhWR9k= 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=mFmz1XuiDpRNSGCzCq7enrQ7AWGjDJomxfsNdI0uf7ndd6dLlMBY8MApV2OmbQJ1ud Lft5wSEbsAyI8f1dO4kMcFP3OYpg//U7xZy47uHpCs6t3ytLPBq3sBkh71EGq+MQch1L +orGYi0RcZWJsdeE5z0UF0PFAzJZEavzO4HWPJOmPFwE1GraIzEJbF6rDpXjJJMqTRfl Khb6vBai///gbTcjNHVWKu/IdstLmb/Q1DhY57IKM0+PCSD0X6CnMlT6q5XamJdnkkjn DRusp5fbZPfi96THYwnC6Pr85MyTfyAC1vc+0NcUIsK8ilzkCxVCk8Mw3PsWe+da4o4G AbbA== X-Gm-Message-State: AKS2vOzN9VouYq7+w4vGSjV7m5f1iIvxUABpvG5I9Ox22ZS9NIqEX3bT 6r0DUncFyMTAJyQNCzs5dQ== X-Received: by 10.98.69.219 with SMTP id n88mr1202762pfi.93.1498117153416; Thu, 22 Jun 2017 00:39:13 -0700 (PDT) Received: from blr-ubuntu-linaro.wlan.qualcomm.com (blr-bdr-fw-01_globalnat_allzones-outside.qualcomm.com. [103.229.18.19]) by smtp.gmail.com with ESMTPSA id w69sm1883591pfk.107.2017.06.22.00.39.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 22 Jun 2017 00:39:13 -0700 (PDT) From: Bhupinder Thakur To: xen-devel@lists.xenproject.org Date: Thu, 22 Jun 2017 13:08:40 +0530 Message-Id: <1498117132-27139-6-git-send-email-bhupinder.thakur@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1498117132-27139-1-git-send-email-bhupinder.thakur@linaro.org> References: <1498117132-27139-1-git-send-email-bhupinder.thakur@linaro.org> Cc: Wei Liu , Julien Grall , Stefano Stabellini , Ian Jackson Subject: [Xen-devel] [PATCH 05/17 v5] 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 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 )