All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 for-4.12] arm/p2m: call iommu iotlb flush if iommu exists and enabled
@ 2019-01-23 12:50 Andrii Anisov
  2019-01-23 12:53 ` Paul Durrant
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Andrii Anisov @ 2019-01-23 12:50 UTC (permalink / raw)
  To: xen-devel
  Cc: Juergen Gross, Julien Grall, Stefano Stabellini, Andrii Anisov,
	Paul Durrant

From: Andrii Anisov <andrii_anisov@epam.com>

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.

Signed-off-by: Andrii Anisov <andrii_anisov@epam.com>
---
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(-)

diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index 2394f97..059a391 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -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;
-- 
2.7.4


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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 for-4.12] arm/p2m: call iommu iotlb flush if iommu exists and enabled
  2019-01-23 12:50 [PATCH v2 for-4.12] arm/p2m: call iommu iotlb flush if iommu exists and enabled Andrii Anisov
@ 2019-01-23 12:53 ` Paul Durrant
  2019-01-23 12:55 ` Juergen Gross
  2019-01-23 13:26 ` Julien Grall
  2 siblings, 0 replies; 7+ messages in thread
From: Paul Durrant @ 2019-01-23 12:53 UTC (permalink / raw)
  To: 'Andrii Anisov', xen-devel
  Cc: Juergen Gross, Julien Grall, Stefano Stabellini, Andrii Anisov

> -----Original Message-----
> From: Andrii Anisov [mailto:andrii.anisov@gmail.com]
> Sent: 23 January 2019 12:50
> To: xen-devel@lists.xenproject.org
> Cc: Julien Grall <julien.grall@arm.com>; Stefano Stabellini
> <sstabellini@kernel.org>; Paul Durrant <Paul.Durrant@citrix.com>; Juergen
> Gross <jgross@suse.com>; Andrii Anisov <andrii_anisov@epam.com>
> Subject: [PATCH v2 for-4.12] arm/p2m: call iommu iotlb flush if iommu
> exists and enabled
> 
> From: Andrii Anisov <andrii_anisov@epam.com>
> 
> 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.
> 
> Signed-off-by: Andrii Anisov <andrii_anisov@epam.com>

Reviewed-by: Paul Durrant <paul.durrant@citrix.com>

> ---
> 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(-)
> 
> diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
> index 2394f97..059a391 100644
> --- a/xen/arch/arm/p2m.c
> +++ b/xen/arch/arm/p2m.c
> @@ -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;
> --
> 2.7.4


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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 for-4.12] arm/p2m: call iommu iotlb flush if iommu exists and enabled
  2019-01-23 12:50 [PATCH v2 for-4.12] arm/p2m: call iommu iotlb flush if iommu exists and enabled Andrii Anisov
  2019-01-23 12:53 ` Paul Durrant
@ 2019-01-23 12:55 ` Juergen Gross
  2019-01-23 13:26 ` Julien Grall
  2 siblings, 0 replies; 7+ messages in thread
From: Juergen Gross @ 2019-01-23 12:55 UTC (permalink / raw)
  To: Andrii Anisov, xen-devel
  Cc: Julien Grall, Stefano Stabellini, Andrii Anisov, Paul Durrant

On 23/01/2019 13:50, Andrii Anisov wrote:
> From: Andrii Anisov <andrii_anisov@epam.com>
> 
> 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.
> 
> Signed-off-by: Andrii Anisov <andrii_anisov@epam.com>

Release-acked-by: Juergen Gross <jgross@suse.com>


Juergen

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 for-4.12] arm/p2m: call iommu iotlb flush if iommu exists and enabled
  2019-01-23 12:50 [PATCH v2 for-4.12] arm/p2m: call iommu iotlb flush if iommu exists and enabled Andrii Anisov
  2019-01-23 12:53 ` Paul Durrant
  2019-01-23 12:55 ` Juergen Gross
@ 2019-01-23 13:26 ` Julien Grall
  2019-01-23 13:32   ` Andrii Anisov
  2 siblings, 1 reply; 7+ messages in thread
From: Julien Grall @ 2019-01-23 13:26 UTC (permalink / raw)
  To: Andrii Anisov, xen-devel
  Cc: Juergen Gross, Stefano Stabellini, Andrii Anisov, Paul Durrant



On 23/01/2019 12:50, Andrii Anisov wrote:
> From: Andrii Anisov <andrii_anisov@epam.com>
> 
> 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:

Acked-by: Julien Grall <julien.grall@arm.com>

Cheers,

-- 
Julien Grall

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 for-4.12] arm/p2m: call iommu iotlb flush if iommu exists and enabled
  2019-01-23 13:26 ` Julien Grall
@ 2019-01-23 13:32   ` Andrii Anisov
  2019-01-23 13:33     ` Julien Grall
  0 siblings, 1 reply; 7+ messages in thread
From: Andrii Anisov @ 2019-01-23 13:32 UTC (permalink / raw)
  To: Julien Grall, xen-devel, Juergen Gross
  Cc: Stefano Stabellini, Andrii Anisov, Paul Durrant

Juergen,

On 23.01.19 15:26, Julien Grall wrote:
> 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?.

> With that:
> 
> Acked-by: Julien Grall <julien.grall@arm.com>

-- 
Sincerely,
Andrii Anisov.

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 for-4.12] arm/p2m: call iommu iotlb flush if iommu exists and enabled
  2019-01-23 13:32   ` Andrii Anisov
@ 2019-01-23 13:33     ` Julien Grall
  2019-01-23 13:34       ` Andrii Anisov
  0 siblings, 1 reply; 7+ messages in thread
From: Julien Grall @ 2019-01-23 13:33 UTC (permalink / raw)
  To: Andrii Anisov, xen-devel, Juergen Gross
  Cc: Stefano Stabellini, Andrii Anisov, Paul Durrant



On 23/01/2019 13:32, Andrii Anisov wrote:
> Juergen,
> 
> On 23.01.19 15:26, Julien Grall wrote:
>> 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,

> 
>> With that:
>>
>> Acked-by: Julien Grall <julien.grall@arm.com>
> 

-- 
Julien Grall

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 for-4.12] arm/p2m: call iommu iotlb flush if iommu exists and enabled
  2019-01-23 13:33     ` Julien Grall
@ 2019-01-23 13:34       ` Andrii Anisov
  0 siblings, 0 replies; 7+ messages in thread
From: Andrii Anisov @ 2019-01-23 13:34 UTC (permalink / raw)
  To: Julien Grall, xen-devel, Juergen Gross
  Cc: Stefano Stabellini, Andrii Anisov, Paul Durrant



On 23.01.19 15:33, Julien Grall wrote:
>> On 23.01.19 15:26, Julien Grall wrote:
> No need, I will fix it on commit.

Thank you.

-- 
Sincerely,
Andrii Anisov.

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-01-23 13:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-23 12:50 [PATCH v2 for-4.12] arm/p2m: call iommu iotlb flush if iommu exists and enabled Andrii Anisov
2019-01-23 12:53 ` Paul Durrant
2019-01-23 12:55 ` Juergen Gross
2019-01-23 13:26 ` Julien Grall
2019-01-23 13:32   ` Andrii Anisov
2019-01-23 13:33     ` Julien Grall
2019-01-23 13:34       ` Andrii Anisov

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.