On 18/07/19 06:55, Jing Liu wrote: >> >> + *eax = kvm_arch_get_supported_cpuid(cs->kvm_state, 0x7, >> + count, R_EAX); > This needs to be firstly checked as follows, otherwise some > architectures would fail to compile. > > What about hvf and tcg CPUID 07 EAX value? > > + /* Maximum ECX value for sub-leaves */ > + if (kvm_enabled()) { > + *eax = kvm_arch_get_supported_cpuid(cs->kvm_state, 0x7, > + count, R_EAX); > + } else if (hvf_enabled()) { > + *eax = hvf_get_supported_cpuid(0x7, count, R_EAX); > + } else { > + *eax = 0; > + } >
Good question. You need to add a new property, for example cpuid_level_func7, whose code would be modeled around cpuid_level (and a field cpuid_min_level_func7 whose code would be modeled around cpuid_min_level). Then CPUID[7,0].EAX is set automatically to 0 or 1 depending on whether BF16 is enabled or not. Paolo