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

[Xen-devel] [PATCH for-4.12] arm/p2m: do not invalidate p2m root if it is shared with IOMMU

From: Andrii Anisov <andrii_anisov@xxxxxxxx>

In case if the p2m table is shared to IOMMU, invalidating it turns IOMMU to
translation faults that could be not repaired.

Fixed patch check for the corresponded condition and has a comment for one
introduced p2m_invalidate_root() call, but miss them for another. So put the
`if` and the comment in place.

Fixes: 2148a12 ("xen/arm: Track page accessed between batch of Set/Way 
Signed-off-by: Andrii Anisov <andrii_anisov@xxxxxxxx>
 xen/arch/arm/p2m.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index 059a391..2367e09 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -1708,8 +1708,13 @@ void p2m_flush_vm(struct vcpu *v)
      * Invalidate the p2m to track which page was modified by the guest
      * between call of p2m_flush_vm().
+     *
+     * This is only turned when IOMMU is not used or the page-table are
+     * not shared because bit[0] (e.g valid bit) unset will result
+     * IOMMU fault that could be not fixed-up.
-    p2m_invalidate_root(p2m);
+    if ( !iommu_use_hap_pt(v->domain) )
+        p2m_invalidate_root(p2m);
     v->arch.need_flush_to_ram = false;

Xen-devel mailing list



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