From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] KVM: qemu: CPUID takes ecx as input value for some functions Date: Sun, 11 Jan 2009 13:23:32 +0200 Message-ID: <4969D6B4.9000507@redhat.com> References: <1231670495-17916-1-git-send-email-amit.shah@redhat.com> <4969CE19.7030009@redhat.com> <20090111105715.GA19556@amit-x200.pnq.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Amit Shah Return-path: Received: from mx2.redhat.com ([66.187.237.31]:38674 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751200AbZAKLXf (ORCPT ); Sun, 11 Jan 2009 06:23:35 -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 n0BBNYge019178 for ; Sun, 11 Jan 2009 06:23:34 -0500 In-Reply-To: <20090111105715.GA19556@amit-x200.pnq.redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Amit Shah wrote: > On Sun, Jan 11, 2009 at 12:46:49PM +0200, Avi Kivity wrote: > >> Amit Shah wrote: >> >>> The CPUID instruction takes the value of ECX as an input parameter >>> in addition to the value of EAX for function 4. Make sure we pass >>> the value to the instruction. >>> >>> >>> >> This needs to go to upstream qemu. I'd suggest adding a new parameter >> rather than making ecx an in/out parameter. >> > > You mean something like > > host_cpuid(index, subindex, eax, ebx, ecx, edx); > > ? > > Yes. >> I'd expect a loop when we use this... >> > > Why a loop? We'll only return the values true for a particular EAX:ECX > combination. The requestor (kernel) will loop. > The kernel doesn't call host_cpuid(). We preload all possible combinations of eax and ecx in advance. -- error compiling committee.c: too many arguments to function