From patchwork Mon Apr 3 09:44:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupinder Thakur X-Patchwork-Id: 96596 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp18467qgd; Mon, 3 Apr 2017 02:46:59 -0700 (PDT) X-Received: by 10.107.3.14 with SMTP id 14mr14455162iod.231.1491212819609; Mon, 03 Apr 2017 02:46:59 -0700 (PDT) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id 17si9231948iob.248.2017.04.03.02.46.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Apr 2017 02:46:59 -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 1cuyXr-0001T2-KF; Mon, 03 Apr 2017 09:45:07 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cuyXq-0001SV-Hd for xen-devel@lists.xenproject.org; Mon, 03 Apr 2017 09:45:06 +0000 Received: from [85.158.143.35] by server-11.bemta-6.messagelabs.com id 63/72-03642-1A912E85; Mon, 03 Apr 2017 09:45:05 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrAIsWRWlGSWpSXmKPExsXiVRtsqLtQ8lG EwfrZPBbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8a3hh2sBWukKxqnHGVsYFwn1sXIxSEkMItR ovvKa0YQh0VgHrPEjQ/vwRwJgX5WiV2LFrF0MXICOTESj3+cYIawKyXerPsHZgsJaEkcPTWbF WJUK5PE56VNQA0cHGwCJhKzOiRAakQElCTurZrMBFLDLDCfUWJvz1lWkISwQLJE69k5jCA2i4 CqxMrfr5hAbF4Bb4ktc1ezQyyTk7h5rpMZZCangI/ErVcJEHu9JV7dn8Y2gVFgASPDKkaN4tS istQiXUNTvaSizPSMktzEzBxdQwMzvdzU4uLE9NScxKRiveT83E2MwNBiAIIdjN+WBRxilORg UhLlfXPnYYQQX1J+SmVGYnFGfFFpTmrxIUYZDg4lCd5ciUcRQoJFqempFWmZOcAgh0lLcPAoi fBOAknzFhck5hZnpkOkTjHqcnzoP/yGSYglLz8vVUqcdz9IkQBIUUZpHtwIWMRdYpSVEuZlBD pKiKcgtSg3swRV/hWjOAejkjBvPMgUnsy8ErhNr4COYAI64gnI/bzFJYkIKakGRtfvK1aHzMz fW9fdvD/Y8gtX8CP36PnWRpcf5+/cMyPg65xvxyU8av/7LWWOrdw+d2WUBcNpoXUzlG5fWsml mbr2QV/Z4u2++5Jm+4meXiz56ukUraVCfgsuqCap6Qm1i+ZrJ+1YkcHz5oC2cs6rxnyrUO6tb cbic5e9lpX99ep0+9TIH40PpZVYijMSDbWYi4oTAQekY3uzAgAA X-Env-Sender: bhupinder.thakur@linaro.org X-Msg-Ref: server-10.tower-21.messagelabs.com!1491212704!55111662!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.2.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 23599 invoked from network); 3 Apr 2017 09:45:05 -0000 Received: from mail-pg0-f49.google.com (HELO mail-pg0-f49.google.com) (74.125.83.49) by server-10.tower-21.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 3 Apr 2017 09:45:05 -0000 Received: by mail-pg0-f49.google.com with SMTP id x125so115253461pgb.0 for ; Mon, 03 Apr 2017 02:45:04 -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=SzRnVnaIjcbhVkeY5DIrcjdp1N9a40mqnv50ikNMOBc=; b=YdJ8KBnlMGJwHJvbfx5D4EC+LtwU2ZoTVuzNzaCNpWjP4uNOHsjJmGY6r+WQC+VAkG 7n/f0DDKv86CEnH8/Ozoz91M8BYmJtM+p3ePjRDRVsxc2VQTiSNDZdhHCEuNNmeAHmZB xFcuvCRyXcKMzwd11Veae4Y337DOnDZxmhC4o= 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=SzRnVnaIjcbhVkeY5DIrcjdp1N9a40mqnv50ikNMOBc=; b=D08D1Jdj9jZ4lpF0JHHc/smcVePY5KGEsHF3sa3LRFgZC4d8jUP+BViSte10dyzZeq mMObXP6cMHYEccr1VC/dkCHw+ca7whThurmZDdgdyg8Z7+4WQSPR4wwj3hYPnSv8UVoo hFA5oc2j6wmRlVkIa9v3Sr0UZs43s6vahrjeQRGe8ZZdjUZMkIkMzG907BWPBKyOYZYq PoxWWHPITYQ0ZmDzVl/hVnh4pgjoGFw9qgyN4+hKmVywbo8VZWBRaE8ynx1Y8b6eTbQr ksDIFi88WX9cbeZcBVUXG18yGglX0uAsMXQEElYUtrBuJiZ9nu4Qgr+zg0WPzm3oK2b3 CsCA== X-Gm-Message-State: AFeK/H2e1jk1207vgDjuBKf0TKgxldvhquDJZPDRcHpwf+cq55Y/AVzceH2tmBKv5ow0MNco X-Received: by 10.99.240.83 with SMTP id s19mr16995975pgj.45.1491212702743; Mon, 03 Apr 2017 02:45:02 -0700 (PDT) Received: from blr-ubuntu-linaro.wlan.qualcomm.com ([202.46.23.54]) by smtp.gmail.com with ESMTPSA id y7sm24751844pfk.93.2017.04.03.02.44.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 03 Apr 2017 02:45:02 -0700 (PDT) From: Bhupinder Thakur To: xen-devel@lists.xenproject.org Date: Mon, 3 Apr 2017 15:14:28 +0530 Message-Id: <1491212673-13476-6-git-send-email-bhupinder.thakur@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1491212673-13476-1-git-send-email-bhupinder.thakur@linaro.org> References: <1491212673-13476-1-git-send-email-bhupinder.thakur@linaro.org> Cc: Wei Liu , Julien Grall , Stefano Stabellini , Ian Jackson Subject: [Xen-devel] [PATCH 05/10] xen/arm: vpl011: Allocate a new PFN in the toolstack for the virtual console 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" 1. Allocate a new pfn and pass on to Xen using a hvm call. 2. Change in xc_hvm_param_deprecated_check () to allow new vpl011 HVM params, which are reusing some deprecated x86 HVM params. Signed-off-by: Bhupinder Thakur --- tools/libxc/include/xc_dom.h | 3 +++ tools/libxc/xc_dom_arm.c | 7 ++++++- tools/libxc/xc_dom_boot.c | 3 +++ tools/libxc/xc_domain.c | 7 +++++++ 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xc_dom.h index 608cbc2..c93d98c 100644 --- a/tools/libxc/include/xc_dom.h +++ b/tools/libxc/include/xc_dom.h @@ -218,6 +218,9 @@ struct xc_dom_image { /* Extra SMBIOS structures passed to HVMLOADER */ struct xc_hvm_firmware_module smbios_module; + + /* Virtual console pfn. */ + xen_pfn_t vconsole_pfn; }; /* --- pluggable kernel loader ------------------------------------- */ diff --git a/tools/libxc/xc_dom_arm.c b/tools/libxc/xc_dom_arm.c index a7e839e..157381e 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 VCONSOLE_PFN_OFFSET 3 #define LPAE_SHIFT 9 @@ -85,6 +86,7 @@ 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->vconsole_pfn = base + VCONSOLE_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); @@ -95,6 +97,9 @@ static int alloc_magic_pages(struct xc_dom_image *dom) dom->xenstore_pfn); xc_hvm_param_set(dom->xch, dom->guest_domid, HVM_PARAM_MONITOR_RING_PFN, base + MEMACCESS_PFN_OFFSET); + xc_hvm_param_set(dom->xch, dom->guest_domid, HVM_PARAM_VCONSOLE_PFN, + base + VCONSOLE_PFN_OFFSET); + /* allocated by toolstack */ xc_hvm_param_set(dom->xch, dom->guest_domid, HVM_PARAM_CONSOLE_EVTCHN, dom->console_evtchn); diff --git a/tools/libxc/xc_dom_boot.c b/tools/libxc/xc_dom_boot.c index 791041b..ec91b15 100644 --- a/tools/libxc/xc_dom_boot.c +++ b/tools/libxc/xc_dom_boot.c @@ -227,6 +227,9 @@ int xc_dom_boot_image(struct xc_dom_image *dom) if ( (rc = clear_page(dom, dom->xenstore_pfn)) != 0 ) return rc; + if ( (rc = clear_page(dom, dom->vconsole_pfn)) != 0 ) + return rc; + /* start info page */ if ( dom->arch_hooks->start_info ) dom->arch_hooks->start_info(dom); diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c index fa1daeb..8ac7d4f 100644 --- a/tools/libxc/xc_domain.c +++ b/tools/libxc/xc_domain.c @@ -1337,9 +1337,16 @@ static inline int xc_hvm_param_deprecated_check(uint32_t param) { switch ( param ) { + /* + * For Aarch64 the following three parameters are reused and hence this + * empty check to avoid returning an error. + */ +#if defined (__arm__) || defined(__aarch64__) +#else case HVM_PARAM_MEMORY_EVENT_CR0: case HVM_PARAM_MEMORY_EVENT_CR3: case HVM_PARAM_MEMORY_EVENT_CR4: +#endif case HVM_PARAM_MEMORY_EVENT_INT3: case HVM_PARAM_MEMORY_EVENT_SINGLE_STEP: case HVM_PARAM_MEMORY_EVENT_MSR: