* [Qemu-devel] [PATCH] hmp: add PC information for ARM vCPUs
@ 2017-02-22 16:25 Alex Bennée
2017-02-22 16:32 ` Eric Blake
2017-02-22 17:26 ` Peter Maydell
0 siblings, 2 replies; 4+ messages in thread
From: Alex Bennée @ 2017-02-22 16:25 UTC (permalink / raw)
To: peter.maydell
Cc: qemu-devel, Alex Bennée, Paolo Bonzini, Peter Crosthwaite,
Richard Henderson, Dr. David Alan Gilbert, Eric Blake,
Markus Armbruster
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
diff --git a/hmp.c b/hmp.c
index 2bc4f062bb..03ef6ffdd7 100644
--- a/hmp.c
+++ b/hmp.c
@@ -369,6 +369,9 @@ void hmp_info_cpus(Monitor *mon, const QDict *qdict)
case CPU_INFO_ARCH_TRICORE:
monitor_printf(mon, " PC=0x%016" PRIx64, cpu->value->u.tricore.PC);
break;
+ case CPU_INFO_ARCH_ARM:
+ monitor_printf(mon, " pc=0x%016" PRIx64, cpu->value->u.arm.pc);
+ break;
default:
break;
}
diff --git a/qapi-schema.json b/qapi-schema.json
index e9a6364b7d..650e98c950 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -1277,7 +1277,7 @@
# Since: 2.6
##
{ 'enum': 'CpuInfoArch',
- 'data': ['x86', 'sparc', 'ppc', 'mips', 'tricore', 'other' ] }
+ 'data': ['x86', 'sparc', 'ppc', 'mips', 'tricore', 'arm', 'other' ] }
##
# @CpuInfo:
@@ -1312,6 +1312,7 @@
'ppc': 'CpuInfoPPC',
'mips': 'CpuInfoMIPS',
'tricore': 'CpuInfoTricore',
+ 'arm': 'CpuInfoARM',
'other': 'CpuInfoOther' } }
##
@@ -1372,6 +1373,17 @@
{ 'struct': 'CpuInfoTricore', 'data': { 'PC': 'int' } }
##
+# @CpuInfoARM:
+#
+# Additional information about a virtual ARM CPU
+#
+# @pc: the instruction pointer
+#
+# Since: 2.9
+##
+{ 'struct': 'CpuInfoARM', 'data': { 'pc': 'int' } }
+
+##
# @CpuInfoOther:
#
# No additional information is available about the virtual CPU
--
2.11.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] hmp: add PC information for ARM vCPUs
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
1 sibling, 0 replies; 4+ messages in thread
From: Eric Blake @ 2017-02-22 16:32 UTC (permalink / raw)
To: Alex Bennée, peter.maydell
Cc: qemu-devel, Paolo Bonzini, Peter Crosthwaite, Richard Henderson,
Dr. David Alan Gilbert, Markus Armbruster
[-- Attachment #1: Type: text/plain, Size: 735 bytes --]
On 02/22/2017 10:25 AM, Alex Bennée 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(-)
>
> +++ b/qapi-schema.json
> @@ -1277,7 +1277,7 @@
> # Since: 2.6
> ##
> { 'enum': 'CpuInfoArch',
> - 'data': ['x86', 'sparc', 'ppc', 'mips', 'tricore', 'other' ] }
> + 'data': ['x86', 'sparc', 'ppc', 'mips', 'tricore', 'arm', 'other' ] }
Is it possible to document "'arm' since 2.9" somewhere for this enum?
Otherwise looks fine to me.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] hmp: add PC information for ARM vCPUs
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
1 sibling, 1 reply; 4+ messages in thread
From: Peter Maydell @ 2017-02-22 17:26 UTC (permalink / raw)
To: Alex Bennée
Cc: QEMU Developers, Paolo Bonzini, Peter Crosthwaite,
Richard Henderson, Dr. David Alan Gilbert, Eric Blake,
Markus Armbruster
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...
thanks
-- PMM
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] hmp: add PC information for ARM vCPUs
2017-02-22 17:26 ` Peter Maydell
@ 2017-02-22 17:58 ` Dr. David Alan Gilbert
0 siblings, 0 replies; 4+ messages in thread
From: Dr. David Alan Gilbert @ 2017-02-22 17:58 UTC (permalink / raw)
To: Peter Maydell
Cc: Alex Bennée, Peter Crosthwaite, Markus Armbruster,
QEMU Developers, Paolo Bonzini, Richard Henderson
* 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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-02-22 17:58 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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).