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