powerpc: book3s: kvm: Don't abuse host r2 in exit path
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Mon, 11 Nov 2013 13:59:47 +0000 (19:29 +0530)
committerAlexander Graf <agraf@suse.de>
Wed, 18 Dec 2013 10:29:31 +0000 (11:29 +0100)
commit36e7bb38028d3d812aa7749208249d600a30c22c
tree44f9412d7b84a8c54c57edb11c1f4597f21df701
parentf5f972102d5c12729f0a35fce266b580aaa03f66
powerpc: book3s: kvm: Don't abuse host r2 in exit path

We don't use PACATOC for PR. Avoid updating HOST_R2 with PR
KVM mode when both HV and PR are enabled in the kernel. Without this we
get the below crash

(qemu)
Unable to handle kernel paging request for data at address 0xffffffffffff8310
Faulting instruction address: 0xc00000000001d5a4
cpu 0x2: Vector: 300 (Data Access) at [c0000001dc53aef0]
    pc: c00000000001d5a4: .vtime_delta.isra.1+0x34/0x1d0
    lr: c00000000001d760: .vtime_account_system+0x20/0x60
    sp: c0000001dc53b170
   msr: 8000000000009032
   dar: ffffffffffff8310
 dsisr: 40000000
  current = 0xc0000001d76c62d0
  paca    = 0xc00000000fef1100   softe: 0        irq_happened: 0x01
    pid   = 4472, comm = qemu-system-ppc
enter ? for help
[c0000001dc53b200c00000000001d760 .vtime_account_system+0x20/0x60
[c0000001dc53b290c00000000008d050 .kvmppc_handle_exit_pr+0x60/0xa50
[c0000001dc53b340c00000000008f51c kvm_start_lightweight+0xb4/0xc4
[c0000001dc53b510c00000000008cdf0 .kvmppc_vcpu_run_pr+0x150/0x2e0
[c0000001dc53b9e0c00000000008341c .kvmppc_vcpu_run+0x2c/0x40
[c0000001dc53ba50c000000000080af4 .kvm_arch_vcpu_ioctl_run+0x54/0x1b0
[c0000001dc53bae0c00000000007b4c8 .kvm_vcpu_ioctl+0x478/0x730
[c0000001dc53bca0c0000000002140cc .do_vfs_ioctl+0x4ac/0x770
[c0000001dc53bd80c0000000002143e8 .SyS_ioctl+0x58/0xb0
[c0000001dc53be30c000000000009e58 syscall_exit+0x0/0x98

Signed-off-by: Alexander Graf <agraf@suse.de>
arch/powerpc/include/asm/kvm_book3s_asm.h
arch/powerpc/kernel/asm-offsets.c
arch/powerpc/kvm/book3s_hv_rmhandlers.S