From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59590) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUd1g-0006y2-MH for qemu-devel@nongnu.org; Wed, 26 Aug 2015 11:54:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZUd1c-0001Dz-JW for qemu-devel@nongnu.org; Wed, 26 Aug 2015 11:54:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57978) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUd1c-0001Du-EY for qemu-devel@nongnu.org; Wed, 26 Aug 2015 11:54:08 -0400 Date: Wed, 26 Aug 2015 12:54:04 -0300 From: Eduardo Habkost Message-ID: <20150826155404.GH4230@thinpad.lan.raisama.net> References: <1440407824-30037-1-git-send-email-pl@kamp.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1440407824-30037-1-git-send-email-pl@kamp.de> Subject: Re: [Qemu-devel] [PATCH] target-i386: add a list of enforceable CPU models to the help output List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Lieven Cc: pbonzini@redhat.com, rth@twiddle.net, qemu-devel@nongnu.org, afaerber@suse.de On Mon, Aug 24, 2015 at 11:17:04AM +0200, Peter Lieven wrote: > this patch adds a probe that lists all enforceable and migrateable > CPU models to the -cpu help output. The idea is to know a priory > which CPU modules can be exposed to the user without loosing any > feature flags. > > Signed-off-by: Peter Lieven [...] > +/* > + * Check if the CPU Definition is enforcable on the current host CPU > + * and contains no unmigratable flags. > + * > + * Returns: true if the CPU can be enforced and migrated. > + */ > +static bool x86_cpu_enforce_and_migratable(X86CPUDefinition *def) > +{ > + int i; > + for (i = 0; i < ARRAY_SIZE(feature_word_info); i++) { > + FeatureWordInfo *fw = &feature_word_info[i]; > + uint32_t eax, ebx, ecx, edx, host; > + host_cpuid(fw->cpuid_eax, 0, &eax, &ebx, &ecx, &edx); This isn't how you check if the CPU model can run in "enforce" mode. Please read x86_cpu_filter_features(). Also, you can't tell if a CPU model is runnable in enforce mode unless you know what's the accelerator being used (see x86_cpu_filter_features()). How do you suggest we show accelerator-specific information in help output? -- Eduardo