From patchwork Fri Apr 28 16:01:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupinder Thakur X-Patchwork-Id: 98368 Delivered-To: patch@linaro.org Received: by 10.182.236.104 with SMTP id ut8csp392040obc; Fri, 28 Apr 2017 09:03:44 -0700 (PDT) X-Received: by 10.107.15.146 with SMTP id 18mr10907893iop.128.1493395424313; Fri, 28 Apr 2017 09:03:44 -0700 (PDT) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id e99si330813itd.86.2017.04.28.09.03.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Apr 2017 09:03:44 -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 1d48LG-0000Dg-LJ; Fri, 28 Apr 2017 16:01:58 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d48LF-0000Cz-Rz for xen-devel@lists.xenproject.org; Fri, 28 Apr 2017 16:01:57 +0000 Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id 39/08-01735-57763095; Fri, 28 Apr 2017 16:01:57 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrIIsWRWlGSWpSXmKPExsXiVRtspFuSzhx p8H+zosX3LZOZHBg9Dn+4whLAGMWamZeUX5HAmvF+wgPmgltiFQcaJjA1MK4R6mLk4hASmM4o 0br9FxuIwyIwj1li34aVjCCOhEA/q0RD73OWLkZOICdNYs6NJ+wQdpXE7ZlzmEBsIQEtiaOnZ rNCjGpmklj0ZSbQKA4ONgETiVkdEiA1IgJKEvdWTWYCqWEWeMso0f/xFCtIQlggRKKvp48ZxG YRUJXY8vMXWJxXwFti4pomZohlchI3z3WC2ZwCPhLX+pexQyz2luhumMcygVFgASPDKkaN4tS istQiXSMLvaSizPSMktzEzBxdQwNTvdzU4uLE9NScxKRiveT83E2MwOCqZ2Bg3MHYt8rvEKMk B5OSKG+lO3OkEF9SfkplRmJxRnxRaU5q8SFGGQ4OJQlegTSgnGBRanpqRVpmDjDMYdISHDxKI rwSIGne4oLE3OLMdIjUKUZdjkcrf7xnEmLJy89LlRLnjQApEgApyijNgxsBi7lLjLJSwryMDA wMQjwFqUW5mSWo8q8YxTkYlYR5c0Cm8GTmlcBtegV0BBPQESwuDCBHlCQipKQaGK3dLnqxTFh 9QNiaR9jkkH5fi96akuDHpS3ui/SbL7fPn/7x4Da5s7t3/V/m9FPIz7WvJH2Sdsa9X0tcOK71 yh1+2WLw7syyJY8yNlqmT7/xqfxm4JEvN1m7o6w311Yu2LrsSkfLjSWMf1r+/jwqGHec/WGAb RJPVo+PRzL3tpzOkFM+kluy3yqxFGckGmoxFxUnAgDD6XPJtAIAAA== X-Env-Sender: bhupinder.thakur@linaro.org X-Msg-Ref: server-14.tower-206.messagelabs.com!1493395315!56769883!1 X-Originating-IP: [74.125.83.50] 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 29313 invoked from network); 28 Apr 2017 16:01:56 -0000 Received: from mail-pg0-f50.google.com (HELO mail-pg0-f50.google.com) (74.125.83.50) by server-14.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 28 Apr 2017 16:01:56 -0000 Received: by mail-pg0-f50.google.com with SMTP id y4so11663485pge.0 for ; Fri, 28 Apr 2017 09:01:56 -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=UeptOIno1pL+/p2UD3QbFyGbPoX+EgQCAdQRJvBJ7Yg=; b=jw2WV6yhtxk1mPz10JSSqeH9nc51s2g4irUrPejc3aeNDpUtj3eujJhLtToasY89ZS hm1wQF5+b4YSr6iXJ8GcYs8l6z5VysHKuIAi/S3lVyi3RlF+OV7+UwZt83jHNvu7W4pc znGxBlQ5n+2S3LfdKqZhFaRIb3+cTb6pbFQVs= 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=UeptOIno1pL+/p2UD3QbFyGbPoX+EgQCAdQRJvBJ7Yg=; b=h5RMfW3IW6iG4B4dmzux3HkK8CEV82OsKwrbU5QTZls5fHUT6PAs+eOp3UOaWB5dQL CUOVdsqF0arTAtH86yM+wBJh1v/tshrOKV9fS5rNHjsTCDLePDbVFy9ikzHOvW01yR/N YZk5dgBZ7J5ueODEqZIiaV885VHWcQzy5iA3Li+IfsFzz2I7ZiQne+84s/IN4s8sejMJ 3vl/J3T/UuNFzkjTU36kLTxRWV+R44IGfxna4/ZJdD5wVGHG9TJ20i5eFQbd8OMfwx2E I00B4Q2UloT9AIT/rkLQ2Iduo+dzlbVYxVoNb4MTquDCT600VEZl9hPo9YSxEgKiFRfz EWcA== X-Gm-Message-State: AN3rC/4ghBvcDN1mnsOmAvKLVyUYZ6uQdC5YXJrEcL+UADjuKivNOXcx vLoGJCgcPMnZ3lnvDRINZQ== X-Received: by 10.98.36.154 with SMTP id k26mr12757112pfk.174.1493395314822; Fri, 28 Apr 2017 09:01:54 -0700 (PDT) Received: from blr-ubuntu-linaro.wlan.qualcomm.com ([103.5.19.18]) by smtp.gmail.com with ESMTPSA id n65sm9870239pga.8.2017.04.28.09.01.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 28 Apr 2017 09:01:54 -0700 (PDT) From: Bhupinder Thakur To: xen-devel@lists.xenproject.org Date: Fri, 28 Apr 2017 21:31:20 +0530 Message-Id: <1493395284-18430-7-git-send-email-bhupinder.thakur@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1493395284-18430-1-git-send-email-bhupinder.thakur@linaro.org> References: <1493395284-18430-1-git-send-email-bhupinder.thakur@linaro.org> Cc: Stefano Stabellini , Wei Liu , Andrew Cooper , Ian Jackson , Julien Grall , Jan Beulich Subject: [Xen-devel] [PATCH 06/10 v2] xen/arm: vpl011: Add vuart ring-buf and evtchn 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 to be used by xenconsoled: - newly allocated PFN to be used as IN/OUT ring buffer - get a new event channel allocated by Xen using a domctl call These paramters are added to xenstore only if vuart console is enabled by the user. Signed-off-by: Bhupinder Thakur --- Changes since v1: - Modified the xenstore key names to /vuart/0/ring-ref and /vuart/0/port. - Replaced the hvm call with domctl call to get the event channel. tools/libxl/libxl_console.c | 10 ++++++++++ tools/libxl/libxl_dom.c | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/tools/libxl/libxl_console.c b/tools/libxl/libxl_console.c index 446e766..ef3bd44 100644 --- a/tools/libxl/libxl_console.c +++ b/tools/libxl/libxl_console.c @@ -67,6 +67,9 @@ int libxl_console_exec(libxl_ctx *ctx, uint32_t domid, int cons_num, case LIBXL_CONSOLE_TYPE_SERIAL: cons_type_s = "serial"; break; + case LIBXL_CONSOLE_TYPE_VUART: + cons_type_s = "vuart"; + break; default: goto out; } @@ -326,6 +329,13 @@ 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 (state->vuart_enabled) + { + flexarray_append(ro_front, "vuart/0/port"); + flexarray_append(ro_front, GCSPRINTF("%"PRIu32, state->vuart_port)); + flexarray_append(ro_front, "vuart/0/ring-ref"); + flexarray_append(ro_front, GCSPRINTF("%lu", state->vuart_mfn)); + } } 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 5d914a5..06ff3b7 100644 --- a/tools/libxl/libxl_dom.c +++ b/tools/libxl/libxl_dom.c @@ -434,6 +434,9 @@ 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 (state->vuart_enabled) + xc_domain_vuart_get_evtchn(ctx->xch, domid, &state->vuart_port); + if (info->type == LIBXL_DOMAIN_TYPE_HVM) { hvm_set_conf_params(ctx->xch, domid, info); #if defined(__i386__) || defined(__x86_64__) @@ -788,6 +791,7 @@ int libxl__build_pv(libxl__gc *gc, uint32_t domid, if (xc_dom_translated(dom)) { state->console_mfn = dom->console_pfn; state->store_mfn = dom->xenstore_pfn; + state->vuart_mfn = dom->vuart_pfn; } else { state->console_mfn = xc_dom_p2m(dom, dom->console_pfn); state->store_mfn = xc_dom_p2m(dom, dom->xenstore_pfn);