qemu-e2k/target-ppc
David Gibson ace9a2cbac target-ppc: KVM: Fix some kernel version edge cases for kvmppc_reset_htab()
The kvmppc_reset_htab() function invokes the KVM_PPC_ALLOCATE_HTAB vm ioctl
to request KVM to allocate and reset a hash page table for the guest - it
returns the size of hash table allocated, or 0 to indicate that qemu needs
to allocate the hash table itself.  In practice qemu needs to allocate the
htab for full emulation and with Book3sPR KVM, but the kernel has to
allocate it for Book3sHV KVM (the hash table needs to be physically
contiguous in that case).

Unfortunately, the logic in this function is incorrect for some existing
kernels.  Specifically:
  * at least some PR KVM versions advertise the relevant capability but
don't actually implement the ioctl(), returning ENOTTY.
  * For old kernels which don't have the capability, we currently return 0.
This is correct for PV KVM, where we need to allocate the htab, but not for
HV KVM - kernels of this era always allocate a 16MB hash table per guest.

This patch corrects both of these edge cases.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
2012-10-04 15:54:18 +02:00
..
cpu-qom.h
cpu.h
excp_helper.c
fpu_helper.c
helper_regs.h
helper.c
helper.h
int_helper.c target-ppc: get rid of the HANDLE_NAN{1, 2, 3} macros 2012-10-04 15:54:17 +02:00
kvm_ppc.c
kvm_ppc.h pseries: Add support for new KVM hash table control call 2012-10-04 15:54:17 +02:00
kvm.c target-ppc: KVM: Fix some kernel version edge cases for kvmppc_reset_htab() 2012-10-04 15:54:18 +02:00
machine.c
Makefile.objs
mem_helper.c
mfrom_table_gen.c
mfrom_table.c
misc_helper.c
mmu_helper.c
mpic_helper.c
STATUS
timebase_helper.c
translate_init.c
translate.c Emit debug_insn for CPU_LOG_TB_OP_OPT as well. 2012-09-27 21:38:50 +02:00