From patchwork Wed May 10 14:35:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupinder Thakur X-Patchwork-Id: 99002 Delivered-To: patch@linaro.org Received: by 10.182.142.97 with SMTP id rv1csp234171obb; Wed, 10 May 2017 07:39:25 -0700 (PDT) X-Received: by 10.36.214.200 with SMTP id o191mr1212108itg.48.1494427165803; Wed, 10 May 2017 07:39:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1494427165; cv=none; d=google.com; s=arc-20160816; b=RJ0L2kNOPQoIH1AZO0ImWUWboucYZsXZAvSXuhygOw4FtMGGTHns8yVf0qioQNvEqI FvF+0pZPlbQTw9OJUB6PFrdwHHGhh/rLRsYqLfuBuPHwvH7SiqsFWxQiQtFyg3HnaC/X m7rGpuKiEQrhJVuWT6fWYtQZ8uHVTpp9Bil6iolIeMpGgDfvKDLN901cF6zJKQ0AA0iv JTADW7slelFA7Z9P6wqG8RLD7B1YmYAtIqLj1lAOTCmfgbnSmUOLKvb9tZLczhLRyD0K xTi0rrmBWO8f42Yw/lZj9hsVKrYe0b9FxEXAlrY6S6KpyDffWxqMw63hAAXFD9Zc5xHO Xp5Q== 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=Dekwgr+qJK6dKTGvNRrqiGt0F4m5GVRgwmiHVW4Yuf4=; b=tbLR4MIPdV7hwJpOXZaNrhnei1yJNoGqRdeX9hUCK4Xh4LeKmG2ospw0yq863KVxlZ 5SECGtNKDxEm3n1izraJoS6ksU82xNL+hhyeoJthaQvGqz2N/3dfcndtlwB8V3A4eCtE vQKBFgKIcXGUeviZw+CElCobNlN6fsphKAGgDiJzMmGdNU9PUxgwmmBniGZMbH6ZzEc7 0/t412hzOeEwiCKym185/Ke86GkPRgPEk013YpuhNa/vaVg/SXTHabFWWJmIhv24GYeB xpOTdIK4JE8rxzwLRZXQqJXto8Iu/qXhWGKF42/JbK/iq+xC9KkI4VxsdNwSTJ8k9DIr VMLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; 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 i126si2360319iof.53.2017.05.10.07.39.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 May 2017 07:39:25 -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; 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 1d8SkG-0004lc-OX; Wed, 10 May 2017 14:37:40 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d8SkF-0004kt-BV for xen-devel@lists.xenproject.org; Wed, 10 May 2017 14:37:39 +0000 Received: from [193.109.254.147] by server-11.bemta-6.messagelabs.com id 1A/DB-03587-2B523195; Wed, 10 May 2017 14:37:38 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprPIsWRWlGSWpSXmKPExsXiVRtsqLtRVTj SYN0Pa4vvWyYzOTB6HP5whSWAMYo1My8pvyKBNePsx7csBe+EK9pX9rM1MF4V6GLk4hASmMko 0X9wPhuIwyIwj1li//o5YI6EQD+rxJFvxxi7GDmBnDiJDdO6oOwyiUNLVrGD2EICWhJHT81mh RjVzCSxYOYh5i5GDg42AROJWR0SIDUiAkoS91ZNZgKxmQW8JT4c+QfWKywQIfH44VUwm0VAVe LU7hmsIK28QDXNXZoQq+Qkbp7rZAaxOQV8JBa9eskCsdZb4tHnPywTGAUWMDKsYtQoTi0qSy3 SNbLUSyrKTM8oyU3MzNE1NDDTy00tLk5MT81JTCrWS87P3cQIDCwGINjBeGBR4CFGSQ4mJVFe 3V1CkUJ8SfkplRmJxRnxRaU5qcWHGGU4OJQkeE+oCEcKCRalpqdWpGXmAEMcJi3BwaMkwrsXJ M1bXJCYW5yZDpE6xajL8Wjlj/dMQix5+XmpUuK8nSBFAiBFGaV5cCNg8XaJUVZKmJcR6Cghno LUotzMElT5V4ziHIxKwrwXQKbwZOaVwG16BXQEE9ARgQwCIEeUJCKkpBoYD+xLOxWRrjjLyN9 qY742k+7h42a2fXqTL7JWWT+1Udgl92ZuQpPVp2CGxF7O2d99NnUVxn177bPRkkE8rVN7Zdv/ 5gVLIi6ef7jw9PwqkyC+ntio5doz3Xl5THvyDWYZV7C8+VyhfXP2qa2TzPKUWa9Fz1KKeaJ++ /JRg+8mjfsSjkY3zYxSYinOSDTUYi4qTgQAGnezr7ICAAA= X-Env-Sender: bhupinder.thakur@linaro.org X-Msg-Ref: server-3.tower-27.messagelabs.com!1494427056!101067131!1 X-Originating-IP: [74.125.83.49] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.12; banners=-,-,- X-VirusChecked: Checked Received: (qmail 53408 invoked from network); 10 May 2017 14:37:37 -0000 Received: from mail-pg0-f49.google.com (HELO mail-pg0-f49.google.com) (74.125.83.49) by server-3.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 10 May 2017 14:37:37 -0000 Received: by mail-pg0-f49.google.com with SMTP id u187so17673265pgb.0 for ; Wed, 10 May 2017 07:37:37 -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=+6Sy4cq/rwVv/N/EC7bK+kPiSgzhsQKhN5hatALg6Fc=; b=GZtv2Gdkbyiet+APqQFws8q7GBSrllxxCKoAN0qwJumT9gXhZb8Ht0Nx5CsTpQcXED +sKYkrL2iV0aAeZdlIhNX6POTmt/eAPhrDWxDnCUISSjzC71uYnH80Akl2mxqfEhKoIP 7/S8hMxL4Ppu+ltcbxh6IxOnCChvxDdVeEYwc= 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=+6Sy4cq/rwVv/N/EC7bK+kPiSgzhsQKhN5hatALg6Fc=; b=dZiu3Pj2nQQqcr9z6uCCL+Kugpd1572+t9HRm0rXrjw6P2tGDREHpZe6/FlbAsjDBc lGdW4DcFVq61+y0OGu38ZoxyaVW4hE0+vOqkxmlUgkwkbB/IM2OaCst1kTAlx/yoTH+e W4Vn/RlfP+5ZW4mGm5JWQVS5AVy6h3Z2DebXIbvZFBcza7EdPPzs2KPR85X5dlS03Hqs 43nPmgOu1Jdd8YUN37vX2JwzEHD6dfCrJHzxdDvORqyOR3ZL5EMiUwz0qE08FU1PrRGA 6um2tzo/Az2D/+mhttgP7B8/fPiOP4xW5h7ADY8RCELeGFVjTewPjHkNvacNwCqrtEoi jbxQ== X-Gm-Message-State: AODbwcBRKqnOoxWyQB07RZu5TXHQSk8ZSpivUOZynGI3zMO9NpYMmIGY R9hDJCxX6/I0A/E6 X-Received: by 10.99.164.2 with SMTP id c2mr6837147pgf.73.1494427056545; Wed, 10 May 2017 07:37:36 -0700 (PDT) Received: from blr-ubuntu-linaro.wlan.qualcomm.com ([61.0.91.57]) by smtp.gmail.com with ESMTPSA id r73sm6167781pfa.65.2017.05.10.07.37.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 10 May 2017 07:37:36 -0700 (PDT) From: Bhupinder Thakur To: xen-devel@lists.xenproject.org Date: Wed, 10 May 2017 20:05:13 +0530 Message-Id: <1494426918-32737-2-git-send-email-bhupinder.thakur@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1494426918-32737-1-git-send-email-bhupinder.thakur@linaro.org> References: <1494426918-32737-1-git-send-email-bhupinder.thakur@linaro.org> Cc: Wei Liu , Ian Jackson Subject: [Xen-devel] [PATCH 07/12 v3] 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 data. Signed-off-by: Bhupinder Thakur Acked-by: Wei Liu Reviewed-by: Stefano Stabellini --- 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 )