pseries: Split CAS PVR negotiation out into a separate function
commit80c33d343f068012348869e16e579375c8911a04
authorDavid Gibson <david@gibson.dropbear.id.au>
Thu, 18 May 2017 04:47:44 +0000 (18 14:47 +1000)
committerDavid Gibson <david@gibson.dropbear.id.au>
Wed, 24 May 2017 01:39:53 +0000 (24 11:39 +1000)
treec43f329fba7953ba7e14e5ce100917b351edcd1a
parent3d85885a1b1f389d38ae3c71e439635207cfcf4d
pseries: Split CAS PVR negotiation out into a separate function

Guests of the qemu machine type go through a feature negotiation process
known as "client architecture support" (CAS) during early boot.  This does
a number of things, one of which is finding a CPU compatibility mode which
can be supported by both guest and host.

In fact the CPU negotiation is probably the single most complex part of the
CAS process, so this splits it out into a helper function.  We've recently
made some mistakes in maintaining backward compatibility for old machine
types here.  Splitting this out will also make it easier to fix this.

This also adds a possibly useful error message if the negotiation fails
(i.e. if there isn't a CPU mode that's suitable for both guest and host).

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
hw/ppc/spapr_hcall.c