Skip to contentSkip to conversation

arm/p2m: call iommu iotlb flush if iommu exists and enabled

PATCH In review Andrii Anisov 4 participants 7 messages Jan 23, 2019

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 arm/p2m: call iommu iotlb flush if iommu exists and enabled

From: Andrii Anisov <[email protected]>

Taking decision by need_iommu_pt_sync() make us never kicking iommu_iotlb_flush() for IOMMUs which do share P2M with CPU. So check has_iommu_pt() instead.

---
Changes in v2:
Fixed a missprint and a nit in a commit message

 xen/arch/arm/p2m.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/arch/arm/p2m.c +1 -1
index 2394f97..059a391 100644
@@ -1019,7 +1019,7 @@ static int __p2m_set_entry(struct p2m_domain *p2m,
          !mfn_eq(lpae_get_mfn(*entry), lpae_get_mfn(orig_pte)) )
         p2m_free_entry(p2m, orig_pte, level);
 
-    if ( need_iommu_pt_sync(p2m->domain) &&
+    if ( has_iommu_pt(p2m->domain) &&
          (lpae_is_valid(orig_pte) || lpae_is_valid(*entry)) )
     {
         unsigned int flush_flags = 0;
Signature · 7 lines
2.7.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Reviewed-by on v2 1/1
#1 lore raw
Quoted 10 lines

-----Original Message-----
From: Andrii Anisov [mailto:[email protected]]
Sent: 23 January 2019 12:50
To: [email protected]
Cc: Julien Grall <[email protected]>; Stefano Stabellini <[email protected]>; Paul Durrant <[email protected]>; Juergen Gross <[email protected]>; Andrii Anisov <[email protected]>
Subject: [PATCH v2 for-4.12] arm/p2m: call iommu iotlb flush if iommu exists and enabled

Quoted 7 lines

From: Andrii Anisov <[email protected]>

Taking decision by need_iommu_pt_sync() make us never kicking iommu_iotlb_flush() for IOMMUs which do share P2M with CPU. So check has_iommu_pt() instead.

Quoted 21 lines

---
Changes in v2:
Fixed a missprint and a nit in a commit message

 xen/arch/arm/p2m.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/arch/arm/p2m.c +1 -2
index 2394f97..059a391 100644
@@ -1019,7 +1019,7 @@ static int __p2m_set_entry(struct p2m_domain *p2m,
          !mfn_eq(lpae_get_mfn(*entry), lpae_get_mfn(orig_pte)) )
         p2m_free_entry(p2m, orig_pte, level);
 
-    if ( need_iommu_pt_sync(p2m->domain) &&
+    if ( has_iommu_pt(p2m->domain) &&
          (lpae_is_valid(orig_pte) || lpae_is_valid(*entry)) )
     {
         unsigned int flush_flags = 0;
--
Quoted 1 line

2.7.4

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#2 lore raw
In reply to Andrii Anisov
Quoted 7 lines · Andrii Anisov

From: Andrii Anisov <[email protected]>

Taking decision by need_iommu_pt_sync() make us never kicking iommu_iotlb_flush() for IOMMUs which do share P2M with CPU. So check has_iommu_pt() instead.

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

Acked-by on v2 1/1
#3 lore raw
In reply to Andrii Anisov
Quoted 5 lines · Andrii Anisov

From: Andrii Anisov <[email protected]>

Taking decision by need_iommu_pt_sync() make us never kicking iommu_iotlb_flush() for IOMMUs which do share P2M with CPU. So check has_iommu_pt() instead.

Please mention the bug was introduced by commit 91d4eca7ad "mm / iommu: split need_iommu() into has_iommu_pt() and need_iommu_pt_sync()".

With that:

Cheers,

Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#4 lore raw

Juergen,

Quoted 1 line · Julien Grall

Please mention the bug was introduced by commit 91d4eca7ad "mm / iommu: split need_iommu() into has_iommu_pt() and need_iommu_pt_sync()".

Should I send v3?.

Quoted 3 lines

With that:

Signature · 7 lines
Sincerely,
Andrii Anisov.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#5 lore raw
Quoted 5 lines · Andrii Anisov

Juergen,

Quoted 1 line · Julien Grall

Please mention the bug was introduced by commit 91d4eca7ad "mm / iommu: split need_iommu() into has_iommu_pt() and need_iommu_pt_sync()".

Should I send v3?.

No need, I will fix it on commit.

Cheers,

Quoted 5 lines
Quoted 4 lines

With that:

Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#6 lore raw
Quoted 2 lines · Julien Grall
Quoted 1 line · Julien Grall

No need, I will fix it on commit.

Thank you.

Signature · 7 lines
Sincerely,
Andrii Anisov.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel