From patchwork Mon Jun 25 13:08:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 139841 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp3974129lji; Mon, 25 Jun 2018 06:11:06 -0700 (PDT) X-Google-Smtp-Source: AAOMgpem3r3fBuyoDMrYmNx9yFYso4Yab5am2ODf3SCHjeTp6uqLAdLhhClAFrZ7pxgDj3z314sK X-Received: by 2002:a24:ac53:: with SMTP id m19-v6mr854147iti.16.1529932266129; Mon, 25 Jun 2018 06:11:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529932266; cv=none; d=google.com; s=arc-20160816; b=MEqqEWFBQIQKFYLfk1S5q9IfUXc1b6AgHpVwWo7pNXk8LK2DKC5/z8sIb9KhksX4GI O4bR+Oz6daOYXrfVs8M60ZbnShg1iBkJoHTeOwZtLoStLzNu8QFYFVm4tDYNpGsM4ZTH GJ0/4xeptcEbp6sKL1gQwXiEjzc2yS9QGHKr7util3AQyg1awvl/TM8joMQI2bM/pMSP w8plNiSMARjd8S/SeOaENsVCVsGuyICKPJlSYYqTDDZW0DeeXBh4jyl4us41fBNezasS axo2uE51Rsl4tXQw2g+xOG91BSa6m5Agw6/ec/V92kG0xmOh74JSeLvQZu62JgFdL56K TivA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:message-id:date:to:from :arc-authentication-results; bh=Bzml3OXxujIh0jB2hijX9XzReyF+3nNL/XBuktFohAk=; b=uDBou9o/SeerzEbPU4xxBRMaqsqTIIAQ/bqOQYtM4CWYm4zzswnVeCbyIDRx+OXlFj ITawfw1Ns0xZu0PqGOcbQR06d+TeLeMRcIQ+7b9wrUH65zdq5aKqr4u10QLBOm6cDPs2 U2AqkXNIohUHFc4GRlnImFIdX4NpaXrxUKpoqgm1BkP2/FCst+6Yscdt2Wqyrz6984P4 hsuAXRaSA4MTAntoc4oN3FUhXkz3XmptlaX8OJ4rcsTjH7kiDhGjd+Eejo186nKhajZo hCekMfSlCBAaU1xae4cOaPk+2tRCE1CZlBfuwzjDGjL6AMLjurXBZSjaETaLNFvuMvsl IQ3w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id 195-v6si6374526itp.118.2018.06.25.06.11.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Jun 2018 06:11:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1fXREH-0006tp-1P; Mon, 25 Jun 2018 13:08:25 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1fXREF-0006tk-Rh for xen-devel@lists.xen.org; Mon, 25 Jun 2018 13:08:23 +0000 X-Inumbo-ID: df50738f-7878-11e8-bc1d-65256ead4e3a Received: from foss.arm.com (unknown [217.140.101.70]) by us1-amaz-eas1.inumbo.com (Halon) with ESMTP id df50738f-7878-11e8-bc1d-65256ead4e3a; Mon, 25 Jun 2018 13:08:37 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id CCEC57A9; Mon, 25 Jun 2018 06:08:20 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.206.53]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 776B23F73D; Mon, 25 Jun 2018 06:08:19 -0700 (PDT) From: Julien Grall To: sstabellini@kernel.org, xen-devel@lists.xen.org Date: Mon, 25 Jun 2018 14:08:14 +0100 Message-Id: <20180625130814.29771-1-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 Subject: [Xen-devel] [PATCH RFC] tools/libxl: Switch Arm guest type to PVH X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: andrew.cooper3@citrix.com, Julien Grall , Ian Jackson , Wei Liu , roger.pau@citrix.com MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Currently, the toolstack is considering Arm guest always PV. However, they are very similar to PVH because HW virtualization extension are used and QEMU is not started. So switch Arm guest type to PVH. Furthermore, the default type for Arm in xl will now be PVH to allow smooth transition for user. Signed-off-by: Julien Grall --- This was discussed at Xen Summit and also in various thread on xen-devel. The latest one was when Andrew sent a patch to deny guest creation on Arm with XEN_DOMCTL_CDF_hap unset. I suspect we first implemented Arm guest as PV in libxl because PVH was non-existent and the type was easier to avoid spawning QEMU. Note that Linux and Xen are already considering Arm guest as PVH. This patch is denying the creation of PV guest on Arm. This will have an impact on any toolstack selecting PV for Arm (e.g libvirt) or anyone using 'type="pv"' in libxl configuration file. I am not entirely sure whether this is the best solution, any opinions? --- docs/man/xl.cfg.pod.5.in | 3 ++- tools/libxl/libxl_arm.c | 10 +++++++++- tools/xl/xl_parse.c | 4 ++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/docs/man/xl.cfg.pod.5.in b/docs/man/xl.cfg.pod.5.in index 47d88243b1..2c2af01515 100644 --- a/docs/man/xl.cfg.pod.5.in +++ b/docs/man/xl.cfg.pod.5.in @@ -86,7 +86,8 @@ guest operating systems. This is the default. Specifies that this is to be an PVH domain. That is a lightweight HVM-like guest without a device model and without many of the emulated devices -available to HVM guests. Note that this mode requires a PVH aware kernel. +available to HVM guests. Note that this mode requires a PVH aware kernel on +x86. =item B diff --git a/tools/libxl/libxl_arm.c b/tools/libxl/libxl_arm.c index 8af9f6f992..3acac7fa93 100644 --- a/tools/libxl/libxl_arm.c +++ b/tools/libxl/libxl_arm.c @@ -978,7 +978,15 @@ int libxl__arch_domain_init_hw_description(libxl__gc *gc, int rc; uint64_t val; - assert(info->type == LIBXL_DOMAIN_TYPE_PV); + if (info->type == LIBXL_DOMAIN_TYPE_PV) { + LOG(ERROR, "PV guest not supported. Please use PVH.\n"); + return ERROR_FEATURE_REMOVED; + } + else if (info->type != LIBXL_DOMAIN_TYPE_PVH) { + LOG(ERROR, "Unsupported Arm guest type %s\n", + libxl_domain_type_to_string(info->type)); + return ERROR_FAIL; + } /* Set the value of domain param HVM_PARAM_CALLBACK_IRQ. */ val = MASK_INSR(HVM_PARAM_CALLBACK_TYPE_PPI, diff --git a/tools/xl/xl_parse.c b/tools/xl/xl_parse.c index e6c54483e0..b705f27277 100644 --- a/tools/xl/xl_parse.c +++ b/tools/xl/xl_parse.c @@ -937,7 +937,11 @@ void parse_config_data(const char *config_source, } if (c_info->type == LIBXL_DOMAIN_TYPE_INVALID) +#if defined(__arm__) || defined(__aarch64__) + c_info->type = LIBXL_DOMAIN_TYPE_PVH; +#else c_info->type = LIBXL_DOMAIN_TYPE_PV; +#endif xlu_cfg_get_defbool(config, "hap", &c_info->hap, 0);