Skip to contentSkip to conversation

kvm-userspace: Add missing KVM string in the signature of CPUID

PATCH In review Guillaume Thouvenin 2 participants 4 messages Dec 2, 2008 – Dec 9, 2008 KVM

lore
Share & tools
lore
#0 lore raw

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
index 671b5b3..e9b200a 100644
@@ -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
#1 lore raw

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
#2 lore raw

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
index 671b5b3..2e68ace 100644
@@ -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
Applied
#3 lore raw

Re: [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