qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "Alex Bennée" <alex.bennee@linaro.org>,
	"Peter Crosthwaite" <crosthwaite.peter@gmail.com>,
	"Markus Armbruster" <armbru@redhat.com>,
	"QEMU Developers" <qemu-devel@nongnu.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Richard Henderson" <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH] hmp: add PC information for ARM vCPUs
Date: Wed, 22 Feb 2017 17:58:33 +0000	[thread overview]
Message-ID: <20170222175832.GB2352@work-vm> (raw)
In-Reply-To: <CAFEAcA8VQAE9_THkm45SS5YoO8cAnf60bCJ4iTaoH+6aL-Qo3w@mail.gmail.com>

* Peter Maydell (peter.maydell@linaro.org) wrote:
> On 22 February 2017 at 16:25, Alex Bennée <alex.bennee@linaro.org> wrote:
> > Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> > ---
> >  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 / dgilbert@redhat.com / Manchester, UK

      reply	other threads:[~2017-02-22 17:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-22 16:25 [Qemu-devel] [PATCH] hmp: add PC information for ARM vCPUs Alex Bennée
2017-02-22 16:32 ` Eric Blake
2017-02-22 17:26 ` Peter Maydell
2017-02-22 17:58   ` Dr. David Alan Gilbert [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170222175832.GB2352@work-vm \
    --to=dgilbert@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=armbru@redhat.com \
    --cc=crosthwaite.peter@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).