From nobody Wed May 1 07:06:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1564062038; cv=none; d=zoho.com; s=zohoarc; b=dCNehf3vtHrOKrndFY/htZmJZjCHgL6dPrev+LPmFZvqUcOZK3UWengswbcWtOE20W4wvUh5vk9oXxxvy8RbMWnJDcxl76fotV6RgKQRkW5nmwlHKtRk64qf4n/XcSoOz0g/lHDJghPXfmsg0ApSX5anzqpOgKqkIr95Ysd1Qc8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564062038; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=YNh/Mm0yr6QO/JrOpLyhpI1JQUlM+kzfXCuubnHY0Jw=; b=WH076n8WwVzfmdRgfomHd+4cGTra8XSycRHLsAGyfkabizaHl+iIU4aMURyScCHQh1ZAYDxstV1qG7rtVYumt6aq7w2rWYnS14vLRz7T4FuLF36cNxi+u/V+w+XwPR0JHXjqnqLbfmyAcvl1T3SvU8mY6V7n8bt05SHbu78kHBI= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1564062038134338.91028555619505; Thu, 25 Jul 2019 06:40:38 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hqdxz-00005c-Bl; Thu, 25 Jul 2019 13:39:31 +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 1hqdxy-00004z-DQ for xen-devel@lists.xenproject.org; Thu, 25 Jul 2019 13:39:30 +0000 Received: from esa2.hc3370-68.iphmx.com (unknown [216.71.145.153]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 9e72038e-aee1-11e9-93b5-3f982684f284; Thu, 25 Jul 2019 13:39:26 +0000 (UTC) X-Inumbo-ID: 9e72038e-aee1-11e9-93b5-3f982684f284 Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=paul.durrant@citrix.com; spf=Pass smtp.mailfrom=Paul.Durrant@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of paul.durrant@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="Paul.Durrant@citrix.com"; x-sender="paul.durrant@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa2.hc3370-68.iphmx.com: domain of Paul.Durrant@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="Paul.Durrant@citrix.com"; x-sender="Paul.Durrant@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 (esa2.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=esa2.hc3370-68.iphmx.com; envelope-from="Paul.Durrant@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: tvCDlWXsc21oTiC0bVHRH6sjnB5NWjLw1wSfLD6tZ1roFNzJHKcWv/lWJ6n4WN+AaLW2Mu+uf+ CP0+1hWIlkL+L5+juT4aXs5IocBpwy3U7bdnKHj91UUIjy00nRV4i11pLM4NyNgTHDt9wK9r8U 7EFmgai14oDQ314Ph/zxjadYSVCFlx2JwJb59Whs/ohfJWsFgsDMPgeM3RaREwUTlv6wV0sM0M pdy+I479AzJOL++EuxY5dSpjIxN7y+hRc3ul7ysIxM4Q5F3oMA7XfA910dHJHpsKgZ7F+Ofgf/ OAk= X-SBRS: 2.7 X-MesageID: 3420484 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.64,306,1559534400"; d="scan'208";a="3420484" From: Paul Durrant To: Date: Thu, 25 Jul 2019 14:39:15 +0100 Message-ID: <20190725133920.40673-2-paul.durrant@citrix.com> X-Mailer: git-send-email 2.20.1.2.gb21ebb671 In-Reply-To: <20190725133920.40673-1-paul.durrant@citrix.com> References: <20190725133920.40673-1-paul.durrant@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v2 1/6] domain: stash xen_domctl_createdomain flags in struct domain 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 , Tim Deegan , Julien Grall , Paul Durrant , Jan Beulich Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" These are canonical source of data used to set various other flags. If they are available directly in struct domain then the other flags are no longer needed. This patch simply copies the flags into a new 'options' field in struct domain. Subsequent patches will do the related clean-up work. Signed-off-by: Paul Durrant Acked-by: George Dunlap Reviewed-by: Roger Pau Monn=C3=A9 --- Cc: Andrew Cooper Cc: George Dunlap Cc: Ian Jackson Cc: Jan Beulich Cc: Julien Grall Cc: Konrad Rzeszutek Wilk Cc: Stefano Stabellini Cc: Tim Deegan Cc: Wei Liu v2: - Rename 'createflags' to 'options' --- xen/common/domain.c | 6 ++++-- xen/include/xen/sched.h | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/xen/common/domain.c b/xen/common/domain.c index bc56a51815..eef486af05 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -331,6 +331,8 @@ struct domain *domain_create(domid_t domid, if ( (d =3D alloc_domain_struct()) =3D=3D NULL ) return ERR_PTR(-ENOMEM); =20 + d->options =3D config ? config->flags : 0; + /* Sort out our idea of is_system_domain(). */ d->domain_id =3D domid; =20 @@ -352,7 +354,7 @@ struct domain *domain_create(domid_t domid, } =20 /* Sort out our idea of is_{pv,hvm}_domain(). All system domains are = PV. */ - d->guest_type =3D ((config && (config->flags & XEN_DOMCTL_CDF_hvm_gues= t)) + d->guest_type =3D ((d->options & XEN_DOMCTL_CDF_hvm_guest) ? guest_type_hvm : guest_type_pv); =20 TRACE_1D(TRC_DOM0_DOM_ADD, d->domain_id); @@ -429,7 +431,7 @@ struct domain *domain_create(domid_t domid, watchdog_domain_init(d); init_status |=3D INIT_watchdog; =20 - if ( config->flags & XEN_DOMCTL_CDF_xs_domain ) + if ( d->options & XEN_DOMCTL_CDF_xs_domain ) { d->is_xenstore =3D 1; d->disable_migrate =3D 1; diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h index c197e93d73..cff2990b10 100644 --- a/xen/include/xen/sched.h +++ b/xen/include/xen/sched.h @@ -306,6 +306,7 @@ enum guest_type { =20 struct domain { + unsigned int options; /* copy of createdomain flags */ domid_t domain_id; =20 unsigned int max_vcpus; --=20 2.20.1.2.gb21ebb671 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Wed May 1 07:06:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1564062051; cv=none; d=zoho.com; s=zohoarc; b=i9/XJ8SK//Z817arP4COoGOXiyFVnbxnP6j5dZRztwglidHNwvYrQJ6Tqjz/T898TnIBs1rHPeSN6zRqDzrTkrFg0srTP1StflFaAsW175EabB/khFwKZXsAxVfXeNtPmsdqK8omwu1G6CrfDUl6DZUeaO+zRr3lcNGgEqQXsE4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564062051; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=jpoxhWW6S/48zbxHjHqANb1ynWjU1TzXJK85E53Oo6k=; b=N/KNkIEZ6reahP5wzinjbW0EeKndY9d5003693eYN00AJck/+W2YQfDZjK6m5y2AWVIvlyE8jvAz1RMJQDkcji3F4VyZbA9eYGMHpb4QuzO/mKKUWlG8abYDDNlohFvasWVcK3Grapc74prH/l/bbKbHL9sH+9wcgx5a+bPCwIQ= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1564062051109934.2097968973692; Thu, 25 Jul 2019 06:40:51 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hqdy2-00007R-ME; Thu, 25 Jul 2019 13:39:34 +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 1hqdy1-00006q-Kv for xen-devel@lists.xenproject.org; Thu, 25 Jul 2019 13:39:33 +0000 Received: from esa1.hc3370-68.iphmx.com (unknown [216.71.145.142]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id a0ddae34-aee1-11e9-b31c-7f6d28b7fa42; Thu, 25 Jul 2019 13:39:30 +0000 (UTC) X-Inumbo-ID: a0ddae34-aee1-11e9-b31c-7f6d28b7fa42 Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=paul.durrant@citrix.com; spf=Pass smtp.mailfrom=Paul.Durrant@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa1.hc3370-68.iphmx.com: no sender authenticity information available from domain of paul.durrant@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa1.hc3370-68.iphmx.com; envelope-from="Paul.Durrant@citrix.com"; x-sender="paul.durrant@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa1.hc3370-68.iphmx.com: domain of Paul.Durrant@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa1.hc3370-68.iphmx.com; envelope-from="Paul.Durrant@citrix.com"; x-sender="Paul.Durrant@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 (esa1.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=esa1.hc3370-68.iphmx.com; envelope-from="Paul.Durrant@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: rHPnCw9jKNRCzLHnLMh/iSRr6b2+adKVQ6opn15uFtDBALBytR8JQkSwJ7KkhQiovGt22GTTz8 E8yWrJMG60mzN9e/oCIBsimEyBc/cujdKvofnhQk5aiw0JALb5qv8qa5K7J+zMwqRDjUm4L8YW t75Cfo0RccLvkOmCx/IP8Tu7UbYqwRFFuBoAKgrBVobhrW2A2z+vkoRVHgybQsHlQJ7Tn+YTjo 3oQPK0S9hGBPt9anmPmfn1+v1cBl1t1MqjzUIV8tTu/L250QGG5k+bg6nxArificxuCRnwxiBS vgQ= X-SBRS: 2.7 X-MesageID: 3459690 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.64,306,1559534400"; d="scan'208";a="3459690" From: Paul Durrant To: Date: Thu, 25 Jul 2019 14:39:16 +0100 Message-ID: <20190725133920.40673-3-paul.durrant@citrix.com> X-Mailer: git-send-email 2.20.1.2.gb21ebb671 In-Reply-To: <20190725133920.40673-1-paul.durrant@citrix.com> References: <20190725133920.40673-1-paul.durrant@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v2 2/6] domain: remove 'guest_type' field (and enum guest_type) 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 , Tim Deegan , Julien Grall , Paul Durrant , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" The enum guest_type was introduced in commit 6c6492780ea "pvh prep: introduce pv guest type and has_hvm_container macros" to allow a new guest type, distinct from either PV or HVM guest types, to be added in commit 8271d6522c6 "pvh: introduce PVH guest type". Subsequently, commit 33e5c32559e "x86: remove PVHv1 code" removed this third guest type. This patch removes the struct domain field and enumeration as the guest type can now be trivially determined from the 'options' field. Signed-off-by: Paul Durrant Reviewed-by: "Roger Pau Monn=C3=A9" Acked-by: George Dunlap Reviewed-by: Jan Beulich --- Cc: Andrew Cooper Cc: George Dunlap Cc: Ian Jackson Cc: Jan Beulich Cc: Julien Grall Cc: Konrad Rzeszutek Wilk Cc: Stefano Stabellini Cc: Tim Deegan Cc: Wei Liu --- xen/common/domain.c | 4 ---- xen/common/domctl.c | 10 +--------- xen/common/kernel.c | 9 ++------- xen/include/xen/sched.h | 14 ++++---------- 4 files changed, 7 insertions(+), 30 deletions(-) diff --git a/xen/common/domain.c b/xen/common/domain.c index eef486af05..6ee281bd03 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -353,10 +353,6 @@ struct domain *domain_create(domid_t domid, hardware_domain =3D d; } =20 - /* Sort out our idea of is_{pv,hvm}_domain(). All system domains are = PV. */ - d->guest_type =3D ((d->options & XEN_DOMCTL_CDF_hvm_guest) - ? guest_type_hvm : guest_type_pv); - TRACE_1D(TRC_DOM0_DOM_ADD, d->domain_id); =20 /* diff --git a/xen/common/domctl.c b/xen/common/domctl.c index 72a44953d0..ef6714c0aa 100644 --- a/xen/common/domctl.c +++ b/xen/common/domctl.c @@ -187,17 +187,9 @@ void getdomaininfo(struct domain *d, struct xen_domctl= _getdomaininfo *info) (d->controller_pause_count > 0 ? XEN_DOMINF_paused : 0) | (d->debugger_attached ? XEN_DOMINF_debugged : 0) | (d->is_xenstore ? XEN_DOMINF_xs_domain : 0) | + (is_hvm_domain(d) ? XEN_DOMINF_hvm_guest : 0) | d->shutdown_code << XEN_DOMINF_shutdownshift; =20 - switch ( d->guest_type ) - { - case guest_type_hvm: - info->flags |=3D XEN_DOMINF_hvm_guest; - break; - default: - break; - } - xsm_security_domaininfo(d, info); =20 info->tot_pages =3D d->tot_pages; diff --git a/xen/common/kernel.c b/xen/common/kernel.c index 612575430f..f7628d73ce 100644 --- a/xen/common/kernel.c +++ b/xen/common/kernel.c @@ -474,19 +474,14 @@ DO(xen_version)(int cmd, XEN_GUEST_HANDLE_PARAM(void)= arg) fi.submap |=3D (1U << XENFEAT_ARM_SMCCC_supported); #endif #ifdef CONFIG_X86 - switch ( d->guest_type ) - { - case guest_type_pv: + if ( is_pv_domain(d) ) fi.submap |=3D (1U << XENFEAT_mmu_pt_update_preserve_ad) | (1U << XENFEAT_highmem_assist) | (1U << XENFEAT_gnttab_map_avail_bits); - break; - case guest_type_hvm: + else fi.submap |=3D (1U << XENFEAT_hvm_safe_pvclock) | (1U << XENFEAT_hvm_callback_vector) | (has_pirq(d) ? (1U << XENFEAT_hvm_pirqs) : 0); - break; - } #endif break; default: diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h index cff2990b10..aa09d2c574 100644 --- a/xen/include/xen/sched.h +++ b/xen/include/xen/sched.h @@ -300,10 +300,6 @@ struct vm_event_domain =20 struct evtchn_port_ops; =20 -enum guest_type { - guest_type_pv, guest_type_hvm -}; - struct domain { unsigned int options; /* copy of createdomain flags */ @@ -355,8 +351,6 @@ struct domain struct radix_tree_root pirq_tree; unsigned int nr_pirqs; =20 - enum guest_type guest_type; - /* Is this guest dying (i.e., a zombie)? */ enum { DOMDYING_alive, DOMDYING_dying, DOMDYING_dead } is_dying; =20 @@ -916,8 +910,8 @@ void watchdog_domain_destroy(struct domain *d); =20 static inline bool is_pv_domain(const struct domain *d) { - return IS_ENABLED(CONFIG_PV) - ? evaluate_nospec(d->guest_type =3D=3D guest_type_pv) : false; + return IS_ENABLED(CONFIG_PV) && + !evaluate_nospec(d->options & XEN_DOMCTL_CDF_hvm_guest); } =20 static inline bool is_pv_vcpu(const struct vcpu *v) @@ -948,8 +942,8 @@ static inline bool is_pv_64bit_vcpu(const struct vcpu *= v) #endif static inline bool is_hvm_domain(const struct domain *d) { - return IS_ENABLED(CONFIG_HVM) - ? evaluate_nospec(d->guest_type =3D=3D guest_type_hvm) : false; + return IS_ENABLED(CONFIG_HVM) && + evaluate_nospec(d->options & XEN_DOMCTL_CDF_hvm_guest); } =20 static inline bool is_hvm_vcpu(const struct vcpu *v) --=20 2.20.1.2.gb21ebb671 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Wed May 1 07:06:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1564062030; cv=none; d=zoho.com; s=zohoarc; b=Fk8nWuCdufxvrGHOhFZIVJ5Cpzcb9OrapFmjvN4VrFfGw6ZvkD2XjuTcGNmb3dFiDT959IGwSqekknL2+jWE8hMH5LGvzvuY+jduONwwYEHciUGlu98+trnZ7HZ6V2GhNvxKitedPP12XdS5nSL+7G1g5GNUA5xoFF96itQHyZA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564062030; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=ELtRVM3VoMW6LJ7muP2dHsdyR2ub9JqRD4I7viTaCso=; b=cVxTVSoA6Q+jRShS2pOCzshvl/pFUQah+caZKwQKhDu6IMi3dAMNeMRkM8ZUwkYJc3Lca8+KX8xXZD3kTcj+4Jj8vgpUyzzGd/+iPFhTxOuDxjNSXlcFclpYH7nn9efrl6zfkzvdDOEf5eCw8vMrxZGWoRdaqBkpRohUNqvGq9s= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1564062030426674.6325849312774; Thu, 25 Jul 2019 06:40:30 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hqdxw-0008Vq-O3; Thu, 25 Jul 2019 13:39:28 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hqdxv-0008VY-DR for xen-devel@lists.xenproject.org; Thu, 25 Jul 2019 13:39:27 +0000 Received: from esa2.hc3370-68.iphmx.com (unknown [216.71.145.153]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 9eb78409-aee1-11e9-8980-bc764e045a96; Thu, 25 Jul 2019 13:39:26 +0000 (UTC) X-Inumbo-ID: 9eb78409-aee1-11e9-8980-bc764e045a96 Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=paul.durrant@citrix.com; spf=Pass smtp.mailfrom=Paul.Durrant@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of paul.durrant@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="Paul.Durrant@citrix.com"; x-sender="paul.durrant@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa2.hc3370-68.iphmx.com: domain of Paul.Durrant@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="Paul.Durrant@citrix.com"; x-sender="Paul.Durrant@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 (esa2.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=esa2.hc3370-68.iphmx.com; envelope-from="Paul.Durrant@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: FRvNsKi2DiL7dPlV5f7wUcoQ3mwG1eVbRhn3b1+4mTpdODNOwgEo1bPY0zLslX9TP57pwntWN+ aaXEiS/U5BnPyiDjfYnQaGm+Le7/vGLk+TXrFUiWAFKn30AYhReMd9MlIh3gGDiRjVBI8Xo+6Q ZXFmXIzEOTaYYnuEsgtBK+cbEAysB0J6I3EImOukcFR7hHPXJJ6JV3cwT17TluJdrNCrbzwa+P JC6JC/txfeAZ5nwC5d2XW2n5E/1f9uo6LIWhSktyCebFt9EOKA9RIEqd4Zv0uax847wEQKTBpn keY= X-SBRS: 2.7 X-MesageID: 3420489 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.64,306,1559534400"; d="scan'208";a="3420489" From: Paul Durrant To: Date: Thu, 25 Jul 2019 14:39:17 +0100 Message-ID: <20190725133920.40673-4-paul.durrant@citrix.com> X-Mailer: git-send-email 2.20.1.2.gb21ebb671 In-Reply-To: <20190725133920.40673-1-paul.durrant@citrix.com> References: <20190725133920.40673-1-paul.durrant@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v2 3/6] x86/hvm/domain: remove the 'hap_enabled' flag 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 Cooper , Paul Durrant , Wei Liu , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" The hap_enabled() macro can determine whether the feature is available using the domain 'options'; there is no need for a separate flag. Signed-off-by: Paul Durrant Reviewed-by: Roger Pau Monn=C3=A9 --- Cc: Jan Beulich Cc: Andrew Cooper Cc: Wei Liu Cc: "Roger Pau Monn=C3=A9" v2: - Defer changes to shadow_domain_init() to patch #4 --- xen/arch/x86/domain.c | 7 +------ xen/arch/x86/mm/paging.c | 4 ++-- xen/include/asm-x86/hvm/domain.h | 9 +++------ xen/include/asm-x86/paging.h | 2 +- 4 files changed, 7 insertions(+), 15 deletions(-) diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index ea55160887..65f47a7627 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -564,12 +564,7 @@ int arch_domain_create(struct domain *d, HYPERVISOR_COMPAT_VIRT_START(d) =3D is_pv_domain(d) ? __HYPERVISOR_COMPAT_VIRT_START : ~0u; =20 - /* Need to determine if HAP is enabled before initialising paging */ - if ( is_hvm_domain(d) ) - d->arch.hvm.hap_enabled =3D - hvm_hap_supported() && (config->flags & XEN_DOMCTL_CDF_hap); - - if ( (rc =3D paging_domain_init(d, config->flags)) !=3D 0 ) + if ( (rc =3D paging_domain_init(d)) !=3D 0 ) goto fail; paging_initialised =3D true; =20 diff --git a/xen/arch/x86/mm/paging.c b/xen/arch/x86/mm/paging.c index 011089368a..097a27f608 100644 --- a/xen/arch/x86/mm/paging.c +++ b/xen/arch/x86/mm/paging.c @@ -632,7 +632,7 @@ void paging_log_dirty_init(struct domain *d, const stru= ct log_dirty_ops *ops) /* CODE FOR PAGING SUPPORT */ /************************************************/ /* Domain paging struct initialization. */ -int paging_domain_init(struct domain *d, unsigned int domcr_flags) +int paging_domain_init(struct domain *d) { int rc; =20 @@ -653,7 +653,7 @@ int paging_domain_init(struct domain *d, unsigned int d= omcr_flags) if ( hap_enabled(d) ) hap_domain_init(d); else - rc =3D shadow_domain_init(d, domcr_flags); + rc =3D shadow_domain_init(d, d->options); =20 return rc; } diff --git a/xen/include/asm-x86/hvm/domain.h b/xen/include/asm-x86/hvm/dom= ain.h index 6c7c4f5aa6..7897e36b94 100644 --- a/xen/include/asm-x86/hvm/domain.h +++ b/xen/include/asm-x86/hvm/domain.h @@ -156,7 +156,6 @@ struct hvm_domain { =20 struct viridian_domain *viridian; =20 - bool_t hap_enabled; bool_t mem_sharing_enabled; bool_t qemu_mapcache_invalidate; bool_t is_s3_suspended; @@ -195,11 +194,9 @@ struct hvm_domain { }; }; =20 -#ifdef CONFIG_HVM -#define hap_enabled(d) (is_hvm_domain(d) && (d)->arch.hvm.hap_enabled) -#else -#define hap_enabled(d) ({(void)(d); false;}) -#endif +#define hap_enabled(d) \ + (hvm_hap_supported() && is_hvm_domain(d) && \ + evaluate_nospec(d->options & XEN_DOMCTL_CDF_hap)) =20 #endif /* __ASM_X86_HVM_DOMAIN_H__ */ =20 diff --git a/xen/include/asm-x86/paging.h b/xen/include/asm-x86/paging.h index cf57ca708d..ab7887f23c 100644 --- a/xen/include/asm-x86/paging.h +++ b/xen/include/asm-x86/paging.h @@ -207,7 +207,7 @@ void paging_vcpu_init(struct vcpu *v); =20 /* Set up the paging-assistance-specific parts of a domain struct at * start of day. Called for every domain from arch_domain_create() */ -int paging_domain_init(struct domain *d, unsigned int domcr_flags); +int paging_domain_init(struct domain *d); =20 /* Handler for paging-control ops: operations from user-space to enable * and disable ephemeral shadow modes (test mode and log-dirty mode) and --=20 2.20.1.2.gb21ebb671 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Wed May 1 07:06:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1564062039; cv=none; d=zoho.com; s=zohoarc; b=A8SLLxoe062AAeiRKzEUWH6+wO9ei99bKbr+9EDIjlUKvGh6e3biaofXFN6yvAlrsbQDtNEwEwGOCJjAcYyh1WUned0sLXvU1V06XcRzaSCUuMPM4G2bg/QNFIqD976s0pPhwJqcoVpl1F8Fg8RDunhUAOxwTDqd8wMXGXFhhOo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564062039; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=/Bgrhq9nZVipJVEGq3A41t+hHHdDzBLcaBn8SEIy1BY=; b=OMigwLYUjldxLycDxuSeuyVWa2j94TUKTG83Ul7m7KvXlgesGQp2/U2qC0D8UMEBu42dcYIy1J9HudKCGkyzPGGuWBYjiFFKdjz29ZplX6SerQ5U28/QWeNt/kRzLle7xIkgFDLGGwOVCcGA6NHxHTmaWzQtL4Y4AmlDE8JjD7Q= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1564062039255170.55832832403644; Thu, 25 Jul 2019 06:40:39 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hqdy3-00007j-0d; Thu, 25 Jul 2019 13:39:35 +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 1hqdy1-000074-Rp for xen-devel@lists.xenproject.org; Thu, 25 Jul 2019 13:39:33 +0000 Received: from esa1.hc3370-68.iphmx.com (unknown [216.71.145.142]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id a19c38a4-aee1-11e9-95bd-c322ae5a3fc7; Thu, 25 Jul 2019 13:39:31 +0000 (UTC) X-Inumbo-ID: a19c38a4-aee1-11e9-95bd-c322ae5a3fc7 Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=paul.durrant@citrix.com; spf=Pass smtp.mailfrom=Paul.Durrant@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa1.hc3370-68.iphmx.com: no sender authenticity information available from domain of paul.durrant@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa1.hc3370-68.iphmx.com; envelope-from="Paul.Durrant@citrix.com"; x-sender="paul.durrant@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa1.hc3370-68.iphmx.com: domain of Paul.Durrant@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa1.hc3370-68.iphmx.com; envelope-from="Paul.Durrant@citrix.com"; x-sender="Paul.Durrant@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 (esa1.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=esa1.hc3370-68.iphmx.com; envelope-from="Paul.Durrant@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: WO86rw9O8S4A4cxzCRqMWlhWMRanneWqSoJqE+CLUzT/INzAAbQE7eNxCDg28YtE982iP8EnVT jwe6cqpuc90foZnld73MHqvK9rPeF4Lanoi/v8c/Tv5mZ8NaUvJOYLYqWj2ZBiU5RfZxFaFxC0 QIwJCt2e4KtpJYc9zL8QLAx+QtyygVreSMtvP7Ttr6/oZHbtxlYvHnUHyM8N6SihWcgun6nLSm wI0JzOGpSkSTrrUl879v92oNwzztImxV+VIduR+3Qkrw36vJCfRVrd94ekag45w1MhRKtnkPkA t10= X-SBRS: 2.7 X-MesageID: 3459691 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.64,306,1559534400"; d="scan'208";a="3459691" From: Paul Durrant To: Date: Thu, 25 Jul 2019 14:39:18 +0100 Message-ID: <20190725133920.40673-5-paul.durrant@citrix.com> X-Mailer: git-send-email 2.20.1.2.gb21ebb671 In-Reply-To: <20190725133920.40673-1-paul.durrant@citrix.com> References: <20190725133920.40673-1-paul.durrant@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v2 4/6] x86/domain: remove the 'oos_off' flag 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: Wei Liu , George Dunlap , Andrew Cooper , Tim Deegan , Paul Durrant , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" The flag is not needed since the domain 'options' can now be tested directly. Signed-off-by: Paul Durrant Acked-by: Tim Deegan Acked-by: George Dunlap --- Cc: George Dunlap Cc: Jan Beulich Cc: Andrew Cooper Cc: Wei Liu Cc: "Roger Pau Monn=C3=A9" v2: - Move some of the hunks from patch #3 - Also update the definition of shadow_domain_init() in none.c --- xen/arch/x86/mm/paging.c | 2 +- xen/arch/x86/mm/shadow/common.c | 5 ++--- xen/arch/x86/mm/shadow/none.c | 2 +- xen/include/asm-x86/domain.h | 1 - xen/include/asm-x86/shadow.h | 2 +- 5 files changed, 5 insertions(+), 7 deletions(-) diff --git a/xen/arch/x86/mm/paging.c b/xen/arch/x86/mm/paging.c index 097a27f608..69aa228e46 100644 --- a/xen/arch/x86/mm/paging.c +++ b/xen/arch/x86/mm/paging.c @@ -653,7 +653,7 @@ int paging_domain_init(struct domain *d) if ( hap_enabled(d) ) hap_domain_init(d); else - rc =3D shadow_domain_init(d, d->options); + rc =3D shadow_domain_init(d); =20 return rc; } diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/commo= n.c index fa18de0bb6..911d91e502 100644 --- a/xen/arch/x86/mm/shadow/common.c +++ b/xen/arch/x86/mm/shadow/common.c @@ -46,7 +46,7 @@ static void sh_clean_dirty_bitmap(struct domain *); =20 /* Set up the shadow-specific parts of a domain struct at start of day. * Called for every domain from arch_domain_create() */ -int shadow_domain_init(struct domain *d, unsigned int domcr_flags) +int shadow_domain_init(struct domain *d) { static const struct log_dirty_ops sh_ops =3D { .enable =3D sh_enable_log_dirty, @@ -62,7 +62,6 @@ int shadow_domain_init(struct domain *d, unsigned int dom= cr_flags) =20 #if (SHADOW_OPTIMIZATIONS & SHOPT_OUT_OF_SYNC) d->arch.paging.shadow.oos_active =3D 0; - d->arch.paging.shadow.oos_off =3D domcr_flags & XEN_DOMCTL_CDF_oos_off; #endif d->arch.paging.shadow.pagetable_dying_op =3D 0; =20 @@ -2523,7 +2522,7 @@ static void sh_update_paging_modes(struct vcpu *v) #if (SHADOW_OPTIMIZATIONS & SHOPT_OUT_OF_SYNC) /* We need to check that all the vcpus have paging enabled to * unsync PTs. */ - if ( is_hvm_domain(d) && !d->arch.paging.shadow.oos_off ) + if ( is_hvm_domain(d) && !(d->options & XEN_DOMCTL_CDF_oos_off) ) { int pe =3D 1; struct vcpu *vptr; diff --git a/xen/arch/x86/mm/shadow/none.c b/xen/arch/x86/mm/shadow/none.c index a70888bd98..2fddf4274c 100644 --- a/xen/arch/x86/mm/shadow/none.c +++ b/xen/arch/x86/mm/shadow/none.c @@ -18,7 +18,7 @@ static void _clean_dirty_bitmap(struct domain *d) ASSERT(is_pv_domain(d)); } =20 -int shadow_domain_init(struct domain *d, unsigned int domcr_flags) +int shadow_domain_init(struct domain *d) { static const struct log_dirty_ops sh_none_ops =3D { .enable =3D _enable_log_dirty, diff --git a/xen/include/asm-x86/domain.h b/xen/include/asm-x86/domain.h index 933b85901f..5f9899469c 100644 --- a/xen/include/asm-x86/domain.h +++ b/xen/include/asm-x86/domain.h @@ -115,7 +115,6 @@ struct shadow_domain { =20 /* OOS */ bool_t oos_active; - bool_t oos_off; =20 /* Has this domain ever used HVMOP_pagetable_dying? */ bool_t pagetable_dying_op; diff --git a/xen/include/asm-x86/shadow.h b/xen/include/asm-x86/shadow.h index f29f0f652b..8ebb89c027 100644 --- a/xen/include/asm-x86/shadow.h +++ b/xen/include/asm-x86/shadow.h @@ -49,7 +49,7 @@ =20 /* Set up the shadow-specific parts of a domain struct at start of day. * Called from paging_domain_init(). */ -int shadow_domain_init(struct domain *d, unsigned int domcr_flags); +int shadow_domain_init(struct domain *d); =20 /* Setup the shadow-specific parts of a vcpu struct. It is called by * paging_vcpu_init() in paging.c */ --=20 2.20.1.2.gb21ebb671 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Wed May 1 07:06:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1564062049; cv=none; d=zoho.com; s=zohoarc; b=l1iEgN8Hfb3PFgXb/4aVZCclVkUaAzZrZxzEz5Nj3vXk2iWoXlxLqWtekURpmNemfcqolJeqDWyQqUDNnxXkpwoVYDO811CkM+5gjw50Wuyc1gY1KC16xonWtWiCTAUIrpFFKZG66bHtJp4B7C3Koy0or4DL+4PLe0MrrrzBJ/8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564062049; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=dDMPv7S4Plu6tuu6gcTbmjE12uRTvRz9ezqj8Bhu1Z8=; b=Mz8MtNkXd5KzEzSE1I1HCsgf2DohSYNpSaO4/rBaMonqf1oXL61hCBs1KxJAxSiiKwrWj9g5qoqTmYQwa2U1/uUInsWF8sHENq8sea1huxv8VLOf+a8QEft++0i6k0kCtOG0+uppWoc9VKKS3WPLFe7VtevE0vnRWVqBKR5UY4w= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1564062049068533.4899815694067; Thu, 25 Jul 2019 06:40:49 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hqdy4-00009U-Gw; Thu, 25 Jul 2019 13:39:36 +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 1hqdy3-00007k-2g for xen-devel@lists.xenproject.org; Thu, 25 Jul 2019 13:39:35 +0000 Received: from esa1.hc3370-68.iphmx.com (unknown [216.71.145.142]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id a262a804-aee1-11e9-86b6-dbc9c5df9cdd; Thu, 25 Jul 2019 13:39:32 +0000 (UTC) X-Inumbo-ID: a262a804-aee1-11e9-86b6-dbc9c5df9cdd Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=paul.durrant@citrix.com; spf=Pass smtp.mailfrom=Paul.Durrant@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa1.hc3370-68.iphmx.com: no sender authenticity information available from domain of paul.durrant@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa1.hc3370-68.iphmx.com; envelope-from="Paul.Durrant@citrix.com"; x-sender="paul.durrant@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa1.hc3370-68.iphmx.com: domain of Paul.Durrant@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa1.hc3370-68.iphmx.com; envelope-from="Paul.Durrant@citrix.com"; x-sender="Paul.Durrant@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 (esa1.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=esa1.hc3370-68.iphmx.com; envelope-from="Paul.Durrant@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: 9bxae4ntBAD8bLW23e+ZTx8jAYXvOWrzM3J/QnD1DAmbecj/ghB/vRD9AgkkUqh4A97F4QKvZa rFzD4WPKC+I0l+CdDeMOf4FfL+8Z8Zm25FuoXOElRsui0XaUXS/8GxfgWuDTysIqee0KXBIqvx EChs3MYb6ExLhT3YEKtHpQqdlc4qldBrfFxoPgZpGuVqJFDw9W3Fc2XDu7Ecz1kfNH1B61pEeq MsKWYmeoARbyyI5vSn/EwXHVYXBaRYUPmQHz8MtrVrgsJLTEFNCm0IAW9FO9b0CineVRMnY9Hj Gas= X-SBRS: 2.7 X-MesageID: 3459694 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.64,306,1559534400"; d="scan'208";a="3459694" From: Paul Durrant To: Date: Thu, 25 Jul 2019 14:39:19 +0100 Message-ID: <20190725133920.40673-6-paul.durrant@citrix.com> X-Mailer: git-send-email 2.20.1.2.gb21ebb671 In-Reply-To: <20190725133920.40673-1-paul.durrant@citrix.com> References: <20190725133920.40673-1-paul.durrant@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v2 5/6] domain: remove the 'is_xenstore' flag 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 , Tim Deegan , Julien Grall , Paul Durrant , Jan Beulich , Daniel De Graaf , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" This patch introduces a convenience macro, is_xenstore_domain(), which tests the domain 'options' directly and then uses that in place of the 'is_xenstore' flag. Signed-off-by: Paul Durrant Reviewed-by: "Roger Pau Monn=C3=A9" Acked-by: George Dunlap --- Cc: Andrew Cooper Cc: George Dunlap Cc: Ian Jackson Cc: Jan Beulich Cc: Julien Grall Cc: Konrad Rzeszutek Wilk Cc: Stefano Stabellini Cc: Tim Deegan Cc: Wei Liu Cc: Daniel De Graaf v2: - Set 'disable_migrate' to true rather 1 --- xen/common/domain.c | 9 +++------ xen/common/domctl.c | 2 +- xen/include/xen/sched.h | 7 +++++-- xen/include/xsm/dummy.h | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/xen/common/domain.c b/xen/common/domain.c index 6ee281bd03..9db7cbae72 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -348,7 +348,7 @@ struct domain *domain_create(domid_t domid, if ( hardware_domid < 0 || hardware_domid >=3D DOMID_FIRST_RESERVE= D ) panic("The value of hardware_dom must be a valid domain ID\n"); =20 - d->disable_migrate =3D 1; + d->disable_migrate =3D true; old_hwdom =3D hardware_domain; hardware_domain =3D d; } @@ -427,11 +427,8 @@ struct domain *domain_create(domid_t domid, watchdog_domain_init(d); init_status |=3D INIT_watchdog; =20 - if ( d->options & XEN_DOMCTL_CDF_xs_domain ) - { - d->is_xenstore =3D 1; - d->disable_migrate =3D 1; - } + if ( is_xenstore_domain(d) ) + d->disable_migrate =3D true; =20 d->iomem_caps =3D rangeset_new(d, "I/O Memory", RANGESETF_prettypr= int_hex); d->irq_caps =3D rangeset_new(d, "Interrupts", 0); diff --git a/xen/common/domctl.c b/xen/common/domctl.c index ef6714c0aa..f2b582812c 100644 --- a/xen/common/domctl.c +++ b/xen/common/domctl.c @@ -186,7 +186,7 @@ void getdomaininfo(struct domain *d, struct xen_domctl_= getdomaininfo *info) (d->is_shut_down ? XEN_DOMINF_shutdown : 0) | (d->controller_pause_count > 0 ? XEN_DOMINF_paused : 0) | (d->debugger_attached ? XEN_DOMINF_debugged : 0) | - (d->is_xenstore ? XEN_DOMINF_xs_domain : 0) | + (is_xenstore_domain(d) ? XEN_DOMINF_xs_domain : 0) | (is_hvm_domain(d) ? XEN_DOMINF_hvm_guest : 0) | d->shutdown_code << XEN_DOMINF_shutdownshift; =20 diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h index aa09d2c574..973998b288 100644 --- a/xen/include/xen/sched.h +++ b/xen/include/xen/sched.h @@ -372,8 +372,6 @@ struct domain bool is_privileged; /* Can this guest access the Xen console? */ bool is_console; - /* Is this a xenstore domain (not dom0)? */ - bool is_xenstore; /* Non-migratable and non-restoreable? */ bool disable_migrate; /* Is this guest being debugged by dom0? */ @@ -970,6 +968,11 @@ static inline bool is_vcpu_online(const struct vcpu *v) return !test_bit(_VPF_down, &v->pause_flags); } =20 +static inline bool is_xenstore_domain(const struct domain *d) +{ + return d->options & XEN_DOMCTL_CDF_xs_domain; +} + extern bool sched_smt_power_savings; =20 extern enum cpufreq_controller { diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h index ef52bb1764..b8e185e6fa 100644 --- a/xen/include/xsm/dummy.h +++ b/xen/include/xsm/dummy.h @@ -79,7 +79,7 @@ static always_inline int xsm_default_action( { return 0; case XSM_XS_PRIV: - if ( src->is_xenstore ) + if ( is_xenstore_domain(src) ) return 0; } /* fall through */ --=20 2.20.1.2.gb21ebb671 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Wed May 1 07:06:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1564062032; cv=none; d=zoho.com; s=zohoarc; b=W87nO0Qlt9SGm1jtU/HSDJVRFub0dLIyOzjsUyWH8enLr9CF2pw4k12g7ERes2cAO7DjDnhvY3/qfXyFDoANWe3Vuj69YDmRnYkqFSmlWGsw0zox1oP6Z9LHAeuKC/Zytnj8sUqADiYDRd6fVepJKP8f6cc1loqc0rzhh/TcC7o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564062032; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=n3qg+KuAWxYINapoS+040Oa9KZpeXiILZUQzhUUwruc=; b=bh7EL07TT6LvWyXmFdSxvWdUWETz4IhO5E6Fmd74u9kCO35Sc3pfzXqhy9r9Iqn3LoLJJ4gX8tuaQ0ZaiU1SWlkr/YZjMqWIkugAUIHvcDPQ2oZPeYzuEM0LgYVEgT7bT2/OrQPaRXVB3y5Coq+yezt16QVHORTFj1/1DDNljrw= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1564062032265919.4756410614241; Thu, 25 Jul 2019 06:40:32 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hqdxz-00005D-1H; Thu, 25 Jul 2019 13:39:31 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hqdxw-0008Vu-V6 for xen-devel@lists.xenproject.org; Thu, 25 Jul 2019 13:39:28 +0000 Received: from esa2.hc3370-68.iphmx.com (unknown [216.71.145.153]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 9f2170ee-aee1-11e9-8980-bc764e045a96; Thu, 25 Jul 2019 13:39:27 +0000 (UTC) X-Inumbo-ID: 9f2170ee-aee1-11e9-8980-bc764e045a96 Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=paul.durrant@citrix.com; spf=Pass smtp.mailfrom=Paul.Durrant@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of paul.durrant@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="Paul.Durrant@citrix.com"; x-sender="paul.durrant@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa2.hc3370-68.iphmx.com: domain of Paul.Durrant@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="Paul.Durrant@citrix.com"; x-sender="Paul.Durrant@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 (esa2.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=esa2.hc3370-68.iphmx.com; envelope-from="Paul.Durrant@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: wfprLf+3w+Hl2GUE1rQVLob1fHJkSDtnlfzPVFTIAqOrKudbeXZrwrjhdWEXXSZGSsrAN4fQ8J vyNitq/16IZ5WaI/QO2fu8dyQKPgyEL/3B7qLDNJu2OrUnBNILM1hh8KUPUljlBLIavlf1N2XO j1p4ZeK3wTmcU/cGfG6NvGYepx/HPGIETuhba3dPUBGYdsnKN8SlNPlmoAnhdOfAvfX8T6wGtD b/nDG6aqruA6cl36v06n/6tahcFieM3RnDGK3Bp181vMVzuY/JlYpKOm0S/WMIzdQZuxBxxXQR +Aw= X-SBRS: 2.7 X-MesageID: 3420491 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.64,306,1559534400"; d="scan'208";a="3420491" From: Paul Durrant To: Date: Thu, 25 Jul 2019 14:39:20 +0100 Message-ID: <20190725133920.40673-7-paul.durrant@citrix.com> X-Mailer: git-send-email 2.20.1.2.gb21ebb671 In-Reply-To: <20190725133920.40673-1-paul.durrant@citrix.com> References: <20190725133920.40673-1-paul.durrant@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v2 6/6] x86/domain: remove the 's3_integrity' flag 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: Wei Liu , Andrew Cooper , Paul Durrant , Jan Beulich , Shane Wang , Gang Wei , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" The flag is not needed since the domain 'options' can now be tested directly. Signed-off-by: Paul Durrant Reviewed-by: "Roger Pau Monn=C3=A9" Reviewed-by: Jan Beulich --- Cc: Jan Beulich Cc: Andrew Cooper Cc: Wei Liu Cc: Gang Wei Cc: Shane Wang --- xen/arch/x86/domain.c | 2 -- xen/arch/x86/tboot.c | 2 +- xen/include/asm-x86/domain.h | 2 -- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index 65f47a7627..2203882445 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -538,8 +538,6 @@ int arch_domain_create(struct domain *d, d->domain_id); } =20 - d->arch.s3_integrity =3D config->flags & XEN_DOMCTL_CDF_s3_integrity; - emflags =3D config->arch.emulation_flags; =20 if ( is_hardware_domain(d) && is_pv_domain(d) ) diff --git a/xen/arch/x86/tboot.c b/xen/arch/x86/tboot.c index f3fdee4d39..3db8a8a8d8 100644 --- a/xen/arch/x86/tboot.c +++ b/xen/arch/x86/tboot.c @@ -212,7 +212,7 @@ static void tboot_gen_domain_integrity(const uint8_t ke= y[TB_KEY_SIZE], vmac_set_key((uint8_t *)key, &ctx); for_each_domain( d ) { - if ( !d->arch.s3_integrity ) + if ( !(d->options & XEN_DOMCTL_CDF_s3_integrity) ) continue; printk("MACing Domain %u\n", d->domain_id); =20 diff --git a/xen/include/asm-x86/domain.h b/xen/include/asm-x86/domain.h index 5f9899469c..5c038a1065 100644 --- a/xen/include/asm-x86/domain.h +++ b/xen/include/asm-x86/domain.h @@ -295,8 +295,6 @@ struct arch_domain uint32_t pci_cf8; uint8_t cmos_idx; =20 - bool_t s3_integrity; - union { struct pv_domain pv; struct hvm_domain hvm; --=20 2.20.1.2.gb21ebb671 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel