]> git.baikalelectronics.ru Git - kernel.git/commit
ARM: 9046/1: decompressor: Do not clear SCTLR.nTLSMD for ARMv7+ cores
authorVladimir Murzin <vladimir.murzin@arm.com>
Thu, 7 Jan 2021 09:47:24 +0000 (10:47 +0100)
committerRussell King <rmk+kernel@armlinux.org.uk>
Mon, 1 Feb 2021 19:42:13 +0000 (19:42 +0000)
commit51ae34083b1d7c2a765f9f51b891842a7f13141f
tree3d1066b41d2b452e34db089f14a134968e1073d9
parent8ad92b66c4dbb58fbe362648aa41c5992ca8ea1c
ARM: 9046/1: decompressor: Do not clear SCTLR.nTLSMD for ARMv7+ cores

It was observed that decompressor running on hardware implementing ARM v8.2
Load/Store Multiple Atomicity and Ordering Control (LSMAOC), say, as guest,
would stuck just after:

Uncompressing Linux... done, booting the kernel.

The reason is that it clears nTLSMD bit when disabling caches:

  nTLSMD, bit [3]

  When ARMv8.2-LSMAOC is implemented:

    No Trap Load Multiple and Store Multiple to
    Device-nGRE/Device-nGnRE/Device-nGnRnE memory.

    0b0 All memory accesses by A32 and T32 Load Multiple and Store
        Multiple at EL1 or EL0 that are marked at stage 1 as
        Device-nGRE/Device-nGnRE/Device-nGnRnE memory are trapped and
        generate a stage 1 Alignment fault.

    0b1 All memory accesses by A32 and T32 Load Multiple and Store
        Multiple at EL1 or EL0 that are marked at stage 1 as
        Device-nGRE/Device-nGnRE/Device-nGnRnE memory are not trapped.

  This bit is permitted to be cached in a TLB.

  This field resets to 1.

  Otherwise:

  Reserved, RES1

So as effect we start getting traps we are not quite ready for.

Looking into history it seems that mask used for SCTLR clear came from
the similar code for ARMv4, where bit[3] is the enable/disable bit for
the write buffer. That not applicable to ARMv7 and onwards, so retire
that bit from the masks.

Fixes: 33be95cac7fd1e89022003aae0c6b7c712a9f7ae ("[ARM] 4393/2: ARMv7: Add uncompressing code for the new CPU Id format")
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
arch/arm/boot/compressed/head.S