• S
    hw/ppc/spapr_caps: Rework spapr_caps to use uint8 internal representation · 4e5fe368
    Suraj Jitindar Singh 提交于
    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: NDavid Gibson <david@gibson.dropbear.id.au>
    4e5fe368
spapr_caps.c 10.6 KB