]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit - arch/powerpc/kernel/exceptions-64s.S
KVM: PPC: Book3S: 64-bit CONFIG_RELOCATABLE support for interrupts
authorNicholas Piggin <npiggin@gmail.com>
Tue, 28 Mar 2017 16:54:18 +0000 (13:54 -0300)
committerTim Gardner <tim.gardner@canonical.com>
Tue, 28 Mar 2017 20:17:54 +0000 (14:17 -0600)
commitf148cf067c8a00af768a79c176e5166d8fc168ee
tree8bf43bd57d7b0538362b288a65ff91e15b5016cf
parent13ed73eba841397db8e1b112a907a268239257a0
KVM: PPC: Book3S: 64-bit CONFIG_RELOCATABLE support for interrupts

BugLink: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1675806
64-bit Book3S exception handlers must find the dynamic kernel base
to add to the target address when branching beyond __end_interrupts,
in order to support kernel running at non-0 physical address.

Support this in KVM by branching with CTR, similarly to regular
interrupt handlers. The guest CTR saved in HSTATE_SCRATCH1 and
restored after the branch.

Without this, the host kernel hangs and crashes randomly when it is
running at a non-0 address and a KVM guest is started.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Acked-by: Paul Mackerras <paulus@ozlabs.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
(cherry picked from commit a97a65d53d9f53b6897dc1b2aed381bc1707136b)
Signed-off-by: Breno Leitao <breno.leitao@gmail.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
arch/powerpc/include/asm/exception-64s.h
arch/powerpc/kernel/exceptions-64s.S
arch/powerpc/kvm/book3s_hv_rmhandlers.S
arch/powerpc/kvm/book3s_segment.S