qemu-e2k/hw/ppc
Nicholas Piggin 21d3a78ed9 target/ppc: Fix host PVR matching for KVM
ppc_cpu_compare_class_pvr_mask() should match the best CPU class in the
family, because it is used by the KVM subsystem to find the host CPU
class. Since commit 03ae4133ab ("target-ppc: Add pvr_match()
callback"), it matches any class in the family (the first one in the
comparison list).

Since commit f30c843ced ("ppc/pnv: Introduce PowerNV machines with
fixed CPU models"), pnv has relied on pnv_match having these new
semantics to check machine compatibility with a CPU family.

Resolve this by adding a parameter to the pvr_match function to select
the best or any match, and restore the old behaviour for the KVM case.

Prior to this fix, e.g., a POWER9 DD2.3 KVM host matches to the
power9_v1.0 class (because that happens to be the first POWER9 family
CPU compared). After the patch, it matches the power9_v2.0 class.

This approach requires pnv_match contain knowledge of the CPU classes
implemented in the same family, which feels ugly. But pushing the 'best'
match down to the class would still require they know about one another
which is not obviously much better. For now this gets things working.

Fixes: 03ae4133ab ("target-ppc: Add pvr_match() callback")
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Message-Id: <20220731013358.170187-1-npiggin@gmail.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
2022-08-30 16:20:29 -03:00
..
e500-ccsr.h
e500.c hw/ppc: pass random seed to fdt 2022-07-18 13:59:43 -03:00
e500.h
e500plat.c
fdt.c
fw_cfg.c
Kconfig
mac_newworld.c ppc/6xx: Allocate IRQ lines with qdev_init_gpio_in() 2022-07-18 13:59:43 -03:00
mac_oldworld.c ppc/6xx: Allocate IRQ lines with qdev_init_gpio_in() 2022-07-18 13:59:43 -03:00
mac.h
meson.build
mpc8544_guts.c
mpc8544ds.c
pef.c
pegasos2.c ppc/6xx: Allocate IRQ lines with qdev_init_gpio_in() 2022-07-18 13:59:43 -03:00
pnv_bmc.c Remove qemu-common.h include from most units 2022-04-06 14:31:55 +02:00
pnv_core.c
pnv_homer.c
pnv_lpc.c ppc/pnv: Remove PnvLpcController::psi link 2022-04-20 18:00:30 -03:00
pnv_occ.c ppc/pnv: Remove PnvOCC::psi link 2022-04-20 18:00:30 -03:00
pnv_pnor.c block: Change blk_{pread,pwrite}() param order 2022-07-12 12:14:56 +02:00
pnv_psi.c ppc/pnv: Remove useless checks in set_irq handlers 2022-04-20 18:00:30 -03:00
pnv_xscom.c
pnv.c target/ppc: Fix host PVR matching for KVM 2022-08-30 16:20:29 -03:00
ppc4xx_devs.c Use g_new() & friends where that makes obvious sense 2022-03-21 15:44:44 +01:00
ppc4xx_pci.c
ppc405_boards.c hw/ppc/ppc405_boards: Initialize g_autofree pointer 2022-04-20 18:00:30 -03:00
ppc405_uc.c ppc/40x: Allocate IRQ lines with qdev_init_gpio_in() 2022-07-18 13:59:43 -03:00
ppc405.h
ppc440_bamboo.c ppc/40x: Allocate IRQ lines with qdev_init_gpio_in() 2022-07-18 13:59:43 -03:00
ppc440_pcix.c
ppc440_uc.c hw/ppc/ppc440_uc: Initialize length passed to cpu_physical_memory_map() 2022-07-28 10:31:54 -03:00
ppc440.h
ppc_booke.c Use g_new() & friends where that makes obvious sense 2022-03-21 15:44:44 +01:00
ppc.c ppc/e500: Allocate IRQ lines with qdev_init_gpio_in() 2022-07-18 13:59:43 -03:00
ppce500_spin.c
prep_systemio.c ppc/6xx: Allocate IRQ lines with qdev_init_gpio_in() 2022-07-18 13:59:43 -03:00
prep.c ppc/6xx: Allocate IRQ lines with qdev_init_gpio_in() 2022-07-18 13:59:43 -03:00
rs6000_mc.c
sam460ex.c hw/ppc: sam460ex.c: store all GPIO lines in mal_irqs[] 2022-08-04 15:20:14 -03:00
spapr_caps.c Trivial: 3 char repeat typos 2022-06-28 11:06:02 +02:00
spapr_cpu_core.c hw/ppc: free env->tb_env in spapr_unrealize_vcpu() 2022-04-04 08:49:06 +02:00
spapr_drc.c hw/ppc/spapr_drc.c: use g_autofree in spapr_drc_by_index() 2022-03-02 06:51:40 +01:00
spapr_events.c Use g_new() & friends where that makes obvious sense 2022-03-21 15:44:44 +01:00
spapr_hcall.c ppc: Check partition and process table alignment 2022-07-18 13:59:43 -03:00
spapr_iommu.c spapr/ddw: Reset DMA when the last non-default window is removed 2022-07-06 10:22:37 -03:00
spapr_irq.c
spapr_numa.c Remove qemu-common.h include from most units 2022-04-06 14:31:55 +02:00
spapr_nvdimm.c hw/ppc: check if spapr_drc_index() returns NULL in spapr_nvdimm.c 2022-07-28 10:31:54 -03:00
spapr_ovec.c
spapr_pci_nvlink2.c Remove qemu-common.h include from most units 2022-04-06 14:31:55 +02:00
spapr_pci_vfio.c
spapr_pci.c spapr/ddw: Implement 64bit query extension 2022-07-06 10:22:37 -03:00
spapr_rng.c
spapr_rtas_ddw.c spapr/ddw: Implement 64bit query extension 2022-07-06 10:22:37 -03:00
spapr_rtas.c hw/ppc: change indentation to spaces from TABs 2022-04-20 18:00:30 -03:00
spapr_rtc.c
spapr_softmmu.c osdep: Move memalign-related functions to their own header 2022-03-07 13:16:49 +00:00
spapr_tpm_proxy.c Remove qemu-common.h include from most units 2022-04-06 14:31:55 +02:00
spapr_vio.c hw/ppc/spapr_vio.c: use g_autofree in spapr_dt_vdevice() 2022-03-02 06:51:40 +01:00
spapr_vof.c Remove qemu-common.h include from most units 2022-04-06 14:31:55 +02:00
spapr.c ppc: Check partition and process table alignment 2022-07-18 13:59:43 -03:00
trace-events
trace.h
virtex_ml507.c ppc/40x: Allocate IRQ lines with qdev_init_gpio_in() 2022-07-18 13:59:43 -03:00
vof.c ppc/vof: Fix uninitialized string tracing 2022-04-20 18:00:30 -03:00