@@ -677,6 +677,7 @@ static inline int __do_cpuid_func(struct kvm_cpuid_entry2 *entry, u32 function,
goto out;
do_host_cpuid(&entry[i], function, idx);
+ ++*nent;
/*
* The @supported check above should have filtered out
@@ -685,12 +686,13 @@ static inline int __do_cpuid_func(struct kvm_cpuid_entry2 *entry, u32 function,
* reach this point, and they should have a non-zero
* save state size.
*/
- if (WARN_ON_ONCE(!entry[i].eax || (entry[i].ecx & 1)))
+ if (WARN_ON_ONCE(!entry[i].eax || (entry[i].ecx & 1))) {
+ --*nent;
continue;
+ }
entry[i].ecx = 0;
entry[i].edx = 0;
- ++*nent;
++i;
}
break;