• A
    target-ppc: add PowerPCCPU::cpu_dt_id · 0ce470cd
    Alexey Kardashevskiy 提交于
    Normally CPUState::cpu_index is used to pick the right CPU for various
    operations. However default consecutive numbering does not always work
    for POWERPC.
    
    These indexes are reflected in /proc/device-tree/cpus/PowerPC,POWER7@XX
    and used to call KVM VCPU's ioctls. In order to achieve this,
    kvmppc_fixup_cpu() was introduced. Roughly speaking, it multiplies
    cpu_index by the number of threads per core.
    
    This approach has disadvantages such as:
    1. NUMA configuration stays broken after the fixup;
    2. CPU-targeted commands from the QEMU Monitor do not work properly as
    CPU indexes have been fixed and there is no clear way for the user to
    know what the new CPU indexes are.
    
    This introduces a @cpu_dt_id field in the CPUPPCState struct which
    is initialized from @cpu_index by default and can be fixed later
    to meet the device tree requirements.
    
    This adds an API to handle @cpu_dt_id.
    
    This removes kvmppc_fixup_cpu() as it is not more needed, @cpu_dt_id
    is calculated in ppc_cpu_realize().
    
    This will be used later in machine code.
    Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
    Acked-by: NMike Day <ncmike@ncultra.org>
    Signed-off-by: NAlexander Graf <agraf@suse.de>
    0ce470cd
kvm.c 53.6 KB