From patchwork Mon Apr 3 09:44:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhupinder Thakur X-Patchwork-Id: 96599 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp18519qgd; Mon, 3 Apr 2017 02:47:07 -0700 (PDT) X-Received: by 10.107.140.211 with SMTP id o202mr17042352iod.180.1491212827538; Mon, 03 Apr 2017 02:47:07 -0700 (PDT) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id a189si14319632ioa.51.2017.04.03.02.47.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Apr 2017 02:47:07 -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 1cuyXn-0001RB-Cl; Mon, 03 Apr 2017 09:45:03 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cuyXl-0001Po-SO for xen-devel@lists.xenproject.org; Mon, 03 Apr 2017 09:45:01 +0000 Received: from [85.158.137.68] by server-11.bemta-3.messagelabs.com id 8B/D4-23940-D9912E85; Mon, 03 Apr 2017 09:45:01 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprLIsWRWlGSWpSXmKPExsXiVRtspDtH8lG EQc8vcYvvWyYzOTB6HP5whSWAMYo1My8pvyKBNWPb3u8sBRcUKlY1/mBtYNwk1cXIxSEkMINR 4sfD2ywgDovAPGaJzobprF2MnBwSAv2sEofb6yHsGIkZV88xQ9iVEkduHAazhQS0JI6ems0KM amVSWLG0S6gBAcHm4CJxKwOCZAaEQEliXurJjOB1DALzGeU2NtzFmyBsECixI7Ls8BsFgFViW t3NzCC9PIKeEs8meYLsUtO4ua5TrCRnAI+ErdeJUCs9ZZ4dX8a2wRGgQWMDKsY1YtTi8pSi3T N9ZKKMtMzSnITM3N0DQ2M9XJTi4sT01NzEpOK9ZLzczcxAoOKAQh2MDZ+dzrEKMnBpCTK++bO wwghvqT8lMqMxOKM+KLSnNTiQ4wyHBxKEry5Eo8ihASLUtNTK9Iyc4DhDZOW4OBREuG9CJLmL S5IzC3OTIdInWLU5fjQf/gNkxBLXn5eqpQ4736QIgGQoozSPLgRsFi7xCgrJczLCHSUEE9Bal FuZgmq/CtGcQ5GJWHeeSBTeDLzSuA2vQI6ggnoiCcg9/MWlyQipKQaGBu2n5nDwqs07U1L3Za 0JbNcb89pP2DwlkV+cp1tRJpMrLzIlClXH+sdeW/U+Pz3jc6QzV4uTj4rtBvLyp5oLWWRmyEQ sequiWGub/ealK/Nhlt3Hby7r/b5xYcLQ7fU/upk3qmUc7mp/5VUk+39qC2RrJqq0zeu4BP/H xznyPDFoEHH7cU/BiWW4oxEQy3mouJEAOH20M2wAgAA X-Env-Sender: bhupinder.thakur@linaro.org X-Msg-Ref: server-11.tower-31.messagelabs.com!1491212699!62854839!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.2.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 40773 invoked from network); 3 Apr 2017 09:45:00 -0000 Received: from mail-pg0-f50.google.com (HELO mail-pg0-f50.google.com) (74.125.83.50) by server-11.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 3 Apr 2017 09:45:00 -0000 Received: by mail-pg0-f50.google.com with SMTP id 81so115400685pgh.2 for ; Mon, 03 Apr 2017 02:45:00 -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=6jM/ZYj32/DjzwfMoym7PyIVY+zOI+agnapr1N/Aj2s=; b=LK49ZGQAioK1P+xh7TKsj0d45ulsmVniBhJSFVKQtO0ADOad8lVowZ0B9UqWxKC0Oz KmH3ZGYkftJ1ljigM6ADVnPhJrCzqVbRH26PQy0rOAnMTsjm0JNbSYkijCKZm3AkyIyD T1tFfMyD/Ti3YKl8S91w6spwBOGXvCB1tgvbc= 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=6jM/ZYj32/DjzwfMoym7PyIVY+zOI+agnapr1N/Aj2s=; b=V8xZPdIi/MHgjz+SwqYGsgX2PjnXfkn/6BEBYL15sHU4aJNQsWY+SywC0tNRdCs+WC 4ViyXWU2s3roNy8zEGRJadgIVDMSC0EdKAVuAiQhPKXHuWhixEAW7AqtVTRWx38xpCAs lOiDEefiM6+9RJyZtd7iZx6Alylv/gu6XEbby+O30czB1nnIgQIKBAu4IdGvM6G7ANtS B5azdVcVEfWxOeaEHf4lyKPzGN+093+0I+kh9aL7CcICIpJdC1CYsevqC20rJh/Qw0gT hznwfqXbTo8f6JviO9yIU0t3S1rBRWwBMAkHVRfXF9EKmzwckn/5173OWaP4uNwqX66U Op3Q== X-Gm-Message-State: AFeK/H2NjDUFYkQAAru0CkYM6kpTnhhuosWZa2IawjnOFJC3yKaBpfha+tPAAtIeXPnpQspD X-Received: by 10.98.102.88 with SMTP id a85mr16842229pfc.33.1491212698663; Mon, 03 Apr 2017 02:44:58 -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.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 03 Apr 2017 02:44:58 -0700 (PDT) From: Bhupinder Thakur To: xen-devel@lists.xenproject.org Date: Mon, 3 Apr 2017 15:14:27 +0530 Message-Id: <1491212673-13476-5-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 04/10] xen/arm: vpl011: Provide a knob in libxl to enable/disable pl011 emulation 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" An option is provided in libxl to enable/disable pl011 emulation while creating a guest domain. Signed-off-by: Bhupinder Thakur --- tools/libxl/libxl_create.c | 12 ++++++++++++ tools/libxl/libxl_internal.h | 5 +++++ tools/libxl/libxl_types.idl | 2 ++ tools/libxl/xl_cmdimpl.c | 4 ++++ 4 files changed, 23 insertions(+) diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c index e3bc257..9a59354 100644 --- a/tools/libxl/libxl_create.c +++ b/tools/libxl/libxl_create.c @@ -208,6 +208,8 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc, libxl_defbool_setdefault(&b_info->disable_migrate, false); + libxl_defbool_setdefault(&b_info->enable_pl011, false); + for (i = 0 ; i < b_info->num_iomem; i++) if (b_info->iomem[i].gfn == LIBXL_INVALID_GFN) b_info->iomem[i].gfn = b_info->iomem[i].start; @@ -546,6 +548,9 @@ int libxl__domain_make(libxl__gc *gc, libxl_domain_config *d_config, flags |= XEN_DOMCTL_CDF_hap; } + if (libxl_defbool_val(d_config->b_info.enable_pl011)) + flags |= XEN_DOMCTL_VCONSOLE_enable; + /* Ultimately, handle is an array of 16 uint8_t, same as uuid */ libxl_uuid_copy(ctx, (libxl_uuid *)handle, &info->uuid); @@ -910,6 +915,11 @@ static void initiate_domain_create(libxl__egc *egc, goto error_out; } + if (libxl_defbool_val(d_config->b_info.enable_pl011)) + state->vconsole_enabled = true; + else + state->vconsole_enabled = false; + if (d_config->c_info.type == LIBXL_DOMAIN_TYPE_HVM && (libxl_defbool_val(d_config->b_info.u.hvm.nested_hvm) && libxl_defbool_val(d_config->b_info.u.hvm.altp2m))) { @@ -926,6 +936,8 @@ static void initiate_domain_create(libxl__egc *egc, goto error_out; } + state->config.console_domid = state->console_domid; + ret = libxl__domain_make(gc, d_config, &domid, &state->config); if (ret) { LOGD(ERROR, domid, "cannot make domain: %d", ret); diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h index 5f46578..2406eaa 100644 --- a/tools/libxl/libxl_internal.h +++ b/tools/libxl/libxl_internal.h @@ -1128,6 +1128,11 @@ typedef struct { uint32_t num_vmemranges; xc_domain_configuration_t config; + + /* Virtual console mfn and port. */ + unsigned long vconsole_mfn; + uint32_t vconsole_port; + bool vconsole_enabled; } libxl__domain_build_state; _hidden int libxl__build_pre(libxl__gc *gc, uint32_t domid, diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl index a612d1f..fe7f795 100644 --- a/tools/libxl/libxl_types.idl +++ b/tools/libxl/libxl_types.idl @@ -105,6 +105,7 @@ libxl_console_type = Enumeration("console_type", [ (0, "UNKNOWN"), (1, "SERIAL"), (2, "PV"), + (3, "VCON"), ]) libxl_disk_format = Enumeration("disk_format", [ @@ -460,6 +461,7 @@ libxl_domain_build_info = Struct("domain_build_info",[ ("disable_migrate", libxl_defbool), ("cpuid", libxl_cpuid_policy_list), ("blkdev_start", string), + ("enable_pl011", libxl_defbool), ("vnuma_nodes", Array(libxl_vnode_info, "num_vnuma_nodes")), diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index 358757f..4f4d4e6 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -1433,6 +1433,8 @@ static void parse_config_data(const char *config_source, if (!xlu_cfg_get_long (config, "maxvcpus", &l, 0)) b_info->max_vcpus = l; + xlu_cfg_get_defbool(config, "pl011", &b_info->enable_pl011, 0); + parse_vnuma_config(config, b_info); /* Set max_memkb to target_memkb and max_vcpus to avail_vcpus if @@ -3788,6 +3790,8 @@ int main_console(int argc, char **argv) type = LIBXL_CONSOLE_TYPE_PV; else if (!strcmp(optarg, "serial")) type = LIBXL_CONSOLE_TYPE_SERIAL; + else if (!strcmp(optarg, "vcon")) + type = LIBXL_CONSOLE_TYPE_VCON; else { fprintf(stderr, "console type supported are: pv, serial\n"); return EXIT_FAILURE;