From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IT0hC-0005LC-7n for qemu-devel@nongnu.org; Wed, 05 Sep 2007 15:37:50 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IT0hA-0005HP-Iq for qemu-devel@nongnu.org; Wed, 05 Sep 2007 15:37:49 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IT0hA-0005H4-5t for qemu-devel@nongnu.org; Wed, 05 Sep 2007 15:37:48 -0400 Received: from il.qumranet.com ([82.166.9.18]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IT0h9-0002r2-OR for qemu-devel@nongnu.org; Wed, 05 Sep 2007 15:37:48 -0400 Message-ID: <46DF04D5.5000807@qumranet.com> Date: Wed, 05 Sep 2007 22:34:45 +0300 From: Avi Kivity MIME-Version: 1.0 References: <20070905174530.GA3945@karma.qumranet.com> <1189020371.7206.3.camel@squirrel> In-Reply-To: <1189020371.7206.3.camel@squirrel> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [kvm-devel] expose host CPU features to guests Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: danken@qumranet.com, kvm-devel , qemu-devel@nongnu.org Anthony Liguori wrote: > On Wed, 2007-09-05 at 20:45 +0300, danken@qumranet.com wrote: > >> Hi, >> >> It's a pity not to use a host CPU feature if it is available. This patch >> exposes host CPU features to guests. It allows fine-tuning the presented >> features from the command-line. >> >> The code could use some serious clean ups, but I think it is interesting >> enough right now. I'd be happy to hear your opinion and suggestions. >> The diff are done against qemu cvs. I tried it with kvm, but I thinkg it >> should be useful also for kqemu. >> > > I like this idea but I have some suggestions about the general approach. > I think instead of defining another machine type, it would be better to > just have a command line option like -cpuid that took a comma separate > string of features with "all" meaning all features that the host has. > > I think qemu-cvs has a -cpu option for non-x86 which could be used for this. Agree machine types are the wrong approach. > I also think it would be nicer to use cpuid() directly instead of > attempting to parse /proc/cpuinfo. > Yes. -- Any sufficiently difficult bug is indistinguishable from a feature.