RE: [PATCH uq/master V2] kvm: Add CPUID support for VIA CPU

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, Jan
> 
> > @@ -855,6 +870,8 @@ int cpu_x86_register (CPUX86State *env,
> >      env->cpuid_xlevel = def->xlevel;
> >      env->cpuid_kvm_features = def->kvm_features;
> >      env->cpuid_svm_features = def->svm_features;
> > +    env->cpuid_ext4_features = def->ext4_features;
> > +    env->cpuid_xlevel2 = def->xlevel2;
> >      if (!kvm_enabled()) {
> >          env->cpuid_features &= TCG_FEATURES;
> >          env->cpuid_ext_features &= TCG_EXT_FEATURES; @@ -1034,7
> > +1051,12 @@ void cpu_x86_cpuid(CPUX86State *env, uin
> >                     uint32_t *ecx, uint32_t *edx)  {
> >      /* test if maximum index reached */
> > -    if (index & 0x80000000) {
> > +    if ((index & 0xC000000f) == index) {
> 
> This condition can't be correct. It triggers on every index <= 15 and 
> breaks qemu.

I'm so sorry to make such a stupid mistake. Thank you very for your revieview.

> 
> > +        /* Handle the Centaur's CPUID instruction. */
> > +        if (index > env->cpuid_xlevel2) {
> > +            index = env->cpuid_xlevel2;
> > +        }
> > +    } else if (index & 0x80000000) {
> 
> Your very first version looked like this:

The first version has some problem, so you could ignore it.

> 
> -    if (index & 0x80000000) {
> +    if ((index & 0xC0000000) == 0xC0000000) {
> +	/* Handle the Centaur's CPUID instruction.*
> +	* If cpuid_xlevel2 is "0", then put into the*
> +	* default case. */
> +	if (env->cpuid_xlevel2 == 0)
> +	    index = 0xF0000000;
> +	else if (index > env->cpuid_xlevel2)
> +	    index = env->cpuid_xlevel2;
> +    } else if (index & 0x80000000) {
> 
> Something went wrong here, please re-validate the patch carefully.

Ok, I will check it soon. 

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux