All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] xen/arm: create_xen_entries has to flush TLBs on every CPU
@ 2014-04-23 11:36 Julien Grall
  2014-05-02 12:56 ` Ian Campbell
  2014-05-02 12:58 ` Ian Campbell
  0 siblings, 2 replies; 4+ messages in thread
From: Julien Grall @ 2014-04-23 11:36 UTC (permalink / raw)
  To: xen-devel; +Cc: stefano.stabellini, Julien Grall, tim, ian.campbell

The function create_xen_entries creates mappings in second-level page tables
which is shared between every CPU.

Only flushing TLBs on local processor may result to wrong behaviour
when io{re,un}map is used.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
---

This patch is candidate to be backported to Xen 4.4.

create_p2m_entries is only used by vmap ( iore{,un}map functions.

Upstream Xen 4.4 calls these functions only when 1 CPU is online so it's
"safe". But people who make product based on Xen 4.4 might want to use theses
functions when all CPUs are UP.

    Changes in v2:
        - The patch change create_xen_entries not create_p2m_entries
---
 xen/arch/arm/mm.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 362bc8d..eac228c 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -845,7 +845,7 @@ static int create_xen_entries(enum xenmap_operation op,
                 BUG();
         }
     }
-    flush_xen_data_tlb_range_va_local(virt, PAGE_SIZE * nr_mfns);
+    flush_xen_data_tlb_range_va(virt, PAGE_SIZE * nr_mfns);
 
     rc = 0;
 
-- 
1.7.10.4

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

* Re: [PATCH v2] xen/arm: create_xen_entries has to flush TLBs on every CPU
  2014-04-23 11:36 [PATCH v2] xen/arm: create_xen_entries has to flush TLBs on every CPU Julien Grall
@ 2014-05-02 12:56 ` Ian Campbell
  2014-05-02 12:58 ` Ian Campbell
  1 sibling, 0 replies; 4+ messages in thread
From: Ian Campbell @ 2014-05-02 12:56 UTC (permalink / raw)
  To: Julien Grall; +Cc: xen-devel, tim, stefano.stabellini

On Wed, 2014-04-23 at 12:36 +0100, Julien Grall wrote:
> The function create_xen_entries creates mappings in second-level page tables
> which is shared between every CPU.
> 
> Only flushing TLBs on local processor may result to wrong behaviour
> when io{re,un}map is used.
> 
> Signed-off-by: Julien Grall <julien.grall@linaro.org>

Acked + applied.

> ---
> 
> This patch is candidate to be backported to Xen 4.4.

Noted. I think you said this would need some backporting? Given that I'm
inclined to hold off on backporting this until someone who is using 4.4
and tripping over the issue reports/requests it.

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

* Re: [PATCH v2] xen/arm: create_xen_entries has to flush TLBs on every CPU
  2014-04-23 11:36 [PATCH v2] xen/arm: create_xen_entries has to flush TLBs on every CPU Julien Grall
  2014-05-02 12:56 ` Ian Campbell
@ 2014-05-02 12:58 ` Ian Campbell
  2014-05-02 13:17   ` Julien Grall
  1 sibling, 1 reply; 4+ messages in thread
From: Ian Campbell @ 2014-05-02 12:58 UTC (permalink / raw)
  To: Julien Grall; +Cc: xen-devel, tim, stefano.stabellini


On Wed, 2014-04-23 at 12:36 +0100, Julien Grall wrote:
> The function create_xen_entries creates mappings in second-level page tables
> which is shared between every CPU.
> 
> Only flushing TLBs on local processor may result to wrong behaviour
> when io{re,un}map is used.
> 
> Signed-off-by: Julien Grall <julien.grall@linaro.org>

Acked + applied.

> ---
> 
> This patch is candidate to be backported to Xen 4.4.

Noted. I think you said this would need some backporting? Given that I'm
inclined to hold off on backporting this until someone who is using 4.4
and tripping over the issue reports/requests it.

> 
> create_p2m_entries is only used by vmap ( iore{,un}map functions.
> 
> Upstream Xen 4.4 calls these functions only when 1 CPU is online so it's
> "safe". But people who make product based on Xen 4.4 might want to use theses
> functions when all CPUs are UP.
> 
>     Changes in v2:
>         - The patch change create_xen_entries not create_p2m_entries
> ---
>  xen/arch/arm/mm.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
> index 362bc8d..eac228c 100644
> --- a/xen/arch/arm/mm.c
> +++ b/xen/arch/arm/mm.c
> @@ -845,7 +845,7 @@ static int create_xen_entries(enum xenmap_operation op,
>                  BUG();
>          }
>      }
> -    flush_xen_data_tlb_range_va_local(virt, PAGE_SIZE * nr_mfns);
> +    flush_xen_data_tlb_range_va(virt, PAGE_SIZE * nr_mfns);
>  
>      rc = 0;
>  

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

* Re: [PATCH v2] xen/arm: create_xen_entries has to flush TLBs on every CPU
  2014-05-02 12:58 ` Ian Campbell
@ 2014-05-02 13:17   ` Julien Grall
  0 siblings, 0 replies; 4+ messages in thread
From: Julien Grall @ 2014-05-02 13:17 UTC (permalink / raw)
  To: Ian Campbell; +Cc: xen-devel, tim, stefano.stabellini

On 05/02/2014 01:58 PM, Ian Campbell wrote:
>> ---
>>
>> This patch is candidate to be backported to Xen 4.4.
> 
> Noted. I think you said this would need some backporting? Given that I'm
> inclined to hold off on backporting this until someone who is using 4.4
> and tripping over the issue reports/requests it.

I'm fine with this solution.

Regards,

-- 
Julien Grall

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

end of thread, other threads:[~2014-05-02 13:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-23 11:36 [PATCH v2] xen/arm: create_xen_entries has to flush TLBs on every CPU Julien Grall
2014-05-02 12:56 ` Ian Campbell
2014-05-02 12:58 ` Ian Campbell
2014-05-02 13:17   ` Julien Grall

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.