From: Amit Shah Subject: Re: [PATCH] kvm: userspace: Initialise ECX value with 'count' as host_cpuid now expects it Date: Wed, 18 Feb 2009 10:28:15 +0530 Message-ID: <20090218045815.GA10460@amit-x200.pnq.redhat.com> References: <1234885535-8332-1-git-send-email-amit.shah@redhat.com> <499AFDEB.8080603@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from mx2.redhat.com ([66.187.237.31]:58684 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752906AbZBRE6D (ORCPT ); Tue, 17 Feb 2009 23:58:03 -0500 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n1I4w2WX026113 for ; Tue, 17 Feb 2009 23:58:02 -0500 Content-Disposition: inline In-Reply-To: <499AFDEB.8080603@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On (Tue) Feb 17 2009 [18:11:55], Avi Kivity wrote: > Amit Shah wrote: >> host_cpuid now accepts a 'count' parameter for cpuid. Initialise the value >> of ecx before any call to the function. >> >> Signed-off-by: Amit Shah >> --- >> qemu/qemu-kvm-x86.c | 2 ++ >> 1 files changed, 2 insertions(+), 0 deletions(-) >> >> diff --git a/qemu/qemu-kvm-x86.c b/qemu/qemu-kvm-x86.c >> index 5264015..b1e2da2 100644 >> --- a/qemu/qemu-kvm-x86.c >> +++ b/qemu/qemu-kvm-x86.c >> @@ -534,6 +534,7 @@ int kvm_arch_qemu_init_env(CPUState *cenv) >> #endif >> copy.regs[R_EAX] = 0; >> + copy.regs[R_ECX] = 0; >> qemu_kvm_cpuid_on_env(©); >> limit = copy.regs[R_EAX]; >> @@ -559,6 +560,7 @@ int kvm_arch_qemu_init_env(CPUState *cenv) >> } >> copy.regs[R_EAX] = 0x80000000; >> + copy.regs[R_ECX] = 0; >> qemu_kvm_cpuid_on_env(©); >> limit = copy.regs[R_EAX]; > > Does this make any difference? Neither function actually depends on ecx. No; it doesn't. But it's good practice to init all the data that a function takes as arguments.