From patchwork Wed Feb 5 16:50:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 11366635 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5D96C1395 for ; Wed, 5 Feb 2020 16:52:10 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3A2D920674 for ; Wed, 5 Feb 2020 16:52:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=citrix.com header.i=@citrix.com header.b="KkIWFTwv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3A2D920674 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=none 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 1izNtS-0000SQ-QU; Wed, 05 Feb 2020 16:51:14 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1izNtQ-0000Rw-NP for xen-devel@lists.xenproject.org; Wed, 05 Feb 2020 16:51:12 +0000 X-Inumbo-ID: b266ad96-4837-11ea-ad98-bc764e2007e4 Received: from esa4.hc3370-68.iphmx.com (unknown [216.71.155.144]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id b266ad96-4837-11ea-ad98-bc764e2007e4; Wed, 05 Feb 2020 16:51:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1580921464; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=wkRiF1V/Bg3ivbCm3TNMAkp/y/0fmOHfkDJ6wpVO1Ss=; b=KkIWFTwvVKgWK5cPk/h7QrJSVoMSqsiAlex4aGzpsPJVr9t5IEMPBxhr Xx4nczhqVx5SStGFslILmhkUuqtgWzdoPXEU/h6KvdBV5nUo354ojxQ0R Z0phcMm+PKwROHL4IVvbivMhSv9bHDgv3+8Z0YS3EJRiJHZvoxl8Ujxua 8=; Authentication-Results: esa4.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=andrew.cooper3@citrix.com; spf=Pass smtp.mailfrom=Andrew.Cooper3@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: None (esa4.hc3370-68.iphmx.com: no sender authenticity information available from domain of andrew.cooper3@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa4.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa4.hc3370-68.iphmx.com: domain of Andrew.Cooper3@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa4.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="Andrew.Cooper3@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ip4:168.245.78.127 ~all" Received-SPF: None (esa4.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa4.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: nBxv7lrf0X1sy3+VQdHdz0hUZyKn1zDMgHoSAHMbHXOKQs3md85Fe/2Db4sLcpwc5v6In3vj+y BbbVZb1hYU5jScHez0xhir6DqVX990LSIwZInv025difmvD1kulIg7fAz2T1zGGBZz68GQBZc1 jtg/wlnT9xUePbKTebxaVzE+JCdMytmcFweL7yNRtRc8hFUXJxtd2VLI9qISKhb9qCw+aNJEG/ h1hU0ThHeVS1wlx9aOuhR0COJzroXOK/xK0hIKDYPM6rVeR7zQ7ex94pIClJjF6xF+DZiZFk1H wVE= X-SBRS: 2.7 X-MesageID: 12612165 X-Ironport-Server: esa4.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.70,406,1574139600"; d="scan'208";a="12612165" From: Andrew Cooper To: Xen-devel Date: Wed, 5 Feb 2020 16:50:56 +0000 Message-ID: <20200205165056.11734-7-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20200205165056.11734-1-andrew.cooper3@citrix.com> References: <20200205165056.11734-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 6/6] xen/public: Obsolete HVM_PARAM_PAE_ENABLED 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: Stefano Stabellini , Julien Grall , Wei Liu , Andrew Cooper , Jan Beulich , Anthony PERARD , Ian Jackson , Volodymyr Babchuk , =?utf-8?q?Roger_Pau_Monn?= =?utf-8?q?=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" HVM_PARAM_PAE_ENABLED is undocumented and Xen has never acted upon its value, contrary perhaps to expectations based on how other boolean fields work. It was only ever used as a non-standard calling convention for xc_cpuid_apply_policy() but that has been fixed now. Purge its use, and any possible confusion over its behaviour, by having Xen reject any attempts to use it. Forgo setting it up in libxl's hvm_set_conf_params(). The only backwards compatibility necessary is to have the HVM restore stream discard it if found. Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich Acked-by: Julien Grall --- CC: Jan Beulich CC: Wei Liu CC: Roger Pau Monné CC: Stefano Stabellini CC: Julien Grall CC: Volodymyr Babchuk CC: Ian Jackson CC: Wei Liu CC: Anthony PERARD --- tools/libxc/xc_sr_restore_x86_hvm.c | 10 ++++++++++ tools/libxc/xc_sr_save_x86_hvm.c | 1 - tools/libxl/libxl_x86.c | 8 +------- xen/arch/arm/hvm.c | 3 ++- xen/arch/x86/hvm/hvm.c | 2 ++ xen/include/public/hvm/params.h | 2 +- 6 files changed, 16 insertions(+), 10 deletions(-) diff --git a/tools/libxc/xc_sr_restore_x86_hvm.c b/tools/libxc/xc_sr_restore_x86_hvm.c index 3f78248f32..da1574ce11 100644 --- a/tools/libxc/xc_sr_restore_x86_hvm.c +++ b/tools/libxc/xc_sr_restore_x86_hvm.c @@ -72,6 +72,16 @@ static int handle_hvm_params(struct xc_sr_context *ctx, case HVM_PARAM_BUFIOREQ_PFN: xc_clear_domain_page(xch, ctx->domid, entry->value); break; + + case HVM_PARAM_PAE_ENABLED: + /* + * This HVM_PARAM only ever existed a non-standard calling ABI for + * xc_cpuid_apply_policy(). It has now been updated to use a + * regular calling convention, making the param obsolete. + * + * Discard if we find it in an old migration stream. + */ + continue; } rc = xc_hvm_param_set(xch, ctx->domid, entry->index, entry->value); diff --git a/tools/libxc/xc_sr_save_x86_hvm.c b/tools/libxc/xc_sr_save_x86_hvm.c index d99efe65e5..7d3f3ddb8f 100644 --- a/tools/libxc/xc_sr_save_x86_hvm.c +++ b/tools/libxc/xc_sr_save_x86_hvm.c @@ -71,7 +71,6 @@ static int write_hvm_params(struct xc_sr_context *ctx) HVM_PARAM_ACPI_IOPORTS_LOCATION, HVM_PARAM_VIRIDIAN, HVM_PARAM_IDENT_PT, - HVM_PARAM_PAE_ENABLED, HVM_PARAM_VM_GENERATION_ID_ADDR, HVM_PARAM_IOREQ_SERVER_PFN, HVM_PARAM_NR_IOREQ_SERVER_PAGES, diff --git a/tools/libxl/libxl_x86.c b/tools/libxl/libxl_x86.c index 1cae0e2b26..f8bc828e62 100644 --- a/tools/libxl/libxl_x86.c +++ b/tools/libxl/libxl_x86.c @@ -391,12 +391,10 @@ static int hvm_set_conf_params(libxl__gc *gc, uint32_t domid, libxl_ctx *ctx = libxl__gc_owner(gc); xc_interface *xch = ctx->xch; int ret = ERROR_FAIL; - bool pae = true, altp2m = info->altp2m; + bool altp2m = info->altp2m; switch(info->type) { case LIBXL_DOMAIN_TYPE_HVM: - pae = libxl_defbool_val(info->u.hvm.pae); - /* The config parameter "altp2m" replaces the parameter "altp2mhvm". For * legacy reasons, both parameters are accepted on x86 HVM guests. * @@ -425,10 +423,6 @@ static int hvm_set_conf_params(libxl__gc *gc, uint32_t domid, /* Fallthrough */ case LIBXL_DOMAIN_TYPE_PVH: - if (xc_hvm_param_set(xch, domid, HVM_PARAM_PAE_ENABLED, pae)) { - LOG(ERROR, "Couldn't set HVM_PARAM_PAE_ENABLED"); - goto out; - } if (xc_hvm_param_set(xch, domid, HVM_PARAM_TIMER_MODE, timer_mode(info))) { LOG(ERROR, "Couldn't set HVM_PARAM_TIMER_MODE"); diff --git a/xen/arch/arm/hvm.c b/xen/arch/arm/hvm.c index 76b27c9168..f3426f37fe 100644 --- a/xen/arch/arm/hvm.c +++ b/xen/arch/arm/hvm.c @@ -46,7 +46,8 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg) if ( copy_from_guest(&a, arg, 1) ) return -EFAULT; - if ( a.index >= HVM_NR_PARAMS ) + if ( a.index >= HVM_NR_PARAMS || + a.index == HVM_PARAM_PAE_ENABLED ) return -EINVAL; d = rcu_lock_domain_by_any_id(a.domid); diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index 00a9e70b7c..2b869ac997 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -4104,6 +4104,7 @@ static int hvm_allow_set_param(struct domain *d, case HVM_PARAM_X87_FIP_WIDTH: break; /* The following parameters are deprecated. */ + case HVM_PARAM_PAE_ENABLED: case HVM_PARAM_DM_DOMAIN: case HVM_PARAM_BUFIOREQ_EVTCHN: rc = -EPERM; @@ -4410,6 +4411,7 @@ static int hvm_allow_get_param(struct domain *d, case HVM_PARAM_X87_FIP_WIDTH: break; /* The following parameters are deprecated. */ + case HVM_PARAM_PAE_ENABLED: case HVM_PARAM_DM_DOMAIN: case HVM_PARAM_BUFIOREQ_EVTCHN: rc = -ENODATA; diff --git a/xen/include/public/hvm/params.h b/xen/include/public/hvm/params.h index 36832e4b94..faa6bda095 100644 --- a/xen/include/public/hvm/params.h +++ b/xen/include/public/hvm/params.h @@ -86,7 +86,7 @@ #define HVM_PARAM_STORE_PFN 1 #define HVM_PARAM_STORE_EVTCHN 2 -#define HVM_PARAM_PAE_ENABLED 4 +#define HVM_PARAM_PAE_ENABLED 4 /* Obsolete. Do not use. */ #define HVM_PARAM_IOREQ_PFN 5