From: Gleb Natapov <gleb@redhat.com>
To: avi@redhat.com
Cc: kvm@vger.kernel.org
Subject: [PATCH] Initialize entire cpuid2 structure
Date: Tue, 3 Feb 2009 11:02:41 +0200 [thread overview]
Message-ID: <20090203090241.GA30234@redhat.com> (raw)
Uninitialized fields may contain garbage.
Signed-off-by: Gleb Natapov <gleb@redhat.com>
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];
--
Gleb.
next reply other threads:[~2009-02-03 9:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-03 9:02 Gleb Natapov [this message]
2009-02-03 10:09 ` [PATCH] Initialize entire cpuid2 structure Amit Shah
2009-02-03 12:27 ` Avi Kivity
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090203090241.GA30234@redhat.com \
--to=gleb@redhat.com \
--cc=avi@redhat.com \
--cc=kvm@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox