[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 1/2] vtd: Drop dead check for permissions in lookup_page


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: "Teddy Astie" <teddy.astie@xxxxxxxxxx>
  • Date: Fri, 10 Apr 2026 10:09:25 +0000
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=mte1 header.d=mandrillapp.com header.i="@mandrillapp.com" header.h="From:Subject:To:Cc:Message-Id:Feedback-ID:Date:MIME-Version:Content-Type:Content-Transfer-Encoding"; dkim=pass header.s=mte1 header.d=vates.tech header.i="teddy.astie@xxxxxxxxxx" header.h="From:Subject:To:Cc:Message-Id:Feedback-ID:Date:MIME-Version:Content-Type:Content-Transfer-Encoding"
  • Cc: "Teddy Astie" <teddy.astie@xxxxxxxxxx>, "Jan Beulich" <jbeulich@xxxxxxxx>, "Andrew Cooper" <andrew.cooper3@xxxxxxxxxx>, "Roger Pau Monné" <roger.pau@xxxxxxxxxx>
  • Delivery-date: Fri, 10 Apr 2026 10:09:31 +0000
  • Feedback-id: 30504962:30504962.20260410:md
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

`val` comes from `addr_to_dma_page_maddr()` which is a pagetable
paddr and doesn't leak the PTE flags in it.

Rather than returning entries without any permissions, assume they
are always r/w.

Fixes: dd93d54fef0b2 ("vtd: add lookup_page method to iommu_ops")
Signed-off-by: Teddy Astie <teddy.astie@xxxxxxxxxx>
---
This doesn't really matter since the lookup ops are not used currently
(and not implemented on the AMD side), hence it's not a problem in practice.
Perhaps we want to drop the function for the time being, and reintroduce it
when it gets useful ?

 xen/drivers/passthrough/vtd/iommu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/iommu.c 
b/xen/drivers/passthrough/vtd/iommu.c
index 3d6f787b3c..cf97469957 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -2293,8 +2293,8 @@ static int cf_check intel_iommu_lookup_page(
         return -ENOENT;
 
     *mfn = maddr_to_mfn(val);
-    *flags = val & DMA_PTE_READ ? IOMMUF_readable : 0;
-    *flags |= val & DMA_PTE_WRITE ? IOMMUF_writable : 0;
+    /* TODO: Populate flags from pte */
+    *flags = IOMMUF_readable | IOMMUF_writable;
 
     return 0;
 }
-- 
2.52.0



--
Teddy Astie | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.