]> git.proxmox.com Git - mirror_qemu.git/commit
hw/ppc/spapr_caps: Rework spapr_caps to use uint8 internal representation
authorSuraj Jitindar Singh <sjitindarsingh@gmail.com>
Fri, 12 Jan 2018 05:33:43 +0000 (16:33 +1100)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 6 Feb 2018 00:54:33 +0000 (18:54 -0600)
commit6a47136799c942bc8bc6eda0c39a2fe19b418864
treed21f8d0ac65718eefba3837f03355b3da12371b7
parente4f4fa00ebebe4b2c2f2ec2d27b7a2b77ce1c25f
hw/ppc/spapr_caps: Rework spapr_caps to use uint8 internal representation

Currently spapr_caps are tied to boolean values (on or off). This patch
reworks the caps so that they can have any uint8 value. This allows more
capabilities with various values to be represented in the same way
internally. Capabilities are numbered in ascending order. The internal
representation of capability values is an array of uint8s in the
sPAPRMachineState, indexed by capability number.

Capabilities can have their own name, description, options, getter and
setter functions, type and allow functions. They also each have their own
section in the migration stream. Capabilities are only migrated if they
were explictly set on the command line, with the assumption that
otherwise the default will match.

On migration we ensure that the capability value on the destination
is greater than or equal to the capability value from the source. So
long at this remains the case then the migration is considered
compatible and allowed to continue.

This patch implements generic getter and setter functions for boolean
capabilities. It also converts the existings cap-htm, cap-vsx and
cap-dfp capabilities to this new format.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
(cherry picked from commit 4e5fe3688e23d61b45cc549ff1322aff8f50ef45)
 Conflicts:
include/hw/ppc/spapr.h
*drop context dep on 60c6823b9bc
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/ppc/spapr.c
hw/ppc/spapr_caps.c
include/hw/ppc/spapr.h