From patchwork Wed Sep 27 06:13:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupinder Thakur X-Patchwork-Id: 114328 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp4665279qgf; Tue, 26 Sep 2017 23:16:52 -0700 (PDT) X-Received: by 10.107.36.83 with SMTP id k80mr420576iok.176.1506493012568; Tue, 26 Sep 2017 23:16:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506493012; cv=none; d=google.com; s=arc-20160816; b=Ks6IiCINRrWAOIGMotfAp/zsbZL7+r1ClY68v1uuv1M6D5OkyFiiXuAiEW9OEYcXVb pshYGHUh4PAHeOjvRTgLmhez/ZPbBm7NquN7GzgqsuMe0KmMLPQEXuxRP7xaXgcyu2tN D62vm9hkbZ3MUvQ7mE7t7BUDIoqwJ7MPaF6mlINIKk5xynxxbfzVUwi9uXsGpANy/aOG H6IVBH4QV4FsabicCyGU5bvNh6lNbgviZcH08vqpmc00PBFCYJuQpdrCbcDTydyj+vNV syuFVhA8ry0ap/fM37j+lQD/y6tGtqNPLD7sxJ1DUndnWx2Yg09zVHprowuhZG8eN8nL 8+NQ== 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=XfwU7K6hBydRdcZs4SD6Nn+XqcSGGDTYfewGpxhijZmSn7tJ8mc6YTV3AmkLZAwhzB SoGflD0Su3wND/eg5JetvWwbahAGfLV8dxeWg+3gvPi/1Bg83Q5mBBKhItSr+4tRC5l9 CJG7mbEVcrwU+RrTqWbcixIOdjt4Aqk+cMRqtfELVJZJSMdbGAIBKC2jCz2GXEVPUWz9 nDCDCqCk2gZGFnT1B2Tism7U26iKF18ssPHZBvMUnN6CztvFuc0WCGiy5yN06Wc6gphO 8RL/Z1JGCvIgjm+9B99fQbR+3MQhIwCOfliE6XfJ83LsfQgvzReJhPqefVM2M09C10Rj Jz0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=VsBzDlI3; 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 l192si8923732ioe.234.2017.09.26.23.16.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Sep 2017 23:16:52 -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=VsBzDlI3; 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 1dx5bQ-0002Q8-18; Wed, 27 Sep 2017 06:13:48 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dx5bO-0002PX-Iy for xen-devel@lists.xenproject.org; Wed, 27 Sep 2017 06:13:46 +0000 Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id 3D/AA-30935-9914BC95; Wed, 27 Sep 2017 06:13:45 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrLIsWRWlGSWpSXmKPExsVyMfTAat2Zjqc jDRoe8Ft83zKZyYHR4/CHKywBjFGsmXlJ+RUJrBm/bzSwF7ySrDh8YQlbA+Md0S5GTg4hgRmM Es/mxYPYLALzmCWurOboYuTikBDoZ5WYNPMxO0hCQiBP4vWhJ0wQdprE6y19jBB2ucTFP72sE IO0JI6ems0K0iwksIJJ4sXjDqAiDg42AROJWR0SIDUiAkoS91ZNZgKpYRaYzyjRNKmXDSQhLB Ap8e75X3aIK1QlWv53gC3gFfCWWDr7MRvEMjmJm+c6mUFsTgEfidP9t9kgFntLXFrZzzqBUXA BI8MqRo3i1KKy1CJdI0u9pKLM9IyS3MTMHF1DA1O93NTi4sT01JzEpGK95PzcTYzAgKtnYGDc wXh5i98hRkkOJiVR3pr/pyKF+JLyUyozEosz4otKc1KLDzHKcHAoSfDecDgdKSRYlJqeWpGWm QMMfZi0BAePkgjvNZA0b3FBYm5xZjpE6hSjPceFO5f+MHF86b0BJA/suQUkO27e/cMkxJKXn5 cqJc57EaRNAKQtozQPbigsVi8xykoJ8zIyMDAI8RSkFuVmlqDKv2IU52BUEua9CzKFJzOvBG7 3K6CzmIDO6p16AuSskkSElFQDYzLr2vXcj5wVN7L6sUcU3F71aU3Igzf8jfe+f1uhyT6X9WRt /d+QOztETBVvdupVNK70CJv3eY+p/r4NO63+st+yXlbks7lZ1evLBNO2b873vh31UtzTwuYcW DGz+tG+Y11sj9NXy6wrTN/U+UwmRnRF1/GqmiuF/ZNqZqz2L1qae/J2/NGvfEosxRmJhlrMRc WJAIGra/HQAgAA X-Env-Sender: bhupinder.thakur@linaro.org X-Msg-Ref: server-7.tower-206.messagelabs.com!1506492824!110540296!1 X-Originating-IP: [209.85.192.171] 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 9466 invoked from network); 27 Sep 2017 06:13:45 -0000 Received: from mail-pf0-f171.google.com (HELO mail-pf0-f171.google.com) (209.85.192.171) by server-7.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 27 Sep 2017 06:13:45 -0000 Received: by mail-pf0-f171.google.com with SMTP id m63so6749926pfk.7 for ; Tue, 26 Sep 2017 23:13:45 -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=VsBzDlI3xGU9fp/s9/NwZ/ENrH26TT8CZ2xBMPZLRYpC91iD+oPGbts6W0vOemdfUu 7EYbvjgUP9Uj6Bwh2pXuz0Z+e/AfWqv7XK0HDizf5FXkXPGWGblT7mL6PWpLMzthUYt9 jhMp67+2F1BPGsfJ4tCs/7dY7Ljf06M5jA8OU= 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=TKqRTMtFJ4sQZ5s/ITfsDxH4grAv3/v97yNgpFHUziidWsT+INOfvUPxcT7DHKGKei /1B9y8W7jO1rfsY33yQPppMVv2e323rPJAapFmM5Xx0xX3gLDM7+VpwYP8PrhLGFaKW3 ftZhD2IXvH69b7TV1vj+6MevsHDbGyqNbXdSVTfsHTpW5dcsNJKwl0P1HWfQS+JJC9iR YijYqWOdQdXgZ/MyluXosw02x/l+tAJQzcNjhpw/h9zf0kdD8+hw5RvVkHgrA/WQbEMz Yky//UFiTzZUIT5N0yTW+Rlt2m8BBM8plL3P7xM35ySn3nZdLAmu5c3bdgTkCqacPR7o OEDg== X-Gm-Message-State: AHPjjUhmuoYylZdvfBOmfWXTh/nwlNFRcfFJWfF/C120AJMVhLtRgxHJ /SeU6a3rfP36kVuPZdG9ztPrDmr8aKI= X-Google-Smtp-Source: AOwi7QBmG8hS9MCVJxE9v/jJjePlDhE8Mc2BrQL3mSQQlCxbvjfX2wEYycKbkPAyXurVaCaP0iDfWA== X-Received: by 10.99.170.14 with SMTP id e14mr367584pgf.12.1506492823549; Tue, 26 Sep 2017 23:13:43 -0700 (PDT) Received: from blr-ubuntu-linaro.wlan.qualcomm.com (h3.248.139.40.ip.windstream.net. [40.139.248.3]) by smtp.gmail.com with ESMTPSA id s187sm18013485pgb.82.2017.09.26.23.13.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 26 Sep 2017 23:13:43 -0700 (PDT) From: Bhupinder Thakur To: xen-devel@lists.xenproject.org Date: Wed, 27 Sep 2017 11:43:12 +0530 Message-Id: <1506492816-25954-4-git-send-email-bhupinder.thakur@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1506492816-25954-1-git-send-email-bhupinder.thakur@linaro.org> References: <1506492816-25954-1-git-send-email-bhupinder.thakur@linaro.org> Cc: Wei Liu , Julien Grall , Stefano Stabellini , Ian Jackson Subject: [Xen-devel] [PATCH 03/27 v11] 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 )