mirror_qemu/target-ppc
Alexey Kardashevskiy 0ddbd05362 spapr/target-ppc/kvm: Only add hcall-instructions if KVM supports it
ePAPR defines "hcall-instructions" device-tree property which contains
code to call hypercalls in ePAPR paravirtualized guests.  In general
pseries guests won't use this property, instead using the PAPR defined
hypercall interface.

However, this property has been re-used to implement a hack to allow
PR KVM to run (slightly modified) guests in some situations where it
otherwise wouldn't be able to (because the system's L0 hypervisor
doesn't forward the PAPR hypercalls to the PR KVM kernel).

Hence, this property is always present in the device tree for pseries
guests. All KVM guests use it at least to read features via the
KVM_HC_FEATURES hypercall.

The property is populated by the code returned from the KVM's
KVM_PPC_GET_PVINFO ioctl; if not implemented in the KVM, QEMU supplies
code which will fail all hypercall attempts. If QEMU does not create
the property, and the guest kernel is compiled with
CONFIG_EPAPR_PARAVIRT (which is normally the case), there is exactly
the same stub at @epapr_hypercall_start already.

Rather than maintaining this fairly useless stub implementation, it
makes more sense not to create the property in the device tree in the
first place if the host kernel does not implement it.

This changes kvmppc_get_hypercall() to return 1 if the host kernel
does not implement KVM_CAP_PPC_GET_PVINFO. The caller can use it to decide
on whether to create the property or not.

This changes the pseries machine to not create the property if KVM does
not implement KVM_PPC_GET_PVINFO. In practice this means that from now
on the property will not be created if either HV KVM or TCG is used.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
[reworded commit message for clarity --dwg]
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-03-24 11:17:33 +11:00
..
Makefile.objs kvm_ppc: remove kvmppc_timer_hack 2015-09-20 22:48:38 +02:00
STATUS target-ppc: remove powerpc 970gx 2014-03-05 03:06:23 +01:00
arch_dump.c ppc: Clean up includes 2016-01-29 15:07:22 +00:00
cpu-models.c target-ppc: Add PVR for POWER8NVL processor 2016-03-16 09:55:05 +11:00
cpu-models.h target-ppc: Add PVR for POWER8NVL processor 2016-03-16 09:55:05 +11:00
cpu-qom.h dump: qemunotes aren't commonly needed 2016-01-15 14:40:24 +00:00
cpu.h ppc: Add a few more P8 PMU SPRs 2016-03-16 09:55:05 +11:00
dfp_helper.c ppc: Clean up includes 2016-01-29 15:07:22 +00:00
excp_helper.c ppc: Clean up includes 2016-01-29 15:07:22 +00:00
fpu_helper.c ppc: Clean up includes 2016-01-29 15:07:22 +00:00
gdbstub.c target-ppc: rename and export maybe_bswap_register() 2016-01-30 23:37:37 +11:00
helper.h target-ppc: Split 44x tlbiva from ppc_tlb_invalidate_one() 2016-01-30 23:49:26 +11:00
helper_regs.h PPC: Only enter MSR_POW when no interrupts pending 2014-04-08 11:20:05 +02:00
int_helper.c ppc: Clean up includes 2016-01-29 15:07:22 +00:00
kvm-stub.c ppc: Clean up includes 2016-01-29 15:07:22 +00:00
kvm.c spapr/target-ppc/kvm: Only add hcall-instructions if KVM supports it 2016-03-24 11:17:33 +11:00
kvm_ppc.h target-ppc: Add helpers for updating a CPU's SDR1 and external HPT 2016-03-16 09:55:06 +11:00
machine.c target-ppc: Rework SLB page size lookup 2016-01-30 23:37:38 +11:00
mem_helper.c ppc: Clean up includes 2016-01-29 15:07:22 +00:00
mfrom_table.c
mfrom_table_gen.c ppc: Clean up includes 2016-01-29 15:07:22 +00:00
misc_helper.c ppc: Clean up includes 2016-01-29 15:07:22 +00:00
mmu-hash32.c log: do not unnecessarily include qom/cpu.h 2016-02-03 09:19:10 +00:00
mmu-hash32.h target-ppc: Convert mmu-hash{32,64}.[ch] from CPUPPCState to PowerPCCPU 2016-01-30 23:37:38 +11:00
mmu-hash64.c target-ppc: Eliminate kvmppc_kern_htab global 2016-03-16 09:55:06 +11:00
mmu-hash64.h target-ppc: Eliminate kvmppc_kern_htab global 2016-03-16 09:55:06 +11:00
mmu_helper.c target-ppc: Add helpers for updating a CPU's SDR1 and external HPT 2016-03-16 09:55:06 +11:00
monitor.c ppc: Clean up includes 2016-01-29 15:07:22 +00:00
timebase_helper.c ppc: Clean up includes 2016-01-29 15:07:22 +00:00
translate.c tcg: Add type for vCPU pointers 2016-03-01 13:27:09 +00:00
translate_init.c ppc64: set MSR_SF bit 2016-03-24 11:17:33 +11:00
user_only_helper.c ppc: Clean up includes 2016-01-29 15:07:22 +00:00