qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] qapi/x86: add control registers to query-cpus


From: Andreas Färber
Subject: Re: [Qemu-devel] [PATCH] qapi/x86: add control registers to query-cpus
Date: Fri, 25 Jan 2013 13:51:14 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130105 Thunderbird/17.0.2

Am 25.01.2013 13:14, schrieb Luiz Capitulino:
> On Thu, 24 Jan 2013 13:12:08 -0500
> Peter Feiner <address@hidden> wrote:
> 
>>> What about converting 'info registers' to QMP (ie. having 
>>> query-cpu-registers)?
>>
>> We had thought about it, but we decided to go with this lower hanging fruit
>> because it provides immediately useful functionality at a low implementation
>> cost. It's harder (for us) to think of why would anyone want to know XMM12 or
>> r10 in the general case outside of gdb, which is already supported.
> 
> For the same reason you need the other registers now. Besides, it would be
> nice to allow GUIs to have more debug info like this.
> 
> Let me re-state the problem for the CC'ed people: you're adding x86 control
> registers to the query-cpus command. I think this has a few problems:
> 
>  1. Won't "scale", as query-cpus will become a huge mess if people start
>     doing this for other archs
> 
>  2. query-cpus is bad designed. I'd prefer adding new commands instead of
>     extending it (unless the information is general enough)
> 
>  3. It's very desirable to have registers info in QMP
> 
> The obvious suggestion is to add query-cpu-registers. I understand this has a
> few problems (see questions below), but I think the following incremental
> approach could work:
> 
>  1. Add a CPURegisters union
>  2. Each CPU arch is added as a type to the union (eg. CPUX86Registers)
>  3. query-cpu-registers returns the union
>  4. Move do_info_registers() to hmp.c as hmp_info_registers()
>  5. Change hmp_info_registers() to first call qmp_query_cpu_registers(), if
>     this returns the CPU arch it expects, then print it. Otherwise fallback
>     to cpu_dump_state()
> 
> You start by adding CPUX86Registers. Other CPUs are added as needed.
> 
> What do the CC'ed people think?

I wonder why this needs to be a custom QMP command? I have done a lot of
preparations to make all CPUState QOM objects, so it would be easily
possible to add QOM properties for the registers and reuse the existing
qom-get QMP command. That would of course require deciding on property
names and types ;) and on getting usable QOM paths to access the CPUs.

Is there a particular release this feature is being requested for?

Regards,
Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg



reply via email to

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