From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44827) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wl0nQ-0006pZ-TE for qemu-devel@nongnu.org; Thu, 15 May 2014 14:54:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wl0nK-0001DX-DK for qemu-devel@nongnu.org; Thu, 15 May 2014 14:54:24 -0400 Received: from cantor2.suse.de ([195.135.220.15]:51327 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wl0nK-0001DJ-2a for qemu-devel@nongnu.org; Thu, 15 May 2014 14:54:18 -0400 Message-ID: <53750D57.7010403@suse.de> Date: Thu, 15 May 2014 20:54:15 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1398876525-28831-1-git-send-email-ehabkost@redhat.com> <1398876525-28831-13-git-send-email-ehabkost@redhat.com> In-Reply-To: <1398876525-28831-13-git-send-email-ehabkost@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v4 12/18] target-i386: Support check/enforce flags in TCG mode, too List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost , qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , Marcelo Tosatti , Aurelien Jarno , Igor Mammedov Am 30.04.2014 18:48, schrieb Eduardo Habkost: > If enforce/check is specified in TCG mode, QEMU will ensure all CPU > features are supported by TCG, so no CPU feature is silently disabled. >=20 > Reviewed-by: Richard Henderson > Signed-off-by: Eduardo Habkost > --- > Changes v1 -> v2: > * Trivial rebase to latest qom-cpu (commit 90c5d39c) > (Reviewed-by line kept) > Changes v2 -> v3: > * Trivial rebase after QEMU 2.0 (onto commit 2d03b49) > (Reviewed-by line kept) > --- > target-i386/cpu.c | 34 ++++++++++++++++------------------ > 1 file changed, 16 insertions(+), 18 deletions(-) >=20 > diff --git a/target-i386/cpu.c b/target-i386/cpu.c > index b2e30ca..53b5038 100644 > --- a/target-i386/cpu.c > +++ b/target-i386/cpu.c > @@ -1265,8 +1265,9 @@ static int report_unavailable_features(FeatureWor= d w, uint32_t mask) > if (1 << i & mask) { > const char *reg =3D get_register_name_32(f->cpuid_reg); > assert(reg); > - fprintf(stderr, "warning: host doesn't support requested f= eature: " > + fprintf(stderr, "warning: %s doesn't support requested fea= ture: " > "CPUID.%02XH:%s%s%s [bit %d]\n", > + kvm_enabled() ? "host" : "TCG", > f->cpuid_eax, reg, > f->feat_names[i] ? "." : "", > f->feat_names[i] ? f->feat_names[i] : "", i); > @@ -1826,17 +1827,18 @@ CpuDefinitionInfoList *arch_query_cpu_definitio= ns(Error **errp) > static uint32_t x86_cpu_get_supported_feature_word(FeatureWord w) > { > FeatureWordInfo *wi =3D &feature_word_info[w]; > - assert(kvm_enabled()); > - return kvm_arch_get_supported_cpuid(kvm_state, wi->cpuid_eax, > - wi->cpuid_ecx, > - wi->cpuid_reg); > + if (kvm_enabled()) { > + return kvm_arch_get_supported_cpuid(kvm_state, wi->cpuid_eax, > + wi->cpuid_ecx, > + wi->cpuid_reg); > + } else { > + return wi->tcg_features; > + } > } This function is called unconditionally now, so apply the following? diff --git a/target-i386/cpu.c b/target-i386/cpu.c index 48ba1d8..112b437 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -1839,8 +1839,10 @@ static uint32_t x86_cpu_get_supported_feature_word(FeatureWord w) return kvm_arch_get_supported_cpuid(kvm_state, wi->cpuid_eax, wi->cpuid_ecx, wi->cpuid_reg); - } else { + } else if (tcg_enabled()) { return wi->tcg_features; + } else { + return UINT32_MAX; } } Not sure what to do about the warning message. It wouldn't occur though due to the suggested mask, so we could just ignore it for now. Regards, Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg