• P
    target-arm: Split NO_MIGRATE into ALIAS and NO_RAW · 7a0e58fa
    Peter Maydell 提交于
    We currently mark ARM coprocessor/system register definitions with
    the flag ARM_CP_NO_MIGRATE for two different reasons:
    1) register is an alias on to state that's also visible via
       some other register, and that other register is the one
       responsible for migrating the state
    2) register is not actually state at all (for instance the TLB
       or cache maintenance operation "registers") and it makes no
       sense to attempt to migrate it or otherwise access the raw state
    
    This works fine for identifying which registers should be ignored
    when performing migration, but we also use the same functions for
    synchronizing system register state between QEMU and the kernel
    when using KVM. In this case we don't want to try to sync state
    into registers in category 2, but we do want to sync into registers
    in category 1, because the kernel might have picked a different
    one of the aliases as its choice for which one to expose for
    migration. (In particular, on 32 bit hosts the kernel will
    expose the state in the AArch32 version of the register, but
    TCG's convention is to mark the AArch64 version as the version
    to migrate, even if the CPU being emulated happens to be 32 bit,
    so almost all system registers will hit this issue now that we've
    added AArch64 system emulation.)
    
    Fix this by splitting the NO_MIGRATE flag in two (ALIAS and NO_RAW)
    corresponding to the two different reasons we might not want to
    migrate a register. When setting up the TCG list of registers to
    migrate we honour both flags; when populating the list from KVM,
    only ignore registers which are NO_RAW.
    Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
    Reviewed-by: NGreg Bellows <greg.bellows@linaro.org>
    Message-id: 1422282372-13735-2-git-send-email-peter.maydell@linaro.org
    [PMM: changed ARM_CP_NO_MIGRATE to ARM_CP_ALIAS on new SP_EL1 and
     SP_EL2 reginfo stanzas since there was a (semantic) merge conflict
     with the patchset that added those]
    7a0e58fa
cpu.h 66.1 KB