]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit821726e9f85eb7cba49fcebe303a3e9a13362909
tree21f3b35bf1941c3429299987564bdca3b1dd64e7
parent35c98f258657122ef95ed5b692244ef25f4b669b
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