* [Qemu-devel] [PATCH 1/2] hmp: fix info cpus for sparc targets
@ 2012-10-16 23:28 Aurelien Jarno
2012-10-16 23:28 ` [Qemu-devel] [PATCH 2/2] target-sparc: fix FMOVr instruction Aurelien Jarno
2012-10-17 2:01 ` [Qemu-devel] [PATCH 1/2] hmp: fix info cpus for sparc targets Luiz Capitulino
0 siblings, 2 replies; 6+ messages in thread
From: Aurelien Jarno @ 2012-10-16 23:28 UTC (permalink / raw)
To: qemu-devel; +Cc: Blue Swirl, Markus Armbruster, Aurelien Jarno, Luiz Capitulino
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 <lcapitulino@redhat.com>
Cc: Markus Armbruster <armbru@redhat.com>
Cc: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
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);
monitor_printf(mon, "npc=0x%016" PRIx64, cpu->value->npc);
}
if (cpu->value->has_PC) {
--
1.7.10.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Qemu-devel] [PATCH 2/2] target-sparc: fix FMOVr instruction
2012-10-16 23:28 [Qemu-devel] [PATCH 1/2] hmp: fix info cpus for sparc targets Aurelien Jarno
@ 2012-10-16 23:28 ` Aurelien Jarno
2012-10-20 9:03 ` Blue Swirl
2012-10-17 2:01 ` [Qemu-devel] [PATCH 1/2] hmp: fix info cpus for sparc targets Luiz Capitulino
1 sibling, 1 reply; 6+ messages in thread
From: Aurelien Jarno @ 2012-10-16 23:28 UTC (permalink / raw)
To: qemu-devel; +Cc: Blue Swirl, Aurelien Jarno
Like the MOVr instruction, the FMOVr instruction has the condition
encoded between bits 10 and 12.
Cc: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
target-sparc/translate.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/target-sparc/translate.c b/target-sparc/translate.c
index 6cef96b..6d05e7d 100644
--- a/target-sparc/translate.c
+++ b/target-sparc/translate.c
@@ -3154,7 +3154,7 @@ static void disas_sparc_insn(DisasContext * dc, unsigned int insn)
#define FMOVR(sz) \
do { \
DisasCompare cmp; \
- cond = GET_FIELD_SP(insn, 14, 17); \
+ cond = GET_FIELD_SP(insn, 10, 12); \
cpu_src1 = get_src1(insn, cpu_src1); \
gen_compare_reg(&cmp, cond, cpu_src1); \
gen_fmov##sz(dc, &cmp, rd, rs2); \
--
1.7.10.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH 1/2] hmp: fix info cpus for sparc targets
2012-10-16 23:28 [Qemu-devel] [PATCH 1/2] hmp: fix info cpus for sparc targets Aurelien Jarno
2012-10-16 23:28 ` [Qemu-devel] [PATCH 2/2] target-sparc: fix FMOVr instruction Aurelien Jarno
@ 2012-10-17 2:01 ` Luiz Capitulino
2012-10-17 6:06 ` Aurelien Jarno
1 sibling, 1 reply; 6+ messages in thread
From: Luiz Capitulino @ 2012-10-17 2:01 UTC (permalink / raw)
To: Aurelien Jarno; +Cc: Blue Swirl, qemu-devel, Markus Armbruster
On Wed, 17 Oct 2012 01:28:34 +0200
Aurelien Jarno <aurelien@aurel32.net> 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 <lcapitulino@redhat.com>
> Cc: Markus Armbruster <armbru@redhat.com>
> Cc: Blue Swirl <blauwirbel@gmail.com>
> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
> ---
> 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?
> monitor_printf(mon, "npc=0x%016" PRIx64, cpu->value->npc);
> }
> if (cpu->value->has_PC) {
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH 1/2] hmp: fix info cpus for sparc targets
2012-10-17 2:01 ` [Qemu-devel] [PATCH 1/2] hmp: fix info cpus for sparc targets Luiz Capitulino
@ 2012-10-17 6:06 ` Aurelien Jarno
2012-10-17 12:54 ` Luiz Capitulino
0 siblings, 1 reply; 6+ messages in thread
From: Aurelien Jarno @ 2012-10-17 6:06 UTC (permalink / raw)
To: Luiz Capitulino; +Cc: Blue Swirl, qemu-devel, Markus Armbruster
On Tue, Oct 16, 2012 at 11:01:45PM -0300, Luiz Capitulino wrote:
> On Wed, 17 Oct 2012 01:28:34 +0200
> Aurelien Jarno <aurelien@aurel32.net> 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 <lcapitulino@redhat.com>
> > Cc: Markus Armbruster <armbru@redhat.com>
> > Cc: Blue Swirl <blauwirbel@gmail.com>
> > Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
> > ---
> > 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
aurelien@aurel32.net http://www.aurel32.net
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH 1/2] hmp: fix info cpus for sparc targets
2012-10-17 6:06 ` Aurelien Jarno
@ 2012-10-17 12:54 ` Luiz Capitulino
0 siblings, 0 replies; 6+ messages in thread
From: Luiz Capitulino @ 2012-10-17 12:54 UTC (permalink / raw)
To: Aurelien Jarno; +Cc: Blue Swirl, qemu-devel, Markus Armbruster
On Wed, 17 Oct 2012 08:06:13 +0200
Aurelien Jarno <aurelien@aurel32.net> wrote:
> On Tue, Oct 16, 2012 at 11:01:45PM -0300, Luiz Capitulino wrote:
> > On Wed, 17 Oct 2012 01:28:34 +0200
> > Aurelien Jarno <aurelien@aurel32.net> 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 <lcapitulino@redhat.com>
> > > Cc: Markus Armbruster <armbru@redhat.com>
> > > Cc: Blue Swirl <blauwirbel@gmail.com>
> > > Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
> > > ---
> > > 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.
My point is that you dropped the pc assignment along:
- info->value->pc = env->pc;
So, value->pc will be zeroed.
> If you prefer to change this behavior and not have has_npc implying
> has_pc, I can send another patch.
If pc is going to contain relevant info, then we have to set has_pc even
if has_npc implies it. If your point is that pc is irrelevant, then we have
to set has_pc to false and drop its printing from HMP.
>
> > > monitor_printf(mon, "npc=0x%016" PRIx64, cpu->value->npc);
> > > }
> > > if (cpu->value->has_PC) {
> >
> >
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH 2/2] target-sparc: fix FMOVr instruction
2012-10-16 23:28 ` [Qemu-devel] [PATCH 2/2] target-sparc: fix FMOVr instruction Aurelien Jarno
@ 2012-10-20 9:03 ` Blue Swirl
0 siblings, 0 replies; 6+ messages in thread
From: Blue Swirl @ 2012-10-20 9:03 UTC (permalink / raw)
To: Aurelien Jarno; +Cc: qemu-devel
On Tue, Oct 16, 2012 at 11:28 PM, Aurelien Jarno <aurelien@aurel32.net> wrote:
> Like the MOVr instruction, the FMOVr instruction has the condition
> encoded between bits 10 and 12.
Thanks, applied.
>
> Cc: Blue Swirl <blauwirbel@gmail.com>
> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
> ---
> target-sparc/translate.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/target-sparc/translate.c b/target-sparc/translate.c
> index 6cef96b..6d05e7d 100644
> --- a/target-sparc/translate.c
> +++ b/target-sparc/translate.c
> @@ -3154,7 +3154,7 @@ static void disas_sparc_insn(DisasContext * dc, unsigned int insn)
> #define FMOVR(sz) \
> do { \
> DisasCompare cmp; \
> - cond = GET_FIELD_SP(insn, 14, 17); \
> + cond = GET_FIELD_SP(insn, 10, 12); \
> cpu_src1 = get_src1(insn, cpu_src1); \
> gen_compare_reg(&cmp, cond, cpu_src1); \
> gen_fmov##sz(dc, &cmp, rd, rs2); \
> --
> 1.7.10.4
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-10-20 9:03 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-16 23:28 [Qemu-devel] [PATCH 1/2] hmp: fix info cpus for sparc targets Aurelien Jarno
2012-10-16 23:28 ` [Qemu-devel] [PATCH 2/2] target-sparc: fix FMOVr instruction Aurelien Jarno
2012-10-20 9:03 ` Blue Swirl
2012-10-17 2:01 ` [Qemu-devel] [PATCH 1/2] hmp: fix info cpus for sparc targets Luiz Capitulino
2012-10-17 6:06 ` Aurelien Jarno
2012-10-17 12:54 ` Luiz Capitulino
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.