arm64: mdscr_el1: avoid exposing DCC to userspace
authorWill Deacon <will.deacon@arm.com>
Thu, 20 Aug 2015 10:47:13 +0000 (11:47 +0100)
committerWill Deacon <will.deacon@arm.com>
Thu, 20 Aug 2015 15:17:58 +0000 (16:17 +0100)
We don't want to expose the DCC to userspace, particularly as there is
a kernel console driver for it.

This patch resets mdscr_el1 to disable userspace access to the DCC
registers on the cold boot path.

Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/mm/proc.S

index 6e8765a2bddd0a17c5adc8b65391a81846665a69..e4ee7bd8830aed60b9b0b493c4c4dc93863d419c 100644 (file)
@@ -151,7 +151,8 @@ ENTRY(__cpu_setup)
 
        mov     x0, #3 << 20
        msr     cpacr_el1, x0                   // Enable FP/ASIMD
-       msr     mdscr_el1, xzr                  // Reset mdscr_el1
+       mov     x0, #1 << 12                    // Reset mdscr_el1 and disable
+       msr     mdscr_el1, x0                   // access to the DCC from EL0
        /*
         * Memory region attributes for LPAE:
         *