From patchwork Tue Jul 23 16:06:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Durrant X-Patchwork-Id: 11054721 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 97211112C for ; Tue, 23 Jul 2019 16:07:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 885C5204FA for ; Tue, 23 Jul 2019 16:07:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 72A2328724; Tue, 23 Jul 2019 16:07:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0147928702 for ; Tue, 23 Jul 2019 16:07:53 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hpxIt-0001Qa-W8; Tue, 23 Jul 2019 16:06:15 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hpxIs-0001QG-Kf for xen-devel@lists.xenproject.org; Tue, 23 Jul 2019 16:06:14 +0000 X-Inumbo-ID: cb7a8094-ad63-11e9-8980-bc764e045a96 Received: from esa5.hc3370-68.iphmx.com (unknown [216.71.155.168]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id cb7a8094-ad63-11e9-8980-bc764e045a96; Tue, 23 Jul 2019 16:06:13 +0000 (UTC) Authentication-Results: esa5.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 (esa5.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=esa5.hc3370-68.iphmx.com; envelope-from="Paul.Durrant@citrix.com"; x-sender="paul.durrant@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa5.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=esa5.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 (esa5.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=esa5.hc3370-68.iphmx.com; envelope-from="Paul.Durrant@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: biCS4SYpFAFNGCVzYEry4n10akxTAHulQNkkFxBKdI8FiP0zWeufsIR38UKDAnCAbJV7clyzLQ okKns4HfJwy4VKQDWKXYakyackwcs7Dq7a9pX0WGFktf6MJP4v5nmvlRHJHgn1qAxnUoqEmm9D xRR/P6WwKInTKEiFEpaV5dSrfshz7tRM+1j84sPqFmBY9nCv6Aueeu3KHCruBiUKuLtfCnCI3C RBjoIUFD656em5sUX0ajEchVKbeKod/EWWqS/ou6puycuH0vWPdoDUq1WBaqN7ei8BSOVKmBPh Efg= X-SBRS: 2.7 X-MesageID: 3410775 X-Ironport-Server: esa5.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.64,299,1559534400"; d="scan'208";a="3410775" From: Paul Durrant To: Date: Tue, 23 Jul 2019 17:06:04 +0100 Message-ID: <20190723160609.2177-2-paul.durrant@citrix.com> X-Mailer: git-send-email 2.20.1.2.gb21ebb671 In-Reply-To: <20190723160609.2177-1-paul.durrant@citrix.com> References: <20190723160609.2177-1-paul.durrant@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 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 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 'createflags' field in struct domain. Subsequent patches will do the related clean-up work. Signed-off-by: Paul Durrant --- 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 | 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 55aa759b75..d559c8898e 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -333,6 +333,8 @@ struct domain *domain_create(domid_t domid, if ( (d = alloc_domain_struct()) == NULL ) return ERR_PTR(-ENOMEM); + d->createflags = config ? config->flags : 0; + /* Sort out our idea of is_system_domain(). */ d->domain_id = domid; @@ -354,7 +356,7 @@ struct domain *domain_create(domid_t domid, } /* Sort out our idea of is_{pv,hvm}_domain(). All system domains are PV. */ - d->guest_type = ((config && (config->flags & XEN_DOMCTL_CDF_hvm_guest)) + d->guest_type = ((d->createflags & XEN_DOMCTL_CDF_hvm_guest) ? guest_type_hvm : guest_type_pv); TRACE_1D(TRC_DOM0_DOM_ADD, d->domain_id); @@ -431,7 +433,7 @@ struct domain *domain_create(domid_t domid, watchdog_domain_init(d); init_status |= INIT_watchdog; - if ( config->flags & XEN_DOMCTL_CDF_xs_domain ) + if ( d->createflags & XEN_DOMCTL_CDF_xs_domain ) { d->is_xenstore = 1; d->disable_migrate = 1; diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h index b40c8fd138..edae372c2b 100644 --- a/xen/include/xen/sched.h +++ b/xen/include/xen/sched.h @@ -308,6 +308,7 @@ enum guest_type { struct domain { + unsigned int createflags; domid_t domain_id; unsigned int max_vcpus; From patchwork Tue Jul 23 16:06:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paul Durrant X-Patchwork-Id: 11054719 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F40BF912 for ; Tue, 23 Jul 2019 16:07:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E427F27CAF for ; Tue, 23 Jul 2019 16:07:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D834828724; Tue, 23 Jul 2019 16:07:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4FAE927CAF for ; Tue, 23 Jul 2019 16:07:47 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hpxIw-0001RR-7N; Tue, 23 Jul 2019 16:06:18 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hpxIu-0001Qu-JJ for xen-devel@lists.xenproject.org; Tue, 23 Jul 2019 16:06:16 +0000 X-Inumbo-ID: cc927f2b-ad63-11e9-8980-bc764e045a96 Received: from esa5.hc3370-68.iphmx.com (unknown [216.71.155.168]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id cc927f2b-ad63-11e9-8980-bc764e045a96; Tue, 23 Jul 2019 16:06:15 +0000 (UTC) Authentication-Results: esa5.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 (esa5.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=esa5.hc3370-68.iphmx.com; envelope-from="Paul.Durrant@citrix.com"; x-sender="paul.durrant@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa5.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=esa5.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 (esa5.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=esa5.hc3370-68.iphmx.com; envelope-from="Paul.Durrant@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: ZlNUuxeH1saAlTLwhpthpaiwXaxB8ss+49ShkSXZoGmwrTAqif7FQJw++52tUuRezUauya0JT2 Ei46w3yYuupqao+614NdmiCRc2Ho+ByDlub31MbOn9/G7juJY2gthjmdMIWjsPnjCSfp8sXmiT SpZ0G0d+EV6ocH8A/uonPmTyzbXrLUt5ib+CSiIyJZz745+3v9KwXS3ADaZs5kaT6hMCD+tMEw YXLtiyhDDZcE8FqtNzmucHEYzwhXUrLSIP0HJa5i4i61t6kYrrzH8KEXjGYECgPltTNf5KP0Ey KY0= X-SBRS: 2.7 X-MesageID: 3410782 X-Ironport-Server: esa5.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.64,299,1559534400"; d="scan'208";a="3410782" From: Paul Durrant To: Date: Tue, 23 Jul 2019 17:06:05 +0100 Message-ID: <20190723160609.2177-3-paul.durrant@citrix.com> X-Mailer: git-send-email 2.20.1.2.gb21ebb671 In-Reply-To: <20190723160609.2177-1-paul.durrant@citrix.com> References: <20190723160609.2177-1-paul.durrant@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 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 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 'createflags' field. Signed-off-by: Paul Durrant Reviewed-by: Roger Pau Monné --- 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 d559c8898e..6f405d2541 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -355,10 +355,6 @@ struct domain *domain_create(domid_t domid, hardware_domain = d; } - /* Sort out our idea of is_{pv,hvm}_domain(). All system domains are PV. */ - d->guest_type = ((d->createflags & XEN_DOMCTL_CDF_hvm_guest) - ? guest_type_hvm : guest_type_pv); - TRACE_1D(TRC_DOM0_DOM_ADD, d->domain_id); /* 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; - switch ( d->guest_type ) - { - case guest_type_hvm: - info->flags |= XEN_DOMINF_hvm_guest; - break; - default: - break; - } - xsm_security_domaininfo(d, info); info->tot_pages = 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 |= (1U << XENFEAT_ARM_SMCCC_supported); #endif #ifdef CONFIG_X86 - switch ( d->guest_type ) - { - case guest_type_pv: + if ( is_pv_domain(d) ) fi.submap |= (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 |= (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 edae372c2b..9a98857237 100644 --- a/xen/include/xen/sched.h +++ b/xen/include/xen/sched.h @@ -302,10 +302,6 @@ struct vm_event_domain struct evtchn_port_ops; -enum guest_type { - guest_type_pv, guest_type_hvm -}; - struct domain { unsigned int createflags; @@ -357,8 +353,6 @@ struct domain struct radix_tree_root pirq_tree; unsigned int nr_pirqs; - enum guest_type guest_type; - /* Is this guest dying (i.e., a zombie)? */ enum { DOMDYING_alive, DOMDYING_dying, DOMDYING_dead } is_dying; @@ -918,8 +912,8 @@ 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->guest_type == guest_type_pv) : false; + return IS_ENABLED(CONFIG_PV) && + !evaluate_nospec(d->createflags & XEN_DOMCTL_CDF_hvm_guest); } static inline bool is_pv_vcpu(const struct vcpu *v) @@ -950,8 +944,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 == guest_type_hvm) : false; + return IS_ENABLED(CONFIG_HVM) && + evaluate_nospec(d->createflags & XEN_DOMCTL_CDF_hvm_guest); } static inline bool is_hvm_vcpu(const struct vcpu *v) From patchwork Tue Jul 23 16:06:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paul Durrant X-Patchwork-Id: 11054717 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1F61C912 for ; Tue, 23 Jul 2019 16:07:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0F6AB2654B for ; Tue, 23 Jul 2019 16:07:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 03B3328737; Tue, 23 Jul 2019 16:07:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7F76728727 for ; Tue, 23 Jul 2019 16:07:45 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hpxIv-0001R1-JS; Tue, 23 Jul 2019 16:06:17 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hpxIu-0001Qc-2I for xen-devel@lists.xenproject.org; Tue, 23 Jul 2019 16:06:16 +0000 X-Inumbo-ID: cbfde663-ad63-11e9-8980-bc764e045a96 Received: from esa5.hc3370-68.iphmx.com (unknown [216.71.155.168]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id cbfde663-ad63-11e9-8980-bc764e045a96; Tue, 23 Jul 2019 16:06:14 +0000 (UTC) Authentication-Results: esa5.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 (esa5.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=esa5.hc3370-68.iphmx.com; envelope-from="Paul.Durrant@citrix.com"; x-sender="paul.durrant@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa5.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=esa5.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 (esa5.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=esa5.hc3370-68.iphmx.com; envelope-from="Paul.Durrant@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: sWgo6wAwr7dmrXJmzalK9DMAT1UwYqFrPV5tGo//L7xCXd6rs3EconMpv5zegBLGEvGGyVEtPP htMZi6dA1s7Pls5WD2LLlM2uP9gXC+P4bdllViA38OsBIFXG7ZK/t4RlmPA6bEBAwbejaOKYT2 yZxntsjZAxiGDddC9aI5Sc3sS3Ow9UHZiT4jskm+17rkMebP4EJ3F7lxOLIUOIX+SoqxTyof+p pvC/LRgyeT3WPHgN/7/RzBWYQy0+Z3zy5zmOHDMlVV8rGEnoIlovTm82qtIMouRWn1lH5BXe5C Wqs= X-SBRS: 2.7 X-MesageID: 3410779 X-Ironport-Server: esa5.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.64,299,1559534400"; d="scan'208";a="3410779" From: Paul Durrant To: Date: Tue, 23 Jul 2019 17:06:06 +0100 Message-ID: <20190723160609.2177-4-paul.durrant@citrix.com> X-Mailer: git-send-email 2.20.1.2.gb21ebb671 In-Reply-To: <20190723160609.2177-1-paul.durrant@citrix.com> References: <20190723160609.2177-1-paul.durrant@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 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_Pau_Monn=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP The hap_enabled() macro can determine whether the feature is available using the domain 'createflags'; there is no need for a separate flag. Signed-off-by: Paul Durrant --- Cc: Jan Beulich Cc: Andrew Cooper Cc: Wei Liu Cc: "Roger Pau Monné" --- xen/arch/x86/domain.c | 7 +------ xen/arch/x86/mm/paging.c | 4 ++-- xen/arch/x86/mm/shadow/common.c | 4 ++-- xen/include/asm-x86/hvm/domain.h | 9 +++------ xen/include/asm-x86/paging.h | 2 +- xen/include/asm-x86/shadow.h | 2 +- 6 files changed, 10 insertions(+), 18 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) = is_pv_domain(d) ? __HYPERVISOR_COMPAT_VIRT_START : ~0u; - /* Need to determine if HAP is enabled before initialising paging */ - if ( is_hvm_domain(d) ) - d->arch.hvm.hap_enabled = - hvm_hap_supported() && (config->flags & XEN_DOMCTL_CDF_hap); - - if ( (rc = paging_domain_init(d, config->flags)) != 0 ) + if ( (rc = paging_domain_init(d)) != 0 ) goto fail; paging_initialised = true; diff --git a/xen/arch/x86/mm/paging.c b/xen/arch/x86/mm/paging.c index 011089368a..69aa228e46 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 struct 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; @@ -653,7 +653,7 @@ int paging_domain_init(struct domain *d, unsigned int domcr_flags) if ( hap_enabled(d) ) hap_domain_init(d); else - rc = shadow_domain_init(d, domcr_flags); + rc = shadow_domain_init(d); return rc; } diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c index fa18de0bb6..320ea0db21 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 *); /* 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 = { .enable = sh_enable_log_dirty, @@ -62,7 +62,7 @@ int shadow_domain_init(struct domain *d, unsigned int domcr_flags) #if (SHADOW_OPTIMIZATIONS & SHOPT_OUT_OF_SYNC) d->arch.paging.shadow.oos_active = 0; - d->arch.paging.shadow.oos_off = domcr_flags & XEN_DOMCTL_CDF_oos_off; + d->arch.paging.shadow.oos_off = d->createflags & XEN_DOMCTL_CDF_oos_off; #endif d->arch.paging.shadow.pagetable_dying_op = 0; diff --git a/xen/include/asm-x86/hvm/domain.h b/xen/include/asm-x86/hvm/domain.h index 6c7c4f5aa6..b5292696d2 100644 --- a/xen/include/asm-x86/hvm/domain.h +++ b/xen/include/asm-x86/hvm/domain.h @@ -156,7 +156,6 @@ struct hvm_domain { struct viridian_domain *viridian; - 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 { }; }; -#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->createflags & XEN_DOMCTL_CDF_hap)) #endif /* __ASM_X86_HVM_DOMAIN_H__ */ 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); /* 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); /* Handler for paging-control ops: operations from user-space to enable * and disable ephemeral shadow modes (test mode and log-dirty mode) and 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 @@ /* 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); /* Setup the shadow-specific parts of a vcpu struct. It is called by * paging_vcpu_init() in paging.c */ From patchwork Tue Jul 23 16:06:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paul Durrant X-Patchwork-Id: 11054725 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 187DC912 for ; Tue, 23 Jul 2019 16:08:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 07D6428711 for ; Tue, 23 Jul 2019 16:08:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EF8B12871C; Tue, 23 Jul 2019 16:08:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9ADF4286D0 for ; Tue, 23 Jul 2019 16:08:10 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hpxIv-0001R7-T8; Tue, 23 Jul 2019 16:06:17 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hpxIu-0001Qd-4e for xen-devel@lists.xenproject.org; Tue, 23 Jul 2019 16:06:16 +0000 X-Inumbo-ID: cc37775c-ad63-11e9-8980-bc764e045a96 Received: from esa5.hc3370-68.iphmx.com (unknown [216.71.155.168]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id cc37775c-ad63-11e9-8980-bc764e045a96; Tue, 23 Jul 2019 16:06:15 +0000 (UTC) Authentication-Results: esa5.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 (esa5.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=esa5.hc3370-68.iphmx.com; envelope-from="Paul.Durrant@citrix.com"; x-sender="paul.durrant@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa5.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=esa5.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 (esa5.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=esa5.hc3370-68.iphmx.com; envelope-from="Paul.Durrant@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: MociYMKhRQ0Ltw2xIvjoYKhlFBqQIrh8+ujFhhyJIvrXiqD8p7luE8c1xMd5fMiG67+EEzcsTR awAszHS/AHi9GOSxgESHRhymDWQLuLYOi5oenhgW3YidIMSz60ktJUefiZ8IWiZsVIL4zQa6wY kveqbBcpUthZGAyM8cvVO1kKyWeSvTLBMUyv4JIMc9WCIsw9bGka8lxn4CQf1geVlcjBovPqQ5 bZs3aJmYKl3Rrh1EN2sylKhajEpgD80tJv5hrndQD19nH3CTnbzIQp3gepd7IFdfEcDmuJ70Zt D6M= X-SBRS: 2.7 X-MesageID: 3410781 X-Ironport-Server: esa5.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.64,299,1559534400"; d="scan'208";a="3410781" From: Paul Durrant To: Date: Tue, 23 Jul 2019 17:06:07 +0100 Message-ID: <20190723160609.2177-5-paul.durrant@citrix.com> X-Mailer: git-send-email 2.20.1.2.gb21ebb671 In-Reply-To: <20190723160609.2177-1-paul.durrant@citrix.com> References: <20190723160609.2177-1-paul.durrant@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 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_Pau_Monn=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP The flag is not needed since the domain 'createflags' can now be tested directly. Signed-off-by: Paul Durrant Acked-by: Tim Deegan --- Cc: Tim Deegan Cc: George Dunlap Cc: Jan Beulich Cc: Andrew Cooper Cc: Wei Liu Cc: "Roger Pau Monné" --- xen/arch/x86/mm/shadow/common.c | 3 +-- xen/include/asm-x86/domain.h | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c index 320ea0db21..2c7fafa4fb 100644 --- a/xen/arch/x86/mm/shadow/common.c +++ b/xen/arch/x86/mm/shadow/common.c @@ -62,7 +62,6 @@ int shadow_domain_init(struct domain *d) #if (SHADOW_OPTIMIZATIONS & SHOPT_OUT_OF_SYNC) d->arch.paging.shadow.oos_active = 0; - d->arch.paging.shadow.oos_off = d->createflags & XEN_DOMCTL_CDF_oos_off; #endif d->arch.paging.shadow.pagetable_dying_op = 0; @@ -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->createflags & XEN_DOMCTL_CDF_oos_off) ) { int pe = 1; struct vcpu *vptr; 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 { /* OOS */ bool_t oos_active; - bool_t oos_off; /* Has this domain ever used HVMOP_pagetable_dying? */ bool_t pagetable_dying_op; From patchwork Tue Jul 23 16:06:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paul Durrant X-Patchwork-Id: 11054729 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 19C00912 for ; Tue, 23 Jul 2019 16:08:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0743128711 for ; Tue, 23 Jul 2019 16:08:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EFF2728724; Tue, 23 Jul 2019 16:08:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 33C3A28711 for ; Tue, 23 Jul 2019 16:08:14 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hpxIx-0001St-LG; Tue, 23 Jul 2019 16:06:19 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hpxIw-0001RO-9x for xen-devel@lists.xenproject.org; Tue, 23 Jul 2019 16:06:18 +0000 X-Inumbo-ID: ccfb6b9c-ad63-11e9-8980-bc764e045a96 Received: from esa5.hc3370-68.iphmx.com (unknown [216.71.155.168]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id ccfb6b9c-ad63-11e9-8980-bc764e045a96; Tue, 23 Jul 2019 16:06:16 +0000 (UTC) Authentication-Results: esa5.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 (esa5.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=esa5.hc3370-68.iphmx.com; envelope-from="Paul.Durrant@citrix.com"; x-sender="paul.durrant@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa5.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=esa5.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 (esa5.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=esa5.hc3370-68.iphmx.com; envelope-from="Paul.Durrant@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: Jezki6YgTBGUF0IGnguhCbQm9oarsjF/EwH5kXBkSq5mnskjog/Q0wnF4Tt1Vs/YUQicRCUfh/ 2/5wlciElefgKebQW+Wes20lE4e16WqU4NoZ3s+wqujdHwyq9bb56IQoPoL2N7gZAokqT8mt88 fckeZd6c4slBoSYKVkS9j7jXkrz5Jd5bK3Wo2U05XxdugzGE/mHZmctcJTUSjTcmQsx5e+LYS3 XSRhUqgW2w4mt3izO+PiilGaMZfXiZWg65cBZS6dQ+S7Y/vLEZfoN7PRmLdHqYnK6pU4+p2Ssw tpE= X-SBRS: 2.7 X-MesageID: 3410783 X-Ironport-Server: esa5.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.64,299,1559534400"; d="scan'208";a="3410783" From: Paul Durrant To: Date: Tue, 23 Jul 2019 17:06:08 +0100 Message-ID: <20190723160609.2177-6-paul.durrant@citrix.com> X-Mailer: git-send-email 2.20.1.2.gb21ebb671 In-Reply-To: <20190723160609.2177-1-paul.durrant@citrix.com> References: <20190723160609.2177-1-paul.durrant@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 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 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP This patch introduces a convenience macro, is_xenstore_domain(), which tests the domain 'createflags' directly and then uses that in place of the 'is_xenstore' flag. Signed-off-by: Paul Durrant Reviewed-by: Roger Pau Monné --- 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 --- xen/common/domain.c | 5 +---- xen/common/domctl.c | 2 +- xen/include/xen/sched.h | 7 +++++-- xen/include/xsm/dummy.h | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/xen/common/domain.c b/xen/common/domain.c index 6f405d2541..5703da357f 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -429,11 +429,8 @@ struct domain *domain_create(domid_t domid, watchdog_domain_init(d); init_status |= INIT_watchdog; - if ( d->createflags & XEN_DOMCTL_CDF_xs_domain ) - { - d->is_xenstore = 1; + if ( is_xenstore_domain(d) ) d->disable_migrate = 1; - } d->iomem_caps = rangeset_new(d, "I/O Memory", RANGESETF_prettyprint_hex); d->irq_caps = 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; diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h index 9a98857237..1033ca0e8c 100644 --- a/xen/include/xen/sched.h +++ b/xen/include/xen/sched.h @@ -374,8 +374,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? */ @@ -972,6 +970,11 @@ static inline bool is_vcpu_online(const struct vcpu *v) return !test_bit(_VPF_down, &v->pause_flags); } +static inline bool is_xenstore_domain(const struct domain *d) +{ + return d->createflags & XEN_DOMCTL_CDF_xs_domain; +} + extern bool sched_smt_power_savings; 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 */ From patchwork Tue Jul 23 16:06:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paul Durrant X-Patchwork-Id: 11054723 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 38887112C for ; Tue, 23 Jul 2019 16:08:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 28F7528429 for ; Tue, 23 Jul 2019 16:08:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1D5E228711; Tue, 23 Jul 2019 16:08:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B868328429 for ; Tue, 23 Jul 2019 16:08:04 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hpxIu-0001Qq-9o; Tue, 23 Jul 2019 16:06:16 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hpxIs-0001QL-Rw for xen-devel@lists.xenproject.org; Tue, 23 Jul 2019 16:06:14 +0000 X-Inumbo-ID: cbbf2e0e-ad63-11e9-8980-bc764e045a96 Received: from esa5.hc3370-68.iphmx.com (unknown [216.71.155.168]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id cbbf2e0e-ad63-11e9-8980-bc764e045a96; Tue, 23 Jul 2019 16:06:14 +0000 (UTC) Authentication-Results: esa5.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 (esa5.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=esa5.hc3370-68.iphmx.com; envelope-from="Paul.Durrant@citrix.com"; x-sender="paul.durrant@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa5.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=esa5.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 (esa5.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=esa5.hc3370-68.iphmx.com; envelope-from="Paul.Durrant@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: m9mcdEIzOs/L7KB7MAIqxJafHdDEypEOnddpOAH45e4TNz+9Pdj/rmkaVK+gYff3Z2G7EMBHFi HrUCtkYMrv2egPeqx+UpjTF0XdIT8sqHJgV82Wktj2NP9bAHsr16I0jqZ+PlyyDd07HS506r+l KyIie3jJXT6qWnxUzL21BAdU60utd99aBiBO4J0DLeuW52qZIxmksOfj57rg4rvQ70D5M3wH/H PgtVbdapVhVh7Sy7dKVk+ff/Kpq5UmTZ8en/V7HGqyvAyWtSzHMO7qVMOlW8IGTay/S3tV4t0C Pxg= X-SBRS: 2.7 X-MesageID: 3410778 X-Ironport-Server: esa5.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.64,299,1559534400"; d="scan'208";a="3410778" From: Paul Durrant To: Date: Tue, 23 Jul 2019 17:06:09 +0100 Message-ID: <20190723160609.2177-7-paul.durrant@citrix.com> X-Mailer: git-send-email 2.20.1.2.gb21ebb671 In-Reply-To: <20190723160609.2177-1-paul.durrant@citrix.com> References: <20190723160609.2177-1-paul.durrant@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 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_Pau_Monn=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP The flag is not needed since the domain 'createflags' can now be tested directly. Signed-off-by: Paul Durrant Reviewed-by: Roger Pau Monné --- Cc: Jan Beulich Cc: Andrew Cooper Cc: Wei Liu Cc: "Roger Pau Monné" 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); } - d->arch.s3_integrity = config->flags & XEN_DOMCTL_CDF_s3_integrity; - emflags = config->arch.emulation_flags; 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..1a7e44a8a9 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 key[TB_KEY_SIZE], vmac_set_key((uint8_t *)key, &ctx); for_each_domain( d ) { - if ( !d->arch.s3_integrity ) + if ( !(d->createflags & XEN_DOMCTL_CDF_s3_integrity) ) continue; printk("MACing Domain %u\n", d->domain_id); 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; - bool_t s3_integrity; - union { struct pv_domain pv; struct hvm_domain hvm;