[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [RFC PATCH v1 4/5] xics: Use migration_id instead of cpu_
From: |
Nikunj A Dadhania |
Subject: |
Re: [Qemu-ppc] [RFC PATCH v1 4/5] xics: Use migration_id instead of cpu_index in XICS code |
Date: |
Wed, 06 Jul 2016 14:38:04 +0530 |
User-agent: |
Notmuch/0.21 (https://notmuchmail.org) Emacs/25.0.94.1 (x86_64-redhat-linux-gnu) |
Bharata B Rao <address@hidden> writes:
> xics maintains an array of ICPState structures which is indexed
> by cpu_index. Change this to index the ICPState array by migration_id
> for pseries-2.7 onwards. This allows migration of guest to suceed
> when there are holes in cpu_index range due to CPU hot removal.
>
> NOTE: In rtas_set_xive() and h_ipi(), cpu_dt_id is implicitly
> assume to be equivalent to migration_id.
>
> Signed-off-by: Bharata B Rao <address@hidden>
> ---
> hw/intc/xics.c | 12 ++++++++----
> hw/intc/xics_kvm.c | 11 +++++------
> hw/intc/xics_spapr.c | 28 +++++++++++++++++++++-------
> 3 files changed, 34 insertions(+), 17 deletions(-)
>
> diff --git a/hw/intc/xics.c b/hw/intc/xics.c
> index cd48f42..ce7571e 100644
> --- a/hw/intc/xics.c
> +++ b/hw/intc/xics.c
> @@ -50,9 +50,11 @@ int xics_get_cpu_index_by_dt_id(int cpu_dt_id)
> void xics_cpu_destroy(XICSState *xics, PowerPCCPU *cpu)
> {
> CPUState *cs = CPU(cpu);
> - ICPState *ss = &xics->ss[cs->cpu_index];
> + CPUClass *cc = CPU_GET_CLASS(cs);
> + int server = cc->get_migration_id(cs);
> + ICPState *ss = &xics->ss[server];
A helper like this will make code much more compact at other places:
static inline int xics_get_server(PowerPCCPU cpu)
{
CPUState *cs = CPU(cpu);
CPUClass *cc = CPU_GET_CLASS(cs);
return cc->get_migration_id(cs);
}
void xics_cpu_destroy(XICSState *xics, PowerPCCPU *cpu)
{
int server = xics_get_server(cpu);
ICPState *ss = &xics->ss[server];
....
}
Regards
Nikunj
- [Qemu-ppc] [RFC PATCH v1 2/5] cpu: Introduce CPUState::migration_id, (continued)
- [Qemu-ppc] [RFC PATCH v1 5/5] cpu, spapr: Use migration_id from pseries-2.7 onwards, Bharata B Rao, 2016/07/06
- [Qemu-ppc] [RFC PATCH v1 4/5] xics: Use migration_id instead of cpu_index in XICS code, Bharata B Rao, 2016/07/06
- Re: [Qemu-ppc] [RFC PATCH v1 4/5] xics: Use migration_id instead of cpu_index in XICS code,
Nikunj A Dadhania <=
- [Qemu-ppc] [RFC PATCH v1 3/5] spapr: Implement CPUClass::get_migration_id() for PowerPC CPUs, Bharata B Rao, 2016/07/06
- Re: [Qemu-ppc] [RFC PATCH v1 3/5] spapr: Implement CPUClass::get_migration_id() for PowerPC CPUs, David Gibson, 2016/07/06
Re: [Qemu-ppc] [RFC PATCH v1 3/5] spapr: Implement CPUClass::get_migration_id() for PowerPC CPUs, Greg Kurz, 2016/07/06
Re: [Qemu-ppc] [RFC PATCH v1 3/5] spapr: Implement CPUClass::get_migration_id() for PowerPC CPUs, David Gibson, 2016/07/06