powerpc/32s: Avoid crossing page boundary while changing SRR0/1.
authorChristophe Leroy <christophe.leroy@c-s.fr>
Sat, 21 Dec 2019 08:32:37 +0000 (08:32 +0000)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 27 Jan 2020 11:37:03 +0000 (22:37 +1100)
commit94dd54c51a410b9ffa6356c3ed2ab0317f998ded
tree786b3fa5323918fc302f8967f32dae0421f9c632
parent2e15001ea9ea110837a6eb6dba518416dedb4c39
powerpc/32s: Avoid crossing page boundary while changing SRR0/1.

Trying VMAP_STACK with KVM, vmlinux was not starting.
This was due to SRR0 and SRR1 clobbered by an ISI due to
the rfi being in a different page than the mtsrr0/1:

c0003fe0 <mmu_off>:
c0003fe0:       38 83 00 54     addi    r4,r3,84
c0003fe4:       7c 60 00 a6     mfmsr   r3
c0003fe8:       70 60 00 30     andi.   r0,r3,48
c0003fec:       4d 82 00 20     beqlr
c0003ff0:       7c 63 00 78     andc    r3,r3,r0
c0003ff4:       7c 9a 03 a6     mtsrr0  r4
c0003ff8:       7c 7b 03 a6     mtsrr1  r3
c0003ffc:       7c 00 04 ac     hwsync
c0004000:       4c 00 00 64     rfi

Align the 4 instruction block used to deactivate MMU to order 4,
so that the block never crosses a page boundary.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/30d2cda111b7977227fff067fa7e358440e2b3a4.1576916812.git.christophe.leroy@c-s.fr
arch/powerpc/kernel/head_32.S