From nobody Tue Feb 10 01:31:28 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1595609215; cv=none; d=zohomail.com; s=zohoarc; b=Mwe11SFBhK2Ss+oMFzkeUxtqyonLGvv3t5JF4mx0jM+wAQ28FUQlsOB4R4MyTlqTq+VXdHfc8Y2wHyGXdDt1VVVzeAu9movaiaSDkJqjF/yutRjZkBS4PYTdzOInstktBBeKrgk29bXTVHZBeDApAMP4P3cl+c5eZ986BxbwOCQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1595609215; h=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; bh=cZN6jmbYm9lCxNLsfkXuY/1LcmLkMfluVmH0qNDCEu0=; b=N+ZhtMkmFb7RLWV4T1u/3fzo6nYXiwenHD+gWjtg/a/JIGqepx8Ad0L2jGIXPfV8uawKn+D+8luuhCA2z7+p7eNyJycL+0cYDN98woPkjGUxQctT6HI8L6dM2H+3tW9NFoYb5KAnEEmKD8T5aI13+K1RW4/uOMXS87CaQlPPMCU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) 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 1595609215890442.7722468690214; Fri, 24 Jul 2020 09:46:55 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jz0qF-00019Q-3W; Fri, 24 Jul 2020 16:46:39 +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.92) (envelope-from ) id 1jz0qD-00015d-E1 for xen-devel@lists.xenproject.org; Fri, 24 Jul 2020 16:46:37 +0000 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 39ae33b2-cdcd-11ea-a42a-12813bfff9fa; Fri, 24 Jul 2020 16:46:30 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jz0q5-00054Q-D0; Fri, 24 Jul 2020 16:46:29 +0000 Received: from host86-143-223-30.range86-143.btcentralplus.com ([86.143.223.30] helo=u2f063a87eabd5f.home) by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jz0q5-0006WL-4k; Fri, 24 Jul 2020 16:46:29 +0000 X-Inumbo-ID: 39ae33b2-cdcd-11ea-a42a-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org; s=20200302mail; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=cZN6jmbYm9lCxNLsfkXuY/1LcmLkMfluVmH0qNDCEu0=; b=I/cHUa/pd6pC9G6tExT7F95xXC VMncjymlOmzZTFVStzMGzHXDL4camoe6ZhB+cRBPNxkP4BftickwLm9xxELciMdqnPvqm0nm5obvX s2eB21PKzYpi6rdWnjji8PmV9JArdSa/xnpFTgtfVooiQoM6bKXS+0djifcfoMpW0bio=; From: Paul Durrant To: xen-devel@lists.xenproject.org Subject: [PATCH 3/6] iommu: remove iommu_lookup_page() and the lookup_page() method... Date: Fri, 24 Jul 2020 17:46:16 +0100 Message-Id: <20200724164619.1245-4-paul@xen.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200724164619.1245-1-paul@xen.org> References: <20200724164619.1245-1-paul@xen.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Paul Durrant , Kevin Tian , Jan Beulich Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Paul Durrant ... from iommu_ops. This patch is essentially a reversion of dd93d54f "vtd: add lookup_page met= hod to iommu_ops". The code was intended to be used by a patch that has long- since been abandoned. Therefore it is dead code and can be removed. Signed-off-by: Paul Durrant --- Cc: Jan Beulich Cc: Kevin Tian --- xen/drivers/passthrough/iommu.c | 11 -------- xen/drivers/passthrough/vtd/iommu.c | 41 ----------------------------- xen/include/xen/iommu.h | 5 ---- 3 files changed, 57 deletions(-) diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iomm= u.c index dad4088531..327df17c5d 100644 --- a/xen/drivers/passthrough/iommu.c +++ b/xen/drivers/passthrough/iommu.c @@ -350,17 +350,6 @@ int iommu_legacy_unmap(struct domain *d, dfn_t dfn, un= signed int page_order) return rc; } =20 -int iommu_lookup_page(struct domain *d, dfn_t dfn, mfn_t *mfn, - unsigned int *flags) -{ - const struct domain_iommu *hd =3D dom_iommu(d); - - if ( !is_iommu_enabled(d) || !hd->platform_ops->lookup_page ) - return -EOPNOTSUPP; - - return iommu_call(hd->platform_ops, lookup_page, d, dfn, mfn, flags); -} - int iommu_iotlb_flush(struct domain *d, dfn_t dfn, unsigned int page_count, unsigned int flush_flags) { diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/= vtd/iommu.c index 40834e2e7a..149d7122c3 100644 --- a/xen/drivers/passthrough/vtd/iommu.c +++ b/xen/drivers/passthrough/vtd/iommu.c @@ -1808,46 +1808,6 @@ static int __must_check intel_iommu_unmap_page(struc= t domain *d, dfn_t dfn, return 0; } =20 -static int intel_iommu_lookup_page(struct domain *d, dfn_t dfn, mfn_t *mfn, - unsigned int *flags) -{ - struct domain_iommu *hd =3D dom_iommu(d); - struct dma_pte *page, val; - u64 pg_maddr; - - /* - * If VT-d shares EPT page table or if the domain is the hardware - * domain and iommu_passthrough is set then pass back the dfn. - */ - if ( iommu_use_hap_pt(d) || - (iommu_hwdom_passthrough && is_hardware_domain(d)) ) - return -EOPNOTSUPP; - - spin_lock(&hd->arch.mapping_lock); - - pg_maddr =3D addr_to_dma_page_maddr(d, dfn_to_daddr(dfn), 0); - if ( !pg_maddr ) - { - spin_unlock(&hd->arch.mapping_lock); - return -ENOENT; - } - - page =3D map_vtd_domain_page(pg_maddr); - val =3D page[dfn_x(dfn) & LEVEL_MASK]; - - unmap_vtd_domain_page(page); - spin_unlock(&hd->arch.mapping_lock); - - if ( !dma_pte_present(val) ) - return -ENOENT; - - *mfn =3D maddr_to_mfn(dma_pte_addr(val)); - *flags =3D dma_pte_read(val) ? IOMMUF_readable : 0; - *flags |=3D dma_pte_write(val) ? IOMMUF_writable : 0; - - return 0; -} - static int __init vtd_ept_page_compatible(struct vtd_iommu *iommu) { u64 ept_cap, vtd_cap =3D iommu->cap; @@ -2710,7 +2670,6 @@ static struct iommu_ops __initdata vtd_ops =3D { .teardown =3D iommu_domain_teardown, .map_page =3D intel_iommu_map_page, .unmap_page =3D intel_iommu_unmap_page, - .lookup_page =3D intel_iommu_lookup_page, .reassign_device =3D reassign_device_ownership, .get_device_group_id =3D intel_iommu_group_id, .enable_x2apic =3D intel_iommu_enable_eim, diff --git a/xen/include/xen/iommu.h b/xen/include/xen/iommu.h index 51c29180a4..271bd8e546 100644 --- a/xen/include/xen/iommu.h +++ b/xen/include/xen/iommu.h @@ -158,9 +158,6 @@ int __must_check iommu_legacy_map(struct domain *d, dfn= _t dfn, mfn_t mfn, int __must_check iommu_legacy_unmap(struct domain *d, dfn_t dfn, unsigned int page_order); =20 -int __must_check iommu_lookup_page(struct domain *d, dfn_t dfn, mfn_t *mfn, - unsigned int *flags); - int __must_check iommu_iotlb_flush(struct domain *d, dfn_t dfn, unsigned int page_count, unsigned int flush_flags); @@ -260,8 +257,6 @@ struct iommu_ops { unsigned int *flush_flags); int __must_check (*unmap_page)(struct domain *d, dfn_t dfn, unsigned int *flush_flags); - int __must_check (*lookup_page)(struct domain *d, dfn_t dfn, mfn_t *mf= n, - unsigned int *flags); =20 #ifdef CONFIG_X86 int (*enable_x2apic)(void); --=20 2.20.1