]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
Merge remote-tracking branch 'remotes/armbru/tags/pull-misc-2019-06-11-v3' into staging
authorPeter Maydell <peter.maydell@linaro.org>
Wed, 12 Jun 2019 12:50:01 +0000 (13:50 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Wed, 12 Jun 2019 12:50:02 +0000 (13:50 +0100)
Miscellaneous patches for 2019-06-11

# gpg: Signature made Wed 12 Jun 2019 12:20:41 BST
# gpg:                using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653
# gpg:                issuer "armbru@redhat.com"
# gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [full]
# gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>" [full]
# Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653

* remotes/armbru/tags/pull-misc-2019-06-11-v3:
  MAINTAINERS: Polish headline decorations
  MAINTAINERS: Improve section headlines
  MAINTAINERS: Remove duplicate entries of qemu-devel@nongnu.org
  Clean up a header guard symbols (again)
  Supply missing header guards
  Clean up a few header guard symbols
  scripts/clean-header-guards: Fix handling of trailing comments
  Normalize position of header guard
  Include qemu-common.h exactly where needed
  Include qemu/module.h where needed, drop it from qemu-common.h
  qemu-common: Move qemu_isalnum() etc. to qemu/ctype.h
  qemu-common: Move tcg_enabled() etc. to sysemu/tcg.h

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
1  2 
target/i386/cpu.c
target/i386/machine.c

diff --combined target/i386/cpu.c
index 7e5b545005885c02b1a9d5c9a13b3c53fdf877eb,a108b65d9fed14a740d3efb7e2f938fed84a8597..fbed2eb804e320bd1afa491917222e9aaaaf66b7
@@@ -32,6 -32,7 +32,7 @@@
  #include "sev_i386.h"
  
  #include "qemu/error-report.h"
+ #include "qemu/module.h"
  #include "qemu/option.h"
  #include "qemu/config-file.h"
  #include "qapi/error.h"
@@@ -47,6 -48,7 +48,7 @@@
  #include "standard-headers/asm-x86/kvm_para.h"
  
  #include "sysemu/sysemu.h"
+ #include "sysemu/tcg.h"
  #include "hw/qdev-properties.h"
  #include "hw/i386/topology.h"
  #ifndef CONFIG_USER_ONLY
@@@ -3671,38 -3673,6 +3673,38 @@@ static void x86_cpu_parse_featurestr(co
  static void x86_cpu_expand_features(X86CPU *cpu, Error **errp);
  static int x86_cpu_filter_features(X86CPU *cpu);
  
 +/* Build a list with the name of all features on a feature word array */
 +static void x86_cpu_list_feature_names(FeatureWordArray features,
 +                                       strList **feat_names)
 +{
 +    FeatureWord w;
 +    strList **next = feat_names;
 +
 +    for (w = 0; w < FEATURE_WORDS; w++) {
 +        uint32_t filtered = features[w];
 +        int i;
 +        for (i = 0; i < 32; i++) {
 +            if (filtered & (1UL << i)) {
 +                strList *new = g_new0(strList, 1);
 +                new->value = g_strdup(x86_cpu_feature_name(w, i));
 +                *next = new;
 +                next = &new->next;
 +            }
 +        }
 +    }
 +}
 +
 +static void x86_cpu_get_unavailable_features(Object *obj, Visitor *v,
 +                                             const char *name, void *opaque,
 +                                             Error **errp)
 +{
 +    X86CPU *xc = X86_CPU(obj);
 +    strList *result = NULL;
 +
 +    x86_cpu_list_feature_names(xc->filtered_features, &result);
 +    visit_type_strList(v, "unavailable-features", &result, errp);
 +}
 +
  /* Check for missing features that may prevent the CPU class from
   * running using the current machine and accelerator.
   */
@@@ -3710,6 -3680,7 +3712,6 @@@ static void x86_cpu_class_check_missing
                                                   strList **missing_feats)
  {
      X86CPU *xc;
 -    FeatureWord w;
      Error *err = NULL;
      strList **next = missing_feats;
  
  
      x86_cpu_filter_features(xc);
  
 -    for (w = 0; w < FEATURE_WORDS; w++) {
 -        uint32_t filtered = xc->filtered_features[w];
 -        int i;
 -        for (i = 0; i < 32; i++) {
 -            if (filtered & (1UL << i)) {
 -                strList *new = g_new0(strList, 1);
 -                new->value = g_strdup(x86_cpu_feature_name(w, i));
 -                *next = new;
 -                next = &new->next;
 -            }
 -        }
 -    }
 +    x86_cpu_list_feature_names(xc->filtered_features, next);
  
      object_unref(OBJECT(xc));
  }
@@@ -5643,15 -5625,6 +5645,15 @@@ static void x86_cpu_initfn(Object *obj
      object_property_add(obj, "filtered-features", "X86CPUFeatureWordInfo",
                          x86_cpu_get_feature_words,
                          NULL, NULL, (void *)cpu->filtered_features, NULL);
 +    /*
 +     * The "unavailable-features" property has the same semantics as
 +     * CpuDefinitionInfo.unavailable-features on the "query-cpu-definitions"
 +     * QMP command: they list the features that would have prevented the
 +     * CPU from running if the "enforce" flag was set.
 +     */
 +    object_property_add(obj, "unavailable-features", "strList",
 +                        x86_cpu_get_unavailable_features,
 +                        NULL, NULL, NULL, &error_abort);
  
      object_property_add(obj, "crash-information", "GuestPanicInformation",
                          x86_cpu_get_crash_info_qom, NULL, NULL, NULL, NULL);
diff --combined target/i386/machine.c
index 2c96cfc9a2bec162253617e62b083ca6612cf3b4,1150967b9739ffe97ad26d00eff3f8cc4b3682fe..4aff1a763f9d892c5214a6fe315781495e435944
@@@ -1,5 -1,4 +1,4 @@@
  #include "qemu/osdep.h"
- #include "qemu-common.h"
  #include "cpu.h"
  #include "exec/exec-all.h"
  #include "hw/hw.h"
@@@ -10,6 -9,7 +9,7 @@@
  #include "hyperv.h"
  
  #include "sysemu/kvm.h"
+ #include "sysemu/tcg.h"
  
  #include "qemu/error-report.h"
  
@@@ -964,27 -964,6 +964,27 @@@ static const VMStateDescription vmstate
      }
  };
  
 +#ifndef TARGET_X86_64
 +static bool intel_efer32_needed(void *opaque)
 +{
 +    X86CPU *cpu = opaque;
 +    CPUX86State *env = &cpu->env;
 +
 +    return env->efer != 0;
 +}
 +
 +static const VMStateDescription vmstate_efer32 = {
 +    .name = "cpu/efer32",
 +    .version_id = 1,
 +    .minimum_version_id = 1,
 +    .needed = intel_efer32_needed,
 +    .fields = (VMStateField[]) {
 +        VMSTATE_UINT64(env.efer, X86CPU),
 +        VMSTATE_END_OF_LIST()
 +    }
 +};
 +#endif
 +
  VMStateDescription vmstate_x86_cpu = {
      .name = "cpu",
      .version_id = 12,
          &vmstate_msr_intel_pt,
          &vmstate_msr_virt_ssbd,
          &vmstate_svm_npt,
 +#ifndef TARGET_X86_64
 +        &vmstate_efer32,
 +#endif
          NULL
      }
  };