From patchwork Tue Sep 10 12:01:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 11139325 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 2D88813BD for ; Tue, 10 Sep 2019 12:05:28 +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 F243A2089F for ; Tue, 10 Sep 2019 12:05:27 +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="ON0vU1Nw" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F243A2089F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=eu.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 1i7esA-0007NY-CT; Tue, 10 Sep 2019 12:03:50 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i7es8-0007N9-N5 for xen-devel@lists.xenproject.org; Tue, 10 Sep 2019 12:03:48 +0000 X-Inumbo-ID: 0b554fd2-d3c3-11e9-ac1c-12813bfff9fa Received: from esa3.hc3370-68.iphmx.com (unknown [216.71.145.155]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 0b554fd2-d3c3-11e9-ac1c-12813bfff9fa; Tue, 10 Sep 2019 12:03:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1568117028; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=nDH9H0EOC4JqqYAHcuZ2aZizo39n+sLwbxY8meJcGSM=; b=ON0vU1NwBbzmse1wOFFos8yS1zhtWHHZL67TXt1AN3P+bCrvutek63a/ YoptKyanxXq3H2aaxfCOlbuvBa68yAEdwLU84fPH1LQ/TONDiqnMXYP1a VZ5PW9bhjov0BTaEZ4AfRK/RYAxp8YXDwdIWLM/vT+CacOX0ameMs3wzO s=; Authentication-Results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=ian.jackson@eu.citrix.com; spf=Pass smtp.mailfrom=Ian.Jackson@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: None (esa3.hc3370-68.iphmx.com: no sender authenticity information available from domain of ian.jackson@eu.citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa3.hc3370-68.iphmx.com; envelope-from="Ian.Jackson@citrix.com"; x-sender="ian.jackson@eu.citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa3.hc3370-68.iphmx.com: domain of Ian.Jackson@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa3.hc3370-68.iphmx.com; envelope-from="Ian.Jackson@citrix.com"; x-sender="Ian.Jackson@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 ~all" Received-SPF: None (esa3.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=esa3.hc3370-68.iphmx.com; envelope-from="Ian.Jackson@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: LvM1Zm8l3NtvGw0eMDqKGlw0jNMmpAHeTt33DjWUruJHwxAx5AG25OxnPFk9Hgq55ml0wu9puV T8klW0FdPxY2U0oI7Grzf0/Hn/GGCeTlnu8174vijQhWX+k1N/UYiqocd0cCY+jBsfDTyLkUXN iX18lZDJ5uIoEVvFPLUwH3J/2EixAq9wD27Da6CJa/zUr6hrAsO7gYm2nGwrOwvlJIEb8F+iOF 5eRkD+XzqvGFEhjcFPjsmYo//8GqnXgSQmCufnrJ1L1D+Oi1VpArdBqwg+ShtOyBeDMUpb34PB vRY= X-SBRS: 2.7 X-MesageID: 5370519 X-Ironport-Server: esa3.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.64,489,1559534400"; d="scan'208";a="5370519" From: Ian Jackson To: Date: Tue, 10 Sep 2019 13:01:59 +0100 Message-ID: <20190910120207.10358-5-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190910120207.10358-1-ian.jackson@eu.citrix.com> References: <20190910120207.10358-1-ian.jackson@eu.citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v3 04/12] xen/domctl: Drop guest suffix from XEN_DOMCTL_CDF_hvm 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 , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , =?utf-8?q?Marek_Marczykowski-G?= =?utf-8?q?=C3=B3recki?= , Tim Deegan , Julien Grall , Jan Beulich , Anthony PERARD , Volodymyr Babchuk , =?utf-8?q?Roger_Pau_Monn?= =?utf-8?q?=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" From: Andrew Cooper Signed-off-by: Andrew Cooper Acked-by: Jan Beulich Acked-by: Julien Grall --- tools/libxl/libxl_create.c | 2 +- tools/python/xen/lowlevel/xc/xc.c | 2 +- xen/arch/arm/domain.c | 2 +- xen/arch/arm/domain_build.c | 2 +- xen/arch/arm/setup.c | 2 +- xen/arch/x86/domain.c | 4 ++-- xen/arch/x86/setup.c | 2 +- xen/common/domain.c | 4 ++-- xen/include/public/domctl.h | 4 ++-- xen/include/xen/sched.h | 4 ++-- 10 files changed, 14 insertions(+), 14 deletions(-) diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c index 03ce166f4f..79e010da72 100644 --- a/tools/libxl/libxl_create.c +++ b/tools/libxl/libxl_create.c @@ -557,7 +557,7 @@ int libxl__domain_make(libxl__gc *gc, libxl_domain_config *d_config, }; if (info->type != LIBXL_DOMAIN_TYPE_PV) { - create.flags |= XEN_DOMCTL_CDF_hvm_guest; + create.flags |= XEN_DOMCTL_CDF_hvm; create.flags |= libxl_defbool_val(info->hap) ? XEN_DOMCTL_CDF_hap : 0; create.flags |= diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c index 9d53c4cf37..26b9a0fb74 100644 --- a/tools/python/xen/lowlevel/xc/xc.c +++ b/tools/python/xen/lowlevel/xc/xc.c @@ -155,7 +155,7 @@ static PyObject *pyxc_domain_create(XcObject *self, } #if defined (__i386) || defined(__x86_64__) - if ( config.flags & XEN_DOMCTL_CDF_hvm_guest ) + if ( config.flags & XEN_DOMCTL_CDF_hvm ) config.arch.emulation_flags = (XEN_X86_EMU_ALL & ~XEN_X86_EMU_VPCI); #elif defined (__arm__) || defined(__aarch64__) config.arch.gic_version = XEN_DOMCTL_CONFIG_GIC_NATIVE; diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c index 941bbff4fe..a9c4113c26 100644 --- a/xen/arch/arm/domain.c +++ b/xen/arch/arm/domain.c @@ -608,7 +608,7 @@ int arch_sanitise_domain_config(struct xen_domctl_createdomain *config) { unsigned int max_vcpus; - if ( config->flags != (XEN_DOMCTL_CDF_hvm_guest | XEN_DOMCTL_CDF_hap) ) + if ( config->flags != (XEN_DOMCTL_CDF_hvm | XEN_DOMCTL_CDF_hap) ) { dprintk(XENLOG_INFO, "Unsupported configuration %#x\n", config->flags); return -EINVAL; diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index e79d4e204f..a0fee1ef13 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -2070,7 +2070,7 @@ void __init create_domUs(void) struct xen_domctl_createdomain d_cfg = { .arch.gic_version = XEN_DOMCTL_CONFIG_GIC_NATIVE, .arch.nr_spis = 0, - .flags = XEN_DOMCTL_CDF_hvm_guest | XEN_DOMCTL_CDF_hap, + .flags = XEN_DOMCTL_CDF_hvm | XEN_DOMCTL_CDF_hap, .max_evtchn_port = -1, .max_grant_frames = 64, .max_maptrack_frames = 1024, diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c index fa6c110b11..1b303bde34 100644 --- a/xen/arch/arm/setup.c +++ b/xen/arch/arm/setup.c @@ -797,7 +797,7 @@ void __init start_xen(unsigned long boot_phys_offset, struct bootmodule *xen_bootmodule; struct domain *dom0; struct xen_domctl_createdomain dom0_cfg = { - .flags = XEN_DOMCTL_CDF_hvm_guest | XEN_DOMCTL_CDF_hap, + .flags = XEN_DOMCTL_CDF_hvm | XEN_DOMCTL_CDF_hap, .max_evtchn_port = -1, .max_grant_frames = gnttab_dom0_frames(), .max_maptrack_frames = opt_max_maptrack_frames, diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index d538de8eae..4b0ad5e15d 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -442,7 +442,7 @@ void arch_vcpu_destroy(struct vcpu *v) int arch_sanitise_domain_config(struct xen_domctl_createdomain *config) { - bool hvm = config->flags & XEN_DOMCTL_CDF_hvm_guest; + bool hvm = config->flags & XEN_DOMCTL_CDF_hvm; unsigned int max_vcpus; if ( hvm ? !hvm_enabled : !IS_ENABLED(CONFIG_PV) ) @@ -473,7 +473,7 @@ int arch_sanitise_domain_config(struct xen_domctl_createdomain *config) return -EINVAL; } - if ( !(config->flags & XEN_DOMCTL_CDF_hvm_guest) ) + if ( !(config->flags & XEN_DOMCTL_CDF_hvm) ) /* * It is only meaningful for XEN_DOMCTL_CDF_oos_off to be clear * for HVM guests. diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index 5a88ef368f..27981adc0b 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -1723,7 +1723,7 @@ void __init noreturn __start_xen(unsigned long mbi_p) if ( opt_dom0_pvh ) { - dom0_cfg.flags |= (XEN_DOMCTL_CDF_hvm_guest | + dom0_cfg.flags |= (XEN_DOMCTL_CDF_hvm | ((hvm_hap_supported() && !opt_dom0_shadow) ? XEN_DOMCTL_CDF_hap : 0)); diff --git a/xen/common/domain.c b/xen/common/domain.c index e9d2c613e0..09917b2885 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -297,7 +297,7 @@ static void _domain_destroy(struct domain *d) static int sanitise_domain_config(struct xen_domctl_createdomain *config) { - if ( config->flags & ~(XEN_DOMCTL_CDF_hvm_guest | + if ( config->flags & ~(XEN_DOMCTL_CDF_hvm | XEN_DOMCTL_CDF_hap | XEN_DOMCTL_CDF_s3_integrity | XEN_DOMCTL_CDF_oos_off | @@ -313,7 +313,7 @@ static int sanitise_domain_config(struct xen_domctl_createdomain *config) return -EINVAL; } - if ( !(config->flags & XEN_DOMCTL_CDF_hvm_guest) && + if ( !(config->flags & XEN_DOMCTL_CDF_hvm) && (config->flags & XEN_DOMCTL_CDF_hap) ) { dprintk(XENLOG_INFO, "HAP requested for non-HVM guest\n"); diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h index 72d5133cba..ff9265f765 100644 --- a/xen/include/public/domctl.h +++ b/xen/include/public/domctl.h @@ -50,8 +50,8 @@ struct xen_domctl_createdomain { uint32_t ssidref; xen_domain_handle_t handle; /* Is this an HVM guest (as opposed to a PV guest)? */ -#define _XEN_DOMCTL_CDF_hvm_guest 0 -#define XEN_DOMCTL_CDF_hvm_guest (1U<<_XEN_DOMCTL_CDF_hvm_guest) +#define _XEN_DOMCTL_CDF_hvm 0 +#define XEN_DOMCTL_CDF_hvm (1U<<_XEN_DOMCTL_CDF_hvm) /* Use hardware-assisted paging if available? */ #define _XEN_DOMCTL_CDF_hap 1 #define XEN_DOMCTL_CDF_hap (1U<<_XEN_DOMCTL_CDF_hap) diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h index d2bbe03bd9..e3601c1935 100644 --- a/xen/include/xen/sched.h +++ b/xen/include/xen/sched.h @@ -912,7 +912,7 @@ void watchdog_domain_destroy(struct domain *d); static inline bool is_pv_domain(const struct domain *d) { return IS_ENABLED(CONFIG_PV) && - evaluate_nospec(!(d->options & XEN_DOMCTL_CDF_hvm_guest)); + evaluate_nospec(!(d->options & XEN_DOMCTL_CDF_hvm)); } static inline bool is_pv_vcpu(const struct vcpu *v) @@ -944,7 +944,7 @@ static inline bool is_pv_64bit_vcpu(const struct vcpu *v) static inline bool is_hvm_domain(const struct domain *d) { return IS_ENABLED(CONFIG_HVM) && - evaluate_nospec(d->options & XEN_DOMCTL_CDF_hvm_guest); + evaluate_nospec(d->options & XEN_DOMCTL_CDF_hvm); } static inline bool is_hvm_vcpu(const struct vcpu *v)