Re: [libvirt] [PATCH 0/3] qmp: query-host-cpu command

2016-06-21 Thread David Hildenbrand
> On Tue, Jun 21, 2016 at 02:52:54PM +0200, David Hildenbrand wrote:
> > > On Tue, Jun 21, 2016 at 08:20:40AM +0200, David Hildenbrand wrote:  
> > > > > Add QMP command to allow management software to query for
> > > > > CPU information for the running host.
> > > > > 
> > > > > The data returned by the command is in the form of a dictionary
> > > > > of QOM properties.
> > > > > 
> > > > > This series depends on the "Add runnability info to
> > > > > query-cpu-definitions" series I sent 2 weeks ago.
> > > > > 
> > > > > Git tree:
> > > > >   https://github.com/ehabkost/qemu-hacks.git work/query-host-cpu
> > > > > 
> > > > 
> > > > I like that interface, I'm going to post (maybe today? :) ) a similar 
> > > > interface
> > > > that allows to also expand other cpu models, not just the host model.   
> > > >  
> > > 
> > > In x86 I want to avoid exposing the details of other CPU models
> > > to libvirt because the details depend on machine-type.
> > > 
> > > But if it is useful for you, I believe the same "qom-properties"
> > > dict could be returned in query-cpu-definitions.
> > >   
> > > > 
> > > > Maybe we can then decide which one makes sense for all of us. But in 
> > > > general,
> > > > this interface is much better compared to what we had before. 
> > > 
> > > Maybe both? I think it's better to have a separate interface for
> > > querying "what exactly this host supports" and another one for
> > > querying for "what happens if I use -cpu host". In the case of
> > > x86, both are equivalent, but we can't guarantee this on all
> > > architectures.
> > >   
> > 
> > I'll post my patches in a couple of minutes, let's discuss it
> > then.
> > 
> > We might want to avoid having multiple interfaces carrying out
> > the same task.  
> 
> OK, I will wait for the patches before discussing it. My
> assumption is that both look similar, but are actually different
> tasks.
> 

For us, also "-cpu host" and querying the host model is identical. Not sure
if there would for now really be a requirement for some other architecture
to handle this differently. Do you have anything specific already in mind?

But let's see if it indeed makes sense to split this up after looking at
our interface proposal.

David

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH 0/3] qmp: query-host-cpu command

2016-06-21 Thread Eduardo Habkost
On Tue, Jun 21, 2016 at 02:52:54PM +0200, David Hildenbrand wrote:
> > On Tue, Jun 21, 2016 at 08:20:40AM +0200, David Hildenbrand wrote:
> > > > Add QMP command to allow management software to query for
> > > > CPU information for the running host.
> > > > 
> > > > The data returned by the command is in the form of a dictionary
> > > > of QOM properties.
> > > > 
> > > > This series depends on the "Add runnability info to
> > > > query-cpu-definitions" series I sent 2 weeks ago.
> > > > 
> > > > Git tree:
> > > >   https://github.com/ehabkost/qemu-hacks.git work/query-host-cpu
> > > >   
> > > 
> > > I like that interface, I'm going to post (maybe today? :) ) a similar 
> > > interface
> > > that allows to also expand other cpu models, not just the host model.  
> > 
> > In x86 I want to avoid exposing the details of other CPU models
> > to libvirt because the details depend on machine-type.
> > 
> > But if it is useful for you, I believe the same "qom-properties"
> > dict could be returned in query-cpu-definitions.
> > 
> > > 
> > > Maybe we can then decide which one makes sense for all of us. But in 
> > > general,
> > > this interface is much better compared to what we had before.   
> > 
> > Maybe both? I think it's better to have a separate interface for
> > querying "what exactly this host supports" and another one for
> > querying for "what happens if I use -cpu host". In the case of
> > x86, both are equivalent, but we can't guarantee this on all
> > architectures.
> > 
> 
> I'll post my patches in a couple of minutes, let's discuss it
> then.
> 
> We might want to avoid having multiple interfaces carrying out
> the same task.

OK, I will wait for the patches before discussing it. My
assumption is that both look similar, but are actually different
tasks.

-- 
Eduardo

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH 0/3] qmp: query-host-cpu command

2016-06-21 Thread David Hildenbrand
> On Tue, Jun 21, 2016 at 08:20:40AM +0200, David Hildenbrand wrote:
> > > Add QMP command to allow management software to query for
> > > CPU information for the running host.
> > > 
> > > The data returned by the command is in the form of a dictionary
> > > of QOM properties.
> > > 
> > > This series depends on the "Add runnability info to
> > > query-cpu-definitions" series I sent 2 weeks ago.
> > > 
> > > Git tree:
> > >   https://github.com/ehabkost/qemu-hacks.git work/query-host-cpu
> > >   
> > 
> > I like that interface, I'm going to post (maybe today? :) ) a similar 
> > interface
> > that allows to also expand other cpu models, not just the host model.  
> 
> In x86 I want to avoid exposing the details of other CPU models
> to libvirt because the details depend on machine-type.
> 
> But if it is useful for you, I believe the same "qom-properties"
> dict could be returned in query-cpu-definitions.
> 
> > 
> > Maybe we can then decide which one makes sense for all of us. But in 
> > general,
> > this interface is much better compared to what we had before.   
> 
> Maybe both? I think it's better to have a separate interface for
> querying "what exactly this host supports" and another one for
> querying for "what happens if I use -cpu host". In the case of
> x86, both are equivalent, but we can't guarantee this on all
> architectures.
> 

I'll post my patches in a couple of minutes, let's discuss it then.

We might want to avoid having multiple interfaces carrying out the same task.

David

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH 0/3] qmp: query-host-cpu command

2016-06-21 Thread Eduardo Habkost
On Tue, Jun 21, 2016 at 08:20:40AM +0200, David Hildenbrand wrote:
> > Add QMP command to allow management software to query for
> > CPU information for the running host.
> > 
> > The data returned by the command is in the form of a dictionary
> > of QOM properties.
> > 
> > This series depends on the "Add runnability info to
> > query-cpu-definitions" series I sent 2 weeks ago.
> > 
> > Git tree:
> >   https://github.com/ehabkost/qemu-hacks.git work/query-host-cpu
> > 
> 
> I like that interface, I'm going to post (maybe today? :) ) a similar 
> interface
> that allows to also expand other cpu models, not just the host model.

In x86 I want to avoid exposing the details of other CPU models
to libvirt because the details depend on machine-type.

But if it is useful for you, I believe the same "qom-properties"
dict could be returned in query-cpu-definitions.

> 
> Maybe we can then decide which one makes sense for all of us. But in general,
> this interface is much better compared to what we had before. 

Maybe both? I think it's better to have a separate interface for
querying "what exactly this host supports" and another one for
querying for "what happens if I use -cpu host". In the case of
x86, both are equivalent, but we can't guarantee this on all
architectures.

-- 
Eduardo

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH 0/3] qmp: query-host-cpu command

2016-06-21 Thread David Hildenbrand
> Add QMP command to allow management software to query for
> CPU information for the running host.
> 
> The data returned by the command is in the form of a dictionary
> of QOM properties.
> 
> This series depends on the "Add runnability info to
> query-cpu-definitions" series I sent 2 weeks ago.
> 
> Git tree:
>   https://github.com/ehabkost/qemu-hacks.git work/query-host-cpu
> 

I like that interface, I'm going to post (maybe today? :) ) a similar interface
that allows to also expand other cpu models, not just the host model.

Maybe we can then decide which one makes sense for all of us. But in general,
this interface is much better compared to what we had before. 

David

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH 0/3] qmp: query-host-cpu command

2016-06-20 Thread Eduardo Habkost
Add QMP command to allow management software to query for
CPU information for the running host.

The data returned by the command is in the form of a dictionary
of QOM properties.

This series depends on the "Add runnability info to
query-cpu-definitions" series I sent 2 weeks ago.

Git tree:
  https://github.com/ehabkost/qemu-hacks.git work/query-host-cpu

Example output for x86:

{
"qom-properties": {
"pfthreshold": false,
"pku": false,
"rtm": false,
"tsc-deadline": true,
"xstore-en": false,
"cpuid-0xb": true,
"abm": true,
"ia64": false,
"kvm-mmu": false,
"xsaveopt": true,
"hv-spinlocks": -1,
"hotpluggable": true,
"tce": false,
"smep": true,
"nx": true,
"xcrypt": false,
"sse4_2": true,
"clflush": true,
"sse4_1": true,
"flushbyasid": false,
"kvm-steal-time": true,
"host-cache-info": false,
"tsc": true,
"adx": false,
"ds": false,
"fxsr": true,
"tm": false,
"hv-relaxed": false,
"pclmuldq": true,
"xgetbv1": false,
"xstore": false,
"migratable": true,
"vme": true,
"vendor": "GenuineIntel",
"arat": true,
"ffxsr": false,
"de": true,
"aes": true,
"pse": true,
"ds-cpl": false,
"tbm": false,
"sse": true,
"phe-en": false,
"f16c": true,
"hotplugged": true,
"mpx": false,
"tsc-adjust": true,
"avx512f": false,
"avx2": true,
"misalignsse": false,
"level": 13,
"pbe": false,
"cx16": true,
"avx512pf": false,
"movbe": true,
"perfctr-nb": false,
"enforce": false,
"ospke": false,
"pmu": true,
"fma4": false,
"stepping": 1,
"feature-words": [
{
"cpuid-register": "EAX",
"cpuid-input-eax": 6,
"features": 4
},
{
"cpuid-register": "EAX",
"cpuid-input-eax": 13,
"features": 1,
"cpuid-input-ecx": 1
},
{
"cpuid-register": "EDX",
"cpuid-input-eax": 2147483658,
"features": 0
},
{
"cpuid-register": "EAX",
"cpuid-input-eax": 1073741825,
"features": 16777467
},
{
"cpuid-register": "EDX",
"cpuid-input-eax": 3221225473,
"features": 0
},
{
"cpuid-register": "EDX",
"cpuid-input-eax": 2147483655,
"features": 0
},
{
"cpuid-register": "ECX",
"cpuid-input-eax": 2147483649,
"features": 33
},
{
"cpuid-register": "EDX",
"cpuid-input-eax": 2147483649,
"features": 739248128
},
{
"cpuid-register": "ECX",
"cpuid-input-eax": 7,
"features": 0,
"cpuid-input-ecx": 0
},
{
"cpuid-register": "EBX",
"cpuid-input-eax": 7,
"features": 1963,
"cpuid-input-ecx": 0
},
{
"cpuid-register": "ECX",
"cpuid-input-eax": 1,
"features": 4160369155
},
{
"cpuid-register": "EDX",
"cpuid-input-eax": 1,
"features": 260832255
}
],
"sse4a": false,
"i64": true,
"xsave": true,
"hv-runtime": false,
"pmm": false,
"hle": false,
"hv-crash": false,
"est": false,
"xop": false,
"smx": false,
"tsc-scale": false,
"monitor": false,
"avx512er": false,
"apic": true,
"sse4.1": true,
"sse4.2": true,
"hv-vapic": false,
"pause-filter": false,
"lahf-lm": true,
"kvm-nopiodelay": true,
"acpi": false,
"mmx": true,
"osxsave": false,