qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Igor Mammedov <imammedo@redhat.com>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: aliguori@us.ibm.com, hpa@linux.intel.com,
	stefanha@linux.vnet.ibm.com, jan.kiszka@siemens.com,
	Don@cloudswitch.com, mtosatti@redhat.com, qemu-devel@nongnu.org,
	mdroth@linux.vnet.ibm.com, blauwirbel@gmail.com, avi@redhat.com,
	pbonzini@redhat.com, akong@redhat.com, lersek@redhat.com,
	afaerber@suse.de
Subject: Re: [Qemu-devel] [PATCH 20/23] target-i386: use properties to set/unset user specified features on CPU
Date: Tue, 2 Oct 2012 18:12:21 +0200	[thread overview]
Message-ID: <20121002181221.33fbf317@nial.usersys.redhat.com> (raw)
In-Reply-To: <20121002160140.GO15784@otherpad.lan.raisama.net>

On Tue, 2 Oct 2012 13:01:40 -0300
Eduardo Habkost <ehabkost@redhat.com> wrote:

> On Tue, Oct 02, 2012 at 05:37:12PM +0200, Igor Mammedov wrote:
> > Signed-off-by: Igor Mammedov <imammedo@redhat.com>
> > Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> > ---
> > v2:
> >   * fix error of initializing from incorrect cpu model definition
> >     use x86_cpu_def instead of def. spotted-by: Eduardo Habkost
> >   * add missing env in cpu_x86_find_by_name()
> >   * added cpu_x86_set_props() to make following code movement more
> >     clean. suggested-by: Eduardo Habkost
> >   * init name and feature to NULL, to avoid freeing uninitialized mem
> > v3:
> >   * rebase on top of "x86: Implement SMEP and SMAP"
> > ---
> >  target-i386/cpu.c |  199
> > +++++++++++----------------------------------------- 1 files changed, 42
> > insertions(+), 157 deletions(-)
> > 
> > diff --git a/target-i386/cpu.c b/target-i386/cpu.c
> > index 9b3cffd..22a1ded 100644
> > --- a/target-i386/cpu.c
> > +++ b/target-i386/cpu.c
> > @@ -221,25 +221,6 @@ static bool lookup_feature(uint32_t *pval, const
> > char *s, const char *e, return found;
> >  }
> >  
> > -static void add_flagname_to_bitmaps(const char *flagname, uint32_t
> > *features,
> > -                                    uint32_t *ext_features,
> > -                                    uint32_t *ext2_features,
> > -                                    uint32_t *ext3_features,
> > -                                    uint32_t *kvm_features,
> > -                                    uint32_t *svm_features,
> > -                                    uint32_t *cpuid_7_0_ebx_features)
> > -{
> > -    if (!lookup_feature(features, flagname, NULL, feature_name) &&
> > -        !lookup_feature(ext_features, flagname, NULL, ext_feature_name)
> > &&
> > -        !lookup_feature(ext2_features, flagname, NULL,
> > ext2_feature_name) &&
> > -        !lookup_feature(ext3_features, flagname, NULL,
> > ext3_feature_name) &&
> > -        !lookup_feature(kvm_features, flagname, NULL, kvm_feature_name)
> > &&
> > -        !lookup_feature(svm_features, flagname, NULL, svm_feature_name)
> > &&
> > -        !lookup_feature(cpuid_7_0_ebx_features, flagname, NULL,
> > -                        cpuid_7_0_ebx_feature_name))
> > -            fprintf(stderr, "CPU feature %s not found\n", flagname);
> > -}
> > -
> >  typedef struct x86_def_t {
> >      struct x86_def_t *next;
> >      const char *name;
> > @@ -847,7 +828,9 @@ static void x86_cpuid_get_feature(Object *obj,
> > Visitor *v, void *opaque, !is_feature_set(name, env->cpuid_ext2_features,
> > ext2_feature_name) && !is_feature_set(name, env->cpuid_ext3_features,
> > ext3_feature_name) && !is_feature_set(name, env->cpuid_kvm_features,
> > kvm_feature_name) &&
> > -       !is_feature_set(name, env->cpuid_svm_features, svm_feature_name))
> > {
> > +       !is_feature_set(name, env->cpuid_svm_features, svm_feature_name)
> > &&
> > +       !is_feature_set(name, env->cpuid_7_0_ebx_features,
> > +                       cpuid_7_0_ebx_feature_name)) {
> 
> If you ever need to respin this series, it would be nice to do this at
> patch 07/23 instead.
> 
> >          value = false;
> >      }
> >  
> [...]
> > @@ -2208,6 +2092,7 @@ static void x86_cpu_initfn(Object *obj)
> >      x86_register_cpuid_properties(obj, ext3_feature_name);
> >      x86_register_cpuid_properties(obj, kvm_feature_name);
> >      x86_register_cpuid_properties(obj, svm_feature_name);
> > +    x86_register_cpuid_properties(obj, cpuid_7_0_ebx_feature_name);
> 
> This could go to patch 07/23 as well.
Thanks,
I'll move it there and queue for next respin.

> 
> It's not a problem to keep it here, however, because the new properties
> don't get actually used until this patch is applied.
> 
> >  
> >      env->cpuid_apic_id = env->cpu_index;
> >  
> > -- 
> > 1.7.1
> > 
> 

  reply	other threads:[~2012-10-02 16:12 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-02 15:36 [Qemu-devel] [PATCH 00/23 v4] target-i386: convert CPU features into properties Igor Mammedov
2012-10-02 15:36 ` [Qemu-devel] [PATCH 01/23] target-i386: return Error from cpu_x86_find_by_name() Igor Mammedov
2012-10-10 14:05   ` Andreas Färber
2012-10-10 14:38     ` Igor Mammedov
2012-10-10 16:37       ` Luiz Capitulino
2012-10-02 15:36 ` [Qemu-devel] [PATCH 02/23] target-i386: cpu_x86_register(): report error from property setter Igor Mammedov
2012-10-10 14:07   ` Andreas Färber
2012-10-02 15:36 ` [Qemu-devel] [PATCH 03/23] target-i386: if x86_cpu_realize() failed report error and do cleanup Igor Mammedov
2012-10-10 14:09   ` Andreas Färber
2012-10-02 15:36 ` [Qemu-devel] [PATCH 04/23] target-i386: filter out not TCG features if running without kvm at realize time Igor Mammedov
2012-10-02 15:36 ` [Qemu-devel] [PATCH 05/23] target-i386: move out CPU features initialization in separate func Igor Mammedov
2012-10-02 15:36 ` [Qemu-devel] [PATCH 06/23] target-i386: xlevel should be more than 0x80000000, move fixup into setter Igor Mammedov
2012-10-02 15:36 ` [Qemu-devel] [PATCH 07/23] target-i386: convert cpuid features into properties Igor Mammedov
2012-10-02 20:38   ` Eduardo Habkost
2012-10-03 15:03     ` Eduardo Habkost
2012-10-03 15:20       ` Paolo Bonzini
2012-10-03 16:24         ` Igor Mammedov
2012-10-03 16:54           ` Eduardo Habkost
2012-10-04  6:53             ` Igor Mammedov
2012-10-04  7:20               ` Paolo Bonzini
2012-10-04 12:43               ` Eduardo Habkost
2012-10-04 12:57                 ` Andreas Färber
2012-10-04 13:06                   ` Eduardo Habkost
2012-10-04 13:10                   ` Igor Mammedov
2012-10-04 13:19                     ` Eduardo Habkost
2012-10-04 13:01                 ` Igor Mammedov
2012-10-04 13:10                   ` Eduardo Habkost
2012-10-04 13:25                     ` Igor Mammedov
2012-10-04 13:33                       ` Eduardo Habkost
2012-10-04 13:50                         ` Igor Mammedov
2012-10-04 14:20                           ` Eduardo Habkost
2012-10-02 15:37 ` [Qemu-devel] [PATCH 08/23] target-i386: add stubs for hyperv_(vapic_recommended|relaxed_timing_enabled|get_spinlock_retries)() Igor Mammedov
2012-10-02 15:37 ` [Qemu-devel] [PATCH 09/23] target-i386: convert 'hv_spinlocks' feature into property Igor Mammedov
2012-10-02 15:37 ` [Qemu-devel] [PATCH 10/23] target-i386: convert 'hv_relaxed' " Igor Mammedov
2012-10-02 15:37 ` [Qemu-devel] [PATCH 11/23] target-i386: convert 'hv_vapic' " Igor Mammedov
2012-10-02 15:37 ` [Qemu-devel] [PATCH 12/23] target-i386: convert 'check' and 'enforce' features into properties Igor Mammedov
2012-10-02 15:37 ` [Qemu-devel] [PATCH 13/23] add visitor for parsing hz[KMG] input string Igor Mammedov
2012-10-02 15:37 ` [Qemu-devel] [PATCH 14/23] target-i386: use visit_type_hz to parse tsc_freq property value Igor Mammedov
2012-10-02 15:37 ` [Qemu-devel] [PATCH 15/23] target-i386: introduce vendor-override property Igor Mammedov
2012-10-02 15:37 ` [Qemu-devel] [PATCH 16/23] target-i386: use define for cpuid vendor string size Igor Mammedov
2012-10-02 15:37 ` [Qemu-devel] [PATCH 17/23] target-i386: postpone cpuid_level update to realize time Igor Mammedov
2012-10-02 15:37 ` [Qemu-devel] [PATCH 18/23] target-i386: replace uint32_t vendor fields by vendor string in x86_def_t Igor Mammedov
2012-10-02 15:37 ` [Qemu-devel] [PATCH 19/23] target-i386: parse cpu_model string into set of stringified properties Igor Mammedov
2012-10-02 15:37 ` [Qemu-devel] [PATCH 20/23] target-i386: use properties to set/unset user specified features on CPU Igor Mammedov
2012-10-02 16:01   ` Eduardo Habkost
2012-10-02 16:12     ` Igor Mammedov [this message]
2012-10-02 15:37 ` [Qemu-devel] [PATCH 21/23] target-i386: move init of "hypervisor" feature into CPU initializer from cpudef Igor Mammedov
2012-10-02 15:37 ` [Qemu-devel] [PATCH 22/23] target-i386: move default init of cpuid_kvm_features bitmap " Igor Mammedov
2012-10-02 15:37 ` [Qemu-devel] [PATCH 23/23] target-i386: cleanup cpu_x86_find_by_name(), only fill x86_def_t in it Igor Mammedov

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=20121002181221.33fbf317@nial.usersys.redhat.com \
    --to=imammedo@redhat.com \
    --cc=Don@cloudswitch.com \
    --cc=afaerber@suse.de \
    --cc=akong@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=avi@redhat.com \
    --cc=blauwirbel@gmail.com \
    --cc=ehabkost@redhat.com \
    --cc=hpa@linux.intel.com \
    --cc=jan.kiszka@siemens.com \
    --cc=lersek@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=mtosatti@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@linux.vnet.ibm.com \
    /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).