[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC PATCH v1 3/5] spapr: Implement CPUClass::get_migra
From: |
Igor Mammedov |
Subject: |
Re: [Qemu-devel] [RFC PATCH v1 3/5] spapr: Implement CPUClass::get_migration_id() for PowerPC CPUs |
Date: |
Wed, 6 Jul 2016 14:01:14 +0200 |
On Wed, 6 Jul 2016 14:29:19 +0530
Bharata B Rao <address@hidden> wrote:
> cpu_index is used as migration_id by default. For machine type
> versions that set use-migration-id property, cpu_dt_it is returned.
>
> Signed-off-by: Bharata B Rao <address@hidden>
> ---
> target-ppc/translate_init.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c
> index efd6b88..9ca2f5e 100644
> --- a/target-ppc/translate_init.c
> +++ b/target-ppc/translate_init.c
> @@ -10359,6 +10359,17 @@ static gchar *ppc_gdb_arch_name(CPUState *cs)
> #endif
> }
>
> +static int ppc_cpu_get_migration_id(CPUState *cs)
> +{
> + PowerPCCPU *cpu = POWERPC_CPU(cs);
> +
> + if (cs->use_migration_id) {
> + return (int) cpu->cpu_dt_id;
Could cpu_dt_id have value bigger than 32bit int? If yes, it's not safe
to do so, that's the reason why I'm going to use index in possible_cpus
on ARM and for the sake of uniformity do the same for x86 (even though
it's possible to use 32bit APIC ID).
> + } else {
> + return cs->cpu_index;
> + }
> +}
> +
> static void ppc_cpu_class_init(ObjectClass *oc, void *data)
> {
> PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
> @@ -10412,6 +10423,7 @@ static void ppc_cpu_class_init(ObjectClass
> *oc, void *data) #ifndef CONFIG_USER_ONLY
> cc->virtio_is_big_endian = ppc_cpu_is_big_endian;
> #endif
> + cc->get_migration_id = ppc_cpu_get_migration_id;
>
> dc->fw_name = "PowerPC,UNKNOWN";
> }
- Re: [Qemu-devel] [RFC PATCH v1 1/5] cpu, target-ppc: Move cpu_vmstate_[un]register calls to cpu_common_[un]realize, (continued)
Re: [Qemu-devel] [RFC PATCH v1 1/5] cpu, target-ppc: Move cpu_vmstate_[un]register calls to cpu_common_[un]realize, David Gibson, 2016/07/06
[Qemu-devel] [RFC PATCH v1 2/5] cpu: Introduce CPUState::migration_id, Bharata B Rao, 2016/07/06
Re: [Qemu-devel] [RFC PATCH v1 2/5] cpu: Introduce CPUState::migration_id, David Gibson, 2016/07/06
[Qemu-devel] [RFC PATCH v1 3/5] spapr: Implement CPUClass::get_migration_id() for PowerPC CPUs, Bharata B Rao, 2016/07/06
- Re: [Qemu-devel] [RFC PATCH v1 3/5] spapr: Implement CPUClass::get_migration_id() for PowerPC CPUs,
Igor Mammedov <=
Re: [Qemu-devel] [RFC PATCH v1 3/5] spapr: Implement CPUClass::get_migration_id() for PowerPC CPUs, David Gibson, 2016/07/06
Re: [Qemu-devel] [RFC PATCH v1 3/5] spapr: Implement CPUClass::get_migration_id() for PowerPC CPUs, Greg Kurz, 2016/07/06
Re: [Qemu-devel] [RFC PATCH v1 3/5] spapr: Implement CPUClass::get_migration_id() for PowerPC CPUs, David Gibson, 2016/07/06
[Qemu-devel] [RFC PATCH v1 4/5] xics: Use migration_id instead of cpu_index in XICS code, Bharata B Rao, 2016/07/06