]> git.proxmox.com Git - mirror_qemu.git/commit
pseries: Rewrite CAS PVR compatibility logic
authorDavid Gibson <david@gibson.dropbear.id.au>
Wed, 16 Nov 2016 02:54:48 +0000 (13:54 +1100)
committerDavid Gibson <david@gibson.dropbear.id.au>
Mon, 30 Jan 2017 23:10:14 +0000 (10:10 +1100)
commit152ef803ceb1959e2380a1da7736b935b109222e
treeb70903c557334dd1149de261e9dbe5052b3ae73e
parentef291226494f53f10c5cbe90bff550a52bda7b76
pseries: Rewrite CAS PVR compatibility logic

During boot, PAPR guests negotiate CPU model support with the
ibm,client-architecture-support mechanism.  The logic to implement this in
qemu is very convoluted.  This cleans it up to be cleaner, using the new
ppc_check_compat() call.

The new logic for choosing a compatibility mode is:
    1. Usually, use the most recent compatibility mode that is
            a) supported by the guest
            b) supported by the CPU
        and c) no later than the maximum allowed (if specified)
    2. If no suitable compatibility mode was found, the guest *does*
       support this CPU explicitly, and no maximum compatibility mode is
       specified, then use "raw" mode for the current CPU
    3. Otherwise, fail the boot.

This differs from the results of the old code: the old code preferred using
"raw" mode to a compatibility mode, whereas the new code prefers a
compatibility mode if available.  Using compatibility mode preferentially
means that we're more likely to be able to migrate the guest to a similar
but not identical host.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/ppc/spapr_hcall.c
hw/ppc/trace-events