From patchwork Tue Feb 21 11:26:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupinder Thakur X-Patchwork-Id: 94259 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp396483qgi; Tue, 21 Feb 2017 03:28:19 -0800 (PST) X-Received: by 10.36.55.145 with SMTP id r139mr25192935itr.12.1487676499887; Tue, 21 Feb 2017 03:28:19 -0800 (PST) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id 192si19972638ioe.138.2017.02.21.03.28.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Feb 2017 03:28:19 -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 1cg8ac-0002s1-AS; Tue, 21 Feb 2017 11:26:38 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cg8ab-0002r8-GQ for xen-devel@lists.xenproject.org; Tue, 21 Feb 2017 11:26:37 +0000 Received: from [85.158.137.68] by server-8.bemta-3.messagelabs.com id 4C/41-31649-CE32CA85; Tue, 21 Feb 2017 11:26:36 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprPIsWRWlGSWpSXmKPExsXiVRtsrPtGeU2 EQcd8HovvWyYzOTB6HP5whSWAMYo1My8pvyKBNWPP4zXMBT/kKt4t3M7awHhJsouRi0NIYCaj xI0n29hBHBaBecwSS3/2sYI4EgL9rBLvfrUydjFyAjkxEm2rL7ND2GUS344eYQWxhQS0JI6em g1ltzJJzF9r0MXIwcEmYCIxq0MCJCwioCRxb9VkJhCbWSBU4t+zNrAxwgKBEt+fzWYDsVkEVC X69y8DG8Mr4C2xZv90JohVchI3z3Uyg9icAj4Sf/e9ZIdY5S0x7c4KtgmMAgsYGVYxahSnFpW lFukaWeolFWWmZ5TkJmbm6BoaGOvlphYXJ6an5iQmFesl5+duYgQGVj0DA+MOxqa9focYJTmY lER5s6XWRAjxJeWnVGYkFmfEF5XmpBYfYpTh4FCS4LUDBqqQYFFqempFWmYOMMRh0hIcPEoiv Pkgad7igsTc4sx0iNQpRl2OXbsuv2QSYsnLz0uVEueVBCkSACnKKM2DGwGLt0uMslLCvIwMDA xCPAWpRbmZJajyrxjFORiVhHn3KwFN4cnMK4Hb9AroCCagI256rAQ5oiQRISXVwDh9foOXpm+ FSKh6L3NRlO3GTd8Ms6QEhMznp8zieD6pVNBig0Oh267Vrz/Jnny/+VnXf977Pf9b5n9Oucb6 T+VBHKtq5ZMuUcbZNrG2746FifZGfDQuE/F8XHt103oGkwOxiyr2RpyMSTw5q/bshX9ZDgfj3 xptsTd6IP5tQ+F9vfNqlpuOHlViKc5INNRiLipOBACSwl6LsgIAAA== X-Env-Sender: bhupinder.thakur@linaro.org X-Msg-Ref: server-10.tower-31.messagelabs.com!1487676394!85981605!1 X-Originating-IP: [74.125.83.51] 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 20343 invoked from network); 21 Feb 2017 11:26:36 -0000 Received: from mail-pg0-f51.google.com (HELO mail-pg0-f51.google.com) (74.125.83.51) by server-10.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 21 Feb 2017 11:26:36 -0000 Received: by mail-pg0-f51.google.com with SMTP id b129so34939204pgc.2 for ; Tue, 21 Feb 2017 03:26:35 -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=2bQAjwS6ZOeKwuKo1eY3qabIdVCWaz8XL5Zph2lOB6g=; b=My6txS2sfny6FY0ox0oUlkpti7qiTYAvnMsEyS3NABMsG0i8fNEZW9B/FQN1UBi7yd OgaJBnz6axJOrLfb2zAHwxIGTp4wvpKCBK57qtwp365f92u8EshE28Ts62z2Wm9j/KKo Sj1Y+WJCRpHwQmUtfqYgzVNE/IJlhRqkbRd2I= 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=2bQAjwS6ZOeKwuKo1eY3qabIdVCWaz8XL5Zph2lOB6g=; b=h+AdsTQixpML8927hgSyiirSuhdNxW4vGSUfGu+5Xy0BUf6B0JKPxc60bA+zsvgAN/ 59fa6ianmHMxX2eMrTTFo/1fiO7K61ILh5GSChRZlZQ5V+j0eCyo0EOHK/nqrw9qI+Rx Pl5+9jZPOemDKI+V/I2PNC+hV4qlgY/oZj6gDo9JNXvoNFPNJ92lCxQriIPNSxxjY5Pv 0KN8D5Qgkhg8jK8AMCVKn17pIMEo1AHAyu9yYvQk7heoK/S2dOj4re4YvgCVfzzOhi87 X6maX8Dd3T9YycHAAbd7dqkPyXpjevkp01dY+fkJDLJJEQcg7TMlFjhvFa1kHr4rRc2g 2D3g== X-Gm-Message-State: AMke39n5/xPgY+FPkzVCtKXsjtyoQ/YnLDXVK5ka37fwZYTyQpA3S0+7UEB84HQpKpPDtftz X-Received: by 10.99.178.9 with SMTP id x9mr7304001pge.48.1487676394218; Tue, 21 Feb 2017 03:26:34 -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.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 21 Feb 2017 03:26:33 -0800 (PST) From: Bhupinder Thakur To: xen-devel@lists.xenproject.org Date: Tue, 21 Feb 2017 16:56:04 +0530 Message-Id: <1487676368-22356-8-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 07/11] xen/arm: vpl011: Add two new vpl011 parameters to xenstore 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" Add two new parameters to the xen store: - newly allocated PFN to be used as IN/OUT ring buffer by xenconsoled - a new event channel read from Xen using a hvm call to be used by xenconsoled for eventing Signed-off-by: Bhupinder Thakur --- tools/libxl/libxl.c | 6 ++++++ tools/libxl/libxl_dom.c | 18 +++++++++++++++++- tools/libxl/libxl_internal.h | 4 ++++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c index d400fa2..cc00235 100644 --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -3159,6 +3159,12 @@ int libxl__device_console_add(libxl__gc *gc, uint32_t domid, flexarray_append(ro_front, GCSPRINTF("%"PRIu32, state->console_port)); flexarray_append(ro_front, "ring-ref"); flexarray_append(ro_front, GCSPRINTF("%lu", state->console_mfn)); +#if defined(__arm__) || defined(__aarch64__) + flexarray_append(ro_front, "vpl011-port"); + flexarray_append(ro_front, GCSPRINTF("%"PRIu32, state->vpl011_console_port)); + flexarray_append(ro_front, "vpl011-ring-ref"); + flexarray_append(ro_front, GCSPRINTF("%lu", state->vpl011_console_mfn)); +#endif } else { flexarray_append(front, "state"); flexarray_append(front, GCSPRINTF("%d", XenbusStateInitialising)); diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c index d519c8d..39eaff6 100644 --- a/tools/libxl/libxl_dom.c +++ b/tools/libxl/libxl_dom.c @@ -302,7 +302,7 @@ int libxl__build_pre(libxl__gc *gc, uint32_t domid, libxl_ctx *ctx = libxl__gc_owner(gc); char *xs_domid, *con_domid; int rc; - uint64_t size; + uint64_t size, val=-1; if (xc_domain_max_vcpus(ctx->xch, domid, info->max_vcpus) != 0) { LOG(ERROR, "Couldn't set max vcpu count"); @@ -432,6 +432,16 @@ int libxl__build_pre(libxl__gc *gc, uint32_t domid, state->store_port = xc_evtchn_alloc_unbound(ctx->xch, domid, state->store_domid); state->console_port = xc_evtchn_alloc_unbound(ctx->xch, domid, state->console_domid); +#if defined(__arm__) || defined(__aarch64__) + /* get the vpl011 event channel from Xen */ + rc = xc_hvm_param_get(ctx->xch, domid, HVM_PARAM_VPL011_CONSOLE_EVTCHN, + &val); + if ( rc ) + state->vpl011_console_port = -1; + else + state->vpl011_console_port = (uint32_t)val; +#endif + if (info->type == LIBXL_DOMAIN_TYPE_HVM) { hvm_set_conf_params(ctx->xch, domid, info); #if defined(__i386__) || defined(__x86_64__) @@ -727,6 +737,9 @@ int libxl__build_pv(libxl__gc *gc, uint32_t domid, dom->flags = flags; dom->console_evtchn = state->console_port; +#if defined(__arm__) || defined(__aarch64__) + dom->vpl011_console_evtchn = state->vpl011_console_port; +#endif dom->console_domid = state->console_domid; dom->xenstore_evtchn = state->store_port; dom->xenstore_domid = state->store_domid; @@ -771,6 +784,9 @@ int libxl__build_pv(libxl__gc *gc, uint32_t domid, if (xc_dom_feature_translated(dom)) { state->console_mfn = dom->console_pfn; state->store_mfn = dom->xenstore_pfn; +#if defined(__arm__) || defined(__aarch64__) + state->vpl011_console_mfn = dom->vpl011_console_pfn; +#endif } else { state->console_mfn = xc_dom_p2m(dom, dom->console_pfn); state->store_mfn = xc_dom_p2m(dom, dom->xenstore_pfn); diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h index 5f46578..10e262e 100644 --- a/tools/libxl/libxl_internal.h +++ b/tools/libxl/libxl_internal.h @@ -1128,6 +1128,10 @@ typedef struct { uint32_t num_vmemranges; xc_domain_configuration_t config; +#if defined(__arm__) || defined(__aarch64__) + unsigned long vpl011_console_mfn; + uint32_t vpl011_console_port; +#endif } libxl__domain_build_state; _hidden int libxl__build_pre(libxl__gc *gc, uint32_t domid,