mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-31 22:50:30 +03:00
cpu: Fix waitpkg feature dependency for migration
This patch adds special handling for the waitpkg CPU feature to ensure its required CPU feature bit is properly set. During live migration, the waitpkg feature (CPUID.07H:ECX bit 5) can fail with the error message: "This feature depends on other features that were not requested: CPUID.07H:ECX.waitpkg [bit 5]" This patch ensures the correct CPUID bit is explicitly set when the waitpkg feature is requested, fixing the migration issue.
This commit is contained in:
parent
631fceade9
commit
5495dda78c
@ -3499,12 +3499,25 @@ static int
|
||||
virCPUx86DataAddFeature(virCPUData *cpuData,
|
||||
const char *name)
|
||||
{
|
||||
virCPUx86Feature *feature;
|
||||
virCPUx86DataItem cpuid_waitpkg_item = CPUID_EMPTY;
|
||||
virCPUx86Map *map;
|
||||
virCPUx86Feature *feature;
|
||||
|
||||
if (!(map = virCPUx86GetMap()))
|
||||
return -1;
|
||||
|
||||
if (STREQ(name, "waitpkg")) {
|
||||
/* The waitpkg feature requires CPUID.07H:ECX.waitpkg [bit 5] */
|
||||
VIR_DEBUG("Adding CPU dependency for waitpkg feature");
|
||||
|
||||
/* Define the CPU feature bit needed for waitpkg */
|
||||
cpuid_waitpkg_item.type = VIR_CPU_X86_DATA_CPUID;
|
||||
cpuid_waitpkg_item.data.cpuid.eax_in = 0x00000007;
|
||||
cpuid_waitpkg_item.data.cpuid.ecx_in = 0x00000000;
|
||||
cpuid_waitpkg_item.data.cpuid.ecx = 0x00000020; /* Bit 5 in ECX */
|
||||
virCPUx86DataAdd(cpuData, &cpuid_waitpkg_item);
|
||||
}
|
||||
|
||||
/* ignore unknown features */
|
||||
if (!(feature = x86FeatureFind(map, name)) &&
|
||||
!(feature = x86FeatureFindInternal(name)))
|
||||
@ -3768,7 +3781,6 @@ virCPUx86GetCanonicalModel(const char *modelName)
|
||||
return model->canonical->name;
|
||||
}
|
||||
|
||||
|
||||
struct cpuArchDriver cpuDriverX86 = {
|
||||
.name = "x86",
|
||||
.arch = archs,
|
||||
|
Loading…
x
Reference in New Issue
Block a user