qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] hmp: add PC information for ARM vCPUs


From: Dr. David Alan Gilbert
Subject: Re: [Qemu-devel] [PATCH] hmp: add PC information for ARM vCPUs
Date: Wed, 22 Feb 2017 17:58:33 +0000
User-agent: Mutt/1.7.1 (2016-10-04)

* Peter Maydell (address@hidden) wrote:
> On 22 February 2017 at 16:25, Alex Bennée <address@hidden> wrote:
> > Signed-off-by: Alex Bennée <address@hidden>
> > ---
> >  cpus.c           |  6 ++++++
> >  hmp.c            |  3 +++
> >  qapi-schema.json | 14 +++++++++++++-
> >  3 files changed, 22 insertions(+), 1 deletion(-)
> >
> > diff --git a/cpus.c b/cpus.c
> > index 559a0805bc..dc8dbfb0f0 100644
> > --- a/cpus.c
> > +++ b/cpus.c
> > @@ -1869,6 +1869,9 @@ CpuInfoList *qmp_query_cpus(Error **errp)
> >  #elif defined(TARGET_TRICORE)
> >          TriCoreCPU *tricore_cpu = TRICORE_CPU(cpu);
> >          CPUTriCoreState *env = &tricore_cpu->env;
> > +#elif defined(TARGET_AARCH64)
> > +        ARMCPU *arm_cpu = ARM_CPU(cpu);
> > +        CPUARMState *env = &arm_cpu->env;
> >  #endif
> >
> >          cpu_synchronize_state(cpu);
> > @@ -1896,6 +1899,9 @@ CpuInfoList *qmp_query_cpus(Error **errp)
> >  #elif defined(TARGET_TRICORE)
> >          info->value->arch = CPU_INFO_ARCH_TRICORE;
> >          info->value->u.tricore.PC = env->PC;
> > +#elif defined(TARGET_AARCH64)
> > +        info->value->arch = CPU_INFO_ARCH_ARM;
> > +        info->value->u.arm.pc = env->pc;
> >  #else
> >          info->value->arch = CPU_INFO_ARCH_OTHER;
> >  #endif
> 
> My standard reaction when I see patches adding another
> arm to a target-ifdef ladder like this is to ask whether
> we can refactor this so that the target-specific
> code lives in target/$ARCH instead...

It feels like that should be possible with PC; but then you get
the weird outliers; x86 that adds in CS, but OK that could be wrapped
up in a target function; and then SPARC that's got pc and npc
just to be different.

Dave

> thanks
> -- PMM
> 
--
Dr. David Alan Gilbert / address@hidden / Manchester, UK



reply via email to

[Prev in Thread] Current Thread [Next in Thread]