Hi Paolo,
On 6/20/2019 8:16 PM, Paolo Bonzini wrote:
On 20/06/19 13:21, Jing Liu wrote:
+ÂÂÂÂÂÂÂ for (i = 1; i <= times; i++) {
+ÂÂÂÂÂÂÂÂÂÂÂ if (*nent >= maxnent)
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ goto out;
+ÂÂÂÂÂÂÂÂÂÂÂ do_cpuid_1_ent(&entry[i], function, i);
+ÂÂÂÂÂÂÂÂÂÂÂ entry[i].eax &= F(AVX512_BF16);
+ÂÂÂÂÂÂÂÂÂÂÂ entry[i].ebx = 0;
+ÂÂÂÂÂÂÂÂÂÂÂ entry[i].ecx = 0;
+ÂÂÂÂÂÂÂÂÂÂÂ entry[i].edx = 0;
+ÂÂÂÂÂÂÂÂÂÂÂ entry[i].flags |= KVM_CPUID_FLAG_SIGNIFCANT_INDEX;
+ÂÂÂÂÂÂÂÂÂÂÂ ++*nent;
This woud be wrong for i > 1, so instead make this
ÂÂÂÂif (entry->eax >= 1)
I am confused about the @index parameter. @index seems not used for
every case except 0x07. Since the caller function only has @index=0, so
all other cases except 0x07 put cpuid info from subleaf=0 to max subleaf.
What do you think about @index in current function? Does it mean, we
need put cpuid from index to max subleaf to @entry[i]? If so, the logic
seems as follows,
if (index == 0) {
ÂÂÂ // Put subleaf 0 into @entry
ÂÂÂ // Put subleaf 1 into @entry[1]
} else if (index < entry->eax) {
ÂÂÂ // Put subleaf 1 into @entry
} else {
ÂÂÂ // Put all zero into @entry
}
But this seems not identical with other cases, for current caller
function. Or we can simply ignore @index in 0x07 and just put all possible
subleaf info back?
and define F(AVX512_BF16) as a new constant kvm_cpuid_7_1_eax_features.Got it.
Thanks,
Jing
Paolo