qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Pavel Dovgalyuk" <dovgaluk@ispras.ru>
To: "'Aleksandar Markovic'" <amarkovic@wavecomp.com>,
	"'Philippe Mathieu-Daudé'" <philmd@redhat.com>,
	"'Pavel Dovgalyuk'" <Pavel.Dovgaluk@ispras.ru>,
	qemu-devel@nongnu.org,
	"'Marc-André Lureau'" <marcandre.lureau@redhat.com>,
	"'Markus Armbruster'" <armbru@redhat.com>
Cc: 'Aleksandar Rikalo' <arikalo@wavecomp.com>,
	mdroth@linux.vnet.ibm.com, natalia.fursova@ispras.ru,
	aurelien@aurel32.net
Subject: Re: [Qemu-devel] [PATCH] mips: implement qmp query-cpu-definitions command
Date: Mon, 18 Feb 2019 10:01:08 +0300	[thread overview]
Message-ID: <001301d4c757$b94cb040$2be610c0$@ru> (raw)
In-Reply-To: <BN6PR2201MB1251B9927732A72EB237EA66C6630@BN6PR2201MB1251.namprd22.prod.outlook.com>

> From: Aleksandar Markovic [mailto:amarkovic@wavecomp.com]
> > From: Pavel Dovgalyuk [mailto:Pavel.Dovgaluk@ispras.ru]
> >
> > This patch enables QMP-based querying of the available CPU types for MIPS
> > and MIPS64 platforms.
> >
> > Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
> > ---
> >  monitor.c            |    2 +-
> >  target/mips/helper.c |   33 +++++++++++++++++++++++++++++++++
> >  2 files changed, 34 insertions(+), 1 deletion(-)
> >
> 
> Hello, Pavel,
> 
> Thanks for involving in this area!
> 
> I have just a couple of question:
> 
> 1) What are the effects of these two patches on the end user?

This patch make qmp query-cpu-definitions available for the MIPS users.
This command allows requesting possible CPU models with QMP.

> 2) What is the context of these patches? Do you intend to send more related patches in the
> future? Are these patches preconditions for some other not yet implemented features?

Not yet.
We are developing GUI for virtual machine management and debugging
with record-replay feature: https://github.com/ispras/qemu-gui
Therefore we need to request possible CPU and hardware options.

> 3) Why is only target MIPS included? Do other targets need similar improvements?

We use MIPS in our projects. Some other targets need similar improvements, but we do
not focus on them right now.

Pavel Dovgalyuk

> 
> Thanks,
> Aleksandar
> 
> 
> > diff --git a/monitor.c b/monitor.c
> > index c09fa63940..25d3b141ad 100644
> > --- a/monitor.c
> > +++ b/monitor.c
> > @@ -1165,7 +1165,7 @@ static void qmp_unregister_commands_hack(void)
> >      qmp_unregister_command(&qmp_commands, "query-cpu-model-comparison");
> >  #endif
> >  #if !defined(TARGET_PPC) && !defined(TARGET_ARM) && !defined(TARGET_I386) \
> > -    && !defined(TARGET_S390X)
> > +    && !defined(TARGET_S390X) && !defined(TARGET_MIPS)
> >      qmp_unregister_command(&qmp_commands, "query-cpu-definitions");
> >  #endif
> >  }
> > diff --git a/target/mips/helper.c b/target/mips/helper.c
> > index 8988452dbd..c84d056c09 100644
> > --- a/target/mips/helper.c
> > +++ b/target/mips/helper.c
> > @@ -24,6 +24,7 @@
> >  #include "exec/cpu_ldst.h"
> >  #include "exec/log.h"
> >  #include "hw/mips/cpudevs.h"
> > +#include "sysemu/arch_init.h"
> >
> >  enum {
> >      TLBRET_XI = -6,
> > @@ -1472,3 +1473,35 @@ void QEMU_NORETURN do_raise_exception_err(CPUMIPSState *env,
> >
> >      cpu_loop_exit_restore(cs, pc);
> >  }
> > +
> > +static void mips_cpu_add_definition(gpointer data, gpointer user_data)
> > +{
> > +    ObjectClass *oc = data;
> > +    CpuDefinitionInfoList **cpu_list = user_data;
> > +    CpuDefinitionInfoList *entry;
> > +    CpuDefinitionInfo *info;
> > +    const char *typename;
> > +
> > +    typename = object_class_get_name(oc);
> > +    info = g_malloc0(sizeof(*info));
> > +    info->name = g_strndup(typename,
> > +                           strlen(typename) - strlen("-" TYPE_MIPS_CPU));
> > +    info->q_typename = g_strdup(typename);
> > +
> > +    entry = g_malloc0(sizeof(*entry));
> > +    entry->value = info;
> > +    entry->next = *cpu_list;
> > +    *cpu_list = entry;
> > +}
> > +
> > +CpuDefinitionInfoList *arch_query_cpu_definitions(Error **errp)
> > +{
> > +    CpuDefinitionInfoList *cpu_list = NULL;
> > +    GSList *list;
> > +
> > +    list = object_class_get_list(TYPE_MIPS_CPU, false);
> > +    g_slist_foreach(list, mips_cpu_add_definition, &cpu_list);
> > +    g_slist_free(list);
> > +
> > +    return cpu_list;
> > +}
> 
> 

  reply	other threads:[~2019-02-18  7:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-05 13:07 [Qemu-devel] [PATCH] mips: implement qmp query-cpu-definitions command Pavel Dovgalyuk
2019-02-11  5:34 ` Pavel Dovgalyuk
2019-02-16 18:34   ` Philippe Mathieu-Daudé
2019-02-18  6:47     ` Aleksandar Markovic
2019-02-18  7:01       ` Pavel Dovgalyuk [this message]
2019-02-19  7:28     ` Markus Armbruster
2019-02-19 19:19       ` Aleksandar Markovic
2019-02-20  5:20         ` Pavel Dovgalyuk

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='001301d4c757$b94cb040$2be610c0$@ru' \
    --to=dovgaluk@ispras.ru \
    --cc=Pavel.Dovgaluk@ispras.ru \
    --cc=amarkovic@wavecomp.com \
    --cc=arikalo@wavecomp.com \
    --cc=armbru@redhat.com \
    --cc=aurelien@aurel32.net \
    --cc=marcandre.lureau@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=natalia.fursova@ispras.ru \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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).