]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/64s: Fix hypercall entry clobbering r12 input
authorNicholas Piggin <npiggin@gmail.com>
Tue, 18 Jul 2017 05:32:44 +0000 (15:32 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 18 Jul 2017 06:45:11 +0000 (16:45 +1000)
commit4c00bd7643ff1e66680a382e2ecb02b8b25385ce
treea864cd3c7a3f4713d916fb11aa4523b56cfa3502
parenta9f14f396deffdebe4c979d4803f06c02ca3173e
powerpc/64s: Fix hypercall entry clobbering r12 input

A previous optimisation incorrectly assumed the PAPR hcall does
not use r12, and clobbers it upon entry. In fact it is used as
an input. This can result in KVM guests crashing (observed with
PR KVM).

Instead of using r12 to save r13, tihs patch saves r13 in ctr.
This is more costly, but not as slow as using the SPRG.

Fixes: 44feff99f97f8 ("powerpc/64s: Optimize hypercall/syscall entry")
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/kernel/exceptions-64s.S