render / rpms / libvirt

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