From patchwork Fri Aug 16 17:19:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paul Durrant X-Patchwork-Id: 11098075 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 4E7FA17E2 for ; Fri, 16 Aug 2019 17:21:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3760828A0A for ; Fri, 16 Aug 2019 17:21:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2BB4028A31; Fri, 16 Aug 2019 17:21: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.0 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 ABE0228A10 for ; Fri, 16 Aug 2019 17:21: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 1hyftZ-0005Kg-9J; Fri, 16 Aug 2019 17:20:09 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hyftX-0005H4-Ha for xen-devel@lists.xenproject.org; Fri, 16 Aug 2019 17:20:07 +0000 X-Inumbo-ID: 170d0d06-c04a-11e9-a661-bc764e2007e4 Received: from esa4.hc3370-68.iphmx.com (unknown [216.71.155.144]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 170d0d06-c04a-11e9-a661-bc764e2007e4; Fri, 16 Aug 2019 17:20:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1565976006; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=OdGW6GVTh4b2kxBBsSlAFuzfQHu1a/ueBoA8DtvJsaY=; b=F/2R+yIZ3wx1p1rizJX+ry0Za7jWqjdX6gEx3pGbO5rEHGa1C/hXkuWr s9p+pIulgWAmcXNqWrl5oKVTrg+7GIUF/TqQXF+de1sKByMyJFRYwua+V 6+uCtRRfyY7TQNNcQPqVaMy3Dg6kXc/WJWPmg4v42Sj3wASgXJ+PXhvOP g=; Authentication-Results: esa4.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 (esa4.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=esa4.hc3370-68.iphmx.com; envelope-from="Paul.Durrant@citrix.com"; x-sender="paul.durrant@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa4.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=esa4.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 (esa4.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa4.hc3370-68.iphmx.com; envelope-from="Paul.Durrant@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: UY2b4Y+xYUe440aZPuKVhWYHG8VtL6HcI5gntoAeo+VjBX02ToQQedpa3hyX3flrXJq180M8aB UEOq9cmzlxrpYRNH9Kng8UDixJ5Lhp99QfuGxkvNHCI+CTqCEzeSMwsf9qcXYMi3ulKYTDDjvK yYryl4hZuy7P3TjbJxVDnRgse0Ayi36vTSbuMYGI3KW8xQN566mqHj2vG49smDM3sVkxE+baa8 iFv8muQmQ0xLrPPxdhJzCWeNvA4ZHFdojrJHACjdPMOnXaKIayRBdivOzwKeit+n4sghF1xBA0 kVU= X-SBRS: 2.7 X-MesageID: 4596317 X-Ironport-Server: esa4.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.64,394,1559534400"; d="scan'208";a="4596317" From: Paul Durrant To: Date: Fri, 16 Aug 2019 18:19:55 +0100 Message-ID: <20190816172001.3905-5-paul.durrant@citrix.com> X-Mailer: git-send-email 2.20.1.2.gb21ebb671 In-Reply-To: <20190816172001.3905-1-paul.durrant@citrix.com> References: <20190816172001.3905-1-paul.durrant@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v6 04/10] 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_Pau_Monn=C3=A9?= 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 'options' directly and then uses that in place of the 'is_xenstore' flag. Signed-off-by: Paul Durrant Reviewed-by: "Roger Pau Monné" Acked-by: George Dunlap Acked-by: Daniel De Graaf --- Cc: Andrew Cooper 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 95321482ef..76e6976617 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -363,7 +363,7 @@ struct domain *domain_create(domid_t domid, if ( hardware_domid < 0 || hardware_domid >= DOMID_FIRST_RESERVED ) panic("The value of hardware_dom must be a valid domain ID\n"); - d->disable_migrate = 1; + d->disable_migrate = true; old_hwdom = hardware_domain; hardware_domain = d; } @@ -442,11 +442,8 @@ struct domain *domain_create(domid_t domid, watchdog_domain_init(d); init_status |= INIT_watchdog; - if ( d->options & XEN_DOMCTL_CDF_xs_domain ) - { - d->is_xenstore = 1; - d->disable_migrate = 1; - } + if ( is_xenstore_domain(d) ) + d->disable_migrate = true; 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 b48e408583..6e6e9b9866 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 07a64947ed..df331a3bb0 100644 --- a/xen/include/xen/sched.h +++ b/xen/include/xen/sched.h @@ -375,8 +375,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? */ @@ -979,6 +977,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->options & 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 */