From patchwork Mon Apr 3 09:44:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupinder Thakur X-Patchwork-Id: 9659153 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8F08060364 for ; Mon, 3 Apr 2017 09:47:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7B8471FF61 for ; Mon, 3 Apr 2017 09:47:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7071F27EED; Mon, 3 Apr 2017 09:47:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8C7CA20572 for ; Mon, 3 Apr 2017 09:47:19 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cuyXw-0001Wi-7I; Mon, 03 Apr 2017 09:45:12 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cuyXu-0001V9-Nv for xen-devel@lists.xenproject.org; Mon, 03 Apr 2017 09:45:10 +0000 Received: from [85.158.137.68] by server-7.bemta-3.messagelabs.com id 0A/B6-23854-5A912E85; Mon, 03 Apr 2017 09:45:09 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprDIsWRWlGSWpSXmKPExsXiVRtsoLtE8lG EQd83I4vvWyYzOTB6HP5whSWAMYo1My8pvyKBNePjnKvsBeckKo7t+M7WwLhFuIuRk0NIYAaj xP6PSV2MXBwsAvOYJb5f+MkEkpAQ6GcFchQh7BiJ/c+mQsWrJabtX88O0awlcfTUbFYIu5VJY k6jYRcjBwebgInErA4JkLCIgJLEvVWTmUDmMwvMZ5TY23MWrF5YIE5ix4XrYHNYBFQlvs/6Az afV8BboqlrIjvELjmJm+c6mUFmcgr4SNx6lQCxylvi1f1pbBMYBRYwMqxiVC9OLSpLLdI100s qykzPKMlNzMzRNTQw1stNLS5OTE/NSUwq1kvOz93ECAypegYGxh2MV9qcDzFKcjApifK+ufMw QogvKT+lMiOxOCO+qDQntfgQowwHh5IEb67EowghwaLU9NSKtMwcYHDDpCU4eJREeCeBpHmLC xJzizPTIVKnGHU5PvQffsMkxJKXn5cqJc4bCVIkAFKUUZoHNwIWaZcYZaWEeRkZGBiEeApSi3 IzS1DlXzGKczAqCfPGg0zhycwrgdv0CugIJqAjnoDcz1tckoiQkmpgnKNXuvORecCMY50HJz7 RD57W+jL0yKW13zYL3Nk3NfL2U0vuz5Nv1Gx4YvfsiMU9+S3Pje4lZfyWDPhVKqhkyvD63WPO X4bqc99yi7s++6Xbl691Za2AR+zFVVrTDc0vHFv+U/zjT49bbx+1vHW7mLNi+VGx7Isi/05tM qucaZl1JfX35sz/jwSUWIozEg21mIuKEwHeyNhHrwIAAA== X-Env-Sender: bhupinder.thakur@linaro.org X-Msg-Ref: server-13.tower-31.messagelabs.com!1491212707!93096544!1 X-Originating-IP: [74.125.83.48] 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 65471 invoked from network); 3 Apr 2017 09:45:08 -0000 Received: from mail-pg0-f48.google.com (HELO mail-pg0-f48.google.com) (74.125.83.48) by server-13.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 3 Apr 2017 09:45:08 -0000 Received: by mail-pg0-f48.google.com with SMTP id 81so115404056pgh.2 for ; Mon, 03 Apr 2017 02:45:08 -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=hKqzCRoq5ZyD1sggAMACL2Z1OX45c34HDvJRWEfIJeE=; b=gq4dKy6Wb0e2Vih/tQn7vSmnGmfBwVP+JRIONP+6dCVE66+G4rJ27JgsqIOCHH3ody 5dRV+SXB1mRX9y2Txuv+5Y8ZqeL4a3G8sOUEpFjn5ySRxN/4YFQzjpREgi2LUtn+1lUq fh7NbU9d1T6gYKUYX8dtxJQZoHMLQyzMdkBrI= 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=hKqzCRoq5ZyD1sggAMACL2Z1OX45c34HDvJRWEfIJeE=; b=mm2XBglyPn7fvLZMwalDlxsQgr8aY5DYNgpmD19o/SqInY8Onq2bDrGwlpnNdt9PH6 AJx5voDAI0cP6F3acbbB074lftmK/dHZEWq7EfyLQFEbD/Nld/B3Umu6tQsKsJkd/AuI 3i4WjGKlv7HE6sDszWXH08W/d8Ho9CIT2rKBCur+7AxeGMcrJJC94twUAUISb5HTiPSR lHhuh3NUfTgTsXexdRqNWQjcmKYAKEQMLiSMBXwSIAJV1dohQqQ/cMc4HMcImBQM4HMu cXiedOtTIvv9AJ6G1DJew2q9xLCnDqA7AUaF0MpJtwB4pqnwNSYF8+VAIwYIgLoncLD+ OjGg== X-Gm-Message-State: AFeK/H0DSgeah4evNV82uDM7c1uPPLsdML07x/iguTLqEjwiR98qi0HPP95e7aBPA5wyaw5V X-Received: by 10.99.131.195 with SMTP id h186mr16722641pge.57.1491212706916; Mon, 03 Apr 2017 02:45:06 -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.45.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 03 Apr 2017 02:45:06 -0700 (PDT) From: Bhupinder Thakur To: xen-devel@lists.xenproject.org Date: Mon, 3 Apr 2017 15:14:29 +0530 Message-Id: <1491212673-13476-7-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 06/10] xen/arm: vpl011: Add new parameters to xenstore 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" X-Virus-Scanned: ClamAV using ClamSMTP 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 Signed-off-by: Bhupinder Thakur --- tools/libxl/libxl.c | 10 ++++++++++ tools/libxl/libxl_dom.c | 13 ++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c index d400fa2..5fa1e41 100644 --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -1791,6 +1791,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_VCON: + cons_type_s = "vcon"; + break; default: goto out; } @@ -3159,6 +3162,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->vconsole_enabled) + { + flexarray_append(ro_front, "vcon-port"); + flexarray_append(ro_front, GCSPRINTF("%"PRIu32, state->vconsole_port)); + flexarray_append(ro_front, "vcon-ring-ref"); + flexarray_append(ro_front, GCSPRINTF("%lu", state->vconsole_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 d519c8d..8df1e10 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; 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); + state->vconsole_port = -1; + + if (state->vconsole_enabled) + { + rc = xc_hvm_param_get(ctx->xch, domid, HVM_PARAM_VCONSOLE_EVTCHN, + &val); + if ( !rc ) + state->vconsole_port = val; + } + if (info->type == LIBXL_DOMAIN_TYPE_HVM) { hvm_set_conf_params(ctx->xch, domid, info); #if defined(__i386__) || defined(__x86_64__) @@ -771,6 +781,7 @@ 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; + state->vconsole_mfn = dom->vconsole_pfn; } else { state->console_mfn = xc_dom_p2m(dom, dom->console_pfn); state->store_mfn = xc_dom_p2m(dom, dom->xenstore_pfn);