p2m_mmio_direct should result in setting IOMMUF_readable and IOMMUF_writable
flags.
When pvh domain maps mmio regions, the EPT entries are not getting mapped.
This leads to IOMMU Page faults for some devices, as for example USB Host
controllers with embedded Debug devices. See pvh-set-need_iommu-early RFC
patch discussion fgor detail.

I will appreciate your comments and ideas in regards to this change.

Looking at Roger patches (xen/pvh: check permissions when adding MMIO regions)
the mmio memory type is proposed to be changed from p2m_mmio_direct to 
p2m_access_rw.
This type still does not have proper IOMMU flags mapping.

Signed-off-by: Elena Ufimtseva <elena.ufimts...@oracle.com>
---
 xen/include/asm-x86/p2m.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h
index 5f7fe71..7b918de 100644
--- a/xen/include/asm-x86/p2m.h
+++ b/xen/include/asm-x86/p2m.h
@@ -695,6 +695,7 @@ static inline unsigned int p2m_get_iommu_flags(p2m_type_t 
p2mt)
     case p2m_grant_map_rw:
     case p2m_ram_logdirty:
     case p2m_map_foreign:
+    case p2m_mmio_direct:
         flags =  IOMMUF_readable | IOMMUF_writable;
         break;
     case p2m_ram_ro:
-- 
2.1.3


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

Reply via email to