kvm-userspace: Add missing KVM string in the signature of CPUID
PATCH 1/1 kvm-userspace: Add missing KVM string in the signature of CPUID
It adds a missing "KVM" string in the signature of the CPUID. Without it signature[2] is not well defined.
--- qemu/qemu-kvm-x86.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
qemu/qemu-kvm-x86.c +1 -1
@@ -573,7 +573,7 @@ int kvm_arch_qemu_init_env(CPUState *cenv)#ifdef KVM_CPUID_SIGNATURE /* Paravirtualization CPUIDs */ -memcpy (signature,"KVMKVMKVM" ,12 ); +memcpy (signature,"KVMKVMKVMKVM" ,12 ); pv_ent = &cpuid_ent[cpuid_nent++];memset (pv_ent,0 ,sizeof (*pv_ent)); pv_ent->function =KVM_CPUID_SIGNATURE ;
Signature · 1 line
1.6.0.4.623.g171d7
qemu/qemu-kvm-x86.c int kvm_arch_qemu_init_env(CPUState *cenv) · line 579
Quoted 12 lines · Guillaume Thouvenin
It adds a missing "KVM" string in the signature of the CPUID. Without it signature[2] is not well defined.
#ifdef KVM_CPUID_SIGNATURE /* Paravirtualization CPUIDs */qemu/qemu-kvm-x86.c +1
-1-memcpy (signature,"KVMKVMKVM" ,12 ); +memcpy (signature,"KVMKVMKVMKVM" ,12 ); pv_ent = &cpuid_ent[cpuid_nent++];memset (pv_ent,0 ,sizeof (*pv_ent)); pv_ent->function =KVM_CPUID_SIGNATURE ;
That's not what the kernel is looking for. Add three '\0's instead.
Signature · 1 line
error compiling committee.c: too many arguments to function
PATCH 1/1 kvm-userspace: Add '\0' at the end of the signature of CPUID
Add '\0' at the end of the signature of CPUID
in order to fill the signature with known values.
--- qemu/qemu-kvm-x86.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
qemu/qemu-kvm-x86.c +1 -1
@@ -573,7 +573,7 @@ int kvm_arch_qemu_init_env(CPUState *cenv)#ifdef KVM_CPUID_SIGNATURE /* Paravirtualization CPUIDs */ -memcpy (signature,"KVMKVMKVM" ,12 ); +memcpy (signature,"KVMKVMKVM\0\0\0" ,12 ); pv_ent = &cpuid_ent[cpuid_nent++];memset (pv_ent,0 ,sizeof (*pv_ent)); pv_ent->function =KVM_CPUID_SIGNATURE ;
Signature · 1 line
1.6.0.4.623.g171d7
Avi Kivity
AppliedRe: [PATCH] kvm-userspace: Add '\0' at the end of the signature of CPUID
Quoted 2 lines · Guillaume Thouvenin
Add '\0' at the end of the signature of CPUID in order to fill the signature with known values.
Applied, thanks.
Signature · 1 line
error compiling committee.c: too many arguments to function