From nobody Mon Feb 9 04:31:56 2026 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=1564494333; cv=none; d=zoho.com; s=zohoarc; b=EHZpoZF0dZPKfQZwa4Dx0onptlBjmff1RScU0sxYq9/KgX5wNwI149WAveNBohrA781kNEjHeHfZVM4QbyNEIYkU79K6HmyhDTwu5keDu5P5VKKkuis9enIkv6QIaaEg0ZxuzOAgp34qK3rEl5SElR6un61LkVYxfUu9sV4eN6c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564494333; 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=UBTDxw0T0JVlAVAXkvaQSVSCJ+2efRz4+CPh4rFIgbI=; b=H20zifwk1DVRTqoYqrjUV3ksZffMu902SYv/Hcr2WyDNcBsTVyL1lxZ+YRKXTFHE/nNw3IaqB+H+Z9QKyZHH0FvQmwLI6rBpAxNdl6jwoFDL1Xz+OX6x4vlAY7VBpXSOjpJ0wulWc7+Wtyr+i436PJeGh666pZEAxERS9YBnuz0= 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 1564494333697990.0413185866986; Tue, 30 Jul 2019 06:45:33 -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 1hsSQW-00057E-H5; Tue, 30 Jul 2019 13:44: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 1hsSQU-00056a-Je for xen-devel@lists.xenproject.org; Tue, 30 Jul 2019 13:44:26 +0000 Received: from esa4.hc3370-68.iphmx.com (unknown [216.71.155.144]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 2510b1f2-b2d0-11e9-8980-bc764e045a96; Tue, 30 Jul 2019 13:44:25 +0000 (UTC) X-Inumbo-ID: 2510b1f2-b2d0-11e9-8980-bc764e045a96 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 (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 (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: lOhpXlgMWhK5RSGMPD2l/LQjTw4WQIvJB4BoAQPVfNU9ixmzW+0Cyibapn0u2ngieWcLyvW3hh seAIS5Ds+L5JhJpOEUQw6Su62ObCnT1esqsciV8LPgjMza0jdMA63mw8XLdmNoERH7x+PNHajM 4RRJ/2wJT2mvBApsHxpFEWAbl4Aw6Jwp/dYuI3crNieM7l9wilbt5ajzXDdBvrhWeBheby7NBN gTCjw9bz0qTz6Ghl4K8jlVY5ghj54XysbkoLuxbGIA+C5hH7MeRKMc21AtqIL1FAjIV+zfrj/V 1Zc= X-SBRS: 2.7 X-MesageID: 3760803 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,326,1559534400"; d="scan'208";a="3760803" From: Paul Durrant To: Date: Tue, 30 Jul 2019 14:44:18 +0100 Message-ID: <20190730134419.2739-6-paul.durrant@citrix.com> X-Mailer: git-send-email 2.20.1.2.gb21ebb671 In-Reply-To: <20190730134419.2739-1-paul.durrant@citrix.com> References: <20190730134419.2739-1-paul.durrant@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 5/6] iommu: tidy up iommu_us_hap_pt() and need_iommu_pt_sync() macros 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 , Volodymyr Babchuk , =?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" Thes macros really ought to live in the common xen/iommu.h header rather then being distributed amongst architecture specific iommu headers and xen/sched.h. This patch moves them there. NOTE: Disabling 'sharept' in the command line iommu options should really be hard error on ARM (as opposed to just being ignored), so avoid parsing that option if CONFIG_ARM is set. Signed-off-by: Paul Durrant --- Cc: Jan Beulich Cc: Andrew Cooper Cc: George Dunlap Cc: Ian Jackson Cc: Julien Grall Cc: Konrad Rzeszutek Wilk Cc: Stefano Stabellini Cc: Tim Deegan Cc: Wei Liu Cc: Volodymyr Babchuk Cc: "Roger Pau Monn=C3=A9" --- xen/drivers/passthrough/iommu.c | 2 ++ xen/include/asm-arm/iommu.h | 3 --- xen/include/asm-x86/iommu.h | 4 ---- xen/include/xen/iommu.h | 7 +++++++ xen/include/xen/sched.h | 6 ------ 5 files changed, 9 insertions(+), 13 deletions(-) diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iomm= u.c index 30976b4406..67855eeed5 100644 --- a/xen/drivers/passthrough/iommu.c +++ b/xen/drivers/passthrough/iommu.c @@ -102,8 +102,10 @@ static int __init parse_iommu_param(const char *s) iommu_hwdom_passthrough =3D val; else if ( (val =3D parse_boolean("dom0-strict", s, ss)) >=3D 0 ) iommu_hwdom_strict =3D val; +#ifndef CONFIG_ARM else if ( (val =3D parse_boolean("sharept", s, ss)) >=3D 0 ) iommu_hap_pt_share =3D val; +#endif else rc =3D -EINVAL; =20 diff --git a/xen/include/asm-arm/iommu.h b/xen/include/asm-arm/iommu.h index e5050636d7..77a94b29eb 100644 --- a/xen/include/asm-arm/iommu.h +++ b/xen/include/asm-arm/iommu.h @@ -20,9 +20,6 @@ struct arch_iommu void *priv; }; =20 -/* Always share P2M Table between the CPU and the IOMMU */ -#define iommu_use_hap_pt(d) (is_iommu_enabled(d)) - const struct iommu_ops *iommu_get_ops(void); void iommu_set_ops(const struct iommu_ops *ops); =20 diff --git a/xen/include/asm-x86/iommu.h b/xen/include/asm-x86/iommu.h index 6d024d5c0e..25d2aee9a9 100644 --- a/xen/include/asm-x86/iommu.h +++ b/xen/include/asm-x86/iommu.h @@ -79,10 +79,6 @@ struct iommu_init_ops { =20 extern const struct iommu_init_ops *iommu_init_ops; =20 -/* Are we using the domain P2M table as its IOMMU pagetable? */ -#define iommu_use_hap_pt(d) \ - (hap_enabled(d) && is_iommu_enabled(d) && iommu_hap_pt_share) - void iommu_update_ire_from_apic(unsigned int apic, unsigned int reg, unsig= ned int value); unsigned int iommu_read_apic_from_ire(unsigned int apic, unsigned int reg); int iommu_setup_hpet_msi(struct msi_desc *); diff --git a/xen/include/xen/iommu.h b/xen/include/xen/iommu.h index 4b6871936c..45ec6cfe44 100644 --- a/xen/include/xen/iommu.h +++ b/xen/include/xen/iommu.h @@ -268,6 +268,13 @@ struct domain_iommu { #define iommu_set_feature(d, f) set_bit(f, dom_iommu(d)->features) #define iommu_clear_feature(d, f) clear_bit(f, dom_iommu(d)->features) =20 +/* Are we using the domain P2M table as its IOMMU pagetable? */ +#define iommu_use_hap_pt(d) \ + (hap_enabled(d) && is_iommu_enabled(d) && iommu_hap_pt_share) + +/* Does the IOMMU pagetable need to be kept synchronized with the P2M */ +#define need_iommu_pt_sync(d) (dom_iommu(d)->need_sync) + int __must_check iommu_suspend(void); void iommu_resume(void); void iommu_crash_shutdown(void); diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h index 538be7120b..6568f2b85b 100644 --- a/xen/include/xen/sched.h +++ b/xen/include/xen/sched.h @@ -963,12 +963,6 @@ static inline bool is_hwdom_pinned_vcpu(const struct v= cpu *v) cpumask_weight(v->cpu_hard_affinity) =3D=3D 1); } =20 -#ifdef CONFIG_HAS_PASSTHROUGH -#define need_iommu_pt_sync(d) (dom_iommu(d)->need_sync) -#else -#define need_iommu_pt_sync(d) false -#endif - static inline bool is_vcpu_online(const struct vcpu *v) { return !test_bit(_VPF_down, &v->pause_flags); --=20 2.20.1.2.gb21ebb671 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel