aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/kvm/cpuid.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
index 2f7bc2de9915..644bfe828ce1 100644
--- a/arch/x86/kvm/cpuid.c
+++ b/arch/x86/kvm/cpuid.c
@@ -482,8 +482,14 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
482 entry[i].ebx = 482 entry[i].ebx =
483 xstate_required_size(supported, 483 xstate_required_size(supported,
484 true); 484 true);
485 } else if (entry[i].eax == 0 || !(supported & mask)) 485 } else {
486 continue; 486 if (entry[i].eax == 0 || !(supported & mask))
487 continue;
488 if (WARN_ON_ONCE(entry[i].ecx & 1))
489 continue;
490 }
491 entry[i].ecx = 0;
492 entry[i].edx = 0;
487 entry[i].flags |= 493 entry[i].flags |=
488 KVM_CPUID_FLAG_SIGNIFCANT_INDEX; 494 KVM_CPUID_FLAG_SIGNIFCANT_INDEX;
489 ++*nent; 495 ++*nent;