arm64: Clear OSDLR_EL1 on CPU boot
authorJean-Philippe Brucker <jean-philippe.brucker@arm.com>
Mon, 8 Apr 2019 17:17:18 +0000 (18:17 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 21 May 2019 16:50:14 +0000 (18:50 +0200)
commit 6fda41bf12615ee7c3ddac88155099b1a8cf8d00 upstream.

Some firmwares may reboot CPUs with OS Double Lock set. Make sure that
it is unlocked, in order to use debug exceptions.

Cc: <stable@vger.kernel.org>
Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm64/kernel/debug-monitors.c

index c7ef99904934a3a1f52997fbfe689342c11e55a2..edb63bf2ac1ca3eae6088613a12e2d02c8e28c3b 100644 (file)
@@ -133,6 +133,7 @@ NOKPROBE_SYMBOL(disable_debug_monitors);
  */
 static int clear_os_lock(unsigned int cpu)
 {
+       write_sysreg(0, osdlr_el1);
        write_sysreg(0, oslar_el1);
        isb();
        return 0;