Re: [libvirt] [PATCH V1 1/2] cpu: Handle only high order 16 bits of PVR for IBM Power processors

2014-08-19 Thread Pradipta Kumar Banerjee
On 08/20/2014 09:02 AM, Martin Kletzander wrote:
> On Tue, Aug 19, 2014 at 11:00:12PM +0530, Pradipta Kr. Banerjee wrote:
>> IBM Power processors encode PVR as CPU family in higher 16 bits and a CPU
>> version in lower 16 bits. Since there is no significant change in behavior
>> between versions, there is no point to add every single CPU version in
>> cpu_map.xml and check for the same in cpu_powerpc.c
>>
> 
> Just an idea, but what if we select the model based on the whole pvr
> and only in case none is found, we will fallback to the first one that
> has the same high 16 bits?  When we have already power8_v1.0 and
> you're adding power8, we will never select the second one in the way
> you have implemented it.
Actually none of the model_vX.X are required. Only base processor versions are
required. Should I send a V2 with those changes ?

Additionally PowerKVM doesn't support specifying cpu model for guests (qemu
cmdline: -cpu ). The only way possible is to use qemu compat mode (qemu
cmdline: -cpu host,compat=model) support of which is yet to be added in libvirt.
The only supported models in compat modes are power6,power7,power8.

There was an RFC posted on the same -
https://www.redhat.com/archives/libvir-list/2014-June/msg01338.html

Please let me know your thoughts.

> 
>> Signed-off-by: Pradipta Kr. Banerjee 
>> ---
>> src/cpu/cpu_powerpc.c | 7 ++-
>> 1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/src/cpu/cpu_powerpc.c b/src/cpu/cpu_powerpc.c
>> index 67cb9ff..18dbc99 100644
>> --- a/src/cpu/cpu_powerpc.c
>> +++ b/src/cpu/cpu_powerpc.c
>> @@ -93,7 +93,12 @@ ppcModelFindPVR(const struct ppc_map *map,
>>
>> model = map->models;
>> while (model != NULL) {
>> -if (model->data.pvr == pvr)
>> +/*IBM PowerPC processors encode PVR as CPU family in higher 16 bits 
>> and
>> + *a CPU version in lower 16 bits. Since there is no significant 
>> change
>> + *in behavior between versions, there is no point to add every 
>> single
>> + *CPU version in cpu_map.xml
>> + */
>> +if ((model->data.pvr & 0x) == (pvr & 0x))
>> return model;
>>
>> model = model->next;
>> -- 
>> 1.9.3
>>
>> -- 
>> libvir-list mailing list
>> libvir-list@redhat.com
>> https://www.redhat.com/mailman/listinfo/libvir-list
> 
> 
> --
> libvir-list mailing list
> libvir-list@redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list
> 


-- 
Regards,
Pradipta Kumar B(bpra...@in.ibm.com)
IBM Systems & Technology Labs,
India.

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


Re: [libvirt] [PATCH V1 1/2] cpu: Handle only high order 16 bits of PVR for IBM Power processors

2014-08-19 Thread Martin Kletzander

On Tue, Aug 19, 2014 at 11:00:12PM +0530, Pradipta Kr. Banerjee wrote:

IBM Power processors encode PVR as CPU family in higher 16 bits and a CPU
version in lower 16 bits. Since there is no significant change in behavior
between versions, there is no point to add every single CPU version in
cpu_map.xml and check for the same in cpu_powerpc.c



Just an idea, but what if we select the model based on the whole pvr
and only in case none is found, we will fallback to the first one that
has the same high 16 bits?  When we have already power8_v1.0 and
you're adding power8, we will never select the second one in the way
you have implemented it.


Signed-off-by: Pradipta Kr. Banerjee 
---
src/cpu/cpu_powerpc.c | 7 ++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/cpu/cpu_powerpc.c b/src/cpu/cpu_powerpc.c
index 67cb9ff..18dbc99 100644
--- a/src/cpu/cpu_powerpc.c
+++ b/src/cpu/cpu_powerpc.c
@@ -93,7 +93,12 @@ ppcModelFindPVR(const struct ppc_map *map,

model = map->models;
while (model != NULL) {
-if (model->data.pvr == pvr)
+/*IBM PowerPC processors encode PVR as CPU family in higher 16 bits and
+ *a CPU version in lower 16 bits. Since there is no significant change
+ *in behavior between versions, there is no point to add every single
+ *CPU version in cpu_map.xml
+ */
+if ((model->data.pvr & 0x) == (pvr & 0x))
return model;

model = model->next;
--
1.9.3

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


signature.asc
Description: Digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH V1 1/2] cpu: Handle only high order 16 bits of PVR for IBM Power processors

2014-08-19 Thread Pradipta Kr. Banerjee
IBM Power processors encode PVR as CPU family in higher 16 bits and a CPU
version in lower 16 bits. Since there is no significant change in behavior
between versions, there is no point to add every single CPU version in
cpu_map.xml and check for the same in cpu_powerpc.c

Signed-off-by: Pradipta Kr. Banerjee 
---
 src/cpu/cpu_powerpc.c | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/cpu/cpu_powerpc.c b/src/cpu/cpu_powerpc.c
index 67cb9ff..18dbc99 100644
--- a/src/cpu/cpu_powerpc.c
+++ b/src/cpu/cpu_powerpc.c
@@ -93,7 +93,12 @@ ppcModelFindPVR(const struct ppc_map *map,
 
 model = map->models;
 while (model != NULL) {
-if (model->data.pvr == pvr)
+/*IBM PowerPC processors encode PVR as CPU family in higher 16 bits and
+ *a CPU version in lower 16 bits. Since there is no significant change
+ *in behavior between versions, there is no point to add every single
+ *CPU version in cpu_map.xml
+ */
+if ((model->data.pvr & 0x) == (pvr & 0x))
 return model;
 
 model = model->next;
-- 
1.9.3

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