[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC 06/28] s390x/cpumodel: introduce CPU feature group
From: |
David Hildenbrand |
Subject: |
Re: [Qemu-devel] [RFC 06/28] s390x/cpumodel: introduce CPU feature group definitions |
Date: |
Wed, 22 Jun 2016 08:19:44 +0200 |
> On 21.06.2016 15:02, David Hildenbrand wrote:
> > Let's use the generated groups to create feature group representations for
> > the user. These groups can later be used to enable/disable multiple
> > features in one shot and will be used to reduce the amount of reported
> > features to the user if all subfeatures are in place.
> >
> > Acked-by: Cornelia Huck <address@hidden>
> > Signed-off-by: David Hildenbrand <address@hidden>
> > ---
> > target-s390x/cpu_features.c | 44
> > +++++++++++++++++++++++++++++++++++++++++++-
> > target-s390x/cpu_features.h | 23 +++++++++++++++++++++++
> > 2 files changed, 66 insertions(+), 1 deletion(-)
> >
> > diff --git a/target-s390x/cpu_features.c b/target-s390x/cpu_features.c
> > index c78a189..6ec2bfc 100644
> > --- a/target-s390x/cpu_features.c
> > +++ b/target-s390x/cpu_features.c
> > @@ -12,6 +12,7 @@
> >
> > #include "qemu/osdep.h"
> > #include "cpu_features.h"
> > +#include "gen-features.h"
> >
> > #define FEAT_INIT(_name, _type, _bit, _desc) \
> > { \
> > @@ -321,14 +322,55 @@ void s390_add_from_feat_block(S390FeatBitmap
> > features, S390FeatType type,
> > }
> > }
> >
> > -void s390_feat_bitmap_to_ascii(const S390FeatBitmap bitmap, void *opaque,
> > +void s390_feat_bitmap_to_ascii(const S390FeatBitmap features, void *opaque,
> > void (*fn)(const char *name, void *opaque))
> > {
> > + S390FeatBitmap bitmap, tmp;
> > + S390FeatGroup group;
> > S390Feat feat;
> >
> > + bitmap_copy(bitmap, features, S390_FEAT_MAX);
> > +
> > + /* process whole groups first */
> > + for (group = 0; group < S390_FEAT_GROUP_MAX; group++) {
> > + const S390FeatGroupDef *def = s390_feat_group_def(group);
> > +
> > + bitmap_and(tmp, bitmap, def->feat, S390_FEAT_MAX);
> > + if (bitmap_equal(tmp, def->feat, S390_FEAT_MAX)) {
> > + bitmap_andnot(bitmap, bitmap, def->feat, S390_FEAT_MAX);
> > + (*fn)(def->name, opaque);
>
> Maybe simply write
> fn(dev->name, opaque);
> instead?
Will that work? As fn is a pointer I am not a 100% sure. If so, I'll change it!
Thanks!
David
- [Qemu-devel] [RFC 05/28] s390x/cpumodel: generate CPU feature group lists, (continued)
- [Qemu-devel] [RFC 05/28] s390x/cpumodel: generate CPU feature group lists, David Hildenbrand, 2016/06/21
- [Qemu-devel] [RFC 19/28] s390x/kvm: allow runtime-instrumentation for "none" machine, David Hildenbrand, 2016/06/21
- [Qemu-devel] [RFC 10/28] s390x/cpumodel: let the CPU model handle feature checks, David Hildenbrand, 2016/06/21
- [Qemu-devel] [RFC 14/28] s390x/sclp: indicate sclp features, David Hildenbrand, 2016/06/21
- [Qemu-devel] [RFC 13/28] s390x/sclp: introduce sclp feature blocks, David Hildenbrand, 2016/06/21
- [Qemu-devel] [RFC 04/28] s390x/cpumodel: generate CPU feature lists for CPU models, David Hildenbrand, 2016/06/21
- [Qemu-devel] [RFC 02/28] s390x/cpumodel: expose CPU class properties, David Hildenbrand, 2016/06/21
- [Qemu-devel] [RFC 23/28] qmp: add QMP interface "query-cpu-model-expansion", David Hildenbrand, 2016/06/21
- [Qemu-devel] [RFC 06/28] s390x/cpumodel: introduce CPU feature group definitions, David Hildenbrand, 2016/06/21
- [Qemu-devel] [RFC 12/28] s390x/sclp: factor out preparation of cpu entries, David Hildenbrand, 2016/06/21
- [Qemu-devel] [RFC 09/28] s390x/cpumodel: expose features and feature groups as properties, David Hildenbrand, 2016/06/21
- [Qemu-devel] [RFC 18/28] update linux headers (CPU model), David Hildenbrand, 2016/06/21
- [Qemu-devel] [RFC 24/28] qmp: add QMP interface "query-cpu-model-comparison", David Hildenbrand, 2016/06/21
- [Qemu-devel] [RFC 21/28] s390x/kvm: disable host model for existing compat machines, David Hildenbrand, 2016/06/21
- [Qemu-devel] [RFC 25/28] qmp: add QMP interface "query-cpu-model-baseline", David Hildenbrand, 2016/06/21
- [Qemu-devel] [RFC 17/28] s390x/sclp: propagate hmfai, David Hildenbrand, 2016/06/21
- [Qemu-devel] [RFC 16/28] s390x/sclp: propagate the mha via sclp, David Hildenbrand, 2016/06/21
- [Qemu-devel] [RFC 28/28] s390x/cpumodel: implement QMP interface "query-cpu-model-baseline", David Hildenbrand, 2016/06/21