render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
Pablo Greco 40546a
From e9bc4fcd2c16a80cf564879d154f3083a6766ff9 Mon Sep 17 00:00:00 2001
Pablo Greco 40546a
Message-Id: <e9bc4fcd2c16a80cf564879d154f3083a6766ff9@dist-git>
Pablo Greco 40546a
From: Jiri Denemark <jdenemar@redhat.com>
Pablo Greco 40546a
Date: Fri, 21 Jun 2019 09:25:34 +0200
Pablo Greco 40546a
Subject: [PATCH] cpu_x86: Make x86cpuidClearBits more general
Pablo Greco 40546a
MIME-Version: 1.0
Pablo Greco 40546a
Content-Type: text/plain; charset=UTF-8
Pablo Greco 40546a
Content-Transfer-Encoding: 8bit
Pablo Greco 40546a
Pablo Greco 40546a
The parameters changed from virCPUx86CPUID to virCPUx86DataItem and the
Pablo Greco 40546a
function is now called virCPUx86DataItemClearBits.
Pablo Greco 40546a
Pablo Greco 40546a
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Pablo Greco 40546a
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Pablo Greco 40546a
(cherry picked from commit 4e3cab2d002d5f4cfdf81359467de8ffe4e18682)
Pablo Greco 40546a
Pablo Greco 40546a
https://bugzilla.redhat.com/show_bug.cgi?id=1697627
Pablo Greco 40546a
Pablo Greco 40546a
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Pablo Greco 40546a
Message-Id: <bdc0f6c7da3674ba988c2fd83525a60df9108864.1561068591.git.jdenemar@redhat.com>
Pablo Greco 40546a
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Pablo Greco 40546a
---
Pablo Greco 40546a
 src/cpu/cpu_x86.c | 20 ++++++++++----------
Pablo Greco 40546a
 1 file changed, 10 insertions(+), 10 deletions(-)
Pablo Greco 40546a
Pablo Greco 40546a
diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
Pablo Greco 40546a
index e2951ed1b0..5fbf0294bb 100644
Pablo Greco 40546a
--- a/src/cpu/cpu_x86.c
Pablo Greco 40546a
+++ b/src/cpu/cpu_x86.c
Pablo Greco 40546a
@@ -228,16 +228,16 @@ virCPUx86DataItemSetBits(virCPUx86DataItemPtr item,
Pablo Greco 40546a
 
Pablo Greco 40546a
 
Pablo Greco 40546a
 static void
Pablo Greco 40546a
-x86cpuidClearBits(virCPUx86CPUID *cpuid,
Pablo Greco 40546a
-                  const virCPUx86CPUID *mask)
Pablo Greco 40546a
+virCPUx86DataItemClearBits(virCPUx86DataItemPtr item,
Pablo Greco 40546a
+                           const virCPUx86DataItem *mask)
Pablo Greco 40546a
 {
Pablo Greco 40546a
     if (!mask)
Pablo Greco 40546a
         return;
Pablo Greco 40546a
 
Pablo Greco 40546a
-    cpuid->eax &= ~mask->eax;
Pablo Greco 40546a
-    cpuid->ebx &= ~mask->ebx;
Pablo Greco 40546a
-    cpuid->ecx &= ~mask->ecx;
Pablo Greco 40546a
-    cpuid->edx &= ~mask->edx;
Pablo Greco 40546a
+    item->cpuid.eax &= ~mask->cpuid.eax;
Pablo Greco 40546a
+    item->cpuid.ebx &= ~mask->cpuid.ebx;
Pablo Greco 40546a
+    item->cpuid.ecx &= ~mask->cpuid.ecx;
Pablo Greco 40546a
+    item->cpuid.edx &= ~mask->cpuid.edx;
Pablo Greco 40546a
 }
Pablo Greco 40546a
 
Pablo Greco 40546a
 
Pablo Greco 40546a
@@ -430,8 +430,8 @@ x86DataSubtract(virCPUx86Data *data1,
Pablo Greco 40546a
     virCPUx86DataItemPtr item2;
Pablo Greco 40546a
 
Pablo Greco 40546a
     while ((item1 = virCPUx86DataNext(&iter))) {
Pablo Greco 40546a
-        if ((item2 = virCPUx86DataGet(data2, item1)))
Pablo Greco 40546a
-            x86cpuidClearBits(&item1->cpuid, &item2->cpuid);
Pablo Greco 40546a
+        item2 = virCPUx86DataGet(data2, item1);
Pablo Greco 40546a
+        virCPUx86DataItemClearBits(item1, item2);
Pablo Greco 40546a
     }
Pablo Greco 40546a
 }
Pablo Greco 40546a
 
Pablo Greco 40546a
@@ -449,7 +449,7 @@ x86DataIntersect(virCPUx86Data *data1,
Pablo Greco 40546a
         if (item2)
Pablo Greco 40546a
             x86cpuidAndBits(&item1->cpuid, &item2->cpuid);
Pablo Greco 40546a
         else
Pablo Greco 40546a
-            x86cpuidClearBits(&item1->cpuid, &item1->cpuid);
Pablo Greco 40546a
+            virCPUx86DataItemClearBits(item1, item1);
Pablo Greco 40546a
     }
Pablo Greco 40546a
 }
Pablo Greco 40546a
 
Pablo Greco 40546a
@@ -516,7 +516,7 @@ x86DataToVendor(const virCPUx86Data *data,
Pablo Greco 40546a
         virCPUx86VendorPtr vendor = map->vendors[i];
Pablo Greco 40546a
         if ((item = virCPUx86DataGet(data, &vendor->data)) &&
Pablo Greco 40546a
             x86cpuidMatchMasked(&item->cpuid, &vendor->data.cpuid)) {
Pablo Greco 40546a
-            x86cpuidClearBits(&item->cpuid, &vendor->data.cpuid);
Pablo Greco 40546a
+            virCPUx86DataItemClearBits(item, &vendor->data);
Pablo Greco 40546a
             return vendor;
Pablo Greco 40546a
         }
Pablo Greco 40546a
     }
Pablo Greco 40546a
-- 
Pablo Greco 40546a
2.22.0
Pablo Greco 40546a