Received: from eggs.gnu.org ([2001:4830:134:3::10]:60185) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCqMI-0004Jm-HZ for qemu-devel@nongnu.org; Wed, 08 Jul 2015 10:30:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZCqME-0003KZ-BS for qemu-devel@nongnu.org; Wed, 08 Jul 2015 10:29:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38076) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCqME-0003K8-6j for qemu-devel@nongnu.org; Wed, 08 Jul 2015 10:29:54 -0400 Date: Wed, 8 Jul 2015 11:29:52 -0300 From: Eduardo Habkost Message-ID: <20150708142952.GG32472@thinpad.lan.raisama.net> References: <1436265721-30197-1-git-send-email-pbonzini@redhat.com> <20150707172151.GE32472@thinpad.lan.raisama.net> <559D1342.7000608@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <559D1342.7000608@redhat.com> Subject: Re: [Qemu-devel] [PATCH rebased for-2.4] target-i386: add ABM to Haswell* and Broadwell* CPU models List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: jdenemar@redhat.com, qemu-devel@nongnu.org, afaerber@suse.de On Wed, Jul 08, 2015 at 02:10:42PM +0200, Paolo Bonzini wrote: > > > On 07/07/2015 19:21, Eduardo Habkost wrote: > > On Tue, Jul 07, 2015 at 12:42:01PM +0200, Paolo Bonzini wrote: > >> ABM is only implemented as a single instruction set by AMD; all AMD > >> processors support both instructions or neither. Intel considers POPCNT > >> as part of SSE4.2, and LZCNT as part of BMI1, but Intel also uses AMD's > >> ABM flag to indicate support for both POPCNT and LZCNT. It has to be > >> added to Haswell and Broadwell because Haswell, by adding LZCNT, has > >> completed the ABM. > >> > >> Tested with "qemu-kvm -cpu Haswell-noTSX,enforce" (and also with older > >> machine types) on an Haswell-EP machine. > >> > >> Signed-off-by: Paolo Bonzini > >> --- > >> hw/i386/pc_piix.c | 4 ++++ > >> hw/i386/pc_q35.c | 4 ++++ > >> target-i386/cpu.c | 8 ++++---- > >> 3 files changed, 12 insertions(+), 4 deletions(-) > >> > >> diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c > >> index 56cdcb9..d9e9987 100644 > >> --- a/hw/i386/pc_piix.c > >> +++ b/hw/i386/pc_piix.c > >> @@ -312,6 +312,10 @@ static void pc_compat_2_3(MachineState *machine) > >> if (kvm_enabled()) { > >> pcms->smm = ON_OFF_AUTO_OFF; > >> } > >> + x86_cpu_compat_set_features("Haswell", FEAT_8000_0001_ECX, 0, CPUID_EXT3_ABM); > >> + x86_cpu_compat_set_features("Haswell-noTSX", FEAT_8000_0001_ECX, 0, CPUID_EXT3_ABM); > >> + x86_cpu_compat_set_features("Broadwell", FEAT_8000_0001_ECX, 0, CPUID_EXT3_ABM); > >> + x86_cpu_compat_set_features("Broadwell-noTSX", FEAT_8000_0001_ECX, 0, CPUID_EXT3_ABM); > > > > x86_cpu_compat_set_features() is not necessary anymore, please use > > PC_COMPAT_2_3 to disable ABM. > > Would this be appropriate for 2.4, or should I just wait for 2.5? As it can be easily worked around by using "-cpu ,+abm", I don't think it qualifies as bug fix. (Sorry, I just noticed you submitted the patch some time ago but it slipped through the cracks). -- Eduardo