|
Pablo Greco |
40546a |
From e0ea2a8c9fb17cbb0b48cb8a1548152e962b126b Mon Sep 17 00:00:00 2001
|
|
Pablo Greco |
40546a |
Message-Id: <e0ea2a8c9fb17cbb0b48cb8a1548152e962b126b@dist-git>
|
|
Pablo Greco |
40546a |
From: Jiri Denemark <jdenemar@redhat.com>
|
|
Pablo Greco |
40546a |
Date: Fri, 21 Jun 2019 09:25:45 +0200
|
|
Pablo Greco |
40546a |
Subject: [PATCH] cpu_x86: Fix placement of *CheckFeature functions
|
|
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 |
Commit 0a97486e09 moved them outside #ifdef, but after virCPUx86GetHost,
|
|
Pablo Greco |
40546a |
which will start calling them in the following patch.
|
|
Pablo Greco |
40546a |
|
|
Pablo Greco |
40546a |
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
|
Pablo Greco |
40546a |
(cherry picked from commit 32f577ab10aefda6c4666abd07814c5c39f57788)
|
|
Pablo Greco |
40546a |
|
|
Pablo Greco |
40546a |
https://bugzilla.redhat.com/show_bug.cgi?id=1697627
|
|
Pablo Greco |
40546a |
|
|
Pablo Greco |
40546a |
Conflicts:
|
|
Pablo Greco |
40546a |
src/cpu/cpu_x86.c
|
|
Pablo Greco |
40546a |
- only the last patch moving these functions is backported
|
|
Pablo Greco |
40546a |
|
|
Pablo Greco |
40546a |
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
|
Pablo Greco |
40546a |
Message-Id: <7bb25ee8ca5b743934fa2ae8249f5715a47aba06.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 | 70 +++++++++++++++++++++++------------------------
|
|
Pablo Greco |
40546a |
1 file changed, 35 insertions(+), 35 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 fdc2974a0d..3c1bd623db 100644
|
|
Pablo Greco |
40546a |
--- a/src/cpu/cpu_x86.c
|
|
Pablo Greco |
40546a |
+++ b/src/cpu/cpu_x86.c
|
|
Pablo Greco |
40546a |
@@ -2377,6 +2377,41 @@ x86Encode(virArch arch,
|
|
Pablo Greco |
40546a |
}
|
|
Pablo Greco |
40546a |
|
|
Pablo Greco |
40546a |
|
|
Pablo Greco |
40546a |
+static int
|
|
Pablo Greco |
40546a |
+virCPUx86CheckFeature(const virCPUDef *cpu,
|
|
Pablo Greco |
40546a |
+ const char *name)
|
|
Pablo Greco |
40546a |
+{
|
|
Pablo Greco |
40546a |
+ int ret = -1;
|
|
Pablo Greco |
40546a |
+ virCPUx86MapPtr map;
|
|
Pablo Greco |
40546a |
+ virCPUx86ModelPtr model = NULL;
|
|
Pablo Greco |
40546a |
+
|
|
Pablo Greco |
40546a |
+ if (!(map = virCPUx86GetMap()))
|
|
Pablo Greco |
40546a |
+ return -1;
|
|
Pablo Greco |
40546a |
+
|
|
Pablo Greco |
40546a |
+ if (!(model = x86ModelFromCPU(cpu, map, -1)))
|
|
Pablo Greco |
40546a |
+ goto cleanup;
|
|
Pablo Greco |
40546a |
+
|
|
Pablo Greco |
40546a |
+ ret = x86FeatureInData(name, &model->data, map);
|
|
Pablo Greco |
40546a |
+
|
|
Pablo Greco |
40546a |
+ cleanup:
|
|
Pablo Greco |
40546a |
+ x86ModelFree(model);
|
|
Pablo Greco |
40546a |
+ return ret;
|
|
Pablo Greco |
40546a |
+}
|
|
Pablo Greco |
40546a |
+
|
|
Pablo Greco |
40546a |
+
|
|
Pablo Greco |
40546a |
+static int
|
|
Pablo Greco |
40546a |
+virCPUx86DataCheckFeature(const virCPUData *data,
|
|
Pablo Greco |
40546a |
+ const char *name)
|
|
Pablo Greco |
40546a |
+{
|
|
Pablo Greco |
40546a |
+ virCPUx86MapPtr map;
|
|
Pablo Greco |
40546a |
+
|
|
Pablo Greco |
40546a |
+ if (!(map = virCPUx86GetMap()))
|
|
Pablo Greco |
40546a |
+ return -1;
|
|
Pablo Greco |
40546a |
+
|
|
Pablo Greco |
40546a |
+ return x86FeatureInData(name, &data->data.x86, map);
|
|
Pablo Greco |
40546a |
+}
|
|
Pablo Greco |
40546a |
+
|
|
Pablo Greco |
40546a |
+
|
|
Pablo Greco |
40546a |
#if defined(__i386__) || defined(__x86_64__)
|
|
Pablo Greco |
40546a |
static inline void
|
|
Pablo Greco |
40546a |
cpuidCall(virCPUx86CPUID *cpuid)
|
|
Pablo Greco |
40546a |
@@ -2706,41 +2741,6 @@ cpuidSet(uint32_t base, virCPUDataPtr data)
|
|
Pablo Greco |
40546a |
}
|
|
Pablo Greco |
40546a |
|
|
Pablo Greco |
40546a |
|
|
Pablo Greco |
40546a |
-static int
|
|
Pablo Greco |
40546a |
-virCPUx86CheckFeature(const virCPUDef *cpu,
|
|
Pablo Greco |
40546a |
- const char *name)
|
|
Pablo Greco |
40546a |
-{
|
|
Pablo Greco |
40546a |
- int ret = -1;
|
|
Pablo Greco |
40546a |
- virCPUx86MapPtr map;
|
|
Pablo Greco |
40546a |
- virCPUx86ModelPtr model = NULL;
|
|
Pablo Greco |
40546a |
-
|
|
Pablo Greco |
40546a |
- if (!(map = virCPUx86GetMap()))
|
|
Pablo Greco |
40546a |
- return -1;
|
|
Pablo Greco |
40546a |
-
|
|
Pablo Greco |
40546a |
- if (!(model = x86ModelFromCPU(cpu, map, -1)))
|
|
Pablo Greco |
40546a |
- goto cleanup;
|
|
Pablo Greco |
40546a |
-
|
|
Pablo Greco |
40546a |
- ret = x86FeatureInData(name, &model->data, map);
|
|
Pablo Greco |
40546a |
-
|
|
Pablo Greco |
40546a |
- cleanup:
|
|
Pablo Greco |
40546a |
- x86ModelFree(model);
|
|
Pablo Greco |
40546a |
- return ret;
|
|
Pablo Greco |
40546a |
-}
|
|
Pablo Greco |
40546a |
-
|
|
Pablo Greco |
40546a |
-
|
|
Pablo Greco |
40546a |
-static int
|
|
Pablo Greco |
40546a |
-virCPUx86DataCheckFeature(const virCPUData *data,
|
|
Pablo Greco |
40546a |
- const char *name)
|
|
Pablo Greco |
40546a |
-{
|
|
Pablo Greco |
40546a |
- virCPUx86MapPtr map;
|
|
Pablo Greco |
40546a |
-
|
|
Pablo Greco |
40546a |
- if (!(map = virCPUx86GetMap()))
|
|
Pablo Greco |
40546a |
- return -1;
|
|
Pablo Greco |
40546a |
-
|
|
Pablo Greco |
40546a |
- return x86FeatureInData(name, &data->data.x86, map);
|
|
Pablo Greco |
40546a |
-}
|
|
Pablo Greco |
40546a |
-
|
|
Pablo Greco |
40546a |
-
|
|
Pablo Greco |
40546a |
static int
|
|
Pablo Greco |
40546a |
virCPUx86GetHost(virCPUDefPtr cpu,
|
|
Pablo Greco |
40546a |
virDomainCapsCPUModelsPtr models)
|
|
Pablo Greco |
40546a |
--
|
|
Pablo Greco |
40546a |
2.22.0
|
|
Pablo Greco |
40546a |
|