qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: jdenemar@redhat.com, qemu-devel@nongnu.org, afaerber@suse.de
Subject: Re: [Qemu-devel] [PATCH rebased for-2.4] target-i386: add ABM to Haswell* and Broadwell* CPU models
Date: Wed, 8 Jul 2015 14:10:42 +0200	[thread overview]
Message-ID: <559D1342.7000608@redhat.com> (raw)
In-Reply-To: <20150707172151.GE32472@thinpad.lan.raisama.net>



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 <pbonzini@redhat.com>
>> ---
>>  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?

Paolo

  reply	other threads:[~2015-07-08 12:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-07 10:42 [Qemu-devel] [PATCH rebased for-2.4] target-i386: add ABM to Haswell* and Broadwell* CPU models Paolo Bonzini
2015-07-07 17:21 ` Eduardo Habkost
2015-07-08 12:10   ` Paolo Bonzini [this message]
2015-07-08 14:29     ` Eduardo Habkost
2015-07-28 18:51 ` Eduardo Habkost

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=559D1342.7000608@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=afaerber@suse.de \
    --cc=ehabkost@redhat.com \
    --cc=jdenemar@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).