From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33692) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUfb0-0000r5-1F for qemu-devel@nongnu.org; Wed, 26 Aug 2015 14:38:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZUfav-0000fy-2Z for qemu-devel@nongnu.org; Wed, 26 Aug 2015 14:38:49 -0400 Received: from mx-v6.kamp.de ([2a02:248:0:51::16]:51965 helo=mx01.kamp.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUfau-0000cu-OW for qemu-devel@nongnu.org; Wed, 26 Aug 2015 14:38:45 -0400 Message-ID: <55DE07AB.9040401@kamp.de> Date: Wed, 26 Aug 2015 20:38:35 +0200 From: Peter Lieven MIME-Version: 1.0 References: <1440407824-30037-1-git-send-email-pl@kamp.de> <20150826155404.GH4230@thinpad.lan.raisama.net> In-Reply-To: <20150826155404.GH4230@thinpad.lan.raisama.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit 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: Eduardo Habkost Cc: pbonzini@redhat.com, rth@twiddle.net, qemu-devel@nongnu.org, afaerber@suse.de Am 26.08.2015 um 17:54 schrieb Eduardo Habkost: > 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(). I did, but will do again. The problem is that x86_cpu_filter_features requires enabled KVM to run. I believed internally it does something similar to what I do here. > > 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? > The subject was missing that the goal was to list enforceable models in KVM mode. The output of the help page mentions this. Andreas suggested to make annotations to the list of CPU models. In theory it would be possible to have different annotations for different accelerators. Peter