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