All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Durrant <paul.durrant@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Kevin Tian <kevin.tian@intel.com>,
	Paul Durrant <paul.durrant@citrix.com>
Subject: [PATCH 6/7] vtd: change lookup_page failure semantics
Date: Thu, 20 Sep 2018 15:11:48 +0100	[thread overview]
Message-ID: <20180920141149.1643-7-paul.durrant@citrix.com> (raw)
In-Reply-To: <20180920141149.1643-1-paul.durrant@citrix.com>

Commit 43d1622b "vtd: add lookup_page method to iommu_ops" added a
lookup method in to the VT-d IOMMU implementation. In some cases (such as
when shared EPT is in operation) that function simply passes back an
identity MFN (i.e. an MFN with the same value as the DFN that was passed
in), but this doesn't actually make a lot of sense. If, for instance,
shared EPT is used then really the function should be doing a P2M lookup
since DFN space will be identical to GFN space.

In practice there are no current callers of the lookup_page method and,
when PV-IOMMU support is added, the method will not be called if either
shared EPT is in operation or iommu_passthrough is set, so this patch
simply fails the method with -EOPNOTSUPP in those cases.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
Cc: Kevin Tian <kevin.tian@intel.com>
---
 xen/drivers/passthrough/vtd/iommu.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 79ecd15e49..1e861b696d 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1853,10 +1853,7 @@ static int intel_iommu_lookup_page(struct domain *d, dfn_t dfn, mfn_t *mfn,
      */
     if ( iommu_use_hap_pt(d) ||
          (iommu_hwdom_passthrough && is_hardware_domain(d)) )
-    {
-        *mfn = _mfn(dfn_x(dfn));
-        return 0;
-    }
+        return -EOPNOTSUPP;
 
     spin_lock(&hd->arch.mapping_lock);
 
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  parent reply	other threads:[~2018-09-20 14:14 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-20 14:11 [PATCH 0/7] amd-iommu: cleanup and add lookup_page method Paul Durrant
2018-09-20 14:11 ` [PATCH 1/7] amd-iommu: don't domain_crash() inside map/unmap_page() Paul Durrant
2018-09-20 14:11 ` [PATCH 2/7] amd-iommu: re-name u8/16/32/64 to uint8/16/32/64_t Paul Durrant
2018-09-20 14:11 ` [PATCH 3/7] amd-iommu: convert all bool_t to bool Paul Durrant
2018-09-20 14:11 ` [PATCH 4/7] amd-iommu: reduce code duplication Paul Durrant
2018-09-20 14:11 ` [PATCH 5/7] amd-iommu: introduce new get/set_iommu_pde_info() functions Paul Durrant
2018-09-20 14:11 ` Paul Durrant [this message]
2018-09-21  0:58   ` [PATCH 6/7] vtd: change lookup_page failure semantics Tian, Kevin
2018-09-21 10:16   ` Jan Beulich
2018-09-21 10:18     ` Paul Durrant
2018-09-21 10:27       ` Jan Beulich
2018-09-21 10:31         ` Paul Durrant
2018-09-20 14:11 ` [PATCH 7/7] amd-iommu: add lookup_page method to iommu_ops Paul Durrant
2018-09-20 15:03   ` Jan Beulich
2018-09-20 15:41     ` Paul Durrant

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180920141149.1643-7-paul.durrant@citrix.com \
    --to=paul.durrant@citrix.com \
    --cc=kevin.tian@intel.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.