diff mbox

Initialize entire cpuid2 structure

Message ID 20090203090241.GA30234@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Gleb Natapov Feb. 3, 2009, 9:02 a.m. UTC
Uninitialized fields may contain garbage.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
--
			Gleb.
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Amit Shah Feb. 3, 2009, 10:09 a.m. UTC | #1
On (Tue) Feb 03 2009 [11:02:41], Gleb Natapov wrote:
> Uninitialized fields may contain garbage.
> 
> Signed-off-by: Gleb Natapov <gleb@redhat.com>

Acked-By: Amit Shah <amit.shah@redhat.com>
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Avi Kivity Feb. 3, 2009, 12:27 p.m. UTC | #2
Gleb Natapov wrote:
> Uninitialized fields may contain garbage.
>
>   

Applied, thanks.
diff mbox

Patch

diff --git a/qemu/qemu-kvm-x86.c b/qemu/qemu-kvm-x86.c
index 01748ed..d2247c9 100644
--- a/qemu/qemu-kvm-x86.c
+++ b/qemu/qemu-kvm-x86.c
@@ -468,6 +468,8 @@  static void do_cpuid_ent(struct kvm_cpuid_entry2 *e, uint32_t function,
     env->regs[R_ECX] = count;
     qemu_kvm_cpuid_on_env(env);
     e->function = function;
+    e->flags = 0;
+    e->index = 0;
     e->eax = env->regs[R_EAX];
     e->ebx = env->regs[R_EBX];
     e->ecx = env->regs[R_ECX];