提交 8d6ab797 编写于 作者: J Jiri Denemark 提交者: Daniel P. Berrangé

cpu_x86: Do not cache microcode version

The microcode version checks are used to invalidate cached CPU data we
get from QEMU. To minimize /proc/cpuinfo parsing the microcode version
was only read when libvirtd started and cached for the daemon's
lifetime. However, the CPU microcode can change anytime (updating the
microcode package can automatically upload it to the CPU) and we need to
stop caching it to avoid using stale CPU model data.
Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
(cherry picked from commit be46f613)
上级 40cf57b5
...@@ -154,7 +154,6 @@ struct _virCPUx86Map { ...@@ -154,7 +154,6 @@ struct _virCPUx86Map {
}; };
static virCPUx86MapPtr cpuMap; static virCPUx86MapPtr cpuMap;
static unsigned int microcodeVersion;
int virCPUx86DriverOnceInit(void); int virCPUx86DriverOnceInit(void);
VIR_ONCE_GLOBAL_INIT(virCPUx86Driver); VIR_ONCE_GLOBAL_INIT(virCPUx86Driver);
...@@ -1413,8 +1412,6 @@ virCPUx86DriverOnceInit(void) ...@@ -1413,8 +1412,6 @@ virCPUx86DriverOnceInit(void)
if (!(cpuMap = virCPUx86LoadMap())) if (!(cpuMap = virCPUx86LoadMap()))
return -1; return -1;
microcodeVersion = virHostCPUGetMicrocodeVersion();
return 0; return 0;
} }
...@@ -2454,7 +2451,7 @@ virCPUx86GetHost(virCPUDefPtr cpu, ...@@ -2454,7 +2451,7 @@ virCPUx86GetHost(virCPUDefPtr cpu,
goto cleanup; goto cleanup;
ret = x86DecodeCPUData(cpu, cpuData, models); ret = x86DecodeCPUData(cpu, cpuData, models);
cpu->microcodeVersion = microcodeVersion; cpu->microcodeVersion = virHostCPUGetMicrocodeVersion();
cleanup: cleanup:
virCPUx86DataFree(cpuData); virCPUx86DataFree(cpuData);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册