KVM: PPC: Move kvm_vcpu_ioctl_[gs]et_one_reg down to platform-specific code
authorPaul Mackerras <paulus@samba.org>
Mon, 12 Dec 2011 12:26:50 +0000 (12:26 +0000)
committerAvi Kivity <avi@redhat.com>
Mon, 5 Mar 2012 12:52:41 +0000 (14:52 +0200)
commit31f3438eca2fc90dc892e0e9963ba4b93a2c8383
tree21f3b35bf1941c3429299987564bdca3b1dd64e7
parent1022fc3d3bfaca09d5d6bfcc93a168de16840814
KVM: PPC: Move kvm_vcpu_ioctl_[gs]et_one_reg down to platform-specific code

This moves the get/set_one_reg implementation down from powerpc.c into
booke.c, book3s_pr.c and book3s_hv.c.  This avoids #ifdefs in C code,
but more importantly, it fixes a bug on Book3s HV where we were
accessing beyond the end of the kvm_vcpu struct (via the to_book3s()
macro) and corrupting memory, causing random crashes and file corruption.

On Book3s HV we only accept setting the HIOR to zero, since the guest
runs in supervisor mode and its vectors are never offset from zero.

Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
[agraf update to apply on top of changed ONE_REG patches]
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/powerpc/include/asm/kvm_ppc.h
arch/powerpc/kvm/book3s_hv.c
arch/powerpc/kvm/book3s_pr.c
arch/powerpc/kvm/booke.c
arch/powerpc/kvm/powerpc.c
This page took 0.026887 seconds and 5 git commands to generate.