qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 1/2] hmp: fix info cpus for sparc targets


From: Aurelien Jarno
Subject: Re: [Qemu-devel] [PATCH 1/2] hmp: fix info cpus for sparc targets
Date: Wed, 17 Oct 2012 08:06:13 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Tue, Oct 16, 2012 at 11:01:45PM -0300, Luiz Capitulino wrote:
> On Wed, 17 Oct 2012 01:28:34 +0200
> Aurelien Jarno <address@hidden> wrote:
> 
> > On sparc targets, info cpus returns this kind of output:
> > 
> > | info cpus
> > | * CPU #0: 
> > pc=0x0000000000424d18pc=0x0000000000424d18npc=0x0000000000424d1c 
> > thread_id=19460
> > 
> > pc is printed twice, there is no space between pc, pc and npc. As npc
> > implies pc, don't set has_pc on sparc, and add a space between pc and
> > npc.
> > 
> > Cc: Luiz Capitulino <address@hidden>
> > Cc: Markus Armbruster <address@hidden>
> > Cc: Blue Swirl <address@hidden>
> > Signed-off-by: Aurelien Jarno <address@hidden>
> > ---
> >  cpus.c |    2 --
> >  hmp.c  |    2 +-
> >  2 files changed, 1 insertion(+), 3 deletions(-)
> > 
> > diff --git a/cpus.c b/cpus.c
> > index 750a76f..cbc8556 100644
> > --- a/cpus.c
> > +++ b/cpus.c
> > @@ -1216,8 +1216,6 @@ CpuInfoList *qmp_query_cpus(Error **errp)
> >          info->value->has_nip = true;
> >          info->value->nip = env->nip;
> >  #elif defined(TARGET_SPARC)
> > -        info->value->has_pc = true;
> > -        info->value->pc = env->pc;
> >          info->value->has_npc = true;
> >          info->value->npc = env->npc;
> >  #elif defined(TARGET_MIPS)
> > diff --git a/hmp.c b/hmp.c
> > index 70bdec2..64b6ab5 100644
> > --- a/hmp.c
> > +++ b/hmp.c
> > @@ -242,7 +242,7 @@ void hmp_info_cpus(Monitor *mon)
> >              monitor_printf(mon, "nip=0x%016" PRIx64, cpu->value->nip);
> >          }
> >          if (cpu->value->has_npc) {
> > -            monitor_printf(mon, "pc=0x%016" PRIx64, cpu->value->pc);
> > +            monitor_printf(mon, "pc=0x%016 " PRIx64, cpu->value->pc);
> 
> This patch changes qmp_query_cpus() to never set pc, so why do you print it?

Well the print part of the code isn't change beside adding a space at
the end. With the current code, has_npc implies has_pc, that's why I
have removed the latter from qmp_query_cpus() in the sparc case.

If you prefer to change this behavior and not have has_npc implying
has_pc, I can send another patch.

> >              monitor_printf(mon, "npc=0x%016" PRIx64, cpu->value->npc);
> >          }
> >          if (cpu->value->has_PC) {
> 
> 

-- 
Aurelien Jarno                          GPG: 1024D/F1BCDB73
address@hidden                 http://www.aurel32.net



reply via email to

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