From patchwork Tue Feb 21 11:26:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupinder Thakur X-Patchwork-Id: 94261 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp396498qgi; Tue, 21 Feb 2017 03:28:22 -0800 (PST) X-Received: by 10.36.57.10 with SMTP id l10mr14177753ita.88.1487676502338; Tue, 21 Feb 2017 03:28:22 -0800 (PST) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id s84si9354751itd.91.2017.02.21.03.28.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Feb 2017 03:28:22 -0800 (PST) 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 1cg8ae-0002uQ-IM; Tue, 21 Feb 2017 11:26: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 1cg8ad-0002tH-MC for xen-devel@lists.xenproject.org; Tue, 21 Feb 2017 11:26:39 +0000 Received: from [193.109.254.147] by server-3.bemta-6.messagelabs.com id 8F/B1-13524-FE32CA85; Tue, 21 Feb 2017 11:26:39 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprPIsWRWlGSWpSXmKPExsXiVRuspftOeU2 EwdtXAhbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8aqGT1sBcelK15Oec7awPhHrIuRi0NIYCaj xPaJ19lBHBaBecwSUw4sZwRxJAT6WSV2zjzF1sXIAeTESDw8L93FyAlkVko83LWMEcQWEtCSO HpqNivEpFYmifnb/4LVswmYSMzqkACpERFQkri3ajITiM0sECrx71kbO4gtLJAj8XXSXDCbRU BVYuKVRhYQm1fAW2LdzE42iF1yEjfPdTKD2JwCPhJ/971kh9jrLTHtzgq2CYwCCxgZVjFqFKc WlaUW6Rob6CUVZaZnlOQmZuboGhqY6eWmFhcnpqfmJCYV6yXn525iBAYWAxDsYPy7NvAQoyQH k5Iob7bUmgghvqT8lMqMxOKM+KLSnNTiQ4wyHBxKErxzlIBygkWp6akVaZk5wBCHSUtw8CiJ8 B5RBErzFhck5hZnpkOkTjHqcuzadfklkxBLXn5eqpQ4bxnIDAGQoozSPLgRsHi7xCgrJczLCH SUEE9BalFuZgmq/CtGcQ5GJWHeTpApPJl5JXCbXgEdwQR0xE2PlSBHlCQipKQaGOuk/78VvsT bxC3udTLXLubIPZvGUp4pvv4PV75uuMe+qXDhYwVTMZ3L3HbTH2ziVZtxivuf9fr9u4RqDz1u EiplqFj1Zt2nDRJJf5OzpYveXtjw7O71ifaBAd8KrTKNpvUbM64KuvL/Y8MpwWzx87ds9KZMt am6fqXpTHqaWxp3aIoLf5LfTSWW4oxEQy3mouJEAK+VEuayAgAA X-Env-Sender: bhupinder.thakur@linaro.org X-Msg-Ref: server-15.tower-27.messagelabs.com!1487676397!35232499!1 X-Originating-IP: [74.125.83.42] 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 26482 invoked from network); 21 Feb 2017 11:26:38 -0000 Received: from mail-pg0-f42.google.com (HELO mail-pg0-f42.google.com) (74.125.83.42) by server-15.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 21 Feb 2017 11:26:38 -0000 Received: by mail-pg0-f42.google.com with SMTP id a123so33308844pgc.0 for ; Tue, 21 Feb 2017 03:26:38 -0800 (PST) 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=lJTOsICBX68lKFw173RStR+IHtO1pJ7S9btQdiO0dHs=; b=SL62Y6l0EoIgzPSctJw+ozQLHvCiILKFprf056UTtCP0eqkLSC/GBBv+EiFx2hEjEZ QCxYbIvJI2s875t6S/CdvIqHKPaZerUoqoxGmuD+k8nGo6p6WLR1kCUPqGzeKxVGY3hR HjqDTFcAzuiBmKYvNRJdtJoKHa3oBQ1f17Gic= 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=lJTOsICBX68lKFw173RStR+IHtO1pJ7S9btQdiO0dHs=; b=VhJAqP6hHRuYpsjSFU7wSsGHEVVLCbxylSX2kD9nFftTY8XVE5ssM7c4dpiDWLBuDd Kb8K8ZJH4LLzjSKelL76ug4A1mLZK7auzOIJRqRY9d0Bfu+fZKU/IEqYPoKLMW+dT0Zy M0YXELz6QXJc2wsf7rkRcwIMCvWz3KR+sZfkC1xzcy/QgagR+E0NbtM80lz02UEujSiP lzJZ0Nl9RTaVLWoaR+Q09+G0oZz4dAYi0P4LyRpFALPaFGdYUtgg+tZmru+owaLzzmWH 57vx/3bPWMEEBGDeDnpSKvSNtmhRYS0gcMcErVZ8MXaQzo6hX25/w6tQEs5RvbCNDFtP CXuA== X-Gm-Message-State: AMke39lGBi2k33F4ecvXz+mFTSra+vl4P4b7YIUSpaVHIuUI7Y8/J/VuRFxwIZJyrPiwvdXc X-Received: by 10.99.171.75 with SMTP id k11mr33992463pgp.16.1487676396697; Tue, 21 Feb 2017 03:26:36 -0800 (PST) Received: from blr-ubuntu-linaro.wlan.qualcomm.com ([103.5.19.18]) by smtp.gmail.com with ESMTPSA id p66sm40508627pfb.88.2017.02.21.03.26.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 21 Feb 2017 03:26:36 -0800 (PST) From: Bhupinder Thakur To: xen-devel@lists.xenproject.org Date: Tue, 21 Feb 2017 16:56:05 +0530 Message-Id: <1487676368-22356-9-git-send-email-bhupinder.thakur@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1487676368-22356-1-git-send-email-bhupinder.thakur@linaro.org> References: <1487676368-22356-1-git-send-email-bhupinder.thakur@linaro.org> Cc: Julien Grall , Stefano Stabellini Subject: [Xen-devel] [PATCH 08/11] xen/arm: vpl011: Allocate a new PFN in the toolstack and pass to Xen using a hvm call 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" Allocates a new pfn, initializes it and passes on to Xen using a hvm call. Another changes is in xc_hvm_param_deprecated_check () to allow new vpl011 HVM params, which have been defined to some deprecated HVM params. Signed-off-by: Bhupinder Thakur --- tools/libxc/include/xc_dom.h | 5 +++++ tools/libxc/xc_dom_arm.c | 7 ++++++- tools/libxc/xc_dom_boot.c | 5 +++++ tools/libxc/xc_domain.c | 3 +++ 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..c763cf1 100644 --- a/tools/libxc/include/xc_dom.h +++ b/tools/libxc/include/xc_dom.h @@ -218,6 +218,11 @@ struct xc_dom_image { /* Extra SMBIOS structures passed to HVMLOADER */ struct xc_hvm_firmware_module smbios_module; + +#if defined(__arm__) || defined(__aarch64__) + xen_pfn_t vpl011_console_pfn; + unsigned int vpl011_console_evtchn; +#endif }; /* --- pluggable kernel loader ------------------------------------- */ diff --git a/tools/libxc/xc_dom_arm.c b/tools/libxc/xc_dom_arm.c index a7e839e..7060a22 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 VPL011_CONSOLE_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->vpl011_console_pfn = base + VPL011_CONSOLE_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_VPL011_CONSOLE_PFN, + base + VPL011_CONSOLE_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..933e92f 100644 --- a/tools/libxc/xc_dom_boot.c +++ b/tools/libxc/xc_dom_boot.c @@ -227,6 +227,11 @@ int xc_dom_boot_image(struct xc_dom_image *dom) if ( (rc = clear_page(dom, dom->xenstore_pfn)) != 0 ) return rc; +#if defined (__arm__) || defined(__aarch64__) + if ( (rc = clear_page(dom, dom->vpl011_console_pfn)) != 0 ) + return rc; +#endif + /* 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..d881288 100644 --- a/tools/libxc/xc_domain.c +++ b/tools/libxc/xc_domain.c @@ -1337,9 +1337,12 @@ static inline int xc_hvm_param_deprecated_check(uint32_t param) { switch ( param ) { +#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: