arm: enable data-cache at the same time as enabling the MMU, not before
authorIan Campbell <ian.campbell@citrix.com>
Tue, 3 Jul 2012 09:52:26 +0000 (10:52 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Tue, 3 Jul 2012 09:52:26 +0000 (10:52 +0100)
With enough warnings enabled the model seemed to be complaining that pages
cached before paging was enabled had been mapped with to inconsistent sets of
attributes. I'm not convinced that isn't a model issue, nor am I convinced
this has really fixed anything, but it seems sensible enough.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
xen/arch/arm/head.S

index 9a7714a6127d601d8de4b855910d7ab35b291763..cdbe0118205b70330a0a9155016a1f73cc23c604 100644 (file)
@@ -148,10 +148,11 @@ hyp:
         * Exceptions in LE ARM,
         * Low-latency IRQs disabled,
         * Write-implies-XN disabled (for now),
-        * I-cache and d-cache enabled,
+        * D-cache disabled (for now),
+        * I-cache enabled,
         * Alignment checking enabled,
         * MMU translation disabled (for now). */
-       ldr   r0, =(HSCTLR_BASE|SCTLR_A|SCTLR_C)
+       ldr   r0, =(HSCTLR_BASE|SCTLR_A)
        mcr   CP32(r0, HSCTLR)
 
        /* Write Xen's PT's paddr into the HTTBR */
@@ -210,7 +211,7 @@ pt_ready:
 
        ldr   r1, =paging            /* Explicit vaddr, not RIP-relative */
        mrc   CP32(r0, HSCTLR)
-       orr   r0, r0, #0x1           /* Add in the MMU enable bit */
+       orr   r0, r0, #(SCTLR_M|SCTLR_C) /* Enable MMU and D-cache */
        dsb                          /* Flush PTE writes and finish reads */
        mcr   CP32(r0, HSCTLR)       /* now paging is enabled */
        isb                          /* Now, flush the icache */