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

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

 



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 <bpradip@xxxxxxxxxx>
---
 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 & 0xFFFF0000) == (pvr & 0xFFFF0000))
             return model;
 
         model = model->next;
-- 
1.9.3

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




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]