1. 18 2月, 2019 4 次提交
  2. 12 10月, 2018 1 次提交
    • T
      s390x/cpumodel: Set up CPU model for AP device support · c5cd17af
      Tony Krowiak 提交于
      A new CPU model feature and two new CPU model facilities are
      introduced to support AP devices for a KVM guest.
      
      CPU model features:
      
      1. The S390_FEAT_AP CPU model feature indicates whether AP
         instructions are available to the guest. This feature will
         be enabled only if the AP instructions are available on the
         linux host as determined by the availability of the
         KVM_S390_VM_CRYPTO_ENABLE_APIE VM attribute which is exposed
         by KVM only if the AP instructions are available on the
         host.
      
         This feature must be turned on from userspace to execute AP
         instructions on the KVM guest. The QEMU command line to turn
         this feature on looks something like this:
      
      	qemu-system-s390x ... -cpu xxx,ap=on ...
      
         This feature will be supported for zEC12 and newer CPU models.
         The feature will not be supported for older models because
         there are few older systems on which to test and the older
         crypto cards will be going out of service in the relatively
         near future.
      
      CPU model facilities:
      
      1. The S390_FEAT_AP_QUERY_CONFIG_INFO feature indicates whether the
         AP Query Configuration Information (QCI) facility is available
         to the guest as determined by whether the facility is available
         on the host. This feature will be exposed by KVM only if the
         QCI facility is installed on the host.
      
      2. The S390_FEAT_AP_FACILITY_TEST feature indicates whether the AP
         Facility Test (APFT) facility is available to the guest as
         determined by whether the facility is available on the host.
         This feature will be exposed by KVM only if APFT is installed
         on the host.
      Signed-off-by: NTony Krowiak <akrowiak@linux.ibm.com>
      Tested-by: NPierre Morel <pmorel@linux.ibm.com>
      Reviewed-by: NDavid Hildenbrand <david@redhat.com>
      Reviewed-by: NHalil Pasic <pasic@linux.ibm.com>
      Reviewed-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Tested-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Message-Id: <20181010170309.12045-3-akrowiak@linux.ibm.com>
      Signed-off-by: NCornelia Huck <cohuck@redhat.com>
      c5cd17af
  3. 24 8月, 2018 1 次提交
    • E
      qom: convert the CPU list to RCU · 068a5ea0
      Emilio G. Cota 提交于
      Iterating over the list without using atomics is undefined behaviour,
      since the list can be modified concurrently by other threads (e.g.
      every time a new thread is created in user-mode).
      
      Fix it by implementing the CPU list as an RCU QTAILQ. This requires
      a little bit of extra work to traverse list in reverse order (see
      previous patch), but other than that the conversion is trivial.
      Signed-off-by: NEmilio G. Cota <cota@braap.org>
      Message-Id: <20180819091335.22863-12-cota@braap.org>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      068a5ea0
  4. 20 8月, 2018 1 次提交
    • D
      s390x/cpumodel: Add "-cpu max" support · c6117788
      David Hildenbrand 提交于
      The "max" CPU model behaves like "-cpu host" when KVM is enabled, and like
      a CPU with the maximum possible feature set when TCG is enabled.
      
      While the "host" model can not be used under TCG ("kvm_required"), the
      "max" model can and "Enables all features supported by the accelerator in
      the current host".
      
      So we can treat "host" just as a special case of "max" (like x86 does).
      It differs to the "qemu" CPU model under TCG such that compatibility
      handling will not be performed and that some experimental CPU features
      not yet part of the "qemu" model might be indicated.
      
      These are right now under TCG (see "qemu_MAX"):
      - stfle53
      - msa5-base
      - zpci
      
      This will result right now in the following warning when starting QEMU TCG
      with the "max" model:
          "qemu-system-s390x: warning: 'msa5-base' requires 'kimd-sha-512'."
      
      The "qemu" model (used as default in QEMU under TCG) will continue to
      work without such warnings. The "max" model in the current form
      might be interesting for kvm-unit-tests (where we would e.g. now also
      test "msa5-base").
      
      The "max" model is neither static nor migration safe (like the "host"
      model). It is independent of the machine but dependends on the accelerator.
      It can be used to detect the maximum CPU model also under TCG from upper
      layers without having to care about CPU model names for CPU model
      expansion.
      Signed-off-by: NDavid Hildenbrand <david@redhat.com>
      Message-Id: <20180725091233.3300-1-david@redhat.com>
      Reviewed-by: NEduardo Habkost <ehabkost@redhat.com>
      [CH: minor wording changes]
      Signed-off-by: NCornelia Huck <cohuck@redhat.com>
      c6117788
  5. 18 7月, 2018 1 次提交
    • D
      s390x/cpumodel: fix segmentation fault when baselining models · 677ff32d
      David Hildenbrand 提交于
      Usually, when baselining two CPU models, whereby one of them has base
      CPU features disabled (e.g. z14-base,msa=off), we fallback to an older
      model that did not have these features in the base model. We always try to
      create a "sane" CPU model (as far as possible), and one part of it is that
      removing base features is no good and to be avoided.
      
      Now, if we disable base features that were part of a z900, we're out of
      luck. We won't find a CPU model and QEMU will segfault. This is a
      scenario that should never happen in real life, but it can be used to
      crash QEMU.
      
      So let's properly report an error if we baseline e.g.:
      
      { "execute": "query-cpu-model-baseline",
        "arguments" : { "modela": { "name": "z14-base", "props": {"esan3" : false}},
                        "modelb": { "name": "z14"}} }
      
      Instead of segfaulting.
      Signed-off-by: NDavid Hildenbrand <david@redhat.com>
      Message-Id: <20180718092330.19465-1-david@redhat.com>
      Acked-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Signed-off-by: NCornelia Huck <cohuck@redhat.com>
      677ff32d
  6. 18 6月, 2018 1 次提交
  7. 04 5月, 2018 1 次提交
  8. 20 3月, 2018 1 次提交
    • M
      qapi: Replace qobject_to_X(o) by qobject_to(X, o) · 7dc847eb
      Max Reitz 提交于
      This patch was generated using the following Coccinelle script:
      
      @@
      expression Obj;
      @@
      (
      - qobject_to_qnum(Obj)
      + qobject_to(QNum, Obj)
      |
      - qobject_to_qstring(Obj)
      + qobject_to(QString, Obj)
      |
      - qobject_to_qdict(Obj)
      + qobject_to(QDict, Obj)
      |
      - qobject_to_qlist(Obj)
      + qobject_to(QList, Obj)
      |
      - qobject_to_qbool(Obj)
      + qobject_to(QBool, Obj)
      )
      
      and a bit of manual fix-up for overly long lines and three places in
      tests/check-qjson.c that Coccinelle did not find.
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NAlberto Garcia <berto@igalia.com>
      Message-Id: <20180224154033.29559-4-mreitz@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      [eblake: swap order from qobject_to(o, X), rebase to master, also a fix
      to latent false-positive compiler complaint about hw/i386/acpi-build.c]
      Signed-off-by: NEric Blake <eblake@redhat.com>
      7dc847eb
  9. 09 2月, 2018 3 次提交
  10. 15 12月, 2017 4 次提交
  11. 30 10月, 2017 1 次提交
  12. 20 10月, 2017 2 次提交
  13. 06 10月, 2017 3 次提交
  14. 20 9月, 2017 3 次提交
    • C
      s390x/ccw: create s390 phb for compat reasons as well · 8ad9087c
      Cornelia Huck 提交于
      d32bd032 ("s390x/ccw: create s390 phb conditionally") made
      registering the s390 pci host bridge conditional on presense
      of the zpci facility bit. Sadly, that breaks migration from
      machines that did not use the cpu model (2.7 and previous).
      
      Create the s390 phb for pre-cpu model machines as well: We can
      tweak s390_has_feat() to always indicate the zpci facility bit
      when no cpu model is available (on 2.7 and previous compat machines).
      
      Fixes: d32bd032 ("s390x/ccw: create s390 phb conditionally")
      Acked-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Signed-off-by: NCornelia Huck <cohuck@redhat.com>
      8ad9087c
    • D
      s390x: print CPU definitions in sorted order · 99aa6bf2
      David Hildenbrand 提交于
      Other architectures provide nicely sorted lists, let's do it similarly on
      s390x.
      
      While at it, clean up the code we have to touch either way.
      Acked-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Signed-off-by: NDavid Hildenbrand <david@redhat.com>
      Message-Id: <20170913132417.24384-16-david@redhat.com>
      Signed-off-by: NCornelia Huck <cohuck@redhat.com>
      99aa6bf2
    • D
      target/s390x: use "core-id" for cpu number/address/id handling · ca5c1457
      David Hildenbrand 提交于
      Some time ago we discussed that using "id" as property name is not the
      right thing to do, as it is a reserved property for other devices and
      will not work with device_add.
      
      Switch to the term "core-id" instead, and use it as an equivalent to
      "CPU address" mentioned in the PoP. There is no such thing as cpu number,
      so rename env.cpu_num to env.core_id. We use "core-id" as this is the
      common term to use for device_add later on (x86 and ppc).
      
      We can get rid of cpu->id now. Keep cpu_index and env->core_id in sync.
      cpu_index was already implicitly used by e.g. cpu_exists(), so keeping
      both in sync seems to be the right thing to do.
      
      cpu_index will now no longer automatically get set via
      cpu_exec_realizefn(). For now, we were lucky that both implicitly stayed
      in sync.
      
      Our new cpu property "core-id" can be a static property. Range checks can
      be avoided by using the correct type and the "setting after realized"
      check is done implicitly.
      
      device_add will later need the reserved "id" property. Hotplugging a CPU
      on s390x will then be: "device_add host-s390-cpu,id=cpu2,core-id=2".
      Reviewed-by: NMatthew Rosato <mjrosato@linux.vnet.ibm.com>
      Signed-off-by: NDavid Hildenbrand <david@redhat.com>
      Message-Id: <20170913132417.24384-14-david@redhat.com>
      Signed-off-by: NCornelia Huck <cohuck@redhat.com>
      ca5c1457
  15. 31 8月, 2017 3 次提交
  16. 25 7月, 2017 2 次提交
  17. 18 7月, 2017 4 次提交
  18. 14 7月, 2017 2 次提交
  19. 13 7月, 2017 1 次提交
    • A
      Convert error_report() to warn_report() · 3dc6f869
      Alistair Francis 提交于
      Convert all uses of error_report("warning:"... to use warn_report()
      instead. This helps standardise on a single method of printing warnings
      to the user.
      
      All of the warnings were changed using these two commands:
          find ./* -type f -exec sed -i \
            's|error_report(".*warning[,:] |warn_report("|Ig' {} +
      
      Indentation fixed up manually afterwards.
      
      The test-qdev-global-props test case was manually updated to ensure that
      this patch passes make check (as the test cases are case sensitive).
      Signed-off-by: NAlistair Francis <alistair.francis@xilinx.com>
      Suggested-by: NThomas Huth <thuth@redhat.com>
      Cc: Jeff Cody <jcody@redhat.com>
      Cc: Kevin Wolf <kwolf@redhat.com>
      Cc: Max Reitz <mreitz@redhat.com>
      Cc: Ronnie Sahlberg <ronniesahlberg@gmail.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Peter Lieven <pl@kamp.de>
      Cc: Josh Durgin <jdurgin@redhat.com>
      Cc: "Richard W.M. Jones" <rjones@redhat.com>
      Cc: Markus Armbruster <armbru@redhat.com>
      Cc: Peter Crosthwaite <crosthwaite.peter@gmail.com>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
      Cc: Greg Kurz <groug@kaod.org>
      Cc: Rob Herring <robh@kernel.org>
      Cc: Peter Maydell <peter.maydell@linaro.org>
      Cc: Peter Chubb <peter.chubb@nicta.com.au>
      Cc: Eduardo Habkost <ehabkost@redhat.com>
      Cc: Marcel Apfelbaum <marcel@redhat.com>
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Cc: Igor Mammedov <imammedo@redhat.com>
      Cc: David Gibson <david@gibson.dropbear.id.au>
      Cc: Alexander Graf <agraf@suse.de>
      Cc: Gerd Hoffmann <kraxel@redhat.com>
      Cc: Jason Wang <jasowang@redhat.com>
      Cc: Marcelo Tosatti <mtosatti@redhat.com>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Cornelia Huck <cohuck@redhat.com>
      Cc: Stefan Hajnoczi <stefanha@redhat.com>
      Acked-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Acked-by: NGreg Kurz <groug@kaod.org>
      Acked-by: NCornelia Huck <cohuck@redhat.com>
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Reviewed by: Peter Chubb <peter.chubb@data61.csiro.au>
      Acked-by: NMax Reitz <mreitz@redhat.com>
      Acked-by: NMarcel Apfelbaum <marcel@redhat.com>
      Message-Id: <e1cfa2cd47087c248dd24caca9c33d9af0c499b0.1499866456.git.alistair.francis@xilinx.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      3dc6f869
  20. 06 7月, 2017 1 次提交
    • V
      s390x: return unavailable features via query-cpu-definitions · 38cba1f4
      Viktor Mihajlovski 提交于
      The response for query-cpu-definitions didn't include the
      unavailable-features field, which is used by libvirt to figure
      out whether a certain cpu model is usable on the host.
      
      The unavailable features are now computed by obtaining the host CPU
      model and comparing it against the known CPU models. The comparison
      takes into account the generation, the GA level and the feature
      bitmaps. In the case of a CPU generation/GA level mismatch
      a feature called "type" is reported to be missing.
      
      As a result, the output of virsh domcapabilities would change
      from something like
       ...
           <mode name='custom' supported='yes'>
            <model usable='unknown'>z10EC-base</model>
            <model usable='unknown'>z9EC-base</model>
            <model usable='unknown'>z196.2-base</model>
            <model usable='unknown'>z900-base</model>
            <model usable='unknown'>z990</model>
       ...
      to
       ...
           <mode name='custom' supported='yes'>
            <model usable='yes'>z10EC-base</model>
            <model usable='yes'>z9EC-base</model>
            <model usable='no'>z196.2-base</model>
            <model usable='yes'>z900-base</model>
            <model usable='yes'>z990</model>
       ...
      Signed-off-by: NViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
      Message-Id: <1499082529-16970-1-git-send-email-mihajlov@linux.vnet.ibm.com>
      Reviewed-by: NDavid Hildenbrand <david@redhat.com>
      Acked-by: NCornelia Huck <cohuck@redhat.com>
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      38cba1f4