From patchwork Mon Jul 17 13:06:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupinder Thakur X-Patchwork-Id: 107949 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp4495277qge; Mon, 17 Jul 2017 06:09:33 -0700 (PDT) X-Received: by 10.36.129.138 with SMTP id q132mr5519221itd.62.1500296973798; Mon, 17 Jul 2017 06:09:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500296973; cv=none; d=google.com; s=arc-20160816; b=WNoEB3HrfyMogSzPykV9ohWSESgdxJRAqkShQpjkNk8gFwvGD5JwD9eIpgl7ZzkgjE l40Xe3BIwFg2CYYK9YpnGY7d8+NmUnf4z6VxT0aNdm13pyFSCM5eI0P4m//wDaMIFMsU kKK7aSVPOkwl7/qgxq9Rt7ORYc/pPOzE2kyzQiOVfbXuGTMB3eHkQybaGSXJlV2y2izw 9Hz3vumZvlCMEqwBAhoEyy6/mDdTiSYX+tHaayCqwSRkPy57PCDwMUQPtXrkruUzbVwG rphp92NRBMvTnAdWKb6a/UND4vxIipQDscVc79i7Smp4Sb5ihp/Zz75mOZIzn6vDGq2x USzg== 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=IR3pYMGe+i4pQDy3V1alln/C+VQau8iOfedqYqbSPxM=; b=WFT9rOjyCIr3kkH6xB7tKIiyAASwrubh5tNmMfUNfvCwqJMXjSGrUMMdowtIFxSZUI qAVKXTAtm5+8w8KuE1IPRjttt4Fl1KrvXVxKRVqpdCac4btvdH6EVpE52+c7DQNychjc WKlCdZzIHe7eEQFL/NnY67O1AVj4QFsqARKzZaFmoh3ArZJRDLjL7IKdXZcNPkADYn5U Lat8WIktIoblL8qM3Dz7kII8LXnc3/ieEj9J+/taNUC8qVwJtf66Y0JIpBUVgXiaxmZ9 YZM0kkN3ApLSFJkoGAtdM1LDG7/AX1rSbAUmD3DfmiRWCWSmUfeJSMRrAkh3An+OFkPx wblQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=g1i/hu1J; 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 b3si9945441itd.139.2017.07.17.06.09.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Jul 2017 06:09:33 -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=g1i/hu1J; 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 1dX5k4-00048X-2O; Mon, 17 Jul 2017 13:07:16 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dX5k2-00047t-UA for xen-devel@lists.xenproject.org; Mon, 17 Jul 2017 13:07:15 +0000 Received: from [193.109.254.147] by server-11.bemta-6.messagelabs.com id 9D/C2-03612-286BC695; Mon, 17 Jul 2017 13:07:14 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrNIsWRWlGSWpSXmKPExsVyMfTAJt3GbTm RBofuy1l83zKZyYHR4/CHKywBjFGsmXlJ+RUJrBk/D7EW9ElXnFi7hK2B8aFYFyMXh5DADEaJ N3fesoI4LALzmCWeN09mAXEkBPpZJV4cusHcxcgJ5KRJrOi5DJTgALKrJDqa2UHCQgJaEkdPz WaFmNTKJHF73UkmkBo2AROJWR0SIDUiAkoS91ZNZgKpYRaYzyjRNKmXDSQhLBAh8WDzJTCbRU BV4vr2DywgNq+At8TelkcsEHvlJG6e6wS7gVPAR+LMhtVMEIu9JW4emcg0gVFgASPDKkaN4tS istQiXWMjvaSizPSMktzEzBxdQwMzvdzU4uLE9NScxKRiveT83E2MwMBiAIIdjKfXBR5ilORg UhLlvciWHSnEl5SfUpmRWJwRX1Sak1p8iFGGg0NJgtd9a06kkGBRanpqRVpmDjDEYdISHDxKI rxdW4DSvMUFibnFmekQqVOMlhxXrqz7wsQx5cB2IPlqwv9vTEIsefl5qVLivHog8wRAGjJK8+ DGweLwEqOslDAvI9CBQjwFqUW5mSWo8q8YxTkYlYR5dUGm8GTmlcBtfQV0EBPQQcK+YAeVJCK kpBoYW7ZXMLeXM08EpoqVzpd/rZrr9nu2dOcy4blpnZFixlc/O3/vkPHYyXyh+PCcR1VN5V/U 59quOtMx8VV9wc/PYW1fN5pIX1OTrpU/tUl7pvvLlOn7vRS2B5fsTnqpZ3rV26fT9b5iqm5pv 5P8MmnF8gNfdlR7Fd6Mr0jwkwg4z/Bk5d26rD4lluKMREMt5qLiRAB+YtYEvgIAAA== X-Env-Sender: bhupinder.thakur@linaro.org X-Msg-Ref: server-14.tower-27.messagelabs.com!1500296832!95082588!1 X-Originating-IP: [209.85.192.178] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.25; banners=-,-,- X-VirusChecked: Checked Received: (qmail 51412 invoked from network); 17 Jul 2017 13:07:13 -0000 Received: from mail-pf0-f178.google.com (HELO mail-pf0-f178.google.com) (209.85.192.178) by server-14.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 17 Jul 2017 13:07:13 -0000 Received: by mail-pf0-f178.google.com with SMTP id e26so8415263pfd.0 for ; Mon, 17 Jul 2017 06:07:13 -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=ApzB1RQ44i/zDRxK/ABxhhWVVjRsJPkZLhhcrB5okWY=; b=g1i/hu1J2oZBowq/rgfOd1jyZP16LESyh172GKi0Z6XQt2DmBM7h1Jmvy/hZW+TzMt Q24OGABTYmoxQg0Tk6BYk2dfIbN1EAV3BzLToipMryAp+pRfo6AC+Ff+olc5siKdFQzI j/TLlr0aQRXBU1W+/UGevout/GYxenoUqanfE= 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=ApzB1RQ44i/zDRxK/ABxhhWVVjRsJPkZLhhcrB5okWY=; b=LEIV7E3AanLo5XgBIBVCNjWsIR9WX5msrd+ZUvGef5vsPlEMMgzhiqivEBrCWxE/8h I1ecoW82yyJFI/Z/sejE4MUtNjvH2AIfcsN0w4zj/avsc8LH6tKevK0sDJHeA2FbLSmL azZr1gNyeLieg1nNhDZFg0W9mjLhCuITZGseUy8GOrNTIQWlzLB+Q5VK7+PdFQ9Z3RTO 4Tn/o7U5brpY261XcnENTK/Fk7GCnRTKYQn6cGOqiw+/SdEYStykZrYal6l0tOhHL9m4 vl6sFdm4SXHvctep7aFXznY9V3pjMHDXgtbqoj5AHOvt4x8XWwHteqUlF8QQr5QwXKHs LJ1w== X-Gm-Message-State: AIVw111PhvtScfJAKBbixYr6FAQXGthwrDAUmVKT7HwVaZKjJe/Dyy5m 8/3cUi72++VataPWPWk/Mw== X-Received: by 10.98.158.29 with SMTP id s29mr19376938pfd.126.1500296831781; Mon, 17 Jul 2017 06:07:11 -0700 (PDT) Received: from blr-ubuntu-linaro.wlan.qualcomm.com ([103.5.19.18]) by smtp.gmail.com with ESMTPSA id z69sm15705665pgz.42.2017.07.17.06.07.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Jul 2017 06:07:11 -0700 (PDT) From: Bhupinder Thakur To: xen-devel@lists.xenproject.org Date: Mon, 17 Jul 2017 18:36:33 +0530 Message-Id: <1500296815-10243-4-git-send-email-bhupinder.thakur@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1500296815-10243-1-git-send-email-bhupinder.thakur@linaro.org> References: <1500296815-10243-1-git-send-email-bhupinder.thakur@linaro.org> Cc: Wei Liu , Julien Grall , Stefano Stabellini , Ian Jackson Subject: [Xen-devel] [PATCH 03/25 v6] 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(-) 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 )