qemu-e2k/hw/ppc
Daniel Henrique Barboza 07b10bc42c spapr.c: set a 'kvm-type' default value instead of relying on NULL
spapr_kvm_type() is considering 'vm_type=NULL' as a valid input, where
the function returns 0. This is relying on the current QEMU machine
options handling logic, where the absence of the 'kvm-type' option
will be reflected as 'vm_type=NULL' in this function.

This is not robust, and will break if QEMU options code decides to propagate
something else in the case mentioned above (e.g. an empty string instead
of NULL).

Let's avoid this entirely by setting a non-NULL default value in case of
no user input for 'kvm-type'. spapr_kvm_type() was changed to handle 3 fixed
values of kvm-type: "auto", "hv", and "pr", with "auto" being the default
if no kvm-type was set by the user. This allows us to always be predictable
regardless of any enhancements/changes made in QEMU options mechanics.

While we're at it, let's also document in 'kvm-type' description the
already existing default mode, now named 'auto'. The information provided
about it is based on how the pseries kernel handles the KVM_CREATE_VM
ioctl(), where the default value '0' makes the kernel choose an available
KVM module to use, giving precedence to kvm_hv. This logic is described in
the kernel source file arch/powerpc/kvm/powerpc.c, function kvm_arch_init_vm().

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Message-Id: <20201210145517.1532269-2-danielhb413@gmail.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Greg Kurz <groug@kaod.org>
2020-12-14 15:54:12 +11:00
..
e500-ccsr.h Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
e500.c ppc/e500: Free irqs array to avoid memleak 2020-12-14 15:54:12 +11:00
e500.h Use OBJECT_DECLARE_TYPE when possible 2020-09-18 14:12:32 -04:00
e500plat.c
fdt.c
fw_cfg.c
Kconfig
mac_newworld.c vl: extract softmmu/datadir.c 2020-12-10 12:15:18 -05:00
mac_oldworld.c vl: extract softmmu/datadir.c 2020-12-10 12:15:18 -05:00
mac.h mac_newworld: Allow loading binary ROM image 2020-10-19 08:11:21 +01:00
meson.build ppc: introducing spapr_numa.c NUMA code helper 2020-09-08 10:08:43 +10:00
mpc8544_guts.c Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
mpc8544ds.c
pnv_bmc.c ppc/pnv: Add a HIOMAP erase command 2020-09-08 10:08:42 +10:00
pnv_core.c non-virt: Fix Lesser GPL version number 2020-11-15 16:38:24 +01:00
pnv_homer.c
pnv_lpc.c non-virt: Fix Lesser GPL version number 2020-11-15 16:38:24 +01:00
pnv_occ.c
pnv_pnor.c
pnv_psi.c non-virt: Fix Lesser GPL version number 2020-11-15 16:38:24 +01:00
pnv_xscom.c non-virt: Fix Lesser GPL version number 2020-11-15 16:38:24 +01:00
pnv.c vl: extract softmmu/datadir.c 2020-12-10 12:15:18 -05:00
ppc4xx_devs.c
ppc4xx_pci.c Pull request trivial patches 20200919 2020-09-22 15:42:23 +01:00
ppc405_boards.c vl: extract softmmu/datadir.c 2020-12-10 12:15:18 -05:00
ppc405_uc.c
ppc405.h
ppc440_bamboo.c vl: extract softmmu/datadir.c 2020-12-10 12:15:18 -05:00
ppc440_pcix.c Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
ppc440_uc.c Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
ppc440.h
ppc_booke.c
ppc.c hw/ppc: Do not re-read the clock on pre_save if doing savevm 2020-12-14 15:54:12 +11:00
ppce500_spin.c powerpc tcg: Fix Lesser GPL version number 2020-11-15 16:38:50 +01:00
prep_systemio.c Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
prep.c ppc: do not use ram_size global 2020-12-10 12:15:09 -05:00
rs6000_mc.c Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
sam460ex.c vl: extract softmmu/datadir.c 2020-12-10 12:15:18 -05:00
spapr_caps.c spapr: Add a return value to spapr_check_pagesize() 2020-10-09 10:15:06 +11:00
spapr_cpu_core.c spapr: Simplify spapr_cpu_core_realize() and spapr_cpu_core_unrealize() 2020-10-28 01:08:53 +11:00
spapr_drc.c spapr: spapr_drc_attach() cannot fail 2020-12-14 15:54:12 +11:00
spapr_events.c spapr: Pass sPAPR machine state to some RTAS events handling functions 2020-12-14 15:54:12 +11:00
spapr_hcall.c spapr: Pass sPAPR machine state down to spapr_pci_switch_vga() 2020-12-14 15:54:12 +11:00
spapr_iommu.c memory: Add IOMMUTLBEvent 2020-12-08 13:48:57 -05:00
spapr_irq.c spapr/xics: Drop unused argument to xics_kvm_has_broken_disconnect() 2020-12-14 15:50:55 +11:00
spapr_numa.c spapr_numa: consider user input when defining associativity 2020-10-09 15:06:11 +11:00
spapr_nvdimm.c spapr: spapr_drc_attach() cannot fail 2020-12-14 15:54:12 +11:00
spapr_ovec.c
spapr_pci_nvlink2.c spapr_numa: move NVLink2 associativity handling to spapr_numa.c 2020-09-08 10:08:43 +10:00
spapr_pci_vfio.c
spapr_pci.c spapr: Don't use qdev_get_machine() in spapr_msi_write() 2020-12-14 15:54:12 +11:00
spapr_rng.c Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
spapr_rtas_ddw.c
spapr_rtas.c pseries: fix kvmppc_set_fwnmi() 2020-07-27 11:09:25 +10:00
spapr_rtc.c
spapr_tpm_proxy.c
spapr_vio.c ppc: do not use ram_size global 2020-12-10 12:15:09 -05:00
spapr.c spapr.c: set a 'kvm-type' default value instead of relying on NULL 2020-12-14 15:54:12 +11:00
trace-events hw/ppc/spapr_tpm_proxy: Fix hexadecimal format string specifier 2020-12-14 15:54:12 +11:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00
virtex_ml507.c vl: extract softmmu/datadir.c 2020-12-10 12:15:18 -05:00