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: 9720003 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 63A29603F8 for ; Wed, 10 May 2017 14:39:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 561B5285FE for ; Wed, 10 May 2017 14:39:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4AFC328602; Wed, 10 May 2017 14:39:46 +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=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RCVD_IN_SORBS_SPAM,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 ADF03285FF for ; Wed, 10 May 2017 14:39:44 +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 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" 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 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 )