Skip to contentSkip to conversation

s390x CPU models: exposing features

PATCH Superseded David Hildenbrand 6 participants 40 messages Aug 8, 2016 – Aug 16, 2016 2 messages not in the archive Kbuild

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v2 cover s390x CPU models: exposing features

After another very helpful discussion with Eduardo and Jiri and the lates review, these were the major changes:
- QOM interfaces: Only documentation changes
- Minor s390x specific implementation fixups
- Renamed some s390x features, sthyi added to the default + max models Full list of changes can be found at the end of this lengthy cover letter.

Latest version can be found on branch:

    github.com/cohuck/qemu cpumodel-s390x-v2

Whenever this gets pulled, we have time to the next release to double check all feature names and static CPU model features.

--------------------------------Concept------------------------------------

This is our second attempt to implement CPU models for s390x. We realized that we also want to have features exposed via the CPU model. While doing that we realized that we want to have a better interface for libvirt.

Unfortunately, CPU models on s390x are special and we have to take care of:
- A CPU like z13 looks differently in various environments (under different LPAR versions, under different z/VM versions, under different KVM versions, export regulation) - we have _a lot_ of feature variability.
- We still have certain features that are not published but might be implemented/introduced in the future. As they are a theoretical part of a CPU already, we have to find a way to model these future changes.
- We still have certain features that are already published, but not implemented. Implementation might be added in the future in KVM.
- We heavily rely on KVM to tell us which features it can actually virtualize - user space queries like "STFL(e)" give no guarantees.
- Certain "subfeatures" were introduced in one run. In practice, they are always around, but in theory, subfeatures could be dropped in the future.
- Just because two CPU models have the same features doesn't mean they are equal - some internal numbers might be different. E.g. we won't allow running a z13 under a zBC12 just by turning off features.
- We cannot blindly enable all possible features for a CPU generation, the IBC "Instruction Blocking Control" in KVM will try to block instructions introduced with certain features. So a CPU generation always has some maximum feature set that is guaranteed to work.

It all boils down to a specific released CPU to have.
a) A minimum feature set that we expect it to be have on every hypervisor.
b) A variable part that depends on the hypervisor and that could be extended in the future (adding not yet implemented features) that we always want to enable later on.
c) A variable part that we want to enable only if requested - nested virtualization ("vsie") and assists are one example.

As we want our users to always make use of most features, e.g. when using the "z13" CPU model, we will have to update our CPU models between QEMU releases, to include the latest feature additions we implemented/unlocked. We're badically trying to be able at one point in the future to really look like a maximum "z13" CPU in QEMU. However, that means that a "z13" CPU looks differently on different QEMU versions. We will make sure using compatibility machines, that migration stays safe.

However, if the feature set of a CPU model is bound to a compatibility machine, how can it be of any help when used without a compatibility machine? E.g. when indicating the host CPU model in "virsh capabilities", simply saying "z13" is not really clear. Also when baselining and comparing CPU models, we usually have no compatibility machine "context" at hand. For this reason we introduce "static" CPU models, which will never change, so everybody knows without a compatibility machine, what we are talking about.

CPU definitions/models can be categorized:
1. migratable: all features _can_ be identified + properly migrated. --> With migratable=off on x86, "host" cannot be migrated properly.
2. migration-safe: in combination with a QEMU machine, migration will work. --> No CPU features are lost/added during migration
3. static: not bound to a QEMU machine - featureset will never* change. --> Everybody knows which features are part of it, not affected by a compat machine. "virsh capabilities" can show this as "host" model.
*except for trivial bugfixes, especially on very old models nobody used in production. Should be avoided.

We are currently planning to also support a "migratable=off" on s390x for the "-cpu host" model, in order to enable all features, including not recognized ones.

So we have on s390x:
a) A static CPU model for each released CPU that will never change and maps to the minimum feature set we expect to be around on all hypervisors. e.g. "z13-base" or "z10EC.2-base".
b) A "default" CPU model for each released CPU, that can change between QEMU versions and that will always include the features we expect to be around in our currently supported environments and will contain only features we expect to be stable. E.g. nested virtualization will not be contained in these models for now. "z13" or "z10EC.2" are examples.
c) An internal "maximum" CPU model for each generation that tells us which features were supported as a maximum back when the hardware was released. This will not be exposed but used internally.

To not have to replicate all CPU model changes ("new default fetaures") in libvirt, to not duplicate the logic about compatibility and the like, our approach tries to keep all the QEMU logic in libvirt and provide standardized interfaces for libvirt to e.g. baseline, compare. This allows libvirt to not have to care about any model names or feature names, it can just pass the data from interface to interface and report it to the user.

Also, libvirt might want to know what the "host" model looks like and convert a CPU model to a migration safe variant. For this reason, a QMP command is added that can create a migration safe variant of a variable CPU model, indicating only the delta changes done to a stable model.

So we have:
a) "query-cpu-model-expansion" - tell us what the "host" or another CPU model looks like. Either falling back to a static model or completely exposing all properties.
b) "query-cpu-model-comparison" - tell us how two CPU models compare,

    -> needed for "virsh cpu-compare"
c) "query-cpu-model-baseline" - create a new model out of two models,
    -> needed for virsh cpu-baseline"

--------------------------------Libvirt usecase----------------------------

Testing for runability:
- Simply try to start QEMU with KVM, compat machine, CPU model
- Could be done using query-cpu-model-comparison in the future.

Identifying host model, e.g. "virsh capabilities"
- query-cpu-model-expansion on "host" with "-M none --enable-kvm"

<cpu mode='host-model'>:
- simply copy the identified host model

<cpu mode='host-passthrough'>:
- "-cpu host"

"virsh cpu-baseline":
- query-cpu-model-baseline on two models with "-M none"

"virsh cpu-compare":
- query-cpu-model-comparison on two models with "-M none"

There might be some cenarios where libvirt wants to convert another CPU model to a static variant, this can be done using query-cpu-model-expansion

--------------------------------QMP examples------------------------------

Expanding "host" on z13.2 without nested virtualization support:

    { "execute":"query-cpu-model-expansion",
      "arguments":{
        "type":"static",
        "model":{
          "name":"host"
    }}}
    { "return":{
        "model":{
          "name":"z13.2-base",
          "props":{
            "aefsi":true,
            "msa5":true,
            "msa4":true,
            "msa3":true,
            "msa2":true,
            "msa1":true,
            "sthyi":true,
            "edat":true,
            "ri":true,
            "edat2":true,
            "vx":true,
            "ipter":true,
            "esop":true,
            "cte":true,
            "te":true,
            "cmm":true
    }}}}

Expanding "host" on zEC12.2 without nested virtualization support:

    { "execute":"query-cpu-model-expansion",
      "arguments":{
        "type":"static",
        "model":{
          "name":"host"
    }}}
    { "return":{
        "model":{
          "name":"zEC12.2-base",
          "props":{
            "aefsi":true,
            "msa5":true,
            "msa4":true,
            "msa3":true,
            "msa2":true,
            "msa1":true,
            "sthyi":true,
            "edat":true,
            "ri":true,
            "edat2":true,
            "ipter":true,
            "cei":true,
            "gpereh":true,
            "esop":true,
            "ib":true,
            "siif":true,
            "ibs":true,
            "sief2":true,
            "cte":true,
            "64bscao":true,
            "te":true
            "cmm":true,
            "gsls":true,
    }}}}

Comparing both models (dropping features for readability)

    { "execute":"query-cpu-model-comparison",
      "arguments":{
        "modela":{
          "name":"z13.2-base",
          "props":{ ... }
        },
        "modelb":{
          "name":"zEC12.2-base",
          "props":{ ... }
          }
    }}}
    {"return":{
        "result":"incompatible",
        "responsible-properties":[
          "cei",
          "ib",
          "siif",
          "gpereh",
          "sief2",
          "ibs",
          "64bscao",
          "gsls",
          "vx",
          "dfppc",
          "gen13e",
          "gen13ptff",
          "type"
        ]
    }}

Indicated are all z13 features + nested virtualization features. "type" indicates that both models can never be made identical (as different CPU generations).

Baselining both models (dropping features for readability)

    { "execute":"query-cpu-model-baseline",
      "arguments":{
        "modela":{
          "name":"z13.2-base",
          "props":{ ... }
        },
        "modelb":{
          "name":"zEC12.2-base",
          "props":{ ... }
    }}}}
    {
      "return":{
        "model":{
          "name":"zEC12.2-base",
          "props":{
            "aefsi":true,
            "msa5":true,
            "msa4":true,
            "msa3":true,
            "msa2":true,
            "msa1":true,
            "sthyi":true,
            "edat":true,
            "ri":true,
            "edat2":true,
            "ipter":true,
            "esop":true,
            "cte":true,
            "te":true
            "cmm":true,
    }}}}

Which is in fact a zEC12.2 without nested virtualization.

As an example, what "host" on z/VM system (zEC12.2, no vSIE) expands to:

    { "execute":"query-cpu-model-expansion",
      "arguments":{
        "type":"static",
        "model":{
          "name":"host"
    }}}
    { "return":{
        "model":{
          "name":"zEC12.2-base",
          "props":{
            "aefsi":true,
            "msa5":true,
            "msa4":true,
            "msa3":true,
            "msa2":true,
            "msa1":true,
            "sthyi":true,
            "esop":true,
            "cte":true,
    }}}}

Important is: no TE, no EDAT(2), no CMM, no RI, no IPTER

--------------------------------Changes-----------------------------------

Patch v1 -> v2:
- Removed a leftover return statement in s390_get_feat_block()
- Replaced additional vector CAP checks by s390_has_feat()
- Report an error on unsupported expansion types in s390x
- Adapted documentation of query-cpu-definitions return values -- static is not optional anymore, it is automatically set to false
- Changed documentation of query-cpu-(expansion|comparions|baseline) -- be more verbose, document more clearly what can affect the result -- added more details on how the interfaces can be used
-- adapted all suggestions by Eduardo
- new kvm/next linux-headers sync
- s390x:
-- Renamed feature "tx" to "te" (match /proc/cpuinfo)
-- Renamed feature "ctx" to "cte" (match te)
-- Renamed feature "z" to "zarch" (match /proc/cpuinfo)
-- Renamed feature "ecput" to "ectg" (instruction name)
-- Renamed feature "exece" to "exrl" (instruction name)
-- Renamed feature "spropg" to "sprogp" (misspelled)
-- Renamed feature "dateh1" to "dateh" (facility 1 is implicit) -- Renamed feature "edat1" to "edat" (facility 1 is implicit) -- Removed dependency check "cte" -> "te" to avoid warnings under z/VM -- Added sthyi to every default + max model having stfle
-- Removed store-CPU-counter-multiple facility for now

RFC -> Patch v1:
- Rebased to master, had to fixup qmp_visitor and CPU ceation stuff
- Changed function calls from (*fn)(...) to fn(...)
- Mark models not only as migration-safe but also as static
- Introduced "qmp: details about CPU definitions in query-cpu-definitions"
- Expose "static" as CPU class property
- All CPU models except "host" are now migration-safe (e.g. qemu and z13)
- Replaced linux-header update by a proper kvm/next update
- Removed baseline type parameter from "query-cpu-model-baseline" to KIS
- Renamed "stable" expansion to "static" (as stable sounds misleading)
- Removed "migratable" expansion type, can be done via "migratable=off"
- Heavily improved description of the new QMP interfaces
- Actually tested all QMP interfaces. Various bugfixes.

David Hildenbrand (27):
qmp: details about CPU definitions in query-cpu-definitions s390x/cpumodel: "host" and "qemu" as CPU subclasses s390x/cpumodel: expose CPU class properties s390x/cpumodel: generate CPU feature group lists s390x/cpumodel: introduce CPU feature group definitions s390x/cpumodel: register defined CPU models as subclasses s390x/cpumodel: store the CPU model in the CPU instance s390x/cpumodel: expose features and feature groups as properties s390x/cpumodel: let the CPU model handle feature checks s390x/cpumodel: check and apply the CPU model
s390x/sclp: factor out preparation of cpu entries s390x/sclp: introduce sclp feature blocks
s390x/sclp: indicate sclp features
s390x/sclp: propagate the ibc val(lowest and unblocked ibc) s390x/sclp: propagate the mha via sclp
s390x/sclp: propagate hmfai
linux-headers: update against kvm/next
s390x/kvm: allow runtime-instrumentation for "none" machine s390x/kvm: implement CPU model support
s390x/kvm: disable host model for existing compat machines s390x/kvm: let the CPU model control CMM(A)
qmp: add QMP interface "query-cpu-model-expansion"
qmp: add QMP interface "query-cpu-model-comparison"
qmp: add QMP interface "query-cpu-model-baseline" s390x/cpumodel: implement QMP interface "query-cpu-model-expansion" s390x/cpumodel: implement QMP interface "query-cpu-model-comparison" s390x/cpumodel: implement QMP interface "query-cpu-model-baseline"

Michael Mueller (2):
s390x/cpumodel: introduce CPU features s390x/cpumodel: generate CPU feature lists for CPU models

 Makefile.target                                    |    2 +-
 hw/s390x/s390-virtio-ccw.c                         |    5 +
 hw/s390x/s390-virtio.c                             |    6 +-
 hw/s390x/sclp.c                                    |   35 +-
 include/hw/s390x/sclp.h                            |   17 +-
 include/standard-headers/linux/input-event-codes.h |   32 +
 include/standard-headers/linux/input.h             |    1 +
 include/standard-headers/linux/virtio_config.h     |   10 +-
 include/standard-headers/linux/virtio_ids.h        |    1 +
 include/standard-headers/linux/virtio_net.h        |    3 +
 include/sysemu/arch_init.h                         |    9 +
 linux-headers/asm-arm/kvm.h                        |    4 +-
 linux-headers/asm-arm64/kvm.h                      |    2 +
 linux-headers/asm-s390/kvm.h                       |   41 +
 linux-headers/asm-x86/unistd_x32.h                 |    4 +-
 linux-headers/linux/kvm.h                          |   18 +-
 linux-headers/linux/vhost.h                        |   33 +
 qapi-schema.json                                   |  246 ++++-
 qmp-commands.hx                                    |   18 +
 qmp.c                                              |   21 +
 rules.mak                                          |    1 +
 stubs/Makefile.objs                                |    3 +
 stubs/arch-query-cpu-model-baseline.c              |   12 +
 stubs/arch-query-cpu-model-comparison.c            |   12 +
 stubs/arch-query-cpu-model-expansion.c             |   12 +
 target-s390x/Makefile.objs                         |   22 +-
 target-s390x/cpu-qom.h                             |    6 +
 target-s390x/cpu.c                                 |   35 +-
 target-s390x/cpu.h                                 |    5 +
 target-s390x/cpu_features.c                        |  375 +++++++
 target-s390x/cpu_features.h                        |  301 ++++++
 target-s390x/cpu_models.c                          | 1084 ++++++++++++++++++++
 target-s390x/cpu_models.h                          |  113 ++
 target-s390x/gen-features.c                        |  588 +++++++++++
 target-s390x/helper.c                              |   33 +-
 target-s390x/kvm.c                                 |  350 ++++++-
 target-s390x/machine.c                             |   14 +-
 37 files changed, 3398 insertions(+), 76 deletions(-)
 create mode 100644 stubs/arch-query-cpu-model-baseline.c
 create mode 100644 stubs/arch-query-cpu-model-comparison.c
 create mode 100644 stubs/arch-query-cpu-model-expansion.c
 create mode 100644 target-s390x/cpu_features.c
 create mode 100644 target-s390x/cpu_features.h
 create mode 100644 target-s390x/cpu_models.c
 create mode 100644 target-s390x/cpu_models.h
 create mode 100644 target-s390x/gen-features.c
Signature · 1 line
2.6.6
#1 lore raw

PATCH v2 1/29 qmp: details about CPU definitions in query-cpu-definitions

It might be of interest for tooling whether a CPU definition can be safely used when migrating, or if e.g. CPU features might get lost during migration when migrationg from/to a different QEMU version or host, even if the same compatibility machine is used.

Also, we want to know if a CPU definition is static and will never change. Beause these definitions can then be used independantly of a compatibility machine and will always have the same feature set, they can e.g. be used to indicate the "host" model in libvirt later on.

Let's add two return values to query-cpu-definitions, stating for each returned CPU definition, if it is migration-safe and if it is static.

While "migration-safe" is optional, "static" will be set to "false" automatically by all implementing architectures. If a model really was static all the time and will be in the future, this can simply be changed later.

---
 qapi-schema.json | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
qapi-schema.json +13 -1
index 5658723..0d9ae50 100644
@@ -3038,10 +3038,22 @@
 #
 # @name: the name of the CPU definition
 #
+# @migration-safe: #optional whether a CPU definition can be safely used for
+#                  migration in combination with a QEMU compatibility machine
+#                  when migrating between different QMU versions and between
+#                  hosts  with different sets of (hardware or software)
+#                  capabilities. If not provided, information is not available
+#                  and callers should not assume the CPU definition to be
+#                  migration-safe.
+#
+# @static: whether a CPU definition is static and will not change depending on
+#          QEMU version, machine type, machine options and accelerator options.
+#          A static model is always migration-safe.
+#
 # Since: 1.2.0
 ##
 { 'struct': 'CpuDefinitionInfo',
-  'data': { 'name': 'str' } }
+  'data': { 'name': 'str', '*migration-safe' : 'bool', 'static' : 'bool' } }
 
 ##
 # @query-cpu-definitions:
Signature · 1 line
2.6.6
#2 lore raw

PATCH v2 2/29 s390x/cpumodel: "host" and "qemu" as CPU subclasses

In reply to David Hildenbrand

This patch introduces two CPU models, "host" and "qemu". "qemu" is used as default when running under TCG. "host" is used as default when running under KVM. "host" cannot be used without KVM. "host" is not migration-safe. They both inherit from the base s390x CPU, which is turned into an abstract class.

This patch also changes CPU creation to take care of the passed CPU string and reuses common code parse_features() function for that purpose. Unknown CPU definitions are now reported. The "-cpu ?" and "query-cpu-definition" commands are changed to list all CPU subclasses automatically, including migration-safety and whether static.

---
 hw/s390x/s390-virtio.c     |   6 +-
 target-s390x/Makefile.objs |   2 +-
 target-s390x/cpu-qom.h     |   4 +
 target-s390x/cpu.c         |  33 ++-------
 target-s390x/cpu.h         |   2 +
 target-s390x/cpu_models.c  | 177 +++++++++++++++++++++++++++++++++++++++++++++
 target-s390x/helper.c      |  33 ++++++++-
 7 files changed, 229 insertions(+), 28 deletions(-)
 create mode 100644 target-s390x/cpu_models.c
hw/s390x/s390-virtio.c +5 -1
index 544c616..0a96347 100644
@@ -101,7 +101,11 @@ void s390_init_cpus(MachineState *machine)
     gchar *name;
 
     if (machine->cpu_model == NULL) {
-        machine->cpu_model = "host";
+        if (kvm_enabled()) {
+            machine->cpu_model = "host";
+        } else {
+            machine->cpu_model = "qemu";
+        }
     }
 
     cpu_states = g_new0(S390CPU *, max_cpus);
target-s390x/Makefile.objs +1 -1
index dd62cbd..34bd693 100644
@@ -1,5 +1,5 @@
 obj-y += translate.o helper.o cpu.o interrupt.o
 obj-y += int_helper.o fpu_helper.o cc_helper.o mem_helper.o misc_helper.o
-obj-y += gdbstub.o
+obj-y += gdbstub.o cpu_models.o
 obj-$(CONFIG_SOFTMMU) += machine.o ioinst.o arch_dump.o mmu_helper.o
 obj-$(CONFIG_KVM) += kvm.o
target-s390x/cpu-qom.h +4 -0
index 66b5d18..bb993d4 100644
@@ -45,6 +45,10 @@ typedef struct S390CPUClass {
     /*< private >*/
     CPUClass parent_class;
     /*< public >*/
+    bool kvm_required;
+    bool is_static;
+    bool is_migration_safe;
+    const char *desc;
 
     int64_t next_cpu_id;
 
target-s390x/cpu.c +8 -25
index e43e2d6..44e53ec 100644
@@ -44,30 +44,6 @@
 #define CR0_RESET       0xE0UL
 #define CR14_RESET      0xC2000000UL;
 
-/* generate CPU information for cpu -? */
-void s390_cpu_list(FILE *f, fprintf_function cpu_fprintf)
-{
-#ifdef CONFIG_KVM
-    (*cpu_fprintf)(f, "s390 %16s\n", "host");
-#endif
-}
-
-#ifndef CONFIG_USER_ONLY
-CpuDefinitionInfoList *arch_query_cpu_definitions(Error **errp)
-{
-    CpuDefinitionInfoList *entry;
-    CpuDefinitionInfo *info;
-
-    info = g_malloc0(sizeof(*info));
-    info->name = g_strdup("host");
-
-    entry = g_malloc0(sizeof(*entry));
-    entry->value = info;
-
-    return entry;
-}
-#endif
-
 static void s390_cpu_set_pc(CPUState *cs, vaddr value)
 {
     S390CPU *cpu = S390_CPU(cs);
@@ -206,6 +182,12 @@ static void s390_cpu_realizefn(DeviceState *dev, Error **errp)
     CPUS390XState *env = &cpu->env;
     Error *err = NULL;
 
+    /* the model has to be realized before qemu_init_vcpu() due to kvm */
+    s390_realize_cpu_model(cs, &err);
+    if (err) {
+        goto out;
+    }
+
 #if !defined(CONFIG_USER_ONLY)
     if (cpu->id >= max_cpus) {
         error_setg(&err, "Unable to add CPU: %" PRIi64
@@ -435,6 +417,7 @@ static void s390_cpu_class_init(ObjectClass *oc, void *data)
     scc->cpu_reset = s390_cpu_reset;
     scc->initial_cpu_reset = s390_cpu_initial_reset;
     cc->reset = s390_cpu_full_reset;
+    cc->class_by_name = s390_cpu_class_by_name,
     cc->has_work = s390_cpu_has_work;
     cc->do_interrupt = s390_cpu_do_interrupt;
     cc->dump_state = s390_cpu_dump_state;
@@ -470,7 +453,7 @@ static const TypeInfo s390_cpu_type_info = {
     .instance_size = sizeof(S390CPU),
     .instance_init = s390_cpu_initfn,
     .instance_finalize = s390_cpu_finalize,
-    .abstract = false,
+    .abstract = true,
     .class_size = sizeof(S390CPUClass),
     .class_init = s390_cpu_class_init,
 };
target-s390x/cpu.h +2 -0
index c216bda..e34742e 100644
@@ -631,6 +631,8 @@ extern void subsystem_reset(void);
 
 void s390_cpu_list(FILE *f, fprintf_function cpu_fprintf);
 #define cpu_list s390_cpu_list
+void s390_realize_cpu_model(CPUState *cs, Error **errp);
+ObjectClass *s390_cpu_class_by_name(const char *name);
 
 #define EXCP_EXT 1 /* external interrupt */
 #define EXCP_SVC 2 /* supervisor call (syscall) */
target-s390x/cpu_models.c new file +177 -0

177 lines not on this page · raw message

target-s390x/helper.c +32 -1
index 54a5177..68bd2f9 100644
@@ -70,7 +70,38 @@ void s390x_cpu_timer(void *opaque)
 
 S390CPU *cpu_s390x_create(const char *cpu_model, Error **errp)
 {
-    return S390_CPU(object_new(TYPE_S390_CPU));
+    static bool features_parsed;
+    char *name, *features;
+    const char *typename;
+    ObjectClass *oc;
+    CPUClass *cc;
+
+    name = g_strdup(cpu_model);
+    features = strchr(name, ',');
+    if (features) {
+        features[0] = 0;
+        features++;
+    }
+
+    oc = cpu_class_by_name(TYPE_S390_CPU, name);
+    if (!oc) {
+        error_setg(errp, "Unknown CPU definition \'%s\'", name);
+        g_free(name);
+        return NULL;
+    }
+    typename = object_class_get_name(oc);
+
+    if (!features_parsed) {
+        features_parsed = true;
+        cc = CPU_CLASS(oc);
+        cc->parse_features(typename, features, errp);
+    }
+    g_free(name);
+
+    if (*errp) {
+        return NULL;
+    }
+    return S390_CPU(CPU(object_new(typename)));
 }
 
 S390CPU *s390x_new_cpu(const char *cpu_model, int64_t id, Error **errp)
Signature · 1 line
2.6.6
#3 lore raw

PATCH v2 3/29 s390x/cpumodel: expose CPU class properties

In reply to David Hildenbrand

Let's expose the description and migration safety and whether a definition is static, as class properties, this can be helpful in the future.

---
 target-s390x/cpu.c        |  1 +
 target-s390x/cpu.h        |  1 +
 target-s390x/cpu_models.c | 25 +++++++++++++++++++++++++
 3 files changed, 27 insertions(+)
target-s390x/cpu.c +1 -0
index 44e53ec..d7d0b62 100644
@@ -445,6 +445,7 @@ static void s390_cpu_class_init(ObjectClass *oc, void *data)
      * object_unref().
      */
     dc->cannot_destroy_with_object_finalize_yet = true;
+    s390_cpu_model_class_register_props(oc);
 }
 
 static const TypeInfo s390_cpu_type_info = {
target-s390x/cpu.h +1 -0
index e34742e..075bb37 100644
@@ -631,6 +631,7 @@ extern void subsystem_reset(void);
 
 void s390_cpu_list(FILE *f, fprintf_function cpu_fprintf);
 #define cpu_list s390_cpu_list
+void s390_cpu_model_class_register_props(ObjectClass *oc);
 void s390_realize_cpu_model(CPUState *cs, Error **errp);
 ObjectClass *s390_cpu_class_by_name(const char *name);
 
target-s390x/cpu_models.c +25 -0
index 01f442c..7b887f7 100644
@@ -110,6 +110,31 @@ static void s390_cpu_model_finalize(Object *obj)
 {
 }
 
+static bool get_is_migration_safe(Object *obj, Error **errp)
+{
+    return S390_CPU_GET_CLASS(obj)->is_migration_safe;
+}
+
+static bool get_is_static(Object *obj, Error **errp)
+{
+    return S390_CPU_GET_CLASS(obj)->is_static;
+}
+
+static char *get_description(Object *obj, Error **errp)
+{
+    return g_strdup(S390_CPU_GET_CLASS(obj)->desc);
+}
+
+void s390_cpu_model_class_register_props(ObjectClass *oc)
+{
+    object_class_property_add_bool(oc, "migration-safe", get_is_migration_safe,
+                                   NULL, NULL);
+    object_class_property_add_bool(oc, "static", get_is_static,
+                                   NULL, NULL);
+    object_class_property_add_str(oc, "description", get_description, NULL,
+                                  NULL);
+}
+
 #ifdef CONFIG_KVM
 static void s390_host_cpu_model_class_init(ObjectClass *oc, void *data)
 {
Signature · 1 line
2.6.6
#4 lore raw

PATCH v2 4/29 s390x/cpumodel: introduce CPU features

In reply to David Hildenbrand

From: Michael Mueller <[email protected]>

The patch introduces s390x CPU features (most of them refered to as facilities) along with their discription and some functions that will be helpful when working with the features later on.

Please note that we don't introduce all known CPU features, only the ones currently supported by KVM + QEMU. We don't want to enable later on blindly any facilities, for which we don't know yet if we need QEMU support to properly support them (e.g. migrate additional state when active). We can update QEMU later on.

[reworked to include non-stfle features, added definitions]
---
 target-s390x/Makefile.objs  |   2 +-
 target-s390x/cpu_features.c | 333 ++++++++++++++++++++++++++++++++++++++++++++
 target-s390x/cpu_features.h | 278 ++++++++++++++++++++++++++++++++++++
 3 files changed, 612 insertions(+), 1 deletion(-)
 create mode 100644 target-s390x/cpu_features.c
 create mode 100644 target-s390x/cpu_features.h
target-s390x/Makefile.objs +1 -1
index 34bd693..4266c87 100644
@@ -1,5 +1,5 @@
 obj-y += translate.o helper.o cpu.o interrupt.o
 obj-y += int_helper.o fpu_helper.o cc_helper.o mem_helper.o misc_helper.o
-obj-y += gdbstub.o cpu_models.o
+obj-y += gdbstub.o cpu_models.o cpu_features.o
 obj-$(CONFIG_SOFTMMU) += machine.o ioinst.o arch_dump.o mmu_helper.o
 obj-$(CONFIG_KVM) += kvm.o
target-s390x/cpu_features.c new file +333 -0

333 lines not on this page · raw message

target-s390x/cpu_features.h new file +278 -0

278 lines not on this page · raw message

Signature · 1 line
2.6.6
#5 lore raw

Re: [Qemu-devel] [Patch v2 04/29] s390x/cpumodel: introduce CPU features

On 08/08/2016 05:32 PM, David Hildenbrand wrote:

In general this this very good. Mostly bike shedding and naming.

target-s390x/cpu_features.c line 26

Quoted 3 lines
target-s390x/cpu_features.c new file +3 -0
+/* indexed by feature number for easy lookup */
+static const S390FeatDef s390_features[] = {
+    FEAT_INIT("n3", S390_FEAT_TYPE_STFL, 0, "Instructions marked as n3"),

/proc/cpuinfo calls this "esan3", so use the same?

Quoted 4 lines
target-s390x/cpu_features.c new file +4 -0
+    FEAT_INIT("zarch", S390_FEAT_TYPE_STFL, 1, "z/Architecture architectural mode"),
+    FEAT_INIT("dateh", S390_FEAT_TYPE_STFL, 3, "DAT-enhancement facility"),
+    FEAT_INIT("idtes", S390_FEAT_TYPE_STFL, 4, "IDTE selective TLB segment-table clearing"),
+    FEAT_INIT("idter", S390_FEAT_TYPE_STFL, 5, "IDTE selective TLB region-table clearing"),

target-s390x/cpu_features.c line 40

Quoted 10 lines
target-s390x/cpu_features.c new file +10 -0
+    FEAT_INIT("asnlxr", S390_FEAT_TYPE_STFL, 6, "ASN-and-LX reuse facility"),
+    FEAT_INIT("stfle", S390_FEAT_TYPE_STFL, 7, "Store-facility-list-extended facility"),
+    FEAT_INIT("edat", S390_FEAT_TYPE_STFL, 8, "Enhanced-DAT facility"),
+    FEAT_INIT("srs", S390_FEAT_TYPE_STFL, 9, "Sense-running-status facility"),
+    FEAT_INIT("csske", S390_FEAT_TYPE_STFL, 10, "Conditional-SSKE facility"),
+    FEAT_INIT("ctop", S390_FEAT_TYPE_STFL, 11, "Configuration-topology facility"),
+    FEAT_INIT("ipter", S390_FEAT_TYPE_STFL, 13, "IPTE-range facility"),
+    FEAT_INIT("nonqks", S390_FEAT_TYPE_STFL, 14, "Nonquiescing key-setting facility"),
+    FEAT_INIT("etf2", S390_FEAT_TYPE_STFL, 16, "Extended-translation facility 2"),
+    FEAT_INIT("msa-base", S390_FEAT_TYPE_STFL, 17, "Message-security-assist facility (excluding subfunctions)"),

Hmm, same for all other msa variants below. Why not just "msa" (as /proc/cpuinfo)? Does "base" indicate that we have the facility bit/instruction,but no subfunction like SHA?

Quoted 15 lines
target-s390x/cpu_features.c new file +15 -0
+    FEAT_INIT("ldisp", S390_FEAT_TYPE_STFL, 18, "Long-displacement facility"),
+    FEAT_INIT("ldisphp", S390_FEAT_TYPE_STFL, 19, "Long-displacement facility has high performance"),
+    FEAT_INIT("hfpm", S390_FEAT_TYPE_STFL, 20, "HFP-multiply-add/subtract facility"),
+    FEAT_INIT("eimm", S390_FEAT_TYPE_STFL, 21, "Extended-immediate facility"),
+    FEAT_INIT("etf3", S390_FEAT_TYPE_STFL, 22, "Extended-translation facility 3"),
+    FEAT_INIT("hfpue", S390_FEAT_TYPE_STFL, 23, "HFP-unnormalized-extension facility"),
+    FEAT_INIT("etf2eh", S390_FEAT_TYPE_STFL, 24, "ETF2-enhancement facility"),
+    FEAT_INIT("stckf", S390_FEAT_TYPE_STFL, 25, "Store-clock-fast facility"),
+    FEAT_INIT("parseh", S390_FEAT_TYPE_STFL, 26, "Parsing-enhancement facility"),
+    FEAT_INIT("mvcos", S390_FEAT_TYPE_STFL, 27, "Move-with-optional-specification facility"),
+    FEAT_INIT("tods-base", S390_FEAT_TYPE_STFL, 28, "TOD-clock-steering facility (excluding subfunctions)"),
+    FEAT_INIT("etf3eh", S390_FEAT_TYPE_STFL, 30, "ETF3-enhancement facility"),
+    FEAT_INIT("ectg", S390_FEAT_TYPE_STFL, 31, "Extract-CPU-time facility"),
+    FEAT_INIT("csst", S390_FEAT_TYPE_STFL, 32, "Compare-and-swap-and-store facility"),
+    FEAT_INIT("csst2", S390_FEAT_TYPE_STFL, 33, "Compare-and-swap-and-store facility 2"),

target-s390x/cpu_features.c line 65

Quoted 10 lines
target-s390x/cpu_features.c new file +10 -0
+    FEAT_INIT("ginste", S390_FEAT_TYPE_STFL, 34, "General-instructions-extension facility"),
+    FEAT_INIT("exrl", S390_FEAT_TYPE_STFL, 35, "Execute-extensions facility"),
+    FEAT_INIT("emon", S390_FEAT_TYPE_STFL, 36, "Enhanced-monitor facility"),
+    FEAT_INIT("fpe", S390_FEAT_TYPE_STFL, 37, "Floating-point extension facility"),
+    FEAT_INIT("sprogp", S390_FEAT_TYPE_STFL, 40, "Set-program-parameters facility"),
+    FEAT_INIT("fpseh", S390_FEAT_TYPE_STFL, 41, "Floating-point-support-enhancement facilities"),
+    FEAT_INIT("dfp", S390_FEAT_TYPE_STFL, 42, "DFP (decimal-floating-point) facility"),
+    FEAT_INIT("dfphp", S390_FEAT_TYPE_STFL, 43, "DFP (decimal-floating-point) facility has high performance"),
+    FEAT_INIT("pfpo", S390_FEAT_TYPE_STFL, 44, "PFPO instruction"),
+    FEAT_INIT("gen11e", S390_FEAT_TYPE_STFL, 45, "Various facilities introduced with z196"),

Hmm, not sure if gen11e is the best name.

It is for
"The distinct-operands, fast-BCR-serialization, high- word, and population-count facilities, the interlocked-access facility 1, and the load/store-on- condition facility 1 are installed in the z/Architecture architectural mode."

which is certainly too long,even for the comment. So what about "stfle45" instead of "gen11e" ?

target-s390x/cpu_features.c line 68

Quoted 3 lines
target-s390x/cpu_features.c new file +3 -0
+    FEAT_INIT("cmpsceh", S390_FEAT_TYPE_STFL, 47, "CMPSC-enhancement facility"),
+    FEAT_INIT("dfpzc", S390_FEAT_TYPE_STFL, 48, "Decimal-floating-point zoned-conversion facility"),
+    FEAT_INIT("gen12e", S390_FEAT_TYPE_STFL, 49, "Various facilities introduced with zEC12"),

Same here.

target-s390x/cpu_features.c line 72

Quoted 4 lines
target-s390x/cpu_features.c new file +4 -0
+    FEAT_INIT("cte", S390_FEAT_TYPE_STFL, 50, "Constrained transactional-execution facility"),
+    FEAT_INIT("ltlbc", S390_FEAT_TYPE_STFL, 51, "Local-TLB-clearing facility"),
+    FEAT_INIT("iacc2", S390_FEAT_TYPE_STFL, 52, "Interlocked-access facility 2"),
+    FEAT_INIT("gen13e", S390_FEAT_TYPE_STFL, 53, "Various facilities introduced with z13"),

and here

#6 lore raw

Re: [Qemu-devel] [Patch v2 04/29] s390x/cpumodel: introduce CPU features

Quoted 3 lines · David Hildenbrand

In general this this very good. Mostly bike shedding and naming.

Thanks!

Quoted 6 lines

target-s390x/cpu_features.c line 26

Quoted 4 lines
target-s390x/cpu_features.c new file +3 -0
+/* indexed by feature number for easy lookup */
+static const S390FeatDef s390_features[] = {
+    FEAT_INIT("n3", S390_FEAT_TYPE_STFL, 0, "Instructions marked as n3"),  

/proc/cpuinfo calls this "esan3", so use the same?

Agreed.

Quoted 16 lines
Quoted 5 lines
target-s390x/cpu_features.c new file +4 -0
+    FEAT_INIT("zarch", S390_FEAT_TYPE_STFL, 1, "z/Architecture architectural mode"),
+    FEAT_INIT("dateh", S390_FEAT_TYPE_STFL, 3, "DAT-enhancement facility"),
+    FEAT_INIT("idtes", S390_FEAT_TYPE_STFL, 4, "IDTE selective TLB segment-table clearing"),
+    FEAT_INIT("idter", S390_FEAT_TYPE_STFL, 5, "IDTE selective TLB region-table clearing"),

target-s390x/cpu_features.c line 40

Quoted 10 lines
target-s390x/cpu_features.c new file +10 -0
+    FEAT_INIT("asnlxr", S390_FEAT_TYPE_STFL, 6, "ASN-and-LX reuse facility"),
+    FEAT_INIT("stfle", S390_FEAT_TYPE_STFL, 7, "Store-facility-list-extended facility"),
+    FEAT_INIT("edat", S390_FEAT_TYPE_STFL, 8, "Enhanced-DAT facility"),
+    FEAT_INIT("srs", S390_FEAT_TYPE_STFL, 9, "Sense-running-status facility"),
+    FEAT_INIT("csske", S390_FEAT_TYPE_STFL, 10, "Conditional-SSKE facility"),
+    FEAT_INIT("ctop", S390_FEAT_TYPE_STFL, 11, "Configuration-topology facility"),
+    FEAT_INIT("ipter", S390_FEAT_TYPE_STFL, 13, "IPTE-range facility"),
+    FEAT_INIT("nonqks", S390_FEAT_TYPE_STFL, 14, "Nonquiescing key-setting facility"),
+    FEAT_INIT("etf2", S390_FEAT_TYPE_STFL, 16, "Extended-translation facility 2"),
+    FEAT_INIT("msa-base", S390_FEAT_TYPE_STFL, 17, "Message-security-assist facility (excluding subfunctions)"),  
Quoted 2 lines

Hmm, same for all other msa variants below. Why not just "msa" (as /proc/cpuinfo)? Does "base" indicate that we have the facility bit/instruction,but no subfunction like SHA?

Yes, as the description says "excluding subfunctions".

msa is a feature group, containing all introduced subfunctions.

msa-base is just the STFL bit. As discussed a while ago, we need this, because we could have some variance at that point int the future.

Quoted 36 lines
Quoted 16 lines
target-s390x/cpu_features.c new file +15 -0
+    FEAT_INIT("ldisp", S390_FEAT_TYPE_STFL, 18, "Long-displacement facility"),
+    FEAT_INIT("ldisphp", S390_FEAT_TYPE_STFL, 19, "Long-displacement facility has high performance"),
+    FEAT_INIT("hfpm", S390_FEAT_TYPE_STFL, 20, "HFP-multiply-add/subtract facility"),
+    FEAT_INIT("eimm", S390_FEAT_TYPE_STFL, 21, "Extended-immediate facility"),
+    FEAT_INIT("etf3", S390_FEAT_TYPE_STFL, 22, "Extended-translation facility 3"),
+    FEAT_INIT("hfpue", S390_FEAT_TYPE_STFL, 23, "HFP-unnormalized-extension facility"),
+    FEAT_INIT("etf2eh", S390_FEAT_TYPE_STFL, 24, "ETF2-enhancement facility"),
+    FEAT_INIT("stckf", S390_FEAT_TYPE_STFL, 25, "Store-clock-fast facility"),
+    FEAT_INIT("parseh", S390_FEAT_TYPE_STFL, 26, "Parsing-enhancement facility"),
+    FEAT_INIT("mvcos", S390_FEAT_TYPE_STFL, 27, "Move-with-optional-specification facility"),
+    FEAT_INIT("tods-base", S390_FEAT_TYPE_STFL, 28, "TOD-clock-steering facility (excluding subfunctions)"),
+    FEAT_INIT("etf3eh", S390_FEAT_TYPE_STFL, 30, "ETF3-enhancement facility"),
+    FEAT_INIT("ectg", S390_FEAT_TYPE_STFL, 31, "Extract-CPU-time facility"),
+    FEAT_INIT("csst", S390_FEAT_TYPE_STFL, 32, "Compare-and-swap-and-store facility"),
+    FEAT_INIT("csst2", S390_FEAT_TYPE_STFL, 33, "Compare-and-swap-and-store facility 2"),

target-s390x/cpu_features.c line 65

Quoted 10 lines
target-s390x/cpu_features.c new file +10 -0
+    FEAT_INIT("ginste", S390_FEAT_TYPE_STFL, 34, "General-instructions-extension facility"),
+    FEAT_INIT("exrl", S390_FEAT_TYPE_STFL, 35, "Execute-extensions facility"),
+    FEAT_INIT("emon", S390_FEAT_TYPE_STFL, 36, "Enhanced-monitor facility"),
+    FEAT_INIT("fpe", S390_FEAT_TYPE_STFL, 37, "Floating-point extension facility"),
+    FEAT_INIT("sprogp", S390_FEAT_TYPE_STFL, 40, "Set-program-parameters facility"),
+    FEAT_INIT("fpseh", S390_FEAT_TYPE_STFL, 41, "Floating-point-support-enhancement facilities"),
+    FEAT_INIT("dfp", S390_FEAT_TYPE_STFL, 42, "DFP (decimal-floating-point) facility"),
+    FEAT_INIT("dfphp", S390_FEAT_TYPE_STFL, 43, "DFP (decimal-floating-point) facility has high performance"),
+    FEAT_INIT("pfpo", S390_FEAT_TYPE_STFL, 44, "PFPO instruction"),
+    FEAT_INIT("gen11e", S390_FEAT_TYPE_STFL, 45, "Various facilities introduced with z196"),  

Hmm, not sure if gen11e is the best name.

It is for
"The distinct-operands, fast-BCR-serialization, high- word, and population-count facilities, the interlocked-access facility 1, and the load/store-on- condition facility 1 are installed in the z/Architecture architectural mode."

Quoted 2 lines

which is certainly too long,even for the comment. So what about "stfle45" instead of "gen11e" ?

well, it at least tells you that it is a an enhancement part of hw generation
11. But I don't have a strong opinion on that. These should usually never be presented to the user either way (because contained in the base models).

David

#7 lore raw

PATCH v2 5/29 s390x/cpumodel: generate CPU feature lists for CPU models

In reply to David Hildenbrand

From: Michael Mueller <[email protected]>

This patch introduces the helper "gen-features" which allows to generate feature list definitions at compile time. Its flexibility is better and the error-proneness is lower when compared to static programming time added statements.

The helper includes "target-s390x/cpu_features.h" to be able to use named facility bits instead of numbers. The generated defines will be used for the definition of CPU models.

We generate feature lists for each HW generation and GA for EC models. BC models are always based on a EC version and have no separate definitions.

Base features: Features we expect to be always available in sane setups. Migration safe - will never change. Can be seen as "minimum features required for a CPU model".

Default features: Features we expect to be stable and around in latest setups (e.g. having KVM support) - not migration safe.

Max features: All supported features that are theoretically allowed for a CPU model. Exceeding these features could otherwise produce problems with IBC (instruction blocking controls) in KVM.

[generate base, default and models. renaming and cleanup]
---
 Makefile.target             |   2 +-
 rules.mak                   |   1 +
 target-s390x/Makefile.objs  |  20 ++
 target-s390x/gen-features.c | 507 ++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 529 insertions(+), 1 deletion(-)
 create mode 100644 target-s390x/gen-features.c
Makefile.target +1 -1
index a440bcb..8c7a072 100644
@@ -212,7 +212,7 @@ hmp-commands-info.h: $(SRC_PATH)/hmp-commands-info.hx $(SRC_PATH)/scripts/hxtool
 qmp-commands-old.h: $(SRC_PATH)/qmp-commands.hx $(SRC_PATH)/scripts/hxtool
 	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"  GEN   $(TARGET_DIR)$@")
 
-clean:
+clean: clean-target
 	rm -f *.a *~ $(PROGS)
 	rm -f $(shell find . -name '*.[od]')
 	rm -f hmp-commands.h qmp-commands-old.h gdbstub-xml.c
rules.mak +1 -0
index 99cd0b3..55b0121 100644
@@ -14,6 +14,7 @@ MAKEFLAGS += -rR
 %.cpp:
 %.m:
 %.mak:
+clean-target:
 
 # Flags for C++ compilation
 QEMU_CXXFLAGS = -D__STDC_LIMIT_MACROS $(filter-out -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wold-style-declaration -Wold-style-definition -Wredundant-decls, $(QEMU_CFLAGS))
target-s390x/Makefile.objs +20 -0
index 4266c87..745d501 100644
@@ -3,3 +3,23 @@ obj-y += int_helper.o fpu_helper.o cc_helper.o mem_helper.o misc_helper.o
 obj-y += gdbstub.o cpu_models.o cpu_features.o
 obj-$(CONFIG_SOFTMMU) += machine.o ioinst.o arch_dump.o mmu_helper.o
 obj-$(CONFIG_KVM) += kvm.o
+
+# build and run feature list generator
+feat-src = $(SRC_PATH)/target-$(TARGET_BASE_ARCH)/
+feat-dst = $(BUILD_DIR)/$(TARGET_DIR)
+ifneq ($(MAKECMDGOALS),clean)
+GENERATED_HEADERS += $(feat-dst)gen-features.h
+endif
+
+$(feat-dst)gen-features.h: $(feat-dst)gen-features.h-timestamp
+	@cmp $< $@ >/dev/null 2>&1 || cp $< $@
+$(feat-dst)gen-features.h-timestamp: $(feat-dst)gen-features
+	$(call quiet-command,$< >$@,"  GEN   $(TARGET_DIR)gen-features.h")
+
+$(feat-dst)gen-features: $(feat-src)gen-features.c config-target.h
+	$(call quiet-command,$(CC) $(QEMU_INCLUDES) $(QEMU_CFLAGS) $(CFLAGS) -o $@ $<,"  CC    $(TARGET_DIR)gen-features")
+
+clean-target:
+	rm -f gen-features.h-timestamp
+	rm -f gen-features.h
+	rm -f gen-features
target-s390x/gen-features.c new file +507 -0

507 lines not on this page · raw message

Signature · 1 line
2.6.6
#8 lore raw

PATCH v2 6/29 s390x/cpumodel: generate CPU feature group lists

In reply to David Hildenbrand

Feature groups will be very helpful to reduce the amount of features typically available in sane configurations. E.g. the MSA facilities introduced loads of subfunctions, which could - in theory - go away in the future, but we want to avoid reporting hundrets of features to the user if usually all of them are in place.

Groups only contain features that were introduced in one shot, not just random features. Therefore, groups can never change. This is an important property regarding migration.

---
 target-s390x/gen-features.c | 80 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 80 insertions(+)
target-s390x/gen-features.c +80 -0
index 05b8d9b..1dfcc9a 100644
@@ -178,6 +178,35 @@
     S390_FEAT_MSA_EXT_5, \
     S390_FEAT_PPNO_SHA_512_DRNG
 
+/* cpu feature groups */
+static uint16_t group_PLO[] = {
+    S390_FEAT_GROUP_PLO,
+};
+static uint16_t group_TOD_CLOCK_STEERING[] = {
+    S390_FEAT_GROUP_TOD_CLOCK_STEERING,
+};
+static uint16_t group_GEN13_PTFF[] = {
+    S390_FEAT_GROUP_GEN13_PTFF,
+};
+static uint16_t group_MSA[] = {
+    S390_FEAT_GROUP_MSA,
+};
+static uint16_t group_MSA_EXT_1[] = {
+    S390_FEAT_GROUP_MSA_EXT_1,
+};
+static uint16_t group_MSA_EXT_2[] = {
+    S390_FEAT_GROUP_MSA_EXT_2,
+};
+static uint16_t group_MSA_EXT_3[] = {
+    S390_FEAT_GROUP_MSA_EXT_3,
+};
+static uint16_t group_MSA_EXT_4[] = {
+    S390_FEAT_GROUP_MSA_EXT_4,
+};
+static uint16_t group_MSA_EXT_5[] = {
+    S390_FEAT_GROUP_MSA_EXT_5,
+};
+
 /* base features in order of release */
 static uint16_t base_GEN7_GA1[] = {
     S390_FEAT_GROUP_PLO,
@@ -431,6 +460,34 @@ static CpuFeatDefSpec CpuFeatDef[] = {
     CPU_FEAT_INITIALIZER(GEN13_GA2),
 };
 
+#define FEAT_GROUP_INITIALIZER(_name)                  \
+    {                                                  \
+        .name = "S390_FEAT_GROUP_LIST_" #_name,        \
+        .bits =                                        \
+            { .data = group_##_name,                   \
+              .len = ARRAY_SIZE(group_##_name) },      \
+    }
+
+typedef struct {
+    const char *name;
+    BitSpec bits;
+} FeatGroupDefSpec;
+
+/*******************************
+ * feature groups
+ *******************************/
+static FeatGroupDefSpec FeatGroupDef[] = {
+    FEAT_GROUP_INITIALIZER(PLO),
+    FEAT_GROUP_INITIALIZER(TOD_CLOCK_STEERING),
+    FEAT_GROUP_INITIALIZER(GEN13_PTFF),
+    FEAT_GROUP_INITIALIZER(MSA),
+    FEAT_GROUP_INITIALIZER(MSA_EXT_1),
+    FEAT_GROUP_INITIALIZER(MSA_EXT_2),
+    FEAT_GROUP_INITIALIZER(MSA_EXT_3),
+    FEAT_GROUP_INITIALIZER(MSA_EXT_4),
+    FEAT_GROUP_INITIALIZER(MSA_EXT_5),
+};
+
 static void set_bits(uint64_t list[], BitSpec bits)
 {
     uint32_t i;
@@ -488,6 +545,28 @@ static void print_feature_defs(void)
     }
 }
 
+static void print_feature_group_defs(void)
+{
+    int i, j;
+
+    printf("\n/* CPU feature group list data */\n");
+
+    for (i = 0; i < ARRAY_SIZE(FeatGroupDef); i++) {
+        uint64_t feat[S390_FEAT_MAX / 64 + 1] = {};
+
+        set_bits(feat, FeatGroupDef[i].bits);
+        printf("#define %s\t", FeatGroupDef[i].name);
+        for (j = 0; j < ARRAY_SIZE(feat); j++) {
+            printf("0x%016"PRIx64"UL", feat[j]);
+            if (j < ARRAY_SIZE(feat) - 1) {
+                printf(",");
+            } else {
+                printf("\n");
+            }
+        }
+    }
+}
+
 int main(int argc, char *argv[])
 {
     printf("/*\n"
@@ -502,6 +581,7 @@ int main(int argc, char *argv[])
            " */\n\n"
            "#ifndef %s\n#define %s\n", __FILE__, _YEARS, _NAME_H, _NAME_H);
     print_feature_defs();
+    print_feature_group_defs();
     printf("\n#endif\n");
     return 0;
 }
Signature · 1 line
2.6.6
#9 lore raw

PATCH v2 7/29 s390x/cpumodel: introduce CPU feature group definitions

In reply to David Hildenbrand

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.

---
 target-s390x/cpu_features.c | 44 +++++++++++++++++++++++++++++++++++++++++++-
 target-s390x/cpu_features.h | 23 +++++++++++++++++++++++
 2 files changed, 66 insertions(+), 1 deletion(-)
target-s390x/cpu_features.c +43 -1
index 65e2b64..1f51143 100644
@@ -12,6 +12,7 @@
 
 #include "qemu/osdep.h"
 #include "cpu_features.h"
+#include "gen-features.h"
 
 #define FEAT_INIT(_name, _type, _bit, _desc) \
     {                                                \
@@ -320,14 +321,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);
+        }
+    }
+
+    /* report leftovers as separate features */
     feat = find_first_bit(bitmap, S390_FEAT_MAX);
     while (feat < S390_FEAT_MAX) {
         fn(s390_feat_def(feat)->name, opaque);
         feat = find_next_bit(bitmap, S390_FEAT_MAX, feat + 1);
     };
 }
+
+#define FEAT_GROUP_INIT(_name, _group, _desc)        \
+    {                                                \
+        .name = _name,                               \
+        .desc = _desc,                               \
+        .feat = { S390_FEAT_GROUP_LIST_ ## _group }, \
+    }
+
+/* indexed by feature group number for easy lookup */
+static const S390FeatGroupDef s390_feature_groups[] = {
+    FEAT_GROUP_INIT("plo", PLO, "Perform-locked-operation facility"),
+    FEAT_GROUP_INIT("tods", TOD_CLOCK_STEERING, "Tod-clock-steering facility"),
+    FEAT_GROUP_INIT("gen13ptff", GEN13_PTFF, "PTFF enhancements introduced with z13"),
+    FEAT_GROUP_INIT("msa", MSA, "Message-security-assist facility"),
+    FEAT_GROUP_INIT("msa1", MSA_EXT_1, "Message-security-assist-extension 1 facility"),
+    FEAT_GROUP_INIT("msa2", MSA_EXT_2, "Message-security-assist-extension 2 facility"),
+    FEAT_GROUP_INIT("msa3", MSA_EXT_3, "Message-security-assist-extension 3 facility"),
+    FEAT_GROUP_INIT("msa4", MSA_EXT_4, "Message-security-assist-extension 4 facility"),
+    FEAT_GROUP_INIT("msa5", MSA_EXT_5, "Message-security-assist-extension 5 facility"),
+};
+
+const S390FeatGroupDef *s390_feat_group_def(S390FeatGroup group)
+{
+    return &s390_feature_groups[group];
+}
target-s390x/cpu_features.h +23 -0
index 69dc60d..6128903 100644
@@ -272,6 +272,29 @@ void s390_add_from_feat_block(S390FeatBitmap features, S390FeatType type,
 void s390_feat_bitmap_to_ascii(const S390FeatBitmap features, void *opaque,
                                void (*fn)(const char *name, void *opaque));
 
+/* static groups that will never change */
+typedef enum {
+    S390_FEAT_GROUP_PLO,
+    S390_FEAT_GROUP_TOD_CLOCK_STEERING,
+    S390_FEAT_GROUP_GEN13_PTFF_ENH,
+    S390_FEAT_GROUP_MSA,
+    S390_FEAT_GROUP_MSA_EXT_1,
+    S390_FEAT_GROUP_MSA_EXT_2,
+    S390_FEAT_GROUP_MSA_EXT_3,
+    S390_FEAT_GROUP_MSA_EXT_4,
+    S390_FEAT_GROUP_MSA_EXT_5,
+    S390_FEAT_GROUP_MAX,
+} S390FeatGroup;
+
+/* Definition of a CPU feature group */
+typedef struct {
+    const char *name;       /* name exposed to the user */
+    const char *desc;       /* description exposed to the user */
+    S390FeatBitmap feat;    /* features contained in the group */
+} S390FeatGroupDef;
+
+const S390FeatGroupDef *s390_feat_group_def(S390FeatGroup group);
+
 #define BE_BIT_NR(BIT) (BIT ^ (BITS_PER_LONG - 1))
 #define BE_BIT(BIT) (1ULL < BE_BIT_NR(BIT))
 
Signature · 1 line
2.6.6
#10 lore raw

PATCH v2 8/29 s390x/cpumodel: register defined CPU models as subclasses

In reply to David Hildenbrand

This patch adds the CPU model definitions that are known on s390x - like z900, zBC12 or z13. For each definition, introduce two CPU models:

1. Base model (e.g. z13-base): Minimum feature set we expect to be around on all z13 systems. These models are migration-safe and will never change.
2. Flexible models (e.g. z13): Models that can change between QEMU versions and will be extended over time as we implement further features that are already part of such a model in real hardware of certain configurations.

---
 target-s390x/cpu-qom.h    |   2 +
 target-s390x/cpu_models.c | 113 ++++++++++++++++++++++++++++++++++++++++++++++
 target-s390x/cpu_models.h |  36 +++++++++++++++
 3 files changed, 151 insertions(+)
 create mode 100644 target-s390x/cpu_models.h
target-s390x/cpu-qom.h +2 -0
index bb993d4..4e936e7 100644
@@ -21,6 +21,7 @@
 #define QEMU_S390_CPU_QOM_H
 
 #include "qom/cpu.h"
+#include "cpu_models.h"
 
 #define TYPE_S390_CPU "s390-cpu"
 
@@ -45,6 +46,7 @@ typedef struct S390CPUClass {
     /*< private >*/
     CPUClass parent_class;
     /*< public >*/
+    const S390CPUDef *cpu_def;
     bool kvm_required;
     bool is_static;
     bool is_migration_safe;
target-s390x/cpu_models.c +113 -0

148 lines not on this page · raw message

target-s390x/cpu_models.h new file +36 -0
new file mode 100644
index 0000000..13f7217
@@ -0,0 +1,36 @@
+/*
+ * CPU models for s390x
+ *
+ * Copyright 2016 IBM Corp.
+ *
+ * Author(s): David Hildenbrand <[email protected]>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or (at
+ * your option) any later version. See the COPYING file in the top-level
+ * directory.
+ */
+
+#ifndef TARGET_S390X_CPU_MODELS_H
+#define TARGET_S390X_CPU_MODELS_H
+
+#include "cpu_features.h"
+#include "qom/cpu.h"
+
+/* static CPU definition */
+typedef struct S390CPUDef {
+    const char *name;       /* name exposed to the user */
+    const char *desc;       /* description exposed to the user */
+    uint8_t gen;            /* hw generation identification */
+    uint16_t type;          /* cpu type identification */
+    uint8_t ec_ga;          /* EC GA version (on which also the BC is based) */
+    uint8_t mha_pow;        /* Maximum Host Adress Power, mha = 2^pow-1 */
+    uint32_t hmfai;         /* hypervisor-managed facilities */
+    /* base/min features, must never be changed between QEMU versions */
+    S390FeatBitmap base_feat;
+    /* deafault features, QEMU version specific */
+    S390FeatBitmap default_feat;
+    /* max allowed features, QEMU version specific */
+    S390FeatBitmap full_feat;
+} S390CPUDef;
+
+#endif /* TARGET_S390X_CPU_MODELS_H */
Signature · 1 line
2.6.6
#11 lore raw

PATCH v2 9/29 s390x/cpumodel: store the CPU model in the CPU instance

In reply to David Hildenbrand

A CPU model consists of a CPU definition, to which delta changes are applied - features added or removed (e.g. z13-base,vx=on). In addition, certain properties (e.g. cpu id) can later on change during migration but belong into the CPU model. This data will later be filled from the host model in the KVM case.

Therefore, store the configured CPU model inside the CPU instance, so we can later on perform delta changes using properties.

For the "qemu" model, we emulate in TCG a z900. "host" will be uninitialized (cpu->model == NULL) unless we have CPU model support in KVM later on. The other models are all initialized from their definitions. Only the "host" model can have a cpu->model == NULL.

---
 target-s390x/cpu.h        |  1 +
 target-s390x/cpu_models.c | 26 ++++++++++++++++++++++++++
 target-s390x/cpu_models.h | 10 ++++++++++
 3 files changed, 37 insertions(+)
target-s390x/cpu.h +1 -0
index 075bb37..3b76654 100644
@@ -188,6 +188,7 @@ struct S390CPU {
 
     CPUS390XState env;
     int64_t id;
+    S390CPUModel *model;
     /* needed for live migration */
     void *irqstate;
     uint32_t irqstate_saved_size;
target-s390x/cpu_models.c +26 -0
index 8036b6e..f707a4b 100644
@@ -153,6 +153,21 @@ void s390_realize_cpu_model(CPUState *cs, Error **errp)
 
 static void s390_cpu_model_initfn(Object *obj)
 {
+    S390CPU *cpu = S390_CPU(obj);
+    S390CPUClass *xcc = S390_CPU_GET_CLASS(cpu);
+
+    cpu->model = g_malloc0(sizeof(*cpu->model));
+    /* copy the model, so we can modify it */
+    cpu->model->def = xcc->cpu_def;
+    if (xcc->is_static) {
+        /* base model - features will never change */
+        bitmap_copy(cpu->model->features, cpu->model->def->base_feat,
+                    S390_FEAT_MAX);
+    } else {
+        /* latest model - features can change */
+        bitmap_copy(cpu->model->features,
+                    cpu->model->def->default_feat, S390_FEAT_MAX);
+    }
 }
 
 #ifdef CONFIG_KVM
@@ -163,10 +178,21 @@ static void s390_host_cpu_model_initfn(Object *obj)
 
 static void s390_qemu_cpu_model_initfn(Object *obj)
 {
+    S390CPU *cpu = S390_CPU(obj);
+
+    cpu->model = g_malloc0(sizeof(*cpu->model));
+    /* TCG emulates a z900 */
+    cpu->model->def = &s390_cpu_defs[0];
+    bitmap_copy(cpu->model->features, cpu->model->def->default_feat,
+                S390_FEAT_MAX);
 }
 
 static void s390_cpu_model_finalize(Object *obj)
 {
+    S390CPU *cpu = S390_CPU(obj);
+
+    g_free(cpu->model);
+    cpu->model = NULL;
 }
 
 static bool get_is_migration_safe(Object *obj, Error **errp)
target-s390x/cpu_models.h +10 -0
index 13f7217..244256b 100644
@@ -33,4 +33,14 @@ typedef struct S390CPUDef {
     S390FeatBitmap full_feat;
 } S390CPUDef;
 
+/* CPU model based on a CPU definition */
+typedef struct S390CPUModel {
+    const S390CPUDef *def;
+    S390FeatBitmap features;
+    /* values copied from the "host" model, can change during migration */
+    uint16_t lowest_ibc;    /* lowest IBC that the hardware supports */
+    uint32_t cpu_id;        /* CPU id */
+    uint8_t cpu_ver;        /* CPU version, usually "ff" for kvm */
+} S390CPUModel;
+
 #endif /* TARGET_S390X_CPU_MODELS_H */
Signature · 1 line
2.6.6
#12 lore raw

PATCH v2 10/29 s390x/cpumodel: expose features and feature groups as properties

In reply to David Hildenbrand

Let's add all features and feature groups as properties to all CPU models. If the "host" CPU model is unknown, we can neither query nor change features. KVM will just continue to work like it did until now.

We will not allow to enable features that were not part of the original CPU model, because that could collide with the IBC in KVM.

---
 target-s390x/cpu.c        |   1 +
 target-s390x/cpu.h        |   1 +
 target-s390x/cpu_models.c | 149 ++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 151 insertions(+)
target-s390x/cpu.c +1 -0
index d7d0b62..2f3c8e2 100644
@@ -291,6 +291,7 @@ static void s390_cpu_initfn(Object *obj)
     cs->exception_index = EXCP_HLT;
     object_property_add(OBJECT(cpu), "id", "int64_t", s390x_cpu_get_id,
                         s390x_cpu_set_id, NULL, NULL, NULL);
+    s390_cpu_model_register_props(obj);
 #if !defined(CONFIG_USER_ONLY)
     qemu_get_timedate(&tm, 0);
     env->tod_offset = TOD_UNIX_EPOCH +
target-s390x/cpu.h +1 -0
index 3b76654..d03f0f1 100644
@@ -632,6 +632,7 @@ extern void subsystem_reset(void);
 
 void s390_cpu_list(FILE *f, fprintf_function cpu_fprintf);
 #define cpu_list s390_cpu_list
+void s390_cpu_model_register_props(Object *obj);
 void s390_cpu_model_class_register_props(ObjectClass *oc);
 void s390_realize_cpu_model(CPUState *cs, Error **errp);
 ObjectClass *s390_cpu_class_by_name(const char *name);
target-s390x/cpu_models.c +149 -0

169 lines not on this page · raw message

Signature · 1 line
2.6.6
#13 lore raw

PATCH v2 11/29 s390x/cpumodel: let the CPU model handle feature checks

In reply to David Hildenbrand

If we have certain features enabled, we have to migrate additional state (e.g. vector registers or runtime-instrumentation registers). Let the CPU model control that unless we have no "host" CPU model in the KVM case. This will later on be the case for compatibility machines, so migration from QEMU versions without the CPU model will still work.

---
 target-s390x/cpu_models.c | 24 ++++++++++++++++++++++++
 target-s390x/cpu_models.h |  2 ++
 target-s390x/kvm.c        |  4 ++--
 target-s390x/machine.c    | 14 ++------------
 4 files changed, 30 insertions(+), 14 deletions(-)
target-s390x/cpu_models.c +24 -0
index 5f218c2..d135661 100644
@@ -73,6 +73,30 @@ static const S390CPUDef s390_cpu_defs[] = {
     CPUDEF_INIT(0x2965, 13, 2, 47, 0x08000000U, "z13s", "IBM z13s GA1"),
 };
 
+bool s390_has_feat(S390Feat feat)
+{
+    static S390CPU *cpu;
+
+    if (!cpu) {
+        cpu = S390_CPU(qemu_get_cpu(0));
+    }
+
+    if (!cpu || !cpu->model) {
+#ifdef CONFIG_KVM
+        if (kvm_enabled()) {
+            if (feat == S390_FEAT_VECTOR) {
+                return kvm_check_extension(kvm_state, KVM_CAP_S390_VECTOR_REGISTERS);
+            }
+            if (feat == S390_FEAT_RUNTIME_INSTRUMENTATION) {
+                return kvm_s390_get_ri();
+            }
+        }
+#endif
+        return 0;
+    }
+    return test_bit(feat, cpu->model->features);
+}
+
 struct S390PrintCpuListInfo {
     FILE *f;
     fprintf_function print;
target-s390x/cpu_models.h +2 -0
index 244256b..fe988cc 100644
@@ -43,4 +43,6 @@ typedef struct S390CPUModel {
     uint8_t cpu_ver;        /* CPU version, usually "ff" for kvm */
 } S390CPUModel;
 
+bool s390_has_feat(S390Feat feat);
+
 #endif /* TARGET_S390X_CPU_MODELS_H */
target-s390x/kvm.c +2 -2
index 80ac621..55bf6d7 100644
@@ -1517,7 +1517,7 @@ static void sigp_store_adtl_status(void *arg)
 {
     SigpInfo *si = arg;
 
-    if (!kvm_check_extension(kvm_state, KVM_CAP_S390_VECTOR_REGISTERS)) {
+    if (!s390_has_feat(S390_FEAT_VECTOR)) {
         set_sigp_status(si, SIGP_STAT_INVALID_ORDER);
         return;
     }
@@ -2089,7 +2089,7 @@ static uint64_t build_channel_report_mcic(void)
         MCIC_VB_WP | MCIC_VB_MS | MCIC_VB_PM | MCIC_VB_IA | MCIC_VB_FP |
         MCIC_VB_GR | MCIC_VB_CR | MCIC_VB_ST | MCIC_VB_AR | MCIC_VB_PR |
         MCIC_VB_FC | MCIC_VB_CT | MCIC_VB_CC;
-    if (kvm_check_extension(kvm_state, KVM_CAP_S390_VECTOR_REGISTERS)) {
+    if (s390_has_feat(S390_FEAT_VECTOR)) {
         mcic |= MCIC_VB_VR;
     }
     return mcic;
target-s390x/machine.c +2 -12
index aa39e5d..edc3a47 100644
@@ -78,12 +78,7 @@ static const VMStateDescription vmstate_fpu = {
 
 static bool vregs_needed(void *opaque)
 {
-#ifdef CONFIG_KVM
-    if (kvm_enabled()) {
-        return kvm_check_extension(kvm_state, KVM_CAP_S390_VECTOR_REGISTERS);
-    }
-#endif
-    return 0;
+    return s390_has_feat(S390_FEAT_VECTOR);
 }
 
 static const VMStateDescription vmstate_vregs = {
@@ -147,12 +142,7 @@ static const VMStateDescription vmstate_vregs = {
 
 static bool riccb_needed(void *opaque)
 {
-#ifdef CONFIG_KVM
-    if (kvm_enabled()) {
-        return kvm_s390_get_ri();
-    }
-#endif
-    return 0;
+    return s390_has_feat(S390_FEAT_RUNTIME_INSTRUMENTATION);
 }
 
 const VMStateDescription vmstate_riccb = {
Signature · 1 line
2.6.6
#14 lore raw

PATCH v2 12/29 s390x/cpumodel: check and apply the CPU model

In reply to David Hildenbrand

We have to test if a configured CPU model is runnable in the current configuration, and if not report why that is the case. This is done by comparing it to the maximum supported model (host for KVM or z900 for TCG). Also, we want to do some base sanity checking for a configured CPU model.

We'll cache the maximum model and the applied model (for performance reasons and because KVM can only be configured before any VCPU is created).

For unavailable "host" model, we have to make sure that we inform KVM, so it can do some compatibility stuff (enable CMMA later on to be precise).

---
 target-s390x/cpu_models.c | 153 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 153 insertions(+)
target-s390x/cpu_models.c +153 -0
index d135661..b1af0f6 100644
@@ -15,6 +15,7 @@
 #include "gen-features.h"
 #include "qapi/error.h"
 #include "qapi/visitor.h"
+#include "qemu/error-report.h"
 #ifndef CONFIG_USER_ONLY
 #include "sysemu/arch_init.h"
 #endif
@@ -182,14 +183,166 @@ CpuDefinitionInfoList *arch_query_cpu_definitions(Error **errp)
 }
 #endif
 
+static void check_consistency(const S390CPUModel *model)
+{
+    static int dep[][2] = {
+        { S390_FEAT_IPTE_RANGE, S390_FEAT_DAT_ENH },
+        { S390_FEAT_IDTE_SEGMENT, S390_FEAT_DAT_ENH },
+        { S390_FEAT_IDTE_REGION, S390_FEAT_DAT_ENH },
+        { S390_FEAT_IDTE_REGION, S390_FEAT_IDTE_SEGMENT },
+        { S390_FEAT_LOCAL_TLB_CLEARING, S390_FEAT_DAT_ENH},
+        { S390_FEAT_LONG_DISPLACEMENT_FAST, S390_FEAT_LONG_DISPLACEMENT },
+        { S390_FEAT_DFP_FAST, S390_FEAT_DFP },
+        { S390_FEAT_TRANSACTIONAL_EXE, S390_FEAT_GEN12_ENH },
+        { S390_FEAT_EDAT_2, S390_FEAT_EDAT},
+        { S390_FEAT_MSA_EXT_5, S390_FEAT_KIMD_SHA_512 },
+        { S390_FEAT_MSA_EXT_5, S390_FEAT_KLMD_SHA_512 },
+        { S390_FEAT_MSA_EXT_4, S390_FEAT_MSA_EXT_3 },
+        { S390_FEAT_SIE_CMMA, S390_FEAT_CMM },
+        { S390_FEAT_SIE_CMMA, S390_FEAT_SIE_GSLS },
+        { S390_FEAT_SIE_PFMFI, S390_FEAT_EDAT },
+    };
+    int i;
+
+    for (i = 0; i < ARRAY_SIZE(dep); i++) {
+        if (test_bit(dep[i][0], model->features) &&
+            !test_bit(dep[i][1], model->features)) {
+            error_report("Warning: \'%s\' requires \'%s\'.",
+                         s390_feat_def(dep[i][0])->name,
+                         s390_feat_def(dep[i][1])->name);
+        }
+    }
+}
+
+static void error_prepend_missing_feat(const char *name, void *opaque)
+{
+    error_prepend((Error **) opaque, "%s ", name);
+}
+
+static void check_compatibility(const S390CPUModel *max_model,
+                                const S390CPUModel *model, Error **errp)
+{
+    S390FeatBitmap missing;
+
+    if (model->def->gen > max_model->def->gen) {
+        error_setg(errp, "Selected CPU generation is too new. Maximum "
+                   "supported model in the configuration: \'%s\'",
+                   max_model->def->name);
+        return;
+    } else if (model->def->gen == max_model->def->gen &&
+               model->def->ec_ga > max_model->def->ec_ga) {
+        error_setg(errp, "Selected CPU GA level is too new. Maximum "
+                   "supported model in the configuration: \'%s\'",
+                   max_model->def->name);
+        return;
+    }
+
+    /* detect the missing features to properly report them */
+    bitmap_andnot(missing, model->features, max_model->features, S390_FEAT_MAX);
+    if (bitmap_empty(missing, S390_FEAT_MAX)) {
+        return;
+    }
+
+    error_setg(errp, " ");
+    s390_feat_bitmap_to_ascii(missing, errp, error_prepend_missing_feat);
+    error_prepend(errp, "Some features requested in the CPU model are not "
+                  "available in the configuration: ");
+}
+
+static S390CPUModel *get_max_cpu_model(Error **errp)
+{
+#ifndef CONFIG_USER_ONLY
+    static S390CPUModel max_model;
+    static bool cached;
+
+    if (cached) {
+        return &max_model;
+    }
+
+    if (kvm_enabled()) {
+        error_setg(errp, "KVM does not support CPU models.");
+    } else {
+        /* TCG enulates a z900 */
+        max_model.def = &s390_cpu_defs[0];
+        bitmap_copy(max_model.features, max_model.def->default_feat,
+                    S390_FEAT_MAX);
+    }
+    if (!*errp) {
+        cached = true;
+        return &max_model;
+    }
+#endif
+    return NULL;
+}
+
+static inline void apply_cpu_model(const S390CPUModel *model, Error **errp)
+{
+#ifndef CONFIG_USER_ONLY
+    static S390CPUModel applied_model;
+    static bool applied;
+
+    /*
+     * We have the same model for all VCPUs. KVM can only be configured before
+     * any VCPUs are defined in KVM.
+     */
+    if (applied) {
+        if (model && memcmp(&applied_model, model, sizeof(S390CPUModel))) {
+            error_setg(errp, "Mixed CPU models are not supported on s390x.");
+        }
+        return;
+    }
+
+    if (kvm_enabled()) {
+        /* FIXME KVM */
+        error_setg(errp, "KVM doesn't support CPU models.");
+    } else if (model) {
+        /* FIXME TCG - use data for stdip/stfl */
+    }
+
+    if (!*errp) {
+        applied = true;
+        if (model) {
+            applied_model = *model;
+        }
+    }
+#endif
+}
+
 void s390_realize_cpu_model(CPUState *cs, Error **errp)
 {
     S390CPUClass *xcc = S390_CPU_GET_CLASS(cs);
+    S390CPU *cpu = S390_CPU(cs);
+    const S390CPUModel *max_model;
 
     if (xcc->kvm_required && !kvm_enabled()) {
         error_setg(errp, "CPU definition requires KVM");
         return;
     }
+
+    if (!cpu->model) {
+        /* no host model support -> perform compatibility stuff */
+        apply_cpu_model(NULL, errp);
+        return;
+    }
+
+    max_model = get_max_cpu_model(errp);
+    if (*errp) {
+        error_prepend(errp, "CPU models are not available: ");
+        return;
+    }
+
+    /* copy over properties that can vary */
+    cpu->model->lowest_ibc = max_model->lowest_ibc;
+    cpu->model->cpu_id = max_model->cpu_id;
+    cpu->model->cpu_ver = max_model->cpu_ver;
+
+    check_consistency(cpu->model);
+    check_compatibility(max_model, cpu->model, errp);
+    if (*errp) {
+        return;
+    }
+
+    apply_cpu_model(cpu->model, errp);
 }
 
 static void get_feature(Object *obj, Visitor *v, const char *name,
Signature · 1 line
2.6.6
#15 lore raw

PATCH v2 13/29 s390x/sclp: factor out preparation of cpu entries

In reply to David Hildenbrand

Let's factor out the common code of "read cpu info" and "read scp info". This will make the introduction of new cpu entry fields easier.

---
 hw/s390x/sclp.c | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)
hw/s390x/sclp.c +12 -10
index fca37f5..15d7114 100644
@@ -29,6 +29,16 @@ static inline SCLPDevice *get_sclp_device(void)
     return SCLP(object_resolve_path_type("", TYPE_SCLP, NULL));
 }
 
+static void prepare_cpu_entries(SCLPDevice *sclp, CPUEntry *entry, int count)
+{
+    int i;
+
+    for (i = 0; i < count; i++) {
+        entry[i].address = i;
+        entry[i].type = 0;
+    }
+}
+
 /* Provide information about the configuration, CPUs and storage */
 static void read_SCP_info(SCLPDevice *sclp, SCCB *sccb)
 {
@@ -37,7 +47,6 @@ static void read_SCP_info(SCLPDevice *sclp, SCCB *sccb)
     sclpMemoryHotplugDev *mhd = get_sclp_memory_hotplug_dev();
     CPUState *cpu;
     int cpu_count = 0;
-    int i = 0;
     int rnsize, rnmax;
     int slots = MIN(machine->ram_slots, s390_get_memslot_count(kvm_state));
 
@@ -50,10 +59,7 @@ static void read_SCP_info(SCLPDevice *sclp, SCCB *sccb)
     read_info->offset_cpu = cpu_to_be16(offsetof(ReadInfo, entries));
     read_info->highest_cpu = cpu_to_be16(max_cpus);
 
-    for (i = 0; i < cpu_count; i++) {
-        read_info->entries[i].address = i;
-        read_info->entries[i].type = 0;
-    }
+    prepare_cpu_entries(sclp, read_info->entries, cpu_count);
 
     read_info->facilities = cpu_to_be64(SCLP_HAS_CPU_INFO |
                                         SCLP_HAS_PCI_RECONFIG);
@@ -304,7 +310,6 @@ static void sclp_read_cpu_info(SCLPDevice *sclp, SCCB *sccb)
     ReadCpuInfo *cpu_info = (ReadCpuInfo *) sccb;
     CPUState *cpu;
     int cpu_count = 0;
-    int i = 0;
 
     CPU_FOREACH(cpu) {
         cpu_count++;
@@ -318,10 +323,7 @@ static void sclp_read_cpu_info(SCLPDevice *sclp, SCCB *sccb)
     cpu_info->offset_standby = cpu_to_be16(cpu_info->offset_configured
         + cpu_info->nr_configured*sizeof(CPUEntry));
 
-    for (i = 0; i < cpu_count; i++) {
-        cpu_info->entries[i].address = i;
-        cpu_info->entries[i].type = 0;
-    }
+    prepare_cpu_entries(sclp, cpu_info->entries, cpu_count);
 
     sccb->h.response_code = cpu_to_be16(SCLP_RC_NORMAL_READ_COMPLETION);
 }
Signature · 1 line
2.6.6
#16 lore raw

PATCH v2 14/29 s390x/sclp: introduce sclp feature blocks

In reply to David Hildenbrand

The sclp "read cpu info" and "read scp info" commands can include features for the cpu info and configuration characteristics (extended), decribing some advanced features available in the configuration.

---
 include/hw/s390x/sclp.h | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
include/hw/s390x/sclp.h +9 -3
index ba28d1d..30a40ea 100644
@@ -98,11 +98,14 @@ typedef struct SCCBHeader {
 } QEMU_PACKED SCCBHeader;
 
 #define SCCB_DATA_LEN (SCCB_SIZE - sizeof(SCCBHeader))
+#define SCCB_CPU_FEATURE_LEN 6
 
 /* CPU information */
 typedef struct CPUEntry {
     uint8_t address;
-    uint8_t reserved0[13];
+    uint8_t reserved0;
+    uint8_t features[SCCB_CPU_FEATURE_LEN];
+    uint8_t reserved2[6];
     uint8_t type;
     uint8_t reserved1;
 } QEMU_PACKED CPUEntry;
@@ -118,10 +121,13 @@ typedef struct ReadInfo {
     uint8_t  loadparm[8];               /* 24-31 */
     uint8_t  _reserved3[48 - 32];       /* 32-47 */
     uint64_t facilities;                /* 48-55 */
-    uint8_t  _reserved0[100 - 56];
+    uint8_t  _reserved0[80 - 56];       /* 56-79 */
+    uint8_t  conf_char[96 - 80];        /* 80-95 */
+    uint8_t  _reserved4[100 - 96];      /* 96-99 */
     uint32_t rnsize2;
     uint64_t rnmax2;
-    uint8_t  _reserved4[120-112];       /* 112-119 */
+    uint8_t  _reserved6[116 - 112];     /* 112-115 */
+    uint8_t  conf_char_ext[120 - 116];   /* 116-119 */
     uint16_t highest_cpu;
     uint8_t  _reserved5[128 - 122];     /* 122-127 */
     struct CPUEntry entries[0];
Signature · 1 line
2.6.6
#17 lore raw

PATCH v2 15/29 s390x/sclp: indicate sclp features

In reply to David Hildenbrand

We have three different blocks in the SCLP read-SCP information response that indicate sclp features. Let's prepare propagation.

---
 hw/s390x/sclp.c           |  9 +++++++++
 target-s390x/cpu_models.c | 14 ++++++++++++++
 target-s390x/cpu_models.h |  1 +
 3 files changed, 24 insertions(+)
hw/s390x/sclp.c +9 -0
index 15d7114..3c126ee 100644
@@ -31,11 +31,14 @@ static inline SCLPDevice *get_sclp_device(void)
 
 static void prepare_cpu_entries(SCLPDevice *sclp, CPUEntry *entry, int count)
 {
+    uint8_t features[SCCB_CPU_FEATURE_LEN] = { 0 };
     int i;
 
+    s390_get_feat_block(S390_FEAT_TYPE_SCLP_CPU, features);
     for (i = 0; i < count; i++) {
         entry[i].address = i;
         entry[i].type = 0;
+        memcpy(entry[i].features, features, sizeof(entry[i].features));
     }
 }
 
@@ -59,6 +62,12 @@ static void read_SCP_info(SCLPDevice *sclp, SCCB *sccb)
     read_info->offset_cpu = cpu_to_be16(offsetof(ReadInfo, entries));
     read_info->highest_cpu = cpu_to_be16(max_cpus);
 
+    /* Configuration Characteristic (Extension) */
+    s390_get_feat_block(S390_FEAT_TYPE_SCLP_CONF_CHAR,
+                         read_info->conf_char);
+    s390_get_feat_block(S390_FEAT_TYPE_SCLP_CONF_CHAR_EXT,
+                         read_info->conf_char_ext);
+
     prepare_cpu_entries(sclp, read_info->entries, cpu_count);
 
     read_info->facilities = cpu_to_be64(SCLP_HAS_CPU_INFO |
target-s390x/cpu_models.c +14 -0
index b1af0f6..fc25bbf 100644
@@ -74,6 +74,20 @@ static const S390CPUDef s390_cpu_defs[] = {
     CPUDEF_INIT(0x2965, 13, 2, 47, 0x08000000U, "z13s", "IBM z13s GA1"),
 };
 
+void s390_get_feat_block(S390FeatType type, uint8_t *data)
+{
+    static S390CPU *cpu;
+
+    if (!cpu) {
+        cpu = S390_CPU(qemu_get_cpu(0));
+    }
+
+    if (!cpu || !cpu->model) {
+        return;
+    }
+    s390_fill_feat_block(cpu->model->features, type, data);
+}
+
 bool s390_has_feat(S390Feat feat)
 {
     static S390CPU *cpu;
target-s390x/cpu_models.h +1 -0
index fe988cc..04c47c6 100644
@@ -43,6 +43,7 @@ typedef struct S390CPUModel {
     uint8_t cpu_ver;        /* CPU version, usually "ff" for kvm */
 } S390CPUModel;
 
+void s390_get_feat_block(S390FeatType type, uint8_t *data);
 bool s390_has_feat(S390Feat feat);
 
 #endif /* TARGET_S390X_CPU_MODELS_H */
Signature · 1 line
2.6.6
#18 lore raw

PATCH v2 16/29 s390x/sclp: propagate the ibc val(lowest and unblocked ibc)

In reply to David Hildenbrand

If we have a lowest ibc, we can indicate the ibc to the guest.

---
 hw/s390x/sclp.c           |  2 ++
 include/hw/s390x/sclp.h   |  3 ++-
 target-s390x/cpu_models.c | 21 +++++++++++++++++++++
 target-s390x/cpu_models.h | 12 ++++++++++++
 4 files changed, 37 insertions(+), 1 deletion(-)
hw/s390x/sclp.c +2 -0
index 3c126ee..52f8bb9 100644
@@ -62,6 +62,8 @@ static void read_SCP_info(SCLPDevice *sclp, SCCB *sccb)
     read_info->offset_cpu = cpu_to_be16(offsetof(ReadInfo, entries));
     read_info->highest_cpu = cpu_to_be16(max_cpus);
 
+    read_info->ibc_val = cpu_to_be32(s390_get_ibc_val());
+
     /* Configuration Characteristic (Extension) */
     s390_get_feat_block(S390_FEAT_TYPE_SCLP_CONF_CHAR,
                          read_info->conf_char);
include/hw/s390x/sclp.h +2 -1
index 30a40ea..664be9b 100644
@@ -121,7 +121,8 @@ typedef struct ReadInfo {
     uint8_t  loadparm[8];               /* 24-31 */
     uint8_t  _reserved3[48 - 32];       /* 32-47 */
     uint64_t facilities;                /* 48-55 */
-    uint8_t  _reserved0[80 - 56];       /* 56-79 */
+    uint8_t  _reserved0[76 - 56];       /* 56-75 */
+    uint32_t ibc_val;
     uint8_t  conf_char[96 - 80];        /* 80-95 */
     uint8_t  _reserved4[100 - 96];      /* 96-99 */
     uint32_t rnsize2;
target-s390x/cpu_models.c +21 -0
index fc25bbf..b176910 100644
@@ -74,6 +74,27 @@ static const S390CPUDef s390_cpu_defs[] = {
     CPUDEF_INIT(0x2965, 13, 2, 47, 0x08000000U, "z13s", "IBM z13s GA1"),
 };
 
+uint32_t s390_get_ibc_val(void)
+{
+    uint16_t unblocked_ibc, lowest_ibc;
+    static S390CPU *cpu;
+
+    if (!cpu) {
+        cpu = S390_CPU(qemu_get_cpu(0));
+    }
+
+    if (!cpu || !cpu->model) {
+        return 0;
+    }
+    unblocked_ibc = s390_ibc_from_cpu_model(cpu->model);
+    lowest_ibc = cpu->model->lowest_ibc;
+    /* the lowest_ibc always has to be <= unblocked_ibc */
+    if (!lowest_ibc || lowest_ibc > unblocked_ibc) {
+        return 0;
+    }
+    return ((uint32_t) lowest_ibc << 16) | unblocked_ibc;
+}
+
 void s390_get_feat_block(S390FeatType type, uint8_t *data)
 {
     static S390CPU *cpu;
target-s390x/cpu_models.h +12 -0
index 04c47c6..bbb85ac 100644
@@ -43,6 +43,18 @@ typedef struct S390CPUModel {
     uint8_t cpu_ver;        /* CPU version, usually "ff" for kvm */
 } S390CPUModel;
 
+#define S390_GEN_Z10 0xa
+
+uint32_t s390_get_ibc_val(void);
+static inline uint16_t s390_ibc_from_cpu_model(const S390CPUModel *model)
+{
+    uint16_t ibc = 0;
+
+    if (model->def->gen >= S390_GEN_Z10) {
+        ibc = ((model->def->gen - S390_GEN_Z10) << 4) + model->def->ec_ga;
+    }
+    return ibc;
+}
 void s390_get_feat_block(S390FeatType type, uint8_t *data);
 bool s390_has_feat(S390Feat feat);
 
Signature · 1 line
2.6.6
#19 lore raw

PATCH v2 17/29 s390x/sclp: propagate the mha via sclp

In reply to David Hildenbrand

The mha is provided in the CPU model, so get any CPU and extract the value.

---
 hw/s390x/sclp.c           |  1 +
 include/hw/s390x/sclp.h   |  3 ++-
 target-s390x/cpu_models.c | 14 ++++++++++++++
 target-s390x/cpu_models.h |  1 +
 4 files changed, 18 insertions(+), 1 deletion(-)
hw/s390x/sclp.c +1 -0
index 52f8bb9..5ffcf51 100644
@@ -105,6 +105,7 @@ static void read_SCP_info(SCLPDevice *sclp, SCCB *sccb)
 
         read_info->facilities |= cpu_to_be64(SCLP_FC_ASSIGN_ATTACH_READ_STOR);
     }
+    read_info->mha_pow = s390_get_mha_pow();
 
     rnsize = 1 << (sclp->increment_size - 20);
     if (rnsize <= 128) {
include/hw/s390x/sclp.h +2 -1
index 664be9b..dab3c0f 100644
@@ -124,7 +124,8 @@ typedef struct ReadInfo {
     uint8_t  _reserved0[76 - 56];       /* 56-75 */
     uint32_t ibc_val;
     uint8_t  conf_char[96 - 80];        /* 80-95 */
-    uint8_t  _reserved4[100 - 96];      /* 96-99 */
+    uint8_t  _reserved4[99 - 96];       /* 96-98 */
+    uint8_t mha_pow;
     uint32_t rnsize2;
     uint64_t rnmax2;
     uint8_t  _reserved6[116 - 112];     /* 112-115 */
target-s390x/cpu_models.c +14 -0
index b176910..e14c9af 100644
@@ -74,6 +74,20 @@ static const S390CPUDef s390_cpu_defs[] = {
     CPUDEF_INIT(0x2965, 13, 2, 47, 0x08000000U, "z13s", "IBM z13s GA1"),
 };
 
+uint8_t s390_get_mha_pow(void)
+{
+    static S390CPU *cpu;
+
+    if (!cpu) {
+        cpu = S390_CPU(qemu_get_cpu(0));
+    }
+
+    if (!cpu || !cpu->model) {
+        return 0;
+    }
+    return cpu->model->def->mha_pow;
+}
+
 uint32_t s390_get_ibc_val(void)
 {
     uint16_t unblocked_ibc, lowest_ibc;
target-s390x/cpu_models.h +1 -0
index bbb85ac..ee019b4 100644
@@ -45,6 +45,7 @@ typedef struct S390CPUModel {
 
 #define S390_GEN_Z10 0xa
 
+uint8_t s390_get_mha_pow(void);
 uint32_t s390_get_ibc_val(void);
 static inline uint16_t s390_ibc_from_cpu_model(const S390CPUModel *model)
 {
Signature · 1 line
2.6.6
#20 lore raw

PATCH v2 18/29 s390x/sclp: propagate hmfai

In reply to David Hildenbrand

hmfai is provided on CPU models >= z196. Let's propagate it properly.

---
 hw/s390x/sclp.c           |  1 +
 include/hw/s390x/sclp.h   |  3 ++-
 target-s390x/cpu_models.c | 14 ++++++++++++++
 target-s390x/cpu_models.h |  1 +
 4 files changed, 18 insertions(+), 1 deletion(-)
hw/s390x/sclp.c +1 -0
index 5ffcf51..883592c 100644
@@ -106,6 +106,7 @@ static void read_SCP_info(SCLPDevice *sclp, SCCB *sccb)
         read_info->facilities |= cpu_to_be64(SCLP_FC_ASSIGN_ATTACH_READ_STOR);
     }
     read_info->mha_pow = s390_get_mha_pow();
+    read_info->hmfai = cpu_to_be32(s390_get_hmfai());
 
     rnsize = 1 << (sclp->increment_size - 20);
     if (rnsize <= 128) {
include/hw/s390x/sclp.h +2 -1
index dab3c0f..3008a51 100644
@@ -131,7 +131,8 @@ typedef struct ReadInfo {
     uint8_t  _reserved6[116 - 112];     /* 112-115 */
     uint8_t  conf_char_ext[120 - 116];   /* 116-119 */
     uint16_t highest_cpu;
-    uint8_t  _reserved5[128 - 122];     /* 122-127 */
+    uint8_t  _reserved5[124 - 122];     /* 122-123 */
+    uint32_t hmfai;
     struct CPUEntry entries[0];
 } QEMU_PACKED ReadInfo;
 
target-s390x/cpu_models.c +14 -0
index e14c9af..b33387b 100644
@@ -74,6 +74,20 @@ static const S390CPUDef s390_cpu_defs[] = {
     CPUDEF_INIT(0x2965, 13, 2, 47, 0x08000000U, "z13s", "IBM z13s GA1"),
 };
 
+uint32_t s390_get_hmfai(void)
+{
+    static S390CPU *cpu;
+
+    if (!cpu) {
+        cpu = S390_CPU(qemu_get_cpu(0));
+    }
+
+    if (!cpu || !cpu->model) {
+        return 0;
+    }
+    return cpu->model->def->hmfai;
+}
+
 uint8_t s390_get_mha_pow(void)
 {
     static S390CPU *cpu;
target-s390x/cpu_models.h +1 -0
index ee019b4..986f7cb 100644
@@ -45,6 +45,7 @@ typedef struct S390CPUModel {
 
 #define S390_GEN_Z10 0xa
 
+uint32_t s390_get_hmfai(void);
 uint8_t s390_get_mha_pow(void);
 uint32_t s390_get_ibc_val(void);
 static inline uint16_t s390_ibc_from_cpu_model(const S390CPUModel *model)
Signature · 1 line
2.6.6
#21 lore raw

PATCH v2 19/29 linux-headers: update against kvm/next

In reply to David Hildenbrand

Update against 29b4817d4018 ("Linux 4.8-rc1")

---
 include/standard-headers/linux/input-event-codes.h | 32 +++++++++++++++++
 include/standard-headers/linux/input.h             |  1 +
 include/standard-headers/linux/virtio_config.h     | 10 +++++-
 include/standard-headers/linux/virtio_ids.h        |  1 +
 include/standard-headers/linux/virtio_net.h        |  3 ++
 linux-headers/asm-arm/kvm.h                        |  4 +--
 linux-headers/asm-arm64/kvm.h                      |  2 ++
 linux-headers/asm-s390/kvm.h                       | 41 ++++++++++++++++++++++
 linux-headers/asm-x86/unistd_x32.h                 |  4 +--
 linux-headers/linux/kvm.h                          | 18 ++++++++--
 linux-headers/linux/vhost.h                        | 33 +++++++++++++++++
 11 files changed, 142 insertions(+), 7 deletions(-)
include/standard-headers/linux/input-event-codes.h +32 -0
index 354f0de..5c10f7e 100644
@@ -611,6 +611,37 @@
 #define KEY_KBDINPUTASSIST_ACCEPT		0x264
 #define KEY_KBDINPUTASSIST_CANCEL		0x265
 
+/* Diagonal movement keys */
+#define KEY_RIGHT_UP			0x266
+#define KEY_RIGHT_DOWN			0x267
+#define KEY_LEFT_UP			0x268
+#define KEY_LEFT_DOWN			0x269
+
+#define KEY_ROOT_MENU			0x26a /* Show Device's Root Menu */
+/* Show Top Menu of the Media (e.g. DVD) */
+#define KEY_MEDIA_TOP_MENU		0x26b
+#define KEY_NUMERIC_11			0x26c
+#define KEY_NUMERIC_12			0x26d
+/*
+ * Toggle Audio Description: refers to an audio service that helps blind and
+ * visually impaired consumers understand the action in a program. Note: in
+ * some countries this is referred to as "Video Description".
+ */
+#define KEY_AUDIO_DESC			0x26e
+#define KEY_3D_MODE			0x26f
+#define KEY_NEXT_FAVORITE		0x270
+#define KEY_STOP_RECORD			0x271
+#define KEY_PAUSE_RECORD		0x272
+#define KEY_VOD				0x273 /* Video on Demand */
+#define KEY_UNMUTE			0x274
+#define KEY_FASTREVERSE			0x275
+#define KEY_SLOWREVERSE			0x276
+/*
+ * Control a data application associated with the currently viewed channel,
+ * e.g. teletext or data broadcast application (MHEG, MHP, HbbTV, etc.)
+ */
+#define KEY_DATA			0x275
+
 #define BTN_TRIGGER_HAPPY		0x2c0
 #define BTN_TRIGGER_HAPPY1		0x2c0
 #define BTN_TRIGGER_HAPPY2		0x2c1
@@ -749,6 +780,7 @@
 #define SW_ROTATE_LOCK		0x0c  /* set = rotate locked/disabled */
 #define SW_LINEIN_INSERT	0x0d  /* set = inserted */
 #define SW_MUTE_DEVICE		0x0e  /* set = device disabled */
+#define SW_PEN_INSERTED		0x0f  /* set = pen inserted */
 #define SW_MAX_			0x0f
 #define SW_CNT			(SW_MAX_+1)
 
include/standard-headers/linux/input.h +1 -0
index a52b202..7361a16 100644
@@ -244,6 +244,7 @@ struct input_mask {
 #define BUS_ATARI		0x1B
 #define BUS_SPI			0x1C
 #define BUS_RMI			0x1D
+#define BUS_CEC			0x1E
 
 /*
  * MT_TOOL types
include/standard-headers/linux/virtio_config.h +9 -1
index b30d0cb..b777069 100644
@@ -49,7 +49,7 @@
  * transport being used (eg. virtio_ring), the rest are per-device feature
  * bits. */
 #define VIRTIO_TRANSPORT_F_START	28
-#define VIRTIO_TRANSPORT_F_END		33
+#define VIRTIO_TRANSPORT_F_END		34
 
 #ifndef VIRTIO_CONFIG_NO_LEGACY
 /* Do we get callbacks when the ring is completely used, even if we've
@@ -63,4 +63,12 @@
 /* v1.0 compliant. */
 #define VIRTIO_F_VERSION_1		32
 
+/*
+ * If clear - device has the IOMMU bypass quirk feature.
+ * If set - use platform tools to detect the IOMMU.
+ *
+ * Note the reverse polarity (compared to most other features),
+ * this is for compatibility with legacy systems.
+ */
+#define VIRTIO_F_IOMMU_PLATFORM		33
 #endif /* _LINUX_VIRTIO_CONFIG_H */
include/standard-headers/linux/virtio_ids.h +1 -0
index 77925f5..3228d58 100644
@@ -41,5 +41,6 @@
 #define VIRTIO_ID_CAIF	       12 /* Virtio caif */
 #define VIRTIO_ID_GPU          16 /* virtio GPU */
 #define VIRTIO_ID_INPUT        18 /* virtio input */
+#define VIRTIO_ID_VSOCK        19 /* virtio vsock transport */
 
 #endif /* _LINUX_VIRTIO_IDS_H */
include/standard-headers/linux/virtio_net.h +3 -0
index a78f33e..30ff249 100644
@@ -35,6 +35,7 @@
 #define VIRTIO_NET_F_CSUM	0	/* Host handles pkts w/ partial csum */
 #define VIRTIO_NET_F_GUEST_CSUM	1	/* Guest handles pkts w/ partial csum */
 #define VIRTIO_NET_F_CTRL_GUEST_OFFLOADS 2 /* Dynamic offload configuration. */
+#define VIRTIO_NET_F_MTU	3	/* Initial MTU advice */
 #define VIRTIO_NET_F_MAC	5	/* Host has given MAC address. */
 #define VIRTIO_NET_F_GUEST_TSO4	7	/* Guest can handle TSOv4 in. */
 #define VIRTIO_NET_F_GUEST_TSO6	8	/* Guest can handle TSOv6 in. */
@@ -73,6 +74,8 @@ struct virtio_net_config {
 	 * Legal values are between 1 and 0x8000
 	 */
 	uint16_t max_virtqueue_pairs;
+	/* Default maximum transmit unit advice */
+	uint16_t mtu;
 } QEMU_PACKED;
 
 /*
linux-headers/asm-arm/kvm.h +2 -2
index c98e4dc..541268c 100644
@@ -139,8 +139,8 @@ struct kvm_arch_memory_slot {
 #define ARM_CP15_REG64(...) __ARM_CP15_REG64(__VA_ARGS__)
 
 #define KVM_REG_ARM_TIMER_CTL		ARM_CP15_REG32(0, 14, 3, 1)
-#define KVM_REG_ARM_TIMER_CNT		ARM_CP15_REG64(1, 14) 
-#define KVM_REG_ARM_TIMER_CVAL		ARM_CP15_REG64(3, 14) 
+#define KVM_REG_ARM_TIMER_CNT		ARM_CP15_REG64(1, 14)
+#define KVM_REG_ARM_TIMER_CVAL		ARM_CP15_REG64(3, 14)
 
 /* Normal registers are mapped as coprocessor 16. */
 #define KVM_REG_ARM_CORE		(0x0010 << KVM_REG_ARM_COPROC_SHIFT)
linux-headers/asm-arm64/kvm.h +2 -0
index 7d82d1f..fd5a276 100644
@@ -87,9 +87,11 @@ struct kvm_regs {
 /* Supported VGICv3 address types  */
 #define KVM_VGIC_V3_ADDR_TYPE_DIST	2
 #define KVM_VGIC_V3_ADDR_TYPE_REDIST	3
+#define KVM_VGIC_ITS_ADDR_TYPE		4
 
 #define KVM_VGIC_V3_DIST_SIZE		SZ_64K
 #define KVM_VGIC_V3_REDIST_SIZE		(2 * SZ_64K)
+#define KVM_VGIC_V3_ITS_SIZE		(2 * SZ_64K)
 
 #define KVM_ARM_VCPU_POWER_OFF		0 /* CPU is started in OFF state */
 #define KVM_ARM_VCPU_EL1_32BIT		1 /* CPU running a 32bit VM */
linux-headers/asm-s390/kvm.h +41 -0

47 lines not on this page · raw message

linux-headers/asm-x86/unistd_x32.h +2 -2
index 0230779..e5aea76 100644
@@ -306,9 +306,7 @@
 #define __NR_vmsplice (__X32_SYSCALL_BIT + 532)
 #define __NR_move_pages (__X32_SYSCALL_BIT + 533)
 #define __NR_preadv (__X32_SYSCALL_BIT + 534)
-#define __NR_preadv2 (__X32_SYSCALL_BIT + 534)
 #define __NR_pwritev (__X32_SYSCALL_BIT + 535)
-#define __NR_pwritev2 (__X32_SYSCALL_BIT + 535)
 #define __NR_rt_tgsigqueueinfo (__X32_SYSCALL_BIT + 536)
 #define __NR_recvmmsg (__X32_SYSCALL_BIT + 537)
 #define __NR_sendmmsg (__X32_SYSCALL_BIT + 538)
@@ -319,5 +317,7 @@
 #define __NR_io_setup (__X32_SYSCALL_BIT + 543)
 #define __NR_io_submit (__X32_SYSCALL_BIT + 544)
 #define __NR_execveat (__X32_SYSCALL_BIT + 545)
+#define __NR_preadv2 (__X32_SYSCALL_BIT + 546)
+#define __NR_pwritev2 (__X32_SYSCALL_BIT + 547)
 
 #endif /* _ASM_X86_UNISTD_X32_H */
linux-headers/linux/kvm.h +16 -2
index e60e21b..4806e06 100644
@@ -866,6 +866,10 @@ struct kvm_ppc_smmu_info {
 #define KVM_CAP_ARM_PMU_V3 126
 #define KVM_CAP_VCPU_ATTRIBUTES 127
 #define KVM_CAP_MAX_VCPU_ID 128
+#define KVM_CAP_X2APIC_API 129
+#define KVM_CAP_S390_USER_INSTR0 130
+#define KVM_CAP_MSI_DEVID 131
+#define KVM_CAP_PPC_HTM 132
 
 #ifdef KVM_CAP_IRQ_ROUTING
 
@@ -878,7 +882,10 @@ struct kvm_irq_routing_msi {
 	__u32 address_lo;
 	__u32 address_hi;
 	__u32 data;
-	__u32 pad;
+	union {
+		__u32 pad;
+		__u32 devid;
+	};
 };
 
 struct kvm_irq_routing_s390_adapter {
@@ -1024,12 +1031,14 @@ struct kvm_one_reg {
 	__u64 addr;
 };
 
+#define KVM_MSI_VALID_DEVID	(1U << 0)
 struct kvm_msi {
 	__u32 address_lo;
 	__u32 address_hi;
 	__u32 data;
 	__u32 flags;
-	__u8  pad[16];
+	__u32 devid;
+	__u8  pad[12];
 };
 
 struct kvm_arm_device_addr {
@@ -1074,6 +1083,8 @@ enum kvm_device_type {
 #define KVM_DEV_TYPE_FLIC		KVM_DEV_TYPE_FLIC
 	KVM_DEV_TYPE_ARM_VGIC_V3,
 #define KVM_DEV_TYPE_ARM_VGIC_V3	KVM_DEV_TYPE_ARM_VGIC_V3
+	KVM_DEV_TYPE_ARM_VGIC_ITS,
+#define KVM_DEV_TYPE_ARM_VGIC_ITS	KVM_DEV_TYPE_ARM_VGIC_ITS
 	KVM_DEV_TYPE_MAX,
 };
 
@@ -1313,4 +1324,7 @@ struct kvm_assigned_msix_entry {
 	__u16 padding[3];
 };
 
+#define KVM_X2APIC_API_USE_32BIT_IDS            (1ULL << 0)
+#define KVM_X2APIC_API_DISABLE_BROADCAST_QUIRK  (1ULL << 1)
+
 #endif /* __LINUX_KVM_H */
linux-headers/linux/vhost.h +33 -0
index 571294c..ac7a1f1 100644
@@ -47,6 +47,32 @@ struct vhost_vring_addr {
 	__u64 log_guest_addr;
 };
 
+/* no alignment requirement */
+struct vhost_iotlb_msg {
+	__u64 iova;
+	__u64 size;
+	__u64 uaddr;
+#define VHOST_ACCESS_RO      0x1
+#define VHOST_ACCESS_WO      0x2
+#define VHOST_ACCESS_RW      0x3
+	__u8 perm;
+#define VHOST_IOTLB_MISS           1
+#define VHOST_IOTLB_UPDATE         2
+#define VHOST_IOTLB_INVALIDATE     3
+#define VHOST_IOTLB_ACCESS_FAIL    4
+	__u8 type;
+};
+
+#define VHOST_IOTLB_MSG 0x1
+
+struct vhost_msg {
+	int type;
+	union {
+		struct vhost_iotlb_msg iotlb;
+		__u8 padding[64];
+	};
+};
+
 struct vhost_memory_region {
 	__u64 guest_phys_addr;
 	__u64 memory_size; /* bytes */
@@ -146,6 +172,8 @@ struct vhost_memory {
 #define VHOST_F_LOG_ALL 26
 /* vhost-net should add virtio_net_hdr for RX, and strip for TX packets. */
 #define VHOST_NET_F_VIRTIO_NET_HDR 27
+/* Vhost have device IOTLB */
+#define VHOST_F_DEVICE_IOTLB 63
 
 /* VHOST_SCSI specific definitions */
 
@@ -175,4 +203,9 @@ struct vhost_scsi_target {
 #define VHOST_SCSI_SET_EVENTS_MISSED _IOW(VHOST_VIRTIO, 0x43, __u32)
 #define VHOST_SCSI_GET_EVENTS_MISSED _IOW(VHOST_VIRTIO, 0x44, __u32)
 
+/* VHOST_VSOCK specific defines */
+
+#define VHOST_VSOCK_SET_GUEST_CID	_IOW(VHOST_VIRTIO, 0x60, __u64)
+#define VHOST_VSOCK_SET_RUNNING		_IOW(VHOST_VIRTIO, 0x61, int)
+
 #endif
Signature · 1 line
2.6.6
#22 lore raw

PATCH v2 20/29 s390x/kvm: allow runtime-instrumentation for "none" machine

In reply to David Hildenbrand

To be able to query the correct host model for the "none" machine, let's allow runtime-instrumentation for that machine.

---
 hw/s390x/s390-virtio-ccw.c | 5 +++++
 1 file changed, 5 insertions(+)
hw/s390x/s390-virtio-ccw.c +5 -0
index 91d9cef..f7dd2c8 100644
@@ -249,6 +249,11 @@ bool ri_allowed(void)
 
             return s390mc->ri_allowed;
         }
+        /*
+         * Make sure the "none" machine can have ri, otherwise it won't * be
+         * unlocked in KVM and therefore the host CPU model might be wrong.
+         */
+        return true;
     }
     return 0;
 }
Signature · 1 line
2.6.6
#23 lore raw

PATCH v2 21/29 s390x/kvm: implement CPU model support

In reply to David Hildenbrand

Let's implement our two hooks so we can support CPU models.

---
 target-s390x/cpu_models.c |  75 +++++++++++-
 target-s390x/cpu_models.h |  50 ++++++++
 target-s390x/kvm.c        | 295 ++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 417 insertions(+), 3 deletions(-)
target-s390x/cpu_models.c +72 -3
index b33387b..732519c 100644
@@ -161,6 +161,61 @@ bool s390_has_feat(S390Feat feat)
     return test_bit(feat, cpu->model->features);
 }
 
+uint8_t s390_get_gen_for_cpu_type(uint16_t type)
+{
+    int i;
+
+    for (i = 0; i < ARRAY_SIZE(s390_cpu_defs); i++) {
+        if (s390_cpu_defs[i].type == type) {
+            return s390_cpu_defs[i].gen;
+        }
+    }
+    return 0;
+}
+
+const S390CPUDef *s390_find_cpu_def(uint16_t type, uint8_t gen, uint8_t ec_ga,
+                                    S390FeatBitmap features)
+{
+    const S390CPUDef *last_compatible = NULL;
+    int i;
+
+    if (!gen) {
+        ec_ga = 0;
+    }
+    if (!gen && type) {
+        gen = s390_get_gen_for_cpu_type(type);
+    }
+
+    for (i = 0; i < ARRAY_SIZE(s390_cpu_defs); i++) {
+        const S390CPUDef *def = &s390_cpu_defs[i];
+        S390FeatBitmap missing;
+
+        /* don't even try newer generations if we know the generation */
+        if (gen) {
+            if (def->gen > gen) {
+                break;
+            } else if (def->gen == gen && ec_ga && def->ec_ga > ec_ga) {
+                break;
+            }
+        }
+
+        if (features) {
+            /* see if the model satisfies the minimum features */
+            bitmap_andnot(missing, def->base_feat, features, S390_FEAT_MAX);
+            if (!bitmap_empty(missing, S390_FEAT_MAX)) {
+                break;
+            }
+        }
+
+        /* stop the search if we found the exact model */
+        if (def->type == type && def->ec_ga == ec_ga) {
+            return def;
+        }
+        last_compatible = def;
+    }
+    return last_compatible;
+}
+
 struct S390PrintCpuListInfo {
     FILE *f;
     fprintf_function print;
@@ -323,7 +378,7 @@ static S390CPUModel *get_max_cpu_model(Error **errp)
     }
 
     if (kvm_enabled()) {
-        error_setg(errp, "KVM does not support CPU models.");
+        kvm_s390_get_host_cpu_model(&max_model, errp);
     } else {
         /* TCG enulates a z900 */
         max_model.def = &s390_cpu_defs[0];
@@ -356,8 +411,7 @@ static inline void apply_cpu_model(const S390CPUModel *model, Error **errp)
     }
 
     if (kvm_enabled()) {
-        /* FIXME KVM */
-        error_setg(errp, "KVM doesn't support CPU models.");
+        kvm_s390_apply_cpu_model(model, errp);
     } else if (model) {
         /* FIXME TCG - use data for stdip/stfl */
     }
@@ -562,6 +616,21 @@ static void s390_cpu_model_initfn(Object *obj)
 #ifdef CONFIG_KVM
 static void s390_host_cpu_model_initfn(Object *obj)
 {
+    S390CPU *cpu = S390_CPU(obj);
+    Error *err = NULL;
+
+    if (!kvm_enabled() || !kvm_s390_cpu_models_supported()) {
+        return;
+    }
+
+    cpu->model = g_malloc0(sizeof(*cpu->model));
+    kvm_s390_get_host_cpu_model(cpu->model, &err);
+    if (err) {
+        error_report_err(err);
+        g_free(cpu->model);
+        /* fallback to unsupported cpu models */
+        cpu->model = NULL;
+    }
 }
 #endif
 
target-s390x/cpu_models.h +50 -0

62 lines not on this page · raw message

target-s390x/kvm.c +295 -0

298 lines not on this page · raw message

Signature · 1 line
2.6.6
#24 lore raw

PATCH v2 22/29 s390x/kvm: disable host model for existing compat machines

In reply to David Hildenbrand

Compatibility machines that touch runtime-instrumentation should not be used with the CPU model. Otherwise the host model will look different, depending on the QEMU machine QEMU has been started with.

So let's simply disable the host model for existing compatibility machines that all disable ri.

---
 target-s390x/kvm.c | 4 ++++
 1 file changed, 4 insertions(+)
target-s390x/kvm.c +4 -0
index 2cc0357..3c0929b 100644
@@ -2451,6 +2451,10 @@ static int configure_cpu_feat(const S390FeatBitmap features)
 
 bool kvm_s390_cpu_models_supported(void)
 {
+    if (!ri_allowed()) {
+        /* compatibility machines interfere with the cpu model */
+        return false;
+    }
     return kvm_vm_check_attr(kvm_state, KVM_S390_VM_CPU_MODEL,
                              KVM_S390_VM_CPU_MACHINE) &&
            kvm_vm_check_attr(kvm_state, KVM_S390_VM_CPU_MODEL,
Signature · 1 line
2.6.6
#25 lore raw

PATCH v2 23/29 s390x/kvm: let the CPU model control CMM(A)

In reply to David Hildenbrand

Starting with recent kernels, if the cmma attributes are available, we actually have hardware support. Enabling CMMA then means providing the guest VCPU with CMM, therefore enabling its CMM facility.

Let's not blindly enable CMM anymore but let's control it using CPU models. For disabled CPU models, CMMA will continue to always get enabled.

Also enable it in the applicable default models.

Please note that CMM doesn't work with hugetlbfs, therefore we will warn the user and keep it disabled. Migrating from/to a hugetlbfs configuration works, as it will be disabled on both sides.

---
 target-s390x/gen-features.c |  1 +
 target-s390x/kvm.c          | 47 ++++++++++++++++++++++++++++++++++-----------
 2 files changed, 37 insertions(+), 11 deletions(-)
target-s390x/gen-features.c +1 -0
index 1dfcc9a..95f99d9 100644
@@ -372,6 +372,7 @@ static uint16_t full_GEN13_GA1[] = {
 static uint16_t default_GEN9_GA1[] = {
     S390_FEAT_STORE_HYPERVISOR_INFO,
     S390_FEAT_GROUP_MSA_EXT_1,
+    S390_FEAT_CMM,
 };
 #define default_GEN9_GA2 EmptyFeat
 #define default_GEN9_GA3 EmptyFeat
target-s390x/kvm.c +36 -11

91 lines not on this page · raw message

Signature · 1 line
2.6.6
#26 lore raw

PATCH v2 24/29 qmp: add QMP interface "query-cpu-model-expansion"

In reply to David Hildenbrand

Let's provide a standardized interface to expand CPU models. This interface can be used by tooling to get details about a specific CPU model in a certain configuration, e.g. about the "host" model.

To take care of all architectures, two detail levels for an expansion are introduced. Certain architectures might not support all detail levels. While "full" will expand and indicate all relevant properties/features of a CPU model, "static" expands to a static base CPU model, that will never change between QEMU versions and therefore have the same features when used under different compatibility machines.

---
 include/sysemu/arch_init.h             |  3 ++
 qapi-schema.json                       | 92 ++++++++++++++++++++++++++++++++++
 qmp-commands.hx                        |  6 +++
 qmp.c                                  |  7 +++
 stubs/Makefile.objs                    |  1 +
 stubs/arch-query-cpu-model-expansion.c | 12 +++++
 6 files changed, 121 insertions(+)
 create mode 100644 stubs/arch-query-cpu-model-expansion.c
include/sysemu/arch_init.h +3 -0
index d690dfa..37b2e86 100644
@@ -35,5 +35,8 @@ int kvm_available(void);
 int xen_available(void);
 
 CpuDefinitionInfoList *arch_query_cpu_definitions(Error **errp);
+CpuModelExpansionInfo *arch_query_cpu_model_expansion(CpuModelExpansionType type,
+                                                      CpuModelInfo *mode,
+                                                      Error **errp);
 
 #endif
qapi-schema.json +92 -0

98 lines not on this page · raw message

qmp-commands.hx +6 -0
index c8d360a..7ed9528 100644
@@ -3942,6 +3942,12 @@ EQMP
     },
 
     {
+        .name       = "query-cpu-model-expansion",
+        .args_type  = "type:s,model:q",
+        .mhandler.cmd_new = qmp_marshal_query_cpu_model_expansion,
+    },
+
+    {
         .name       = "query-target",
         .args_type  = "",
         .mhandler.cmd_new = qmp_marshal_query_target,
qmp.c +7 -0
index b6d531e..29fbfb8 100644
@@ -607,6 +607,13 @@ CpuDefinitionInfoList *qmp_query_cpu_definitions(Error **errp)
     return arch_query_cpu_definitions(errp);
 }
 
+CpuModelExpansionInfo *qmp_query_cpu_model_expansion(CpuModelExpansionType type,
+                                                     CpuModelInfo *model,
+                                                     Error **errp)
+{
+    return arch_query_cpu_model_expansion(type, model, errp);
+}
+
 void qmp_add_client(const char *protocol, const char *fdname,
                     bool has_skipauth, bool skipauth, bool has_tls, bool tls,
                     Error **errp)
stubs/Makefile.objs +1 -0
index 55edd15..4929842 100644
@@ -1,4 +1,5 @@
 stub-obj-y += arch-query-cpu-def.o
+stub-obj-y += arch-query-cpu-model-expansion.o
 stub-obj-y += bdrv-next-monitor-owned.o
 stub-obj-y += blk-commit-all.o
 stub-obj-y += blockdev-close-all-bdrv-states.o
stubs/arch-query-cpu-model-expansion.c new file +12 -0
new file mode 100644
index 0000000..ae7cf55
@@ -0,0 +1,12 @@
+#include "qemu/osdep.h"
+#include "qemu-common.h"
+#include "sysemu/arch_init.h"
+#include "qapi/qmp/qerror.h"
+
+CpuModelExpansionInfo *arch_query_cpu_model_expansion(CpuModelExpansionType type,
+                                                      CpuModelInfo *mode,
+                                                      Error **errp)
+{
+    error_setg(errp, QERR_UNSUPPORTED);
+    return NULL;
+}
Signature · 1 line
2.6.6
#27 lore raw

PATCH v2 25/29 qmp: add QMP interface "query-cpu-model-comparison"

In reply to David Hildenbrand

Let's provide a standardized interface to compare two CPU models. "query-cpu-model-compare" takes two models and returns how they compare in a specific configuration.

The result will give guarantees about runnability. E.g. if a CPU model A is a subset of CPU model B, model A is guaranteed to run in configurations where model B runs, but not the other way around (might or might not run).

Usually, CPU features or CPU generations are used to calculate the result. If a model is not guaranteed to run in a certain environment (e.g. incompatible), a compatible one can be created by "baselining" both models (follow up patch).

---
 include/sysemu/arch_init.h              |  3 ++
 qapi-schema.json                        | 86 +++++++++++++++++++++++++++++++++
 qmp-commands.hx                         |  6 +++
 qmp.c                                   |  7 +++
 stubs/Makefile.objs                     |  1 +
 stubs/arch-query-cpu-model-comparison.c | 12 +++++
 6 files changed, 115 insertions(+)
 create mode 100644 stubs/arch-query-cpu-model-comparison.c
include/sysemu/arch_init.h +3 -0
index 37b2e86..96d47c0 100644
@@ -38,5 +38,8 @@ CpuDefinitionInfoList *arch_query_cpu_definitions(Error **errp);
 CpuModelExpansionInfo *arch_query_cpu_model_expansion(CpuModelExpansionType type,
                                                       CpuModelInfo *mode,
                                                       Error **errp);
+CpuModelCompareInfo *arch_query_cpu_model_comparison(CpuModelInfo *modela,
+                                                     CpuModelInfo *modelb,
+                                                     Error **errp);
 
 #endif
qapi-schema.json +86 -0

92 lines not on this page · raw message

qmp-commands.hx +6 -0
index 7ed9528..0af2098 100644
@@ -3948,6 +3948,12 @@ EQMP
     },
 
     {
+        .name       = "query-cpu-model-comparison",
+        .args_type  = "modela:q,modelb:q",
+        .mhandler.cmd_new = qmp_marshal_query_cpu_model_comparison,
+    },
+
+    {
         .name       = "query-target",
         .args_type  = "",
         .mhandler.cmd_new = qmp_marshal_query_target,
qmp.c +7 -0
index 29fbfb8..f551019 100644
@@ -614,6 +614,13 @@ CpuModelExpansionInfo *qmp_query_cpu_model_expansion(CpuModelExpansionType type,
     return arch_query_cpu_model_expansion(type, model, errp);
 }
 
+CpuModelCompareInfo *qmp_query_cpu_model_comparison(CpuModelInfo *modela,
+                                                    CpuModelInfo *modelb,
+                                                    Error **errp)
+{
+    return arch_query_cpu_model_comparison(modela, modelb, errp);
+}
+
 void qmp_add_client(const char *protocol, const char *fdname,
                     bool has_skipauth, bool skipauth, bool has_tls, bool tls,
                     Error **errp)
stubs/Makefile.objs +1 -0
index 4929842..da768f0 100644
@@ -1,5 +1,6 @@
 stub-obj-y += arch-query-cpu-def.o
 stub-obj-y += arch-query-cpu-model-expansion.o
+stub-obj-y += arch-query-cpu-model-comparison.o
 stub-obj-y += bdrv-next-monitor-owned.o
 stub-obj-y += blk-commit-all.o
 stub-obj-y += blockdev-close-all-bdrv-states.o
stubs/arch-query-cpu-model-comparison.c new file +12 -0
new file mode 100644
index 0000000..d5486ae
@@ -0,0 +1,12 @@
+#include "qemu/osdep.h"
+#include "qemu-common.h"
+#include "sysemu/arch_init.h"
+#include "qapi/qmp/qerror.h"
+
+CpuModelCompareInfo *arch_query_cpu_model_comparison(CpuModelInfo *modela,
+                                                     CpuModelInfo *modelb,
+                                                     Error **errp)
+{
+    error_setg(errp, QERR_UNSUPPORTED);
+    return NULL;
+}
Signature · 1 line
2.6.6
#28 lore raw

PATCH v2 26/29 qmp: add QMP interface "query-cpu-model-baseline"

In reply to David Hildenbrand

Let's provide a standardized interface to baseline two CPU models, to create a third, compatible one. This is especially helpful when two CPU models are not identical, but a CPU model is required that is guaranteed to run under both configurations, where the original models run.

"query-cpu-model-baseline" takes two CPU models and returns a third, compatible model. The result will always be a static CPU model.

---
 include/sysemu/arch_init.h            |  3 +++
 qapi-schema.json                      | 51 +++++++++++++++++++++++++++++++++++
 qmp-commands.hx                       |  6 +++++
 qmp.c                                 |  7 +++++
 stubs/Makefile.objs                   |  1 +
 stubs/arch-query-cpu-model-baseline.c | 12 +++++++++
 6 files changed, 80 insertions(+)
 create mode 100644 stubs/arch-query-cpu-model-baseline.c
include/sysemu/arch_init.h +3 -0
index 96d47c0..1c9dad1 100644
@@ -41,5 +41,8 @@ CpuModelExpansionInfo *arch_query_cpu_model_expansion(CpuModelExpansionType type
 CpuModelCompareInfo *arch_query_cpu_model_comparison(CpuModelInfo *modela,
                                                      CpuModelInfo *modelb,
                                                      Error **errp);
+CpuModelBaselineInfo *arch_query_cpu_model_baseline(CpuModelInfo *modela,
+                                                    CpuModelInfo *modelb,
+                                                    Error **errp);
 
 #endif
qapi-schema.json +51 -0

57 lines not on this page · raw message

qmp-commands.hx +6 -0
index 0af2098..8abccb9 100644
@@ -3954,6 +3954,12 @@ EQMP
     },
 
     {
+        .name       = "query-cpu-model-baseline",
+        .args_type  = "modela:q,modelb:q",
+        .mhandler.cmd_new = qmp_marshal_query_cpu_model_baseline,
+    },
+
+    {
         .name       = "query-target",
         .args_type  = "",
         .mhandler.cmd_new = qmp_marshal_query_target,
qmp.c +7 -0
index f551019..dea8f81 100644
@@ -621,6 +621,13 @@ CpuModelCompareInfo *qmp_query_cpu_model_comparison(CpuModelInfo *modela,
     return arch_query_cpu_model_comparison(modela, modelb, errp);
 }
 
+CpuModelBaselineInfo *qmp_query_cpu_model_baseline(CpuModelInfo *modela,
+                                                   CpuModelInfo *modelb,
+                                                   Error **errp)
+{
+    return arch_query_cpu_model_baseline(modela, modelb, errp);
+}
+
 void qmp_add_client(const char *protocol, const char *fdname,
                     bool has_skipauth, bool skipauth, bool has_tls, bool tls,
                     Error **errp)
stubs/Makefile.objs +1 -0
index da768f0..c5850e8 100644
@@ -1,6 +1,7 @@
 stub-obj-y += arch-query-cpu-def.o
 stub-obj-y += arch-query-cpu-model-expansion.o
 stub-obj-y += arch-query-cpu-model-comparison.o
+stub-obj-y += arch-query-cpu-model-baseline.o
 stub-obj-y += bdrv-next-monitor-owned.o
 stub-obj-y += blk-commit-all.o
 stub-obj-y += blockdev-close-all-bdrv-states.o
stubs/arch-query-cpu-model-baseline.c new file +12 -0
new file mode 100644
index 0000000..094ec13
@@ -0,0 +1,12 @@
+#include "qemu/osdep.h"
+#include "qemu-common.h"
+#include "sysemu/arch_init.h"
+#include "qapi/qmp/qerror.h"
+
+CpuModelBaselineInfo *arch_query_cpu_model_baseline(CpuModelInfo *modela,
+                                                    CpuModelInfo *modelb,
+                                                    Error **errp)
+{
+    error_setg(errp, QERR_UNSUPPORTED);
+    return NULL;
+}
Signature · 1 line
2.6.6
#29 lore raw

PATCH v2 27/29 s390x/cpumodel: implement QMP interface "query-cpu-model-expansion"

In reply to David Hildenbrand

In order to expand CPU models, we create temporary cpus that handle the feature/group parsing. Only CPU feature properties are expanded.

When converting the data structure back, we always fall back to the static base CPU model, which is by definition migration-safe.

---
 qapi-schema.json          |   3 +-
 target-s390x/cpu_models.c | 146 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 148 insertions(+), 1 deletion(-)
qapi-schema.json +2 -1
index 7f469d0..93d2dc2 100644
@@ -3143,7 +3143,8 @@
 #   global properties may affect expansion of CPU models. Using
 #   query-cpu-model-expansion while using these is not advised.
 #
-# Some architectures may not support all expansion types.
+# Some architectures may not support all expansion types. s390x supports
+# "full" and "static".
 #
 # Returns: a CpuModelExpansionInfo. Returns an error if expanding CPU models is
 #          not supported, if the model cannot be expanded, if the model contains
target-s390x/cpu_models.c +146 -0

158 lines not on this page · raw message

Signature · 1 line
2.6.6
#30 lore raw

PATCH v2 28/29 s390x/cpumodel: implement QMP interface "query-cpu-model-comparison"

In reply to David Hildenbrand

Let's implement that interface by reusing our convertion code implemented for expansion.

We use CPU generations and CPU features to calculate the result. This means, that a zEC12 cannot simply be converted into a z13 by stripping of features. This is required, as other magic values (e.g. maximum address sizes) belong to a CPU generation and cannot simply be emulated by an older generation.

---
 qapi-schema.json          |  3 +-
 target-s390x/cpu_models.c | 84 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 86 insertions(+), 1 deletion(-)
qapi-schema.json +2 -1
index 93d2dc2..ddf921b 100644
@@ -3232,7 +3232,8 @@
 #   global properties may affect expansion of CPU models. Using
 #   query-cpu-model-expansion while using these is not advised.
 #
-# Some architectures may not support comparing CPU models.
+# Some architectures may not support comparing CPU models. s390x supports
+# comparing CPU models.
 #
 # Returns: a CpuModelBaselineInfo. Returns an error if comparing CPU models is
 #          not supported, if a model cannot be used, if a model contains
target-s390x/cpu_models.c +84 -0

90 lines not on this page · raw message

Signature · 1 line
2.6.6
#31 lore raw

PATCH v2 29/29 s390x/cpumodel: implement QMP interface "query-cpu-model-baseline"

In reply to David Hildenbrand

Let's implement that interface by reusing our conversion code and lookup code for CPU definitions.

In order to find a compatible CPU model, we first detect the maximum possible CPU generation and then try to find a maximum model, satisfying all base features (not exceeding the maximum generation).

---
 qapi-schema.json          |  3 ++-
 target-s390x/cpu_models.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 57 insertions(+), 1 deletion(-)
qapi-schema.json +2 -1
index ddf921b..6673e89 100644
@@ -3283,7 +3283,8 @@
 #   global properties may affect expansion of CPU models. Using
 #   query-cpu-model-expansion while using these is not advised.
 #
-# Some architectures may not support baselining CPU models.
+# Some architectures may not support baselining CPU models. s390x supports
+# baselining CPU models.
 #
 # Returns: a CpuModelBaselineInfo. Returns an error if baselining CPU models is
 #          not supported, if a model cannot be used, if a model contains
target-s390x/cpu_models.c +55 -0

61 lines not on this page · raw message

Signature · 1 line
2.6.6
#32 lore raw
In reply to David Hildenbrand
Your series seems to have some coding style problems. See output below for more information:

Hi,

Your series seems to have some coding style problems. See output below for more information:

Message-id: [email protected]
Type: series
Subject: [Qemu-devel] [Patch v2 00/29] s390x CPU models: exposing features

=== TEST SCRIPT BEGIN ===
#!/bin/bash

BASE=base
n=1
total=$(git log --oneline $BASE.. | wc -l)
failed=0

commits="$(git log --format=%H --reverse $BASE..)" for c in $commits; do

    echo "Checking PATCH $n/$total: $(git show --no-patch --format=%s $c)..."
    if ! git show $c --format=email | ./scripts/checkpatch.pl --mailback -; then
        failed=1
        echo
    fi
    n=$((n+1))

done

exit $failed
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
* [new tag] patchew/[email protected] -> patchew/[email protected]
* [new tag] patchew/[email protected] -> patchew/[email protected]
Switched to a new branch 'test'
0f4c162 s390x/cpumodel: implement QMP interface "query-cpu-model-baseline" 82b01ce s390x/cpumodel: implement QMP interface "query-cpu-model-comparison" 53e522c s390x/cpumodel: implement QMP interface "query-cpu-model-expansion" 8f9fa25 qmp: add QMP interface "query-cpu-model-baseline" 402fc8c qmp: add QMP interface "query-cpu-model-comparison" ff71317 qmp: add QMP interface "query-cpu-model-expansion" 89ba00e s390x/kvm: let the CPU model control CMM(A)
0d59bdc s390x/kvm: disable host model for existing compat machines a72bde4 s390x/kvm: implement CPU model support
57ac9b5 s390x/kvm: allow runtime-instrumentation for "none" machine 4eef365 linux-headers: update against kvm/next
cc50bdd s390x/sclp: propagate hmfai
51c8a79 s390x/sclp: propagate the mha via sclp
72e2a71 s390x/sclp: propagate the ibc val(lowest and unblocked ibc) 3265bd9 s390x/sclp: indicate sclp features
f94cb6a s390x/sclp: introduce sclp feature blocks
6c5201b s390x/sclp: factor out preparation of cpu entries c3eb0c9 s390x/cpumodel: check and apply the CPU model
2df0fc2 s390x/cpumodel: let the CPU model handle feature checks 0049535 s390x/cpumodel: expose features and feature groups as properties 38af102 s390x/cpumodel: store the CPU model in the CPU instance 29204e3 s390x/cpumodel: register defined CPU models as subclasses aafc57b s390x/cpumodel: introduce CPU feature group definitions 108d632 s390x/cpumodel: generate CPU feature group lists
14eaffb s390x/cpumodel: generate CPU feature lists for CPU models 9cae26a s390x/cpumodel: introduce CPU features
306bed0 s390x/cpumodel: expose CPU class properties
8eca539 s390x/cpumodel: "host" and "qemu" as CPU subclasses fe0ebf0 qmp: details about CPU definitions in query-cpu-definitions

=== OUTPUT BEGIN ===
Checking PATCH 1/29: qmp: details about CPU definitions in query-cpu-definitions... Checking PATCH 2/29: s390x/cpumodel: "host" and "qemu" as CPU subclasses... Checking PATCH 3/29: s390x/cpumodel: expose CPU class properties... Checking PATCH 4/29: s390x/cpumodel: introduce CPU features...
WARNING: line over 80 characters
#65: FILE: target-s390x/cpu_features.c:27:
+ FEAT_INIT("zarch", S390_FEAT_TYPE_STFL, 1, "z/Architecture architectural mode"),

WARNING: line over 80 characters
#67: FILE: target-s390x/cpu_features.c:29:
+ FEAT_INIT("idtes", S390_FEAT_TYPE_STFL, 4, "IDTE selective TLB segment-table clearing"),

WARNING: line over 80 characters
#68: FILE: target-s390x/cpu_features.c:30:
+ FEAT_INIT("idter", S390_FEAT_TYPE_STFL, 5, "IDTE selective TLB region-table clearing"),

WARNING: line over 80 characters
#70: FILE: target-s390x/cpu_features.c:32:
+ FEAT_INIT("stfle", S390_FEAT_TYPE_STFL, 7, "Store-facility-list-extended facility"),

WARNING: line over 80 characters
#74: FILE: target-s390x/cpu_features.c:36:
+ FEAT_INIT("ctop", S390_FEAT_TYPE_STFL, 11, "Configuration-topology facility"),

WARNING: line over 80 characters
#76: FILE: target-s390x/cpu_features.c:38:
+ FEAT_INIT("nonqks", S390_FEAT_TYPE_STFL, 14, "Nonquiescing key-setting facility"),

WARNING: line over 80 characters
#77: FILE: target-s390x/cpu_features.c:39:
+ FEAT_INIT("etf2", S390_FEAT_TYPE_STFL, 16, "Extended-translation facility 2"),

WARNING: line over 80 characters
#78: FILE: target-s390x/cpu_features.c:40:
+ FEAT_INIT("msa-base", S390_FEAT_TYPE_STFL, 17, "Message-security-assist facility (excluding subfunctions)"),

WARNING: line over 80 characters
#80: FILE: target-s390x/cpu_features.c:42:
+ FEAT_INIT("ldisphp", S390_FEAT_TYPE_STFL, 19, "Long-displacement facility has high performance"),

WARNING: line over 80 characters
#81: FILE: target-s390x/cpu_features.c:43:
+ FEAT_INIT("hfpm", S390_FEAT_TYPE_STFL, 20, "HFP-multiply-add/subtract facility"),

WARNING: line over 80 characters
#83: FILE: target-s390x/cpu_features.c:45:
+ FEAT_INIT("etf3", S390_FEAT_TYPE_STFL, 22, "Extended-translation facility 3"),

WARNING: line over 80 characters
#84: FILE: target-s390x/cpu_features.c:46:
+ FEAT_INIT("hfpue", S390_FEAT_TYPE_STFL, 23, "HFP-unnormalized-extension facility"),

WARNING: line over 80 characters
#87: FILE: target-s390x/cpu_features.c:49:
+ FEAT_INIT("parseh", S390_FEAT_TYPE_STFL, 26, "Parsing-enhancement facility"),

WARNING: line over 80 characters
#88: FILE: target-s390x/cpu_features.c:50:
+ FEAT_INIT("mvcos", S390_FEAT_TYPE_STFL, 27, "Move-with-optional-specification facility"),

WARNING: line over 80 characters
#89: FILE: target-s390x/cpu_features.c:51:
+ FEAT_INIT("tods-base", S390_FEAT_TYPE_STFL, 28, "TOD-clock-steering facility (excluding subfunctions)"),

WARNING: line over 80 characters
#92: FILE: target-s390x/cpu_features.c:54:
+ FEAT_INIT("csst", S390_FEAT_TYPE_STFL, 32, "Compare-and-swap-and-store facility"),

WARNING: line over 80 characters
#93: FILE: target-s390x/cpu_features.c:55:
+ FEAT_INIT("csst2", S390_FEAT_TYPE_STFL, 33, "Compare-and-swap-and-store facility 2"),

WARNING: line over 80 characters
#94: FILE: target-s390x/cpu_features.c:56:
+ FEAT_INIT("ginste", S390_FEAT_TYPE_STFL, 34, "General-instructions-extension facility"),

WARNING: line over 80 characters
#97: FILE: target-s390x/cpu_features.c:59:
+ FEAT_INIT("fpe", S390_FEAT_TYPE_STFL, 37, "Floating-point extension facility"),

WARNING: line over 80 characters
#98: FILE: target-s390x/cpu_features.c:60:
+ FEAT_INIT("sprogp", S390_FEAT_TYPE_STFL, 40, "Set-program-parameters facility"),

WARNING: line over 80 characters
#99: FILE: target-s390x/cpu_features.c:61:
+ FEAT_INIT("fpseh", S390_FEAT_TYPE_STFL, 41, "Floating-point-support-enhancement facilities"),

WARNING: line over 80 characters
#100: FILE: target-s390x/cpu_features.c:62:
+ FEAT_INIT("dfp", S390_FEAT_TYPE_STFL, 42, "DFP (decimal-floating-point) facility"),

WARNING: line over 80 characters
#101: FILE: target-s390x/cpu_features.c:63:
+ FEAT_INIT("dfphp", S390_FEAT_TYPE_STFL, 43, "DFP (decimal-floating-point) facility has high performance"),

WARNING: line over 80 characters
#103: FILE: target-s390x/cpu_features.c:65:
+ FEAT_INIT("gen11e", S390_FEAT_TYPE_STFL, 45, "Various facilities introduced with z196"),

WARNING: line over 80 characters
#105: FILE: target-s390x/cpu_features.c:67:
+ FEAT_INIT("dfpzc", S390_FEAT_TYPE_STFL, 48, "Decimal-floating-point zoned-conversion facility"),

WARNING: line over 80 characters
#106: FILE: target-s390x/cpu_features.c:68:
+ FEAT_INIT("gen12e", S390_FEAT_TYPE_STFL, 49, "Various facilities introduced with zEC12"),

WARNING: line over 80 characters
#107: FILE: target-s390x/cpu_features.c:69:
+ FEAT_INIT("cte", S390_FEAT_TYPE_STFL, 50, "Constrained transactional-execution facility"),

WARNING: line over 80 characters
#109: FILE: target-s390x/cpu_features.c:71:
+ FEAT_INIT("iacc2", S390_FEAT_TYPE_STFL, 52, "Interlocked-access facility 2"),

WARNING: line over 80 characters
#110: FILE: target-s390x/cpu_features.c:72:
+ FEAT_INIT("gen13e", S390_FEAT_TYPE_STFL, 53, "Various facilities introduced with z13"),

WARNING: line over 80 characters
#111: FILE: target-s390x/cpu_features.c:73:
+ FEAT_INIT("msa5-base", S390_FEAT_TYPE_STFL, 57, "Message-security-assist-extension-5 facility (excluding subfunctions)"),

WARNING: line over 80 characters
#112: FILE: target-s390x/cpu_features.c:74:
+ FEAT_INIT("ri", S390_FEAT_TYPE_STFL, 64, "CPU runtime-instrumentation facility"),

WARNING: line over 80 characters
#113: FILE: target-s390x/cpu_features.c:75:
+ FEAT_INIT("te", S390_FEAT_TYPE_STFL, 73, "Transactional-execution facility"),

WARNING: line over 80 characters
#114: FILE: target-s390x/cpu_features.c:76:
+ FEAT_INIT("sthyi", S390_FEAT_TYPE_STFL, 74, "Store-hypervisor-information facility"),

WARNING: line over 80 characters
#115: FILE: target-s390x/cpu_features.c:77:
+ FEAT_INIT("aefsi", S390_FEAT_TYPE_STFL, 75, "Access-exception-fetch/store-indication facility"),

WARNING: line over 80 characters
#116: FILE: target-s390x/cpu_features.c:78:
+ FEAT_INIT("msa3-base", S390_FEAT_TYPE_STFL, 76, "Message-security-assist-extension-3 facility (excluding subfunctions)"),

WARNING: line over 80 characters
#117: FILE: target-s390x/cpu_features.c:79:
+ FEAT_INIT("msa4-base", S390_FEAT_TYPE_STFL, 77, "Message-security-assist-extension-4 facility (excluding subfunctions)"),

WARNING: line over 80 characters
#119: FILE: target-s390x/cpu_features.c:81:
+ FEAT_INIT("dfppc", S390_FEAT_TYPE_STFL, 80, "Decimal-floating-point packed-conversion facility"),

WARNING: line over 80 characters
#122: FILE: target-s390x/cpu_features.c:84:
+ FEAT_INIT("gsls", S390_FEAT_TYPE_SCLP_CONF_CHAR, 40, "SIE: Guest-storage-limit-suppression facility"),

WARNING: line over 80 characters
#123: FILE: target-s390x/cpu_features.c:85:
+ FEAT_INIT("esop", S390_FEAT_TYPE_SCLP_CONF_CHAR, 46, "Enhanced-suppression-on-protection facility"),

WARNING: line over 80 characters
#125: FILE: target-s390x/cpu_features.c:87:
+ FEAT_INIT("64bscao", S390_FEAT_TYPE_SCLP_CONF_CHAR_EXT, 0, "SIE: 64-bit-SCAO facility"),

WARNING: line over 80 characters
#126: FILE: target-s390x/cpu_features.c:88:
+ FEAT_INIT("cmma", S390_FEAT_TYPE_SCLP_CONF_CHAR_EXT, 1, "SIE: Collaborative-memory-management assist"),

WARNING: line over 80 characters
#127: FILE: target-s390x/cpu_features.c:89:
+ FEAT_INIT("pfmfi", S390_FEAT_TYPE_SCLP_CONF_CHAR_EXT, 9, "SIE: PFMF interpretation facility"),

WARNING: line over 80 characters
#128: FILE: target-s390x/cpu_features.c:90:
+ FEAT_INIT("ibs", S390_FEAT_TYPE_SCLP_CONF_CHAR_EXT, 10, "SIE: Interlock-and-broadcast-suppression facility"),

WARNING: line over 80 characters
#130: FILE: target-s390x/cpu_features.c:92:
+ FEAT_INIT("sief2", S390_FEAT_TYPE_SCLP_CPU, 4, "SIE: interception format 2 (Virtual SIE)"),

WARNING: line over 80 characters
#132: FILE: target-s390x/cpu_features.c:94:
+ FEAT_INIT("gpereh", S390_FEAT_TYPE_SCLP_CPU, 10, "SIE: Guest-PER enhancement facility"),

WARNING: line over 80 characters
#133: FILE: target-s390x/cpu_features.c:95:
+ FEAT_INIT("siif", S390_FEAT_TYPE_SCLP_CPU, 11, "SIE: Shared IPTE-interlock facility"),

WARNING: line over 80 characters
#134: FILE: target-s390x/cpu_features.c:96:
+ FEAT_INIT("sigpif", S390_FEAT_TYPE_SCLP_CPU, 12, "SIE: SIGP interpretation facility"),

WARNING: line over 80 characters
#135: FILE: target-s390x/cpu_features.c:97:
+ FEAT_INIT("ib", S390_FEAT_TYPE_SCLP_CPU, 42, "SIE: Intervention bypass facility"),

WARNING: line over 80 characters
#136: FILE: target-s390x/cpu_features.c:98:
+ FEAT_INIT("cei", S390_FEAT_TYPE_SCLP_CPU, 43, "SIE: Conditional-external-interception facility"),

WARNING: line over 80 characters
#139: FILE: target-s390x/cpu_features.c:101:
+ FEAT_INIT("cmm", S390_FEAT_TYPE_MISC, 0, "Collaborative-memory-management facility"),

WARNING: line over 80 characters
#141: FILE: target-s390x/cpu_features.c:103:
+ FEAT_INIT("plo-cl", S390_FEAT_TYPE_PLO, 0, "PLO Compare and load (32 bit in general registers)"),

WARNING: line over 80 characters
#142: FILE: target-s390x/cpu_features.c:104:
+ FEAT_INIT("plo-clg", S390_FEAT_TYPE_PLO, 1, "PLO Compare and load (64 bit in parameter list)"),

WARNING: line over 80 characters
#143: FILE: target-s390x/cpu_features.c:105:
+ FEAT_INIT("plo-clgr", S390_FEAT_TYPE_PLO, 2, "PLO Compare and load (32 bit in general registers)"),

WARNING: line over 80 characters
#144: FILE: target-s390x/cpu_features.c:106:
+ FEAT_INIT("plo-clx", S390_FEAT_TYPE_PLO, 3, "PLO Compare and load (128 bit in parameter list)"),

WARNING: line over 80 characters
#145: FILE: target-s390x/cpu_features.c:107:
+ FEAT_INIT("plo-cs", S390_FEAT_TYPE_PLO, 4, "PLO Compare and swap (32 bit in general registers)"),

WARNING: line over 80 characters
#146: FILE: target-s390x/cpu_features.c:108:
+ FEAT_INIT("plo-csg", S390_FEAT_TYPE_PLO, 5, "PLO Compare and swap (64 bit in parameter list)"),

WARNING: line over 80 characters
#147: FILE: target-s390x/cpu_features.c:109:
+ FEAT_INIT("plo-csgr", S390_FEAT_TYPE_PLO, 6, "PLO Compare and swap (32 bit in general registers)"),

WARNING: line over 80 characters
#148: FILE: target-s390x/cpu_features.c:110:
+ FEAT_INIT("plo-csx", S390_FEAT_TYPE_PLO, 7, "PLO Compare and swap (128 bit in parameter list)"),

WARNING: line over 80 characters
#149: FILE: target-s390x/cpu_features.c:111:
+ FEAT_INIT("plo-dcs", S390_FEAT_TYPE_PLO, 8, "PLO Double compare and swap (32 bit in general registers)"),

WARNING: line over 80 characters
#150: FILE: target-s390x/cpu_features.c:112:
+ FEAT_INIT("plo-dcsg", S390_FEAT_TYPE_PLO, 9, "PLO Double compare and swap (64 bit in parameter list)"),

WARNING: line over 80 characters
#151: FILE: target-s390x/cpu_features.c:113:
+ FEAT_INIT("plo-dcsgr", S390_FEAT_TYPE_PLO, 10, "PLO Double compare and swap (32 bit in general registers)"),

WARNING: line over 80 characters
#152: FILE: target-s390x/cpu_features.c:114:
+ FEAT_INIT("plo-dcsx", S390_FEAT_TYPE_PLO, 11, "PLO Double compare and swap (128 bit in parameter list)"),

WARNING: line over 80 characters
#153: FILE: target-s390x/cpu_features.c:115:
+ FEAT_INIT("plo-csst", S390_FEAT_TYPE_PLO, 12, "PLO Compare and swap and store (32 bit in general registers)"),

WARNING: line over 80 characters
#154: FILE: target-s390x/cpu_features.c:116:
+ FEAT_INIT("plo-csstg", S390_FEAT_TYPE_PLO, 13, "PLO Compare and swap and store (64 bit in parameter list)"),

WARNING: line over 80 characters
#155: FILE: target-s390x/cpu_features.c:117:
+ FEAT_INIT("plo-csstgr", S390_FEAT_TYPE_PLO, 14, "PLO Compare and swap and store (32 bit in general registers)"),

WARNING: line over 80 characters
#156: FILE: target-s390x/cpu_features.c:118:
+ FEAT_INIT("plo-csstx", S390_FEAT_TYPE_PLO, 15, "PLO Compare and swap and store (128 bit in parameter list)"),

WARNING: line over 80 characters
#157: FILE: target-s390x/cpu_features.c:119:
+ FEAT_INIT("plo-csdst", S390_FEAT_TYPE_PLO, 16, "PLO Compare and swap and double store (32 bit in general registers)"),

WARNING: line over 80 characters
#158: FILE: target-s390x/cpu_features.c:120:
+ FEAT_INIT("plo-csdstg", S390_FEAT_TYPE_PLO, 17, "PLO Compare and swap and double store (64 bit in parameter list)"),

WARNING: line over 80 characters
#159: FILE: target-s390x/cpu_features.c:121:
+ FEAT_INIT("plo-csdstgr", S390_FEAT_TYPE_PLO, 18, "PLO Compare and swap and double store (32 bit in general registers)"),

WARNING: line over 80 characters
#160: FILE: target-s390x/cpu_features.c:122:
+ FEAT_INIT("plo-csdstx", S390_FEAT_TYPE_PLO, 19, "PLO Compare and swap and double store (128 bit in parameter list)"),

WARNING: line over 80 characters
#161: FILE: target-s390x/cpu_features.c:123:
+ FEAT_INIT("plo-cstst", S390_FEAT_TYPE_PLO, 20, "PLO Compare and swap and triple store (32 bit in general registers)"),

WARNING: line over 80 characters
#162: FILE: target-s390x/cpu_features.c:124:
+ FEAT_INIT("plo-cststg", S390_FEAT_TYPE_PLO, 21, "PLO Compare and swap and triple store (64 bit in parameter list)"),

WARNING: line over 80 characters
#163: FILE: target-s390x/cpu_features.c:125:
+ FEAT_INIT("plo-cststgr", S390_FEAT_TYPE_PLO, 22, "PLO Compare and swap and triple store (32 bit in general registers)"),

WARNING: line over 80 characters
#164: FILE: target-s390x/cpu_features.c:126:
+ FEAT_INIT("plo-cststx", S390_FEAT_TYPE_PLO, 23, "PLO Compare and swap and triple store (128 bit in parameter list)"),

WARNING: line over 80 characters
#167: FILE: target-s390x/cpu_features.c:129:
+ FEAT_INIT("ptff-qsi", S390_FEAT_TYPE_PTFF, 2, "PTFF Query Steering Information"),

WARNING: line over 80 characters
#170: FILE: target-s390x/cpu_features.c:132:
+ FEAT_INIT("ptff-qtou", S390_FEAT_TYPE_PTFF, 5, "PTFF Query TOD Offset User"),

WARNING: line over 80 characters
#178: FILE: target-s390x/cpu_features.c:140:
+ FEAT_INIT("kmac-etdea-128", S390_FEAT_TYPE_KMAC, 10, "KMAC Encrypted-TDEA-128"),

WARNING: line over 80 characters
#179: FILE: target-s390x/cpu_features.c:141:
+ FEAT_INIT("kmac-etdea-192", S390_FEAT_TYPE_KMAC, 11, "KMAC Encrypted-TDEA-192"),

WARNING: line over 80 characters
#183: FILE: target-s390x/cpu_features.c:145:
+ FEAT_INIT("kmac-eaes-128", S390_FEAT_TYPE_KMAC, 26, "KMAC Encrypted-AES-128"),

WARNING: line over 80 characters
#184: FILE: target-s390x/cpu_features.c:146:
+ FEAT_INIT("kmac-eaes-192", S390_FEAT_TYPE_KMAC, 27, "KMAC Encrypted-AES-192"),

WARNING: line over 80 characters
#185: FILE: target-s390x/cpu_features.c:147:
+ FEAT_INIT("kmac-eaes-256", S390_FEAT_TYPE_KMAC, 28, "KMAC Encrypted-AES-256"),

WARNING: line over 80 characters
#191: FILE: target-s390x/cpu_features.c:153:
+ FEAT_INIT("kmc-etdea-128", S390_FEAT_TYPE_KMC, 10, "KMC Encrypted-TDEA-128"),

WARNING: line over 80 characters
#192: FILE: target-s390x/cpu_features.c:154:
+ FEAT_INIT("kmc-etdea-192", S390_FEAT_TYPE_KMC, 11, "KMC Encrypted-TDEA-192"),

WARNING: line over 80 characters
#215: FILE: target-s390x/cpu_features.c:177:
+ FEAT_INIT("km-xts-eaes-128", S390_FEAT_TYPE_KM, 58, "KM XTS-Encrypted-AES-128"),

WARNING: line over 80 characters
#216: FILE: target-s390x/cpu_features.c:178:
+ FEAT_INIT("km-xts-eaes-256", S390_FEAT_TYPE_KM, 60, "KM XTS-Encrypted-AES-256"),

WARNING: line over 80 characters
#227: FILE: target-s390x/cpu_features.c:189:
+ FEAT_INIT("pckmo-etdea-128", S390_FEAT_TYPE_PCKMO, 2, "PCKMO Encrypted-TDEA-128-Key"),

WARNING: line over 80 characters
#228: FILE: target-s390x/cpu_features.c:190:
+ FEAT_INIT("pckmo-etdea-192", S390_FEAT_TYPE_PCKMO, 3, "PCKMO Encrypted-TDEA-192-Key"),

WARNING: line over 80 characters
#229: FILE: target-s390x/cpu_features.c:191:
+ FEAT_INIT("pckmo-aes-128", S390_FEAT_TYPE_PCKMO, 18, "PCKMO Encrypted-AES-128-Key"),

WARNING: line over 80 characters
#230: FILE: target-s390x/cpu_features.c:192:
+ FEAT_INIT("pckmo-aes-192", S390_FEAT_TYPE_PCKMO, 19, "PCKMO Encrypted-AES-192-Key"),

WARNING: line over 80 characters
#231: FILE: target-s390x/cpu_features.c:193:
+ FEAT_INIT("pckmo-aes-256", S390_FEAT_TYPE_PCKMO, 20, "PCKMO Encrypted-AES-256-Key"),

WARNING: line over 80 characters
#237: FILE: target-s390x/cpu_features.c:199:
+ FEAT_INIT("kmctr-etdea-128", S390_FEAT_TYPE_KMCTR, 10, "KMCTR Encrypted-TDEA-128"),

WARNING: line over 80 characters
#238: FILE: target-s390x/cpu_features.c:200:
+ FEAT_INIT("kmctr-etdea-192", S390_FEAT_TYPE_KMCTR, 11, "KMCTR Encrypted-TDEA-192"),

WARNING: line over 80 characters
#242: FILE: target-s390x/cpu_features.c:204:
+ FEAT_INIT("kmctr-eaes-128", S390_FEAT_TYPE_KMCTR, 26, "KMCTR Encrypted-AES-128"),

WARNING: line over 80 characters
#243: FILE: target-s390x/cpu_features.c:205:
+ FEAT_INIT("kmctr-eaes-192", S390_FEAT_TYPE_KMCTR, 27, "KMCTR Encrypted-AES-192"),

WARNING: line over 80 characters
#244: FILE: target-s390x/cpu_features.c:206:
+ FEAT_INIT("kmctr-eaes-256", S390_FEAT_TYPE_KMCTR, 28, "KMCTR Encrypted-AES-256"),

WARNING: line over 80 characters
#250: FILE: target-s390x/cpu_features.c:212:
+ FEAT_INIT("kmf-etdea-128", S390_FEAT_TYPE_KMF, 10, "KMF Encrypted-TDEA-128"),

WARNING: line over 80 characters
#251: FILE: target-s390x/cpu_features.c:213:
+ FEAT_INIT("kmf-etdea-192", S390_FEAT_TYPE_KMF, 11, "KMF Encrypted-TDEA-192"),

WARNING: line over 80 characters
#263: FILE: target-s390x/cpu_features.c:225:
+ FEAT_INIT("kmo-etdea-128", S390_FEAT_TYPE_KMO, 10, "KMO Encrypted-TDEA-128"),

WARNING: line over 80 characters
#264: FILE: target-s390x/cpu_features.c:226:
+ FEAT_INIT("kmo-etdea-192", S390_FEAT_TYPE_KMO, 11, "KMO Encrypted-TDEA-192"),

WARNING: line over 80 characters
#272: FILE: target-s390x/cpu_features.c:234:
+ FEAT_INIT("pcc-cmac-dea", S390_FEAT_TYPE_PCC, 1, "PCC Compute-Last-Block-CMAC-Using-DEA"),

WARNING: line over 80 characters
#273: FILE: target-s390x/cpu_features.c:235:
+ FEAT_INIT("pcc-cmac-tdea-128", S390_FEAT_TYPE_PCC, 2, "PCC Compute-Last-Block-CMAC-Using-TDEA-128"),

WARNING: line over 80 characters
#274: FILE: target-s390x/cpu_features.c:236:
+ FEAT_INIT("pcc-cmac-tdea-192", S390_FEAT_TYPE_PCC, 3, "PCC Compute-Last-Block-CMAC-Using-TDEA-192"),

WARNING: line over 80 characters
#275: FILE: target-s390x/cpu_features.c:237:
+ FEAT_INIT("pcc-cmac-edea", S390_FEAT_TYPE_PCC, 9, "PCC Compute-Last-Block-CMAC-Using-Encrypted-DEA"),

WARNING: line over 80 characters
#276: FILE: target-s390x/cpu_features.c:238:
+ FEAT_INIT("pcc-cmac-etdea-128", S390_FEAT_TYPE_PCC, 10, "PCC Compute-Last-Block-CMAC-Using-Encrypted-TDEA-128"),

WARNING: line over 80 characters
#277: FILE: target-s390x/cpu_features.c:239:
+ FEAT_INIT("pcc-cmac-etdea-192", S390_FEAT_TYPE_PCC, 11, "PCC Compute-Last-Block-CMAC-Using-EncryptedTDEA-192"),

WARNING: line over 80 characters
#278: FILE: target-s390x/cpu_features.c:240:
+ FEAT_INIT("pcc-cmac-aes-128", S390_FEAT_TYPE_PCC, 18, "PCC Compute-Last-Block-CMAC-Using-AES-128"),

WARNING: line over 80 characters
#279: FILE: target-s390x/cpu_features.c:241:
+ FEAT_INIT("pcc-cmac-aes-192", S390_FEAT_TYPE_PCC, 19, "PCC Compute-Last-Block-CMAC-Using-AES-192"),

WARNING: line over 80 characters
#280: FILE: target-s390x/cpu_features.c:242:
+ FEAT_INIT("pcc-cmac-eaes-256", S390_FEAT_TYPE_PCC, 20, "PCC Compute-Last-Block-CMAC-Using-AES-256"),

WARNING: line over 80 characters
#281: FILE: target-s390x/cpu_features.c:243:
+ FEAT_INIT("pcc-cmac-eaes-128", S390_FEAT_TYPE_PCC, 26, "PCC Compute-Last-Block-CMAC-Using-Encrypted-AES-128"),

WARNING: line over 80 characters
#282: FILE: target-s390x/cpu_features.c:244:
+ FEAT_INIT("pcc-cmac-eaes-192", S390_FEAT_TYPE_PCC, 27, "PCC Compute-Last-Block-CMAC-Using-Encrypted-AES-192"),

WARNING: line over 80 characters
#283: FILE: target-s390x/cpu_features.c:245:
+ FEAT_INIT("pcc-cmac-eaes-256", S390_FEAT_TYPE_PCC, 28, "PCC Compute-Last-Block-CMAC-Using-Encrypted-AES-256"),

WARNING: line over 80 characters
#284: FILE: target-s390x/cpu_features.c:246:
+ FEAT_INIT("pcc-xts-aes-128", S390_FEAT_TYPE_PCC, 50, "PCC Compute-XTS-Parameter-Using-AES-128"),

WARNING: line over 80 characters
#285: FILE: target-s390x/cpu_features.c:247:
+ FEAT_INIT("pcc-xts-aes-256", S390_FEAT_TYPE_PCC, 52, "PCC Compute-XTS-Parameter-Using-AES-256"),

WARNING: line over 80 characters
#286: FILE: target-s390x/cpu_features.c:248:
+ FEAT_INIT("pcc-xts-eaes-128", S390_FEAT_TYPE_PCC, 58, "PCC Compute-XTS-Parameter-Using-Encrypted-AES-128"),

WARNING: line over 80 characters
#287: FILE: target-s390x/cpu_features.c:249:
+ FEAT_INIT("pcc-xts-eaes-256", S390_FEAT_TYPE_PCC, 60, "PCC Compute-XTS-Parameter-Using-Encrypted-AES-256"),

total: 0 errors, 115 warnings, 617 lines checked

Your patch has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

Checking PATCH 5/29: s390x/cpumodel: generate CPU feature lists for CPU models...
ERROR: Macros with complex values should be enclosed in parenthesis #113: FILE: target-s390x/gen-features.c:20:
+#define S390_FEAT_GROUP_PLO \

+    S390_FEAT_PLO_CL, \
+    S390_FEAT_PLO_CLG, \
+    S390_FEAT_PLO_CLGR, \
+    S390_FEAT_PLO_CLX, \
+    S390_FEAT_PLO_CS, \
+    S390_FEAT_PLO_CSG, \
+    S390_FEAT_PLO_CSGR, \
+    S390_FEAT_PLO_CSX, \
+    S390_FEAT_PLO_DCS, \
+    S390_FEAT_PLO_DCSG, \
+    S390_FEAT_PLO_DCSGR, \
+    S390_FEAT_PLO_DCSX, \
+    S390_FEAT_PLO_CSST, \
+    S390_FEAT_PLO_CSSTG, \
+    S390_FEAT_PLO_CSSTGR, \
+    S390_FEAT_PLO_CSSTX, \
+    S390_FEAT_PLO_CSDST, \
+    S390_FEAT_PLO_CSDSTG, \
+    S390_FEAT_PLO_CSDSTGR, \
+    S390_FEAT_PLO_CSDSTX, \
+    S390_FEAT_PLO_CSTST, \
+    S390_FEAT_PLO_CSTSTG, \
+    S390_FEAT_PLO_CSTSTGR, \
+    S390_FEAT_PLO_CSTSTX

ERROR: Macros with complex values should be enclosed in parenthesis #139: FILE: target-s390x/gen-features.c:46:
+#define S390_FEAT_GROUP_TOD_CLOCK_STEERING \

+    S390_FEAT_TOD_CLOCK_STEERING, \
+    S390_FEAT_PTFF_QTO, \
+    S390_FEAT_PTFF_QSI, \
+    S390_FEAT_PTFF_QPT, \
+    S390_FEAT_PTFF_STO

ERROR: Macros with complex values should be enclosed in parenthesis #146: FILE: target-s390x/gen-features.c:53:
+#define S390_FEAT_GROUP_GEN13_PTFF \

+    S390_FEAT_PTFF_QUI, \
+    S390_FEAT_PTFF_QTOU, \
+    S390_FEAT_PTFF_STOU

ERROR: Macros with complex values should be enclosed in parenthesis #151: FILE: target-s390x/gen-features.c:58:
+#define S390_FEAT_GROUP_MSA \

+    S390_FEAT_MSA, \
+    S390_FEAT_KMAC_DEA, \
+    S390_FEAT_KMAC_TDEA_128, \
+    S390_FEAT_KMAC_TDEA_192, \
+    S390_FEAT_KMC_DEA, \
+    S390_FEAT_KMC_TDEA_128, \
+    S390_FEAT_KMC_TDEA_192, \
+    S390_FEAT_KM_DEA, \
+    S390_FEAT_KM_TDEA_128, \
+    S390_FEAT_KM_TDEA_192, \
+    S390_FEAT_KIMD_SHA_1, \
+    S390_FEAT_KLMD_SHA_1

ERROR: Macros with complex values should be enclosed in parenthesis #165: FILE: target-s390x/gen-features.c:72:
+#define S390_FEAT_GROUP_MSA_EXT_1 \

+    S390_FEAT_KMC_AES_128, \
+    S390_FEAT_KM_AES_128, \
+    S390_FEAT_KIMD_SHA_256, \
+    S390_FEAT_KLMD_SHA_256

ERROR: Macros with complex values should be enclosed in parenthesis #171: FILE: target-s390x/gen-features.c:78:
+#define S390_FEAT_GROUP_MSA_EXT_2 \

+    S390_FEAT_KMC_AES_192, \
+    S390_FEAT_KMC_AES_256, \
+    S390_FEAT_KMC_PRNG, \
+    S390_FEAT_KM_AES_192, \
+    S390_FEAT_KM_AES_256, \
+    S390_FEAT_KIMD_SHA_512, \
+    S390_FEAT_KLMD_SHA_512

ERROR: Macros with complex values should be enclosed in parenthesis #180: FILE: target-s390x/gen-features.c:87:
+#define S390_FEAT_GROUP_MSA_EXT_3 \

+    S390_FEAT_MSA_EXT_3, \
+    S390_FEAT_KMAC_EDEA, \
+    S390_FEAT_KMAC_ETDEA_128, \
+    S390_FEAT_KMAC_ETDEA_192, \
+    S390_FEAT_KMC_EAES_128, \
+    S390_FEAT_KMC_EAES_192, \
+    S390_FEAT_KMC_EAES_256, \
+    S390_FEAT_KMC_EDEA, \
+    S390_FEAT_KMC_ETDEA_128, \
+    S390_FEAT_KMC_ETDEA_192, \
+    S390_FEAT_KM_EDEA, \
+    S390_FEAT_KM_ETDEA_128, \
+    S390_FEAT_KM_ETDEA_192, \
+    S390_FEAT_KM_EAES_128, \
+    S390_FEAT_KM_EAES_192, \
+    S390_FEAT_KM_EAES_256, \
+    S390_FEAT_PCKMO_EDEA, \
+    S390_FEAT_PCKMO_ETDEA_128, \
+    S390_FEAT_PCKMO_ETDEA_256, \
+    S390_FEAT_PCKMO_AES_128, \
+    S390_FEAT_PCKMO_AES_192, \
+    S390_FEAT_PCKMO_AES_256

ERROR: Macros with complex values should be enclosed in parenthesis #204: FILE: target-s390x/gen-features.c:111:
+#define S390_FEAT_GROUP_MSA_EXT_4 \

+    S390_FEAT_MSA_EXT_4, \
+    S390_FEAT_KMAC_AES_128, \
+    S390_FEAT_KMAC_AES_192, \
+    S390_FEAT_KMAC_AES_256, \
+    S390_FEAT_KMAC_EAES_128, \
+    S390_FEAT_KMAC_EAES_192, \
+    S390_FEAT_KMAC_EAES_256, \
+    S390_FEAT_KM_XTS_AES_128, \
+    S390_FEAT_KM_XTS_AES_256, \
+    S390_FEAT_KM_XTS_EAES_128, \
+    S390_FEAT_KM_XTS_EAES_256, \
+    S390_FEAT_KIMD_GHASH, \
+    S390_FEAT_KMCTR_DEA, \
+    S390_FEAT_KMCTR_TDEA_128, \
+    S390_FEAT_KMCTR_TDEA_192, \
+    S390_FEAT_KMCTR_EDEA, \
+    S390_FEAT_KMCTR_ETDEA_128, \
+    S390_FEAT_KMCTR_ETDEA_192, \
+    S390_FEAT_KMCTR_AES_128, \
+    S390_FEAT_KMCTR_AES_192, \
+    S390_FEAT_KMCTR_AES_256, \
+    S390_FEAT_KMCTR_EAES_128, \
+    S390_FEAT_KMCTR_EAES_192, \
+    S390_FEAT_KMCTR_EAES_256, \
+    S390_FEAT_KMF_DEA, \
+    S390_FEAT_KMF_TDEA_128, \
+    S390_FEAT_KMF_TDEA_192, \
+    S390_FEAT_KMF_EDEA, \
+    S390_FEAT_KMF_ETDEA_128, \
+    S390_FEAT_KMF_ETDEA_192, \
+    S390_FEAT_KMF_AES_128, \
+    S390_FEAT_KMF_AES_192, \
+    S390_FEAT_KMF_AES_256, \
+    S390_FEAT_KMF_EAES_128, \
+    S390_FEAT_KMF_EAES_192, \
+    S390_FEAT_KMF_EAES_256, \
+    S390_FEAT_KMO_DEA, \
+    S390_FEAT_KMO_TDEA_128, \
+    S390_FEAT_KMO_TDEA_192, \
+    S390_FEAT_KMO_EDEA, \
+    S390_FEAT_KMO_ETDEA_128, \
+    S390_FEAT_KMO_ETDEA_192, \
+    S390_FEAT_KMO_AES_128, \
+    S390_FEAT_KMO_AES_192, \
+    S390_FEAT_KMO_AES_256, \
+    S390_FEAT_KMO_EAES_128, \
+    S390_FEAT_KMO_EAES_192, \
+    S390_FEAT_KMO_EAES_256, \
+    S390_FEAT_PCC_CMAC_DEA, \
+    S390_FEAT_PCC_CMAC_TDEA_128, \
+    S390_FEAT_PCC_CMAC_TDEA_192, \
+    S390_FEAT_PCC_CMAC_ETDEA_128, \
+    S390_FEAT_PCC_CMAC_ETDEA_192, \
+    S390_FEAT_PCC_CMAC_TDEA, \
+    S390_FEAT_PCC_CMAC_AES_128, \
+    S390_FEAT_PCC_CMAC_AES_192, \
+    S390_FEAT_PCC_CMAC_AES_256, \
+    S390_FEAT_PCC_CMAC_EAES_128, \
+    S390_FEAT_PCC_CMAC_EAES_192, \
+    S390_FEAT_PCC_CMAC_EAES_256, \
+    S390_FEAT_PCC_XTS_AES_128, \
+    S390_FEAT_PCC_XTS_AES_256, \
+    S390_FEAT_PCC_XTS_EAES_128, \
+    S390_FEAT_PCC_XTS_EAES_256

ERROR: Macros with complex values should be enclosed in parenthesis #270: FILE: target-s390x/gen-features.c:177:
+#define S390_FEAT_GROUP_MSA_EXT_5 \
+ S390_FEAT_MSA_EXT_5, \
+ S390_FEAT_PPNO_SHA_512_DRNG

total: 9 errors, 0 warnings, 545 lines checked

Your patch has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

Checking PATCH 6/29: s390x/cpumodel: generate CPU feature group lists... Checking PATCH 7/29: s390x/cpumodel: introduce CPU feature group definitions...
WARNING: line over 80 characters
#71: FILE: target-s390x/cpu_features.c:363:
+ FEAT_GROUP_INIT("gen13ptff", GEN13_PTFF, "PTFF enhancements introduced with z13"),

WARNING: line over 80 characters
#73: FILE: target-s390x/cpu_features.c:365:
+ FEAT_GROUP_INIT("msa1", MSA_EXT_1, "Message-security-assist-extension 1 facility"),

WARNING: line over 80 characters
#74: FILE: target-s390x/cpu_features.c:366:
+ FEAT_GROUP_INIT("msa2", MSA_EXT_2, "Message-security-assist-extension 2 facility"),

WARNING: line over 80 characters
#75: FILE: target-s390x/cpu_features.c:367:
+ FEAT_GROUP_INIT("msa3", MSA_EXT_3, "Message-security-assist-extension 3 facility"),

WARNING: line over 80 characters
#76: FILE: target-s390x/cpu_features.c:368:
+ FEAT_GROUP_INIT("msa4", MSA_EXT_4, "Message-security-assist-extension 4 facility"),

WARNING: line over 80 characters
#77: FILE: target-s390x/cpu_features.c:369:
+ FEAT_GROUP_INIT("msa5", MSA_EXT_5, "Message-security-assist-extension 5 facility"),

total: 0 errors, 6 warnings, 92 lines checked

Your patch has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

Checking PATCH 8/29: s390x/cpumodel: register defined CPU models as subclasses...
WARNING: line over 80 characters
#64: FILE: target-s390x/cpu_models.c:30:
+ .base_feat = { S390_FEAT_LIST_GEN ## _gen ## _GA ## _ec_ga ## _BASE }, \

WARNING: line over 80 characters
#65: FILE: target-s390x/cpu_models.c:31:
+ .default_feat = { S390_FEAT_LIST_GEN ## _gen ## _GA ## _ec_ga ## _DEFAULT }, \

WARNING: line over 80 characters
#66: FILE: target-s390x/cpu_models.c:32:
+ .full_feat = { S390_FEAT_LIST_GEN ## _gen ## _GA ## _ec_ga ## _FULL }, \

WARNING: line over 80 characters
#89: FILE: target-s390x/cpu_models.c:55:
+ CPUDEF_INIT(0x2094, 9, 2, 40, 0x00000000U, "z9EC.2", "IBM System z9 EC GA2"),

WARNING: line over 80 characters
#91: FILE: target-s390x/cpu_models.c:57:
+ CPUDEF_INIT(0x2094, 9, 3, 40, 0x00000000U, "z9EC.3", "IBM System z9 EC GA3"),

WARNING: line over 80 characters
#92: FILE: target-s390x/cpu_models.c:58:
+ CPUDEF_INIT(0x2096, 9, 3, 40, 0x00000000U, "z9BC.2", "IBM System z9 BC GA2"),

WARNING: line over 80 characters
#93: FILE: target-s390x/cpu_models.c:59:
+ CPUDEF_INIT(0x2097, 10, 1, 43, 0x00000000U, "z10EC", "IBM System z10 EC GA1"),

WARNING: line over 80 characters
#94: FILE: target-s390x/cpu_models.c:60:
+ CPUDEF_INIT(0x2097, 10, 2, 43, 0x00000000U, "z10EC.2", "IBM System z10 EC GA2"),

WARNING: line over 80 characters
#95: FILE: target-s390x/cpu_models.c:61:
+ CPUDEF_INIT(0x2098, 10, 2, 43, 0x00000000U, "z10BC", "IBM System z10 BC GA1"),

WARNING: line over 80 characters
#96: FILE: target-s390x/cpu_models.c:62:
+ CPUDEF_INIT(0x2097, 10, 3, 43, 0x00000000U, "z10EC.3", "IBM System z10 EC GA3"),

WARNING: line over 80 characters
#97: FILE: target-s390x/cpu_models.c:63:
+ CPUDEF_INIT(0x2098, 10, 3, 43, 0x00000000U, "z10BC.2", "IBM System z10 BC GA2"),

WARNING: line over 80 characters
#98: FILE: target-s390x/cpu_models.c:64:
+ CPUDEF_INIT(0x2817, 11, 1, 44, 0x08000000U, "z196", "IBM zEnterprise 196 GA1"),

WARNING: line over 80 characters
#99: FILE: target-s390x/cpu_models.c:65:
+ CPUDEF_INIT(0x2817, 11, 2, 44, 0x08000000U, "z196.2", "IBM zEnterprise 196 GA2"),

WARNING: line over 80 characters
#100: FILE: target-s390x/cpu_models.c:66:
+ CPUDEF_INIT(0x2818, 11, 2, 44, 0x08000000U, "z114", "IBM zEnterprise 114 GA1"),

WARNING: line over 80 characters
#101: FILE: target-s390x/cpu_models.c:67:
+ CPUDEF_INIT(0x2827, 12, 1, 44, 0x08000000U, "zEC12", "IBM zEnterprise EC12 GA1"),

WARNING: line over 80 characters
#102: FILE: target-s390x/cpu_models.c:68:
+ CPUDEF_INIT(0x2827, 12, 2, 44, 0x08000000U, "zEC12.2", "IBM zEnterprise EC12 GA2"),

WARNING: line over 80 characters
#103: FILE: target-s390x/cpu_models.c:69:
+ CPUDEF_INIT(0x2828, 12, 2, 44, 0x08000000U, "zBC12", "IBM zEnterprise BC12 GA1"),

total: 0 errors, 17 warnings, 198 lines checked

Your patch has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

Checking PATCH 9/29: s390x/cpumodel: store the CPU model in the CPU instance... Checking PATCH 10/29: s390x/cpumodel: expose features and feature groups as properties... Checking PATCH 11/29: s390x/cpumodel: let the CPU model handle feature checks...
WARNING: line over 80 characters
#36: FILE: target-s390x/cpu_models.c:88:
+ return kvm_check_extension(kvm_state, KVM_CAP_S390_VECTOR_REGISTERS);

total: 0 errors, 1 warnings, 78 lines checked

Your patch has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

Checking PATCH 12/29: s390x/cpumodel: check and apply the CPU model... Checking PATCH 13/29: s390x/sclp: factor out preparation of cpu entries... Checking PATCH 14/29: s390x/sclp: introduce sclp feature blocks... Checking PATCH 15/29: s390x/sclp: indicate sclp features...
Checking PATCH 16/29: s390x/sclp: propagate the ibc val(lowest and unblocked ibc)... Checking PATCH 17/29: s390x/sclp: propagate the mha via sclp... Checking PATCH 18/29: s390x/sclp: propagate hmfai...
Checking PATCH 19/29: linux-headers: update against kvm/next...
ERROR: code indent should never use tabs
#21: FILE: include/standard-headers/linux/input-event-codes.h:615:
+#define KEY_RIGHT_UP^I^I^I0x266$

ERROR: code indent should never use tabs
#22: FILE: include/standard-headers/linux/input-event-codes.h:616:
+#define KEY_RIGHT_DOWN^I^I^I0x267$

ERROR: code indent should never use tabs
#23: FILE: include/standard-headers/linux/input-event-codes.h:617:
+#define KEY_LEFT_UP^I^I^I0x268$

ERROR: code indent should never use tabs
#24: FILE: include/standard-headers/linux/input-event-codes.h:618:
+#define KEY_LEFT_DOWN^I^I^I0x269$

ERROR: code indent should never use tabs
#26: FILE: include/standard-headers/linux/input-event-codes.h:620:
+#define KEY_ROOT_MENU^I^I^I0x26a /* Show Device's Root Menu */$

ERROR: code indent should never use tabs
#28: FILE: include/standard-headers/linux/input-event-codes.h:622:
+#define KEY_MEDIA_TOP_MENU^I^I0x26b$

ERROR: code indent should never use tabs
#29: FILE: include/standard-headers/linux/input-event-codes.h:623:
+#define KEY_NUMERIC_11^I^I^I0x26c$

ERROR: code indent should never use tabs
#30: FILE: include/standard-headers/linux/input-event-codes.h:624:
+#define KEY_NUMERIC_12^I^I^I0x26d$

ERROR: code indent should never use tabs
#36: FILE: include/standard-headers/linux/input-event-codes.h:630:
+#define KEY_AUDIO_DESC^I^I^I0x26e$

ERROR: code indent should never use tabs
#37: FILE: include/standard-headers/linux/input-event-codes.h:631:
+#define KEY_3D_MODE^I^I^I0x26f$

ERROR: code indent should never use tabs
#38: FILE: include/standard-headers/linux/input-event-codes.h:632:
+#define KEY_NEXT_FAVORITE^I^I0x270$

ERROR: code indent should never use tabs
#39: FILE: include/standard-headers/linux/input-event-codes.h:633:
+#define KEY_STOP_RECORD^I^I^I0x271$

ERROR: code indent should never use tabs
#40: FILE: include/standard-headers/linux/input-event-codes.h:634:
+#define KEY_PAUSE_RECORD^I^I0x272$

ERROR: code indent should never use tabs
#41: FILE: include/standard-headers/linux/input-event-codes.h:635:
+#define KEY_VOD^I^I^I^I0x273 /* Video on Demand */$

ERROR: code indent should never use tabs
#42: FILE: include/standard-headers/linux/input-event-codes.h:636:
+#define KEY_UNMUTE^I^I^I0x274$

ERROR: code indent should never use tabs
#43: FILE: include/standard-headers/linux/input-event-codes.h:637:
+#define KEY_FASTREVERSE^I^I^I0x275$

ERROR: code indent should never use tabs
#44: FILE: include/standard-headers/linux/input-event-codes.h:638:
+#define KEY_SLOWREVERSE^I^I^I0x276$

ERROR: code indent should never use tabs
#49: FILE: include/standard-headers/linux/input-event-codes.h:643:
+#define KEY_DATA^I^I^I0x275$

ERROR: code indent should never use tabs
#58: FILE: include/standard-headers/linux/input-event-codes.h:783:
+#define SW_PEN_INSERTED^I^I0x0f /* set = pen inserted */$

ERROR: code indent should never use tabs
#70: FILE: include/standard-headers/linux/input.h:247:
+#define BUS_CEC^I^I^I0x1E$

ERROR: code indent should never use tabs
#83: FILE: include/standard-headers/linux/virtio_config.h:52:
+#define VIRTIO_TRANSPORT_F_END^I^I34$

ERROR: code indent should never use tabs
#98: FILE: include/standard-headers/linux/virtio_config.h:73:
+#define VIRTIO_F_IOMMU_PLATFORM^I^I33$

ERROR: code indent should never use tabs
#119: FILE: include/standard-headers/linux/virtio_net.h:38:
+#define VIRTIO_NET_F_MTU^I3^I/* Initial MTU advice */$

ERROR: code indent should never use tabs
#127: FILE: include/standard-headers/linux/virtio_net.h:77:
+^I/* Default maximum transmit unit advice */$

ERROR: code indent should never use tabs
#128: FILE: include/standard-headers/linux/virtio_net.h:78:
+^Iuint16_t mtu;$

ERROR: code indent should never use tabs
#142: FILE: linux-headers/asm-arm/kvm.h:142:
+#define KVM_REG_ARM_TIMER_CNT^I^IARM_CP15_REG64(1, 14)$

ERROR: code indent should never use tabs
#143: FILE: linux-headers/asm-arm/kvm.h:143:
+#define KVM_REG_ARM_TIMER_CVAL^I^IARM_CP15_REG64(3, 14)$

ERROR: code indent should never use tabs
#155: FILE: linux-headers/asm-arm64/kvm.h:90:
+#define KVM_VGIC_ITS_ADDR_TYPE^I^I4$

ERROR: code indent should never use tabs
#159: FILE: linux-headers/asm-arm64/kvm.h:94:
+#define KVM_VGIC_V3_ITS_SIZE^I^I(2 * SZ_64K)$

ERROR: code indent should never use tabs
#171: FILE: linux-headers/asm-s390/kvm.h:96:
+#define KVM_S390_VM_CPU_PROCESSOR_FEAT^I2$

ERROR: code indent should never use tabs
#172: FILE: linux-headers/asm-s390/kvm.h:97:
+#define KVM_S390_VM_CPU_MACHINE_FEAT^I3$

ERROR: code indent should never use tabs
#174: FILE: linux-headers/asm-s390/kvm.h:99:
+#define KVM_S390_VM_CPU_FEAT_NR_BITS^I1024$

ERROR: code indent should never use tabs
#175: FILE: linux-headers/asm-s390/kvm.h:100:
+#define KVM_S390_VM_CPU_FEAT_ESOP^I0$

ERROR: code indent should never use tabs
#176: FILE: linux-headers/asm-s390/kvm.h:101:
+#define KVM_S390_VM_CPU_FEAT_SIEF2^I1$

ERROR: code indent should never use tabs
#177: FILE: linux-headers/asm-s390/kvm.h:102:
+#define KVM_S390_VM_CPU_FEAT_64BSCAO^I2$

ERROR: code indent should never use tabs
#178: FILE: linux-headers/asm-s390/kvm.h:103:
+#define KVM_S390_VM_CPU_FEAT_SIIF^I3$

ERROR: code indent should never use tabs
#179: FILE: linux-headers/asm-s390/kvm.h:104:
+#define KVM_S390_VM_CPU_FEAT_GPERE^I4$

ERROR: code indent should never use tabs
#180: FILE: linux-headers/asm-s390/kvm.h:105:
+#define KVM_S390_VM_CPU_FEAT_GSLS^I5$

ERROR: code indent should never use tabs
#181: FILE: linux-headers/asm-s390/kvm.h:106:
+#define KVM_S390_VM_CPU_FEAT_IB^I^I6$

ERROR: code indent should never use tabs
#182: FILE: linux-headers/asm-s390/kvm.h:107:
+#define KVM_S390_VM_CPU_FEAT_CEI^I7$

ERROR: code indent should never use tabs
#183: FILE: linux-headers/asm-s390/kvm.h:108:
+#define KVM_S390_VM_CPU_FEAT_IBS^I8$

ERROR: code indent should never use tabs
#184: FILE: linux-headers/asm-s390/kvm.h:109:
+#define KVM_S390_VM_CPU_FEAT_SKEY^I9$

ERROR: code indent should never use tabs
#185: FILE: linux-headers/asm-s390/kvm.h:110:
+#define KVM_S390_VM_CPU_FEAT_CMMA^I10$

ERROR: code indent should never use tabs
#186: FILE: linux-headers/asm-s390/kvm.h:111:
+#define KVM_S390_VM_CPU_FEAT_PFMFI^I11$

ERROR: code indent should never use tabs
#187: FILE: linux-headers/asm-s390/kvm.h:112:
+#define KVM_S390_VM_CPU_FEAT_SIGPIF^I12$

ERROR: code indent should never use tabs
#189: FILE: linux-headers/asm-s390/kvm.h:114:
+^I__u64 feat[16];$

ERROR: code indent should never use tabs
#192: FILE: linux-headers/asm-s390/kvm.h:117:
+#define KVM_S390_VM_CPU_PROCESSOR_SUBFUNC^I4$

ERROR: code indent should never use tabs
#193: FILE: linux-headers/asm-s390/kvm.h:118:
+#define KVM_S390_VM_CPU_MACHINE_SUBFUNC^I^I5$

ERROR: code indent should never use tabs
#196: FILE: linux-headers/asm-s390/kvm.h:121:
+^I__u8 plo[32];^I^I/* always */$

ERROR: code indent should never use tabs #197: FILE: linux-headers/asm-s390/kvm.h:122:
+^I__u8 ptff[16];^I^I/* with TOD-clock steering */$

ERROR: code indent should never use tabs
#198: FILE: linux-headers/asm-s390/kvm.h:123:
+^I__u8 kmac[16];^I^I/* with MSA */$

ERROR: code indent should never use tabs
#199: FILE: linux-headers/asm-s390/kvm.h:124:
+^I__u8 kmc[16];^I^I/* with MSA */$

ERROR: code indent should never use tabs
#200: FILE: linux-headers/asm-s390/kvm.h:125:
+^I__u8 km[16];^I^I/* with MSA */$

ERROR: code indent should never use tabs
#201: FILE: linux-headers/asm-s390/kvm.h:126:
+^I__u8 kimd[16];^I^I/* with MSA */$

ERROR: code indent should never use tabs
#202: FILE: linux-headers/asm-s390/kvm.h:127:
+^I__u8 klmd[16];^I^I/* with MSA */$

ERROR: code indent should never use tabs
#203: FILE: linux-headers/asm-s390/kvm.h:128:
+^I__u8 pckmo[16];^I^I/* with MSA3 */$

ERROR: code indent should never use tabs
#204: FILE: linux-headers/asm-s390/kvm.h:129:
+^I__u8 kmctr[16];^I^I/* with MSA4 */$

ERROR: code indent should never use tabs
#205: FILE: linux-headers/asm-s390/kvm.h:130:
+^I__u8 kmf[16];^I^I/* with MSA4 */$

ERROR: code indent should never use tabs
#206: FILE: linux-headers/asm-s390/kvm.h:131:
+^I__u8 kmo[16];^I^I/* with MSA4 */$

ERROR: code indent should never use tabs
#207: FILE: linux-headers/asm-s390/kvm.h:132:
+^I__u8 pcc[16];^I^I/* with MSA4 */$

ERROR: code indent should never use tabs
#208: FILE: linux-headers/asm-s390/kvm.h:133:
+^I__u8 ppno[16];^I^I/* with MSA5 */$

ERROR: code indent should never use tabs
#209: FILE: linux-headers/asm-s390/kvm.h:134:
+^I__u8 reserved[1824];$

ERROR: code indent should never use tabs
#257: FILE: linux-headers/linux/kvm.h:885:
+^Iunion {$

ERROR: code indent should never use tabs
#258: FILE: linux-headers/linux/kvm.h:886:
+^I^I__u32 pad;$

ERROR: code indent should never use tabs
#259: FILE: linux-headers/linux/kvm.h:887:
+^I^I__u32 devid;$

ERROR: code indent should never use tabs
#260: FILE: linux-headers/linux/kvm.h:888:
+^I};$

ERROR: code indent should never use tabs
#268: FILE: linux-headers/linux/kvm.h:1034:
+#define KVM_MSI_VALID_DEVID^I(1U << 0)$

ERROR: code indent should never use tabs
#275: FILE: linux-headers/linux/kvm.h:1040:
+^I__u32 devid;$

ERROR: code indent should never use tabs
#276: FILE: linux-headers/linux/kvm.h:1041:
+^I__u8 pad[12];$

ERROR: code indent should never use tabs
#284: FILE: linux-headers/linux/kvm.h:1086:
+^IKVM_DEV_TYPE_ARM_VGIC_ITS,$

ERROR: code indent should never use tabs
#285: FILE: linux-headers/linux/kvm.h:1087:
+#define KVM_DEV_TYPE_ARM_VGIC_ITS^IKVM_DEV_TYPE_ARM_VGIC_ITS$

ERROR: code indent should never use tabs
#307: FILE: linux-headers/linux/vhost.h:52:
+^I__u64 iova;$

ERROR: code indent should never use tabs
#308: FILE: linux-headers/linux/vhost.h:53:
+^I__u64 size;$

ERROR: code indent should never use tabs
#309: FILE: linux-headers/linux/vhost.h:54:
+^I__u64 uaddr;$

ERROR: code indent should never use tabs
#313: FILE: linux-headers/linux/vhost.h:58:
+^I__u8 perm;$

ERROR: code indent should never use tabs
#318: FILE: linux-headers/linux/vhost.h:63:
+^I__u8 type;$

ERROR: code indent should never use tabs
#324: FILE: linux-headers/linux/vhost.h:69:
+^Iint type;$

ERROR: code indent should never use tabs
#325: FILE: linux-headers/linux/vhost.h:70:
+^Iunion {$

ERROR: code indent should never use tabs
#326: FILE: linux-headers/linux/vhost.h:71:
+^I^Istruct vhost_iotlb_msg iotlb;$

ERROR: code indent should never use tabs
#327: FILE: linux-headers/linux/vhost.h:72:
+^I^I__u8 padding[64];$

ERROR: code indent should never use tabs
#328: FILE: linux-headers/linux/vhost.h:73:
+^I};$

ERROR: code indent should never use tabs
#349: FILE: linux-headers/linux/vhost.h:208:
+#define VHOST_VSOCK_SET_GUEST_CID^I_IOW(VHOST_VIRTIO, 0x60, __u64)$

ERROR: code indent should never use tabs
#350: FILE: linux-headers/linux/vhost.h:209:
+#define VHOST_VSOCK_SET_RUNNING^I^I_IOW(VHOST_VIRTIO, 0x61, int)$

total: 83 errors, 0 warnings, 276 lines checked

Your patch has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

Checking PATCH 20/29: s390x/kvm: allow runtime-instrumentation for "none" machine... Checking PATCH 21/29: s390x/kvm: implement CPU model support... Checking PATCH 22/29: s390x/kvm: disable host model for existing compat machines... Checking PATCH 23/29: s390x/kvm: let the CPU model control CMM(A)... Checking PATCH 24/29: qmp: add QMP interface "query-cpu-model-expansion"...
WARNING: line over 80 characters
#29: FILE: include/sysemu/arch_init.h:38:
+CpuModelExpansionInfo *arch_query_cpu_model_expansion(CpuModelExpansionType type,

WARNING: line over 80 characters
#193: FILE: stubs/arch-query-cpu-model-expansion.c:6:
+CpuModelExpansionInfo *arch_query_cpu_model_expansion(CpuModelExpansionType type,

total: 0 errors, 2 warnings, 148 lines checked

Your patch has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

Checking PATCH 25/29: qmp: add QMP interface "query-cpu-model-comparison"... Checking PATCH 26/29: qmp: add QMP interface "query-cpu-model-baseline"... Checking PATCH 27/29: s390x/cpumodel: implement QMP interface "query-cpu-model-expansion"...
WARNING: line over 80 characters
#152: FILE: target-s390x/cpu_models.c:408:
+ s390_feat_bitmap_to_ascii(model->features, qdict, qdict_add_enabled_feat);

WARNING: line over 80 characters
#165: FILE: target-s390x/cpu_models.c:421:
+CpuModelExpansionInfo *arch_query_cpu_model_expansion(CpuModelExpansionType type,

ERROR: space prohibited before that close parenthesis ')' #181: FILE: target-s390x/cpu_models.c:437:
+ } else if (type != CPU_MODEL_EXPANSION_TYPE_FULL ) {

total: 1 errors, 2 warnings, 167 lines checked

Your patch has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS.

Checking PATCH 28/29: s390x/cpumodel: implement QMP interface "query-cpu-model-comparison"... Checking PATCH 29/29: s390x/cpumodel: implement QMP interface "query-cpu-model-baseline"... === OUTPUT END ===

Test command exited with code: 1

A message that is not in the archive (sent off-list or not yet received): [email protected]

#34 lore raw

On Mon, 8 Aug 2016 09:45:04 -0700 (PDT)
[email protected] wrote:

<Trimmed the no-reply@ -- I wonder whether reply-to should be setup to something sensible, e.g. qemu-devel>

Quoted 4 lines

Checking PATCH 4/29: s390x/cpumodel: introduce CPU features...
WARNING: line over 80 characters
#65: FILE: target-s390x/cpu_features.c:27:
+ FEAT_INIT("zarch", S390_FEAT_TYPE_STFL, 1, "z/Architecture architectural mode"),

We could conceivably break the line after one of the arguments, but there are some very long strings below. I'm not a fan of very long lines myself, but I wonder whether we should relax that limit? The Linux kernel has settled upon a relaxed limit and forbids splitting strings for greppability.

Quoted 18 lines

Checking PATCH 5/29: s390x/cpumodel: generate CPU feature lists for CPU models...
ERROR: Macros with complex values should be enclosed in parenthesis #113: FILE: target-s390x/gen-features.c:20:

(quoted diff) +15 -0
+#define S390_FEAT_GROUP_PLO \
+    S390_FEAT_PLO_CL, \
+    S390_FEAT_PLO_CLG, \
+    S390_FEAT_PLO_CLGR, \
+    S390_FEAT_PLO_CLX, \
+    S390_FEAT_PLO_CS, \
+    S390_FEAT_PLO_CSG, \
+    S390_FEAT_PLO_CSGR, \
+    S390_FEAT_PLO_CSX, \
+    S390_FEAT_PLO_DCS, \
+    S390_FEAT_PLO_DCSG, \
+    S390_FEAT_PLO_DCSGR, \
+    S390_FEAT_PLO_DCSX, \
+    S390_FEAT_PLO_CSST, \
+    S390_FEAT_PLO_CSSTG, \

Review

Quoted 10 lines
(quoted diff) +10 -0
+    S390_FEAT_PLO_CSSTGR, \
+    S390_FEAT_PLO_CSSTX, \
+    S390_FEAT_PLO_CSDST, \
+    S390_FEAT_PLO_CSDSTG, \
+    S390_FEAT_PLO_CSDSTGR, \
+    S390_FEAT_PLO_CSDSTX, \
+    S390_FEAT_PLO_CSTST, \
+    S390_FEAT_PLO_CSTSTG, \
+    S390_FEAT_PLO_CSTSTGR, \
+    S390_FEAT_PLO_CSTSTX

I think the check is wrong to complain here.

Quoted 5 lines

Checking PATCH 6/29: s390x/cpumodel: generate CPU feature group lists... Checking PATCH 7/29: s390x/cpumodel: introduce CPU feature group definitions...
WARNING: line over 80 characters
#71: FILE: target-s390x/cpu_features.c:363:
+ FEAT_GROUP_INIT("gen13ptff", GEN13_PTFF, "PTFF enhancements introduced with z13"),

Same comments as above.

Quoted 4 lines

Checking PATCH 8/29: s390x/cpumodel: register defined CPU models as subclasses...
WARNING: line over 80 characters
#64: FILE: target-s390x/cpu_models.c:30:
+ .base_feat = { S390_FEAT_LIST_GEN ## _gen ## _GA ## _ec_ga ## _BASE }, \

And here. I honestly don't see a way to get this below 80 chars.

Quoted 4 lines

Checking PATCH 19/29: linux-headers: update against kvm/next...
ERROR: code indent should never use tabs
#21: FILE: include/standard-headers/linux/input-event-codes.h:615:
+#define KEY_RIGHT_UP^I^I^I0x266$

We should not check a linux headers update against qemu coding style. Either ignore the respective files, or check whether this patch is a linux headers update and nothing else. (I lack the perl skills for that :)

Quoted 4 lines

Checking PATCH 24/29: qmp: add QMP interface "query-cpu-model-expansion"...
WARNING: line over 80 characters
#29: FILE: include/sysemu/arch_init.h:38:
+CpuModelExpansionInfo *arch_query_cpu_model_expansion(CpuModelExpansionType type,

This is a case of VeryLongVariableNames. Not sure whether we should do anything about that.

Quoted 5 lines

Checking PATCH 27/29: s390x/cpumodel: implement QMP interface "query-cpu-model-expansion"...
WARNING: line over 80 characters
#152: FILE: target-s390x/cpu_models.c:408:
+ s390_feat_bitmap_to_ascii(model->features, qdict, qdict_add_enabled_feat);

Quoted 7 lines

WARNING: line over 80 characters
#165: FILE: target-s390x/cpu_models.c:421:
+CpuModelExpansionInfo *arch_query_cpu_model_expansion(CpuModelExpansionType type,

ERROR: space prohibited before that close parenthesis ')' #181: FILE: target-s390x/cpu_models.c:437:
+ } else if (type != CPU_MODEL_EXPANSION_TYPE_FULL ) {

That's actually a warning I concur with :)

I think we should at least come up with a check for a linux header update to avoid spamming the mailing list. And it would be a good idea to have some consensus about the 80 char limit as well.

#35 lore raw
Quoted 11 lines

On Mon, 8 Aug 2016 09:45:04 -0700 (PDT)
[email protected] wrote:

<Trimmed the no-reply@ -- I wonder whether reply-to should be setup to something sensible, e.g. qemu-devel>

Quoted 4 lines

Checking PATCH 4/29: s390x/cpumodel: introduce CPU features...
WARNING: line over 80 characters
#65: FILE: target-s390x/cpu_features.c:27:
+ FEAT_INIT("zarch", S390_FEAT_TYPE_STFL, 1, "z/Architecture architectural mode"),

Quoted 5 lines

We could conceivably break the line after one of the arguments, but there are some very long strings below. I'm not a fan of very long lines myself, but I wonder whether we should relax that limit? The Linux kernel has settled upon a relaxed limit and forbids splitting strings for greppability.

I kept these > 80 as these definitions look much cleaner this way.

Quoted 31 lines
Quoted 20 lines

Checking PATCH 5/29: s390x/cpumodel: generate CPU feature lists for CPU models...
ERROR: Macros with complex values should be enclosed in parenthesis #113: FILE: target-s390x/gen-features.c:20:

(quoted diff) +15 -0
+#define S390_FEAT_GROUP_PLO \
+    S390_FEAT_PLO_CL, \
+    S390_FEAT_PLO_CLG, \
+    S390_FEAT_PLO_CLGR, \
+    S390_FEAT_PLO_CLX, \
+    S390_FEAT_PLO_CS, \
+    S390_FEAT_PLO_CSG, \
+    S390_FEAT_PLO_CSGR, \
+    S390_FEAT_PLO_CSX, \
+    S390_FEAT_PLO_DCS, \
+    S390_FEAT_PLO_DCSG, \
+    S390_FEAT_PLO_DCSGR, \
+    S390_FEAT_PLO_DCSX, \
+    S390_FEAT_PLO_CSST, \
+    S390_FEAT_PLO_CSSTG, \

Review

Quoted 10 lines
(quoted diff) +10 -0
+    S390_FEAT_PLO_CSSTGR, \
+    S390_FEAT_PLO_CSSTX, \
+    S390_FEAT_PLO_CSDST, \
+    S390_FEAT_PLO_CSDSTG, \
+    S390_FEAT_PLO_CSDSTGR, \
+    S390_FEAT_PLO_CSDSTX, \
+    S390_FEAT_PLO_CSTST, \
+    S390_FEAT_PLO_CSTSTG, \
+    S390_FEAT_PLO_CSTSTGR, \
+    S390_FEAT_PLO_CSTSTX  
Quoted 1 line

I think the check is wrong to complain here.

Yes, these complaints are wrong.

Quoted 8 lines
Quoted 6 lines

Checking PATCH 6/29: s390x/cpumodel: generate CPU feature group lists... Checking PATCH 7/29: s390x/cpumodel: introduce CPU feature group definitions...
WARNING: line over 80 characters
#71: FILE: target-s390x/cpu_features.c:363:
+ FEAT_GROUP_INIT("gen13ptff", GEN13_PTFF, "PTFF enhancements introduced with z13"),

Same comments as above.

Dito, the list of features just looks cleaner.

[...]

Quoted 5 lines
Quoted 5 lines

Checking PATCH 27/29: s390x/cpumodel: implement QMP interface "query-cpu-model-expansion"...
WARNING: line over 80 characters
#152: FILE: target-s390x/cpu_models.c:408:
+ s390_feat_bitmap_to_ascii(model->features, qdict, qdict_add_enabled_feat);

I'll fix that

Quoted 10 lines
Quoted 8 lines

WARNING: line over 80 characters
#165: FILE: target-s390x/cpu_models.c:421:
+CpuModelExpansionInfo *arch_query_cpu_model_expansion(CpuModelExpansionType type,

ERROR: space prohibited before that close parenthesis ')' #181: FILE: target-s390x/cpu_models.c:437:
+ } else if (type != CPU_MODEL_EXPANSION_TYPE_FULL ) {

That's actually a warning I concur with :)

And this of course :)

Quoted 4 lines

I think we should at least come up with a check for a linux header update to avoid spamming the mailing list. And it would be a good idea to have some consensus about the 80 char limit as well.

For the definitions and the lengthy function prototypes I really don't want to break readability just to conform to 80 chars.

Thanks.

David

A message that is not in the archive (sent off-list or not yet received): 201608081645.u78GjISN026387@int-mx10.intmail.prod.int.phx2.redhat.com

#37 lore raw
Quoted 4 lines · On Mon, Aug 08, 2016 at 09:45:04AM -0700…

Hi,

Your series seems to have some coding style problems. See output below for more information:

[...]

Does anybody know who owns this robot?

Signature · 1 line
Eduardo
#38 lore raw
Quoted 8 lines · Eduardo Habkost
Quoted 4 lines · On Mon, Aug 08, 2016 at 09:45:04AM -0700…

Hi,

Your series seems to have some coding style problems. See output below for more information:

[...]

Does anybody know who owns this robot?

Fam does.

#40 lore raw
Quoted 6 lines · David Hildenbrand

I'll wait a bit until sending out another series that fixes two minor style problems.

What about > 80 chars per line. Is it okay for these definitions + function prototype or a no-go?

As long as we are < 90 I think its better than wrapping.

#41 lore raw
Quoted 10 lines · On Mon, 15 Aug 2016 16:03:04 +0200 Christian Borntraeger…
Quoted 6 lines · David Hildenbrand

I'll wait a bit until sending out another series that fixes two minor style problems.

What about > 80 chars per line. Is it okay for these definitions + function prototype or a no-go?

As long as we are < 90 I think its better than wrapping.

Agreed.

I think it's even ok to go over 90 if the alternative is breaking up strings - which is extremely annoying for grepping.