Commit 20800bc9 authored by Andre Przywara's avatar Andre Przywara Committed by Avi Kivity

KVM: fix XSAVE bit scanning

When KVM scans the 0xD CPUID leaf for propagating the XSAVE save area
leaves, it assumes that the leaves are contigious and stops at the
first zero one. On AMD hardware there is a gap, though, as LWP uses
leaf 62 to announce it's state save area.
So lets iterate through all 64 possible leaves and simply skip zero
ones to also cover later features.
Signed-off-by: default avatarAndre Przywara <andre.przywara@amd.com>
Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
parent 0857b9e9
...@@ -2395,9 +2395,9 @@ static void do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function, ...@@ -2395,9 +2395,9 @@ static void do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
int i; int i;
entry->flags |= KVM_CPUID_FLAG_SIGNIFCANT_INDEX; entry->flags |= KVM_CPUID_FLAG_SIGNIFCANT_INDEX;
for (i = 1; *nent < maxnent; ++i) { for (i = 1; *nent < maxnent && i < 64; ++i) {
if (entry[i - 1].eax == 0 && i != 2) if (entry[i].eax == 0)
break; continue;
do_cpuid_1_ent(&entry[i], function, i); do_cpuid_1_ent(&entry[i], function, i);
entry[i].flags |= entry[i].flags |=
KVM_CPUID_FLAG_SIGNIFCANT_INDEX; KVM_CPUID_FLAG_SIGNIFCANT_INDEX;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment