qemu-patch-raspberry4/target/ppc
David Gibson d5fc133eed ppc: Rework CPU compatibility testing across migration
Migrating between different CPU versions is a bit complicated for ppc.
A long time ago, we ensured identical CPU versions at either end by
checking the PVR had the same value.  However, this breaks under KVM
HV, because we always have to use the host's PVR - it's not
virtualized.  That would mean we couldn't migrate between hosts with
different PVRs, even if the CPUs are close enough to compatible in
practice (sometimes identical cores with different surrounding logic
have different PVRs, so this happens in practice quite often).

So, we removed the PVR check, but instead checked that several flags
indicating supported instructions matched.  This turns out to be a bad
idea, because those instruction masks are not architected information, but
essentially a TCG implementation detail.  So changes to qemu internal CPU
modelling can break migration - this happened between qemu-2.6 and
qemu-2.7.  That was addressed by 146c11f1 "target-ppc: Allow eventual
removal of old migration mistakes".

Now, verification of CPU compatibility across a migration basically doesn't
happen.  We simply ignore the PVR of the incoming migration, and hope the
cpu on the destination is close enough to work.

Now that we've cleaned up handling of processor compatibility modes
for pseries machine type, we can do better.  For new machine types
(pseries-2.10+) We allow migration if:

    * The source and destination PVRs are for the same type of CPU, as
      determined by CPU class's pvr_match function
OR  * When the source was in a compatibility mode, and the destination CPU
      supports the same compatibility mode

For older machine types we retain the existing behaviour - current CAS
code will usually set a compat mode which would break backwards
migration if we made them use the new behaviour. [Fixed from an
earlier version by Greg Kurz].

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
Tested-by: Andrea Bolognani <abologna@redhat.com>
2017-06-30 14:03:31 +10:00
..
translate target-ppc: Add xscvqpudz and xscvqpuwz instructions 2017-02-22 11:28:28 +11:00
arch_dump.c target/ppc: Fix size of struct PPCElfPrstatus 2017-04-26 12:41:55 +10:00
compat.c pseries: Move CPU compatibility property to machine 2017-06-30 14:03:31 +10:00
cpu-models.c target/ppc/cpu-models: Fix/remove bad CPU aliases 2017-01-31 13:46:26 +11:00
cpu-models.h target/ppc: Allow workarounds for POWER9 DD1 2017-05-11 09:45:15 +10:00
cpu-qom.h spapr: Add ibm,processor-radix-AP-encodings to the device tree 2017-04-26 12:00:41 +10:00
cpu.c target/ppc: support for 32-bit carry and overflow 2017-03-01 11:23:39 +11:00
cpu.h ppc: Rework CPU compatibility testing across migration 2017-06-30 14:03:31 +10:00
dfp_helper.c
excp_helper.c target/ppc: reset reservation in do_rfi() 2017-05-24 11:39:52 +10:00
fpu_helper.c target/ppc: use helper for excp handling 2017-03-06 13:17:28 +11:00
gdbstub.c
helper.h target/ppc: Flush TLB on write to PIDR 2017-04-26 12:41:56 +10:00
helper_regs.h cputlb: drop flush_global flag from tlb_flush 2017-01-13 14:24:37 +00:00
int_helper.c target/ppc: introduce helper_update_ov_legacy 2017-03-01 11:23:39 +11:00
internal.h target-ppc: implement load atomic instruction 2017-02-22 11:28:27 +11:00
kvm-stub.c
kvm.c target/ppc: fix memory leak in kvmppc_is_mem_backend_page_size_ok() 2017-06-08 11:05:31 +10:00
kvm_ppc.h target/ppc: pass const string to kvmppc_is_mem_backend_page_size_ok() 2017-06-08 11:05:31 +10:00
machine.c ppc: Rework CPU compatibility testing across migration 2017-06-30 14:03:31 +10:00
Makefile.objs target/ppc: Implement ISA V3.00 radix page fault handler 2017-05-11 09:45:15 +10:00
mem_helper.c target-ppc: implement stxvll instructions 2017-01-31 10:10:13 +11:00
mfrom_table.c
mfrom_table_gen.c
misc_helper.c target/ppc: Flush TLB on write to PIDR 2017-04-26 12:41:56 +10:00
mmu-book3s-v3.c target/ppc: Implement ISA V3.00 radix page fault handler 2017-05-11 09:45:15 +10:00
mmu-book3s-v3.h target/ppc: Implement ISA V3.00 radix page fault handler 2017-05-11 09:45:15 +10:00
mmu-hash32.c target/ppc: Eliminate htab_base and htab_mask variables 2017-03-01 11:23:39 +11:00
mmu-hash32.h target/ppc: Manage external HPT via virtual hypervisor 2017-03-01 11:23:39 +11:00
mmu-hash64.c spapr: Small cleanup of PPC MMU enums 2017-03-03 11:30:59 +11:00
mmu-hash64.h target/ppc: Correct SDR1 masking 2017-03-01 11:23:39 +11:00
mmu-radix64.c target/ppc: Implement ISA V3.00 radix page fault handler 2017-05-11 09:45:15 +10:00
mmu-radix64.h target/ppc: Implement ISA V3.00 radix page fault handler 2017-05-11 09:45:15 +10:00
mmu_helper.c spapr: Small cleanup of PPC MMU enums 2017-03-03 11:30:59 +11:00
monitor.c monitor: Fix crashes when using HMP commands without CPU 2017-02-21 18:29:01 +00:00
STATUS
timebase_helper.c
trace-events
translate.c target/ppc: Change tlbie invalid fields for POWER9 support 2017-05-11 09:45:15 +10:00
translate_init.c ppc: Rework CPU compatibility testing across migration 2017-06-30 14:03:31 +10:00
user_only_helper.c