xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* Re: [Xen-users] Xen 4.8.3 running on BeagleBoard X-15 - problem with paging
       [not found]   ` <CALC81-tCG3jDjaxaSA7xv7WmAujCnmgUOJkokP39N6Jsdhtk4w@mail.gmail.com>
@ 2018-02-16 10:27     ` Julien Grall
  0 siblings, 0 replies; only message in thread
From: Julien Grall @ 2018-02-16 10:27 UTC (permalink / raw)
  To: Iain Hunter; +Cc: xen-devel, Stefano Stabellini

(Moving that to xen-devel + Stefano)

On 16/02/18 09:23, Iain Hunter wrote:
> Hi Julian,

Hi,

> The patch I applied is below. I have no idea if it is AM572x/DRA7xx 
> specific or just specific to the 2017.01 u-boot I was using.

Thank you for sending the patch. Indeed we don't know the state of the 
TLBs when turning the MMU on. So, it is necessary to flush the TLBs.

On a side note, it looks like the Arm64 side has the same issue.

Can you submit the patch to xen-devel with a commit message and CC 
Stefano and I?

> 
>  From 36e6bc81803a002637c9b854f2694bc655679e85 Mon Sep 17 00:00:00 2001
> From: Iain Hunter <iain@hunterembedded.co.uk 
> <mailto:iain@hunterembedded.co.uk>>
> Date: Thu, 1 Feb 2018 14:45:27 +0000
> Subject: [PATCH] for AM572x need to flush TLBs before enabling MMU
> 
> ---
>   xen/arch/arm/arm32/head.S | 12 ++++++++++++
>   1 file changed, 12 insertions(+)
> 
> diff --git a/xen/arch/arm/arm32/head.S b/xen/arch/arm/arm32/head.S
> index 2df9a98..b153eeb 100644
> --- a/xen/arch/arm/arm32/head.S
> +++ b/xen/arch/arm/arm32/head.S
> @@ -347,6 +347,17 @@ virtphys_clash:
>           b     fail
> 
>   1:
> +        /*
> +         * Flush the TLB before enabling MMU
> +         */
> +        dsb                          /* Ensure any page table updates 
> made above
> +                                      * have occurred. */
> +        isb

The dsb/isb here is not necessary. As you have MMU disabled, the TLBs 
will not get speculated.

> +        mov   r0, #1
> +        mcr   CP32(r0, TLBIALLH)     /* Flush hypervisor TLB */
> +        dsb                          /* Ensure completion of TLB flush */

You want to use dsb nsh here.

> +        isb

This is not necessary, you can rely on the ISB after enabling the MMU.

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] only message in thread

only message in thread, other threads:[~2018-02-16 10:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <5a733ae5.d69d1c0a.6d755.189a@mx.google.com>
     [not found] ` <36670338-a938-9ce4-6127-6bf3e9575731@arm.com>
     [not found]   ` <CALC81-tCG3jDjaxaSA7xv7WmAujCnmgUOJkokP39N6Jsdhtk4w@mail.gmail.com>
2018-02-16 10:27     ` [Xen-users] Xen 4.8.3 running on BeagleBoard X-15 - problem with paging Julien Grall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).