Received: from eggs.gnu.org ([208.118.235.92]:54851) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNIpo-0007K5-Cm for qemu-devel@nongnu.org; Wed, 03 Apr 2013 04:14:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UNIpl-0002fI-VQ for qemu-devel@nongnu.org; Wed, 03 Apr 2013 04:14:20 -0400 Date: Wed, 3 Apr 2013 10:14:13 +0200 From: Igor Mammedov Message-ID: <20130403101413.0ec52408@nial.usersys.redhat.com> In-Reply-To: <1364935692-24004-1-git-send-email-ehabkost@redhat.com> References: <1364935692-24004-1-git-send-email-ehabkost@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] target-i386: Check for host features before filter_features_for_kvm() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: qemu-stable@nongnu.org, qemu-devel@nongnu.org, Andreas =?ISO-8859-1?B?RuRyYmVy?= On Tue, 2 Apr 2013 17:48:12 -0300 Eduardo Habkost wrote: > commit 5ec01c2e96910e1588d1a0de8609b9dda7618c7f broke "-cpu ..,enforce", > as it has moved kvm_check_features_against_host() after the > filter_features_for_kvm() call. filter_features_for_kvm() removes all > features not supported by the host, so this effectively made > kvm_check_features_against_host() impossible to fail. > > This patch changes the call so we check for host feature support before > filtering the feature bits. > > Signed-off-by: Eduardo Habkost > Cc: Igor Mammedov > --- > target-i386/cpu.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/target-i386/cpu.c b/target-i386/cpu.c > index 9ee5b3d..8fe8bc7 100644 > --- a/target-i386/cpu.c > +++ b/target-i386/cpu.c > @@ -2132,14 +2132,14 @@ static void x86_cpu_realizefn(DeviceState *dev, > Error **errp) env->cpuid_ext3_features &= TCG_EXT3_FEATURES; > env->cpuid_svm_features &= TCG_SVM_FEATURES; > } else { > -#ifdef CONFIG_KVM > - filter_features_for_kvm(cpu); > -#endif > if (check_cpuid && kvm_check_features_against_host(cpu) > && enforce_cpuid) { > error_setg(errp, "Host's CPU doesn't support requested > features"); return; > } > +#ifdef CONFIG_KVM > + filter_features_for_kvm(cpu); > +#endif > } > > #ifndef CONFIG_USER_ONLY Reviewed-By: Igor Mammedov