]> Pileus Git - ~andy/linux/commit
KVM: PPC: Book3S HV: Provide a way for userspace to get/set per-vCPU areas
authorPaul Mackerras <paulus@samba.org>
Tue, 25 Sep 2012 20:33:06 +0000 (20:33 +0000)
committerAlexander Graf <agraf@suse.de>
Fri, 5 Oct 2012 21:38:55 +0000 (23:38 +0200)
commit55b665b0263ae88a776071306ef1eee4b769016b
treec83b5a0f8961ecac8a708cbdeb01f41d5b685d9e
parenta8bd19ef4dd49f0eef86a4a8eb43d60f967236b8
KVM: PPC: Book3S HV: Provide a way for userspace to get/set per-vCPU areas

The PAPR paravirtualization interface lets guests register three
different types of per-vCPU buffer areas in its memory for communication
with the hypervisor.  These are called virtual processor areas (VPAs).
Currently the hypercalls to register and unregister VPAs are handled
by KVM in the kernel, and userspace has no way to know about or save
and restore these registrations across a migration.

This adds "register" codes for these three areas that userspace can
use with the KVM_GET/SET_ONE_REG ioctls to see what addresses have
been registered, and to register or unregister them.  This will be
needed for guest hibernation and migration, and is also needed so
that userspace can unregister them on reset (otherwise we corrupt
guest memory after reboot by writing to the VPAs registered by the
previous kernel).

The "register" for the VPA is a 64-bit value containing the address,
since the length of the VPA is fixed.  The "registers" for the SLB
shadow buffer and dispatch trace log (DTL) are 128 bits long,
consisting of the guest physical address in the high (first) 64 bits
and the length in the low 64 bits.

This also fixes a bug where we were calling init_vpa unconditionally,
leading to an oops when unregistering the VPA.

Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
Documentation/virtual/kvm/api.txt
arch/powerpc/include/asm/kvm.h
arch/powerpc/include/asm/kvm_ppc.h
arch/powerpc/kvm/book3s_hv.c