qemu-patch-raspberry4/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 target-ppc: QOM'ify CPU 2012-04-15 17:10:30 +02:00
cpu.h PPC: BookE206: Bump MAS2 to 64bit 2012-06-24 01:04:52 +02:00
excp_helper.c PPC: Add support for MSR_CM 2012-06-24 01:04:51 +02:00
fpu_helper.c ppc: Add missing break 2012-06-24 01:04:43 +02:00
helper.c ppc: Move misc helpers from helper.c to misc_helper.c 2012-06-24 01:04:43 +02:00
helper.h PPC: BookE: Implement EPR SPR 2012-06-24 01:04:52 +02:00
helper_regs.h Replace always_inline with inline 2009-08-16 09:06:54 +00:00
int_helper.c target-ppc: get rid of the HANDLE_NAN{1, 2, 3} macros 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
kvm_ppc.c Replace Qemu by QEMU in comments 2012-04-07 14:00:45 +00:00
kvm_ppc.h pseries: Add support for new KVM hash table control call 2012-10-04 15:54:17 +02:00
machine.c target-ppc/machine.c: Drop unnecessary ifdefs 2012-04-15 18:23:47 +02:00
Makefile.objs PPC: BookE: Implement EPR SPR 2012-06-24 01:04:52 +02:00
mem_helper.c PPC: Add support for MSR_CM 2012-06-24 01:04:51 +02:00
mfrom_table.c find -type f | xargs sed -i 's/[\t ]$//g' # on most files 2007-09-16 21:08:06 +00:00
mfrom_table_gen.c fix spelling in target sub directory 2011-12-02 10:50:57 +00:00
misc_helper.c ppc: Move misc helpers from helper.c to misc_helper.c 2012-06-24 01:04:43 +02:00
mmu_helper.c ppc64: Rudimentary Support for extra page sizes on server CPUs 2012-06-24 01:04:44 +02:00
mpic_helper.c PPC: BookE: Implement EPR SPR 2012-06-24 01:04:52 +02:00
STATUS Fix typos in comments (chek -> check) 2011-05-22 22:31:45 +01:00
timebase_helper.c ppc: Avoid AREG0 for timebase helpers 2012-06-24 01:04:43 +02:00
translate.c Emit debug_insn for CPU_LOG_TB_OP_OPT as well. 2012-09-27 21:38:50 +02:00
translate_init.c win32: provide separate macros for weak decls and definitions 2012-08-15 13:26:03 -05:00