qemu: fix cpuid eax for kvm cpu
PATCH 1/1 qemu: fix cpuid eax for kvm cpu
cpuid eax should return the max leaf so that
guests can find out the valid range.
This matches Xen et al.
Tested using -cpu kvm64.
--- target-i386/kvm.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
target-i386/kvm.c +1 -1
@@ -379,7 +379,7 @@ int kvm_arch_init_vcpu(CPUX86State *env) c->function =KVM_CPUID_SIGNATURE ;if (!hyperv_enabled ()) {memcpy (signature,"KVMKVMKVM\0\0\0" ,12 ); - c->eax =0 ; + c->eax =KVM_CPUID_FEATURES ; }else {memcpy (signature,"Microsoft Hv" ,12 ); c->eax =HYPERV_CPUID_MIN ;
Signature · 1 line
MST
Quoted 16 lines · Michael S. Tsirkin
cpuid eax should return the max leaf so that
guests can find out the valid range.
This matches Xen et al.Tested using -cpu kvm64.
Signed-off-by Michael S. Tsirkin <[email protected]>--- target-i386/kvm.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)target-i386/kvm.c +0
-0
target-i386/kvm.c int kvm_arch_init_vcpu(CPUX86State *env) · line 385
Quoted 8 lines
target-i386/kvm.c +1
-1@@ -379,7 +379,7 @@ int kvm_arch_init_vcpu(CPUX86State *env) c->function =KVM_CPUID_SIGNATURE ;if (!hyperv_enabled ()) {memcpy (signature,"KVMKVMKVM\0\0\0" ,12 ); - c->eax =0 ; + c->eax =KVM_CPUID_FEATURES ; }else {memcpy (signature,"Microsoft Hv" ,12 ); c->eax =HYPERV_CPUID_MIN ;
Should only change for -M 1.1+?
Signature · 1 line
error compiling committee.c: too many arguments to function
Quoted 12 lines · Avi Kivity
Quoted 11 lines · Michael S. Tsirkin
cpuid eax should return the max leaf so that
guests can find out the valid range.
This matches Xen et al.Tested using -cpu kvm64.
Signed-off-by Michael S. Tsirkin <[email protected]>--- target-i386/kvm.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
Quoted 15 lines
target-i386/kvm.c int kvm_arch_init_vcpu(CPUX86State *env) · line 385
Quoted 13 lines
target-i386/kvm.c +1
-1@@ -379,7 +379,7 @@ int kvm_arch_init_vcpu(CPUX86State *env) c->function =KVM_CPUID_SIGNATURE ;if (!hyperv_enabled ()) {memcpy (signature,"KVMKVMKVM\0\0\0" ,12 ); - c->eax =0 ; + c->eax =KVM_CPUID_FEATURES ; }else {memcpy (signature,"Microsoft Hv" ,12 ); c->eax =HYPERV_CPUID_MIN ;Should only change for -M 1.1+?
I don't think we should: it's a bug fix and we don't try to be bug for bug compatible unless fixing the bug actually affects guest behaviour.
Quoted 2 lines
Signature · 1 line
error compiling committee.c: too many arguments to function
Quoted 29 lines · Michael S. Tsirkin
Quoted 12 lines · Avi Kivity
Quoted 11 lines · Michael S. Tsirkin
cpuid eax should return the max leaf so that
guests can find out the valid range.
This matches Xen et al.Tested using -cpu kvm64.
Signed-off-by Michael S. Tsirkin <[email protected]>--- target-i386/kvm.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)Quoted 15 lines
target-i386/kvm.c int kvm_arch_init_vcpu(CPUX86State *env) · line 385
Quoted 13 lines
target-i386/kvm.c +1
-1@@ -379,7 +379,7 @@ int kvm_arch_init_vcpu(CPUX86State *env) c->function =KVM_CPUID_SIGNATURE ;if (!hyperv_enabled ()) {memcpy (signature,"KVMKVMKVM\0\0\0" ,12 ); - c->eax =0 ; + c->eax =KVM_CPUID_FEATURES ; }else {memcpy (signature,"Microsoft Hv" ,12 ); c->eax =HYPERV_CPUID_MIN ;Should only change for -M 1.1+?
Quoted 3 lines
I don't think we should: it's a bug fix and we don't try to be bug for bug compatible unless fixing the bug actually affects guest behaviour.
I agree.
Signature · 1 line
error compiling committee.c: too many arguments to function