1. 14 5月, 2018 1 次提交
    • D
      s390x: refactor reset/reipl handling · a30fb811
      David Hildenbrand 提交于
      Calling pause_all_vcpus()/resume_all_vcpus() from a VCPU thread might
      not be the best idea. As pause_all_vcpus() temporarily drops the qemu
      mutex, two parallel calls to pause_all_vcpus() can be active at a time,
      resulting in a deadlock. (either by two VCPUs or by the main thread and a
      VCPU)
      
      Let's handle it via the main loop instead, as suggested by Paolo. If we
      would have two parallel reset requests by two different VCPUs at the
      same time, the last one would win.
      
      We use the existing ipl device to handle it. The nice side effect is
      that we can get rid of reipl_requested.
      
      This change implies that all reset handling now goes via the common
      path, so "no-reboot" handling is now active for all kinds of reboots.
      
      Let's execute any CPU initialization code on the target CPU using
      run_on_cpu.
      Signed-off-by: NDavid Hildenbrand <david@redhat.com>
      Message-Id: <20180424101859.10239-1-david@redhat.com>
      Acked-by: NThomas Huth <thuth@redhat.com>
      Signed-off-by: NCornelia Huck <cohuck@redhat.com>
      a30fb811
  2. 10 5月, 2018 4 次提交
  3. 04 5月, 2018 1 次提交
  4. 30 4月, 2018 1 次提交
  5. 09 4月, 2018 3 次提交
  6. 23 3月, 2018 1 次提交
  7. 20 3月, 2018 3 次提交
  8. 08 3月, 2018 1 次提交
  9. 03 3月, 2018 2 次提交
    • M
      qapi: Empty out qapi-schema.json · 112ed241
      Markus Armbruster 提交于
      The previous commit improved compile time by including less of the
      generated QAPI headers.  This is impossible for stuff defined directly
      in qapi-schema.json, because that ends up in headers that that pull in
      everything.
      
      Move everything but include directives from qapi-schema.json to new
      sub-module qapi/misc.json, then include just the "misc" shard where
      possible.
      
      It's possible everywhere, except:
      
      * monitor.c needs qmp-command.h to get qmp_init_marshal()
      
      * monitor.c, ui/vnc.c and the generated qapi-event-FOO.c need
        qapi-event.h to get enum QAPIEvent
      
      Perhaps we'll get rid of those some other day.
      
      Adding a type to qapi/migration.json now recompiles some 120 instead
      of 2300 out of 5100 objects.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20180211093607.27351-25-armbru@redhat.com>
      [eblake: rebase to master]
      Signed-off-by: NEric Blake <eblake@redhat.com>
      112ed241
    • M
      Include less of the generated modular QAPI headers · 9af23989
      Markus Armbruster 提交于
      In my "build everything" tree, a change to the types in
      qapi-schema.json triggers a recompile of about 4800 out of 5100
      objects.
      
      The previous commit split up qmp-commands.h, qmp-event.h, qmp-visit.h,
      qapi-types.h.  Each of these headers still includes all its shards.
      Reduce compile time by including just the shards we actually need.
      
      To illustrate the benefits: adding a type to qapi/migration.json now
      recompiles some 2300 instead of 4800 objects.  The next commit will
      improve it further.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20180211093607.27351-24-armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      [eblake: rebase to master]
      Signed-off-by: NEric Blake <eblake@redhat.com>
      9af23989
  10. 01 3月, 2018 1 次提交
    • D
      s390x/tcg: fix loading 31bit PSWs with the highest bit set · be8b49de
      David Hildenbrand 提交于
      Let's also put the 31-bit hack in front of the REAL MMU, otherwise right
      now we get errors when loading a PSW where the highest bit is set (e.g.
      via s390-netboot.img). The highest bit is not masked away, therefore we
      inject addressing exceptions into the guest.
      
      The proper fix will later be to do all address wrapping before accessing
      the MMU - so we won't get any "wrong" entries in there (which makes
      flushing also easier). But that will require more work (wrapping in
      load_psw, wrapping when incrementing the PC, wrapping every memory
      access).
      
      This fixes the tests/pxe-test test.
      Signed-off-by: NDavid Hildenbrand <david@redhat.com>
      Message-Id: <20180301120826.6847-1-david@redhat.com>
      Signed-off-by: NCornelia Huck <cohuck@redhat.com>
      be8b49de
  11. 26 2月, 2018 7 次提交
    • C
      s390x: remove s390_get_memslot_count · 3e65a3c2
      Cornelia Huck 提交于
      Not needed anymore after removal of the memory hotplug code.
      Acked-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Reviewed-by: NDavid Hildenbrand <david@redhat.com>
      Signed-off-by: NCornelia Huck <cohuck@redhat.com>
      3e65a3c2
    • D
      s390x/sclp: remove memory hotplug support · 82fab5c5
      David Hildenbrand 提交于
      From an architecture point of view, nothing can be mapped into the address
      space on s390x. All there is is memory. Therefore there is also not really
      an interface to communicate such information to the guest. All we can do is
      specify the maximum ram address and guests can probe in that range if
      memory is available and usable (TPROT).
      
      Also memory hotplug is strange. The guest can decide at some point in
      time to add / remove memory in some range. While the hypervisor can deny
      to online an increment, all increments have to be predefined and there is
      no way of telling the guest about a newly "hotplugged" increment. So if we
      specify right now e.g.
          -m 2G,slots=2,maxmem=20G
      An ordinary fedora guest will happily online (hotplug) all memory,
      resulting in a guest consuming 20G. So it really behaves rather like
          -m 22G
      There is no way to hotplug memory from the outside like on other
      architectures. This is of course bad for upper management layers.
      
      As the guest can create/delete memory regions while it is running, of
      course migration support is not available and tricky to implement.
      
      With virtualization, it is different. We might want to map something
      into guest address space (e.g. fake DAX devices) and not detect it
      automatically as memory. So we really want to use the maxmem and slots
      parameter just like on all other architectures. Such devices will have
      to expose the applicable memory range themselves. To finally be able to
      provide memory hotplug to guests, we will need a new paravirtualized
      interface to do that (e.g. something into the direction of virtio-mem).
      
      This implies, that maxmem cannot be used for s390x memory hotplug
      anymore and has to go. This simplifies the code quite a bit.
      
      As migration support is not working, this change cannot really break
      migration as guests without slots and maxmem don't see the SCLP
      features. Also, the ram size calculation does not change.
      Signed-off-by: NDavid Hildenbrand <david@redhat.com>
      Message-Id: <20180219174231.10874-1-david@redhat.com>
      Reviewed-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Acked-by: NMatthew Rosato <mjrosato@linux.vnet.ibm.com>
      [CH: tweaked patch description, as discussed on list]
      Signed-off-by: NCornelia Huck <cohuck@redhat.com>
      82fab5c5
    • H
      s390x/cpumodel: document S390FeatDef.bit not applicable · a5a2b80d
      Halil Pasic 提交于
      The 'bit' field of the 'S390FeatDef' structure is not applicable to all
      its instances. Currently this field is not applicable, and remains
      unused, iff the feature is of type S390_FEAT_TYPE_MISC. Having the value 0
      specified for multiple such feature definitions was a little confusing,
      as it's a perfectly legit bit value, and as the value of the bit
      field is usually ought to be unique for each feature of a given
      feature type.
      
      Let us introduce a specialized macro for defining features of type
      S390_FEAT_TYPE_MISC so, that one does not have to specify neither bit nor
      type (as the latter is implied).
      Signed-off-by: NHalil Pasic <pasic@linux.vnet.ibm.com>
      Message-Id: <20180221165628.78946-1-pasic@linux.vnet.ibm.com>
      Reviewed-by: NDavid Hildenbrand <david@redhat.com>
      Acked-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Signed-off-by: NCornelia Huck <cohuck@redhat.com>
      a5a2b80d
    • V
      qmp: expose s390-specific CPU info · 9d0306df
      Viktor Mihajlovski 提交于
      Presently s390x is the only architecture not exposing specific
      CPU information via QMP query-cpus. Upstream discussion has shown
      that it could make sense to report the architecture specific CPU
      state, e.g. to detect that a CPU has been stopped.
      
      With this change the output of query-cpus will look like this on
      s390:
      
         [
           {"arch": "s390", "current": true,
            "props": {"core-id": 0}, "cpu-state": "operating", "CPU": 0,
            "qom_path": "/machine/unattached/device[0]",
            "halted": false, "thread_id": 63115},
           {"arch": "s390", "current": false,
            "props": {"core-id": 1}, "cpu-state": "stopped", "CPU": 1,
            "qom_path": "/machine/unattached/device[1]",
            "halted": true, "thread_id": 63116}
         ]
      
      This change doesn't add the s390-specific data to HMP 'info cpus'.
      A follow-on patch will remove all architecture specific information
      from there.
      Signed-off-by: NViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
      Reviewed-by: NDavid Hildenbrand <david@redhat.com>
      Reviewed-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1518797321-28356-2-git-send-email-mihajlov@linux.vnet.ibm.com>
      Reviewed-by: NCornelia Huck <cohuck@redhat.com>
      Signed-off-by: NCornelia Huck <cohuck@redhat.com>
      9d0306df
    • D
      s390x/tcg: add various alignment checks · 21fc97c5
      David Hildenbrand 提交于
      Let's add proper alignment checks for a handful of instructions that
      require a SPECIFICATION exception in case alignment is violated.
      
      Introduce new wout/in functions. As we are right now only using them for
      privileged instructions, we have to add ugly ifdefs to silence
      compilers.
      
      Convert STORE CPU ID right away to make use of the wout function.
      Signed-off-by: NDavid Hildenbrand <david@redhat.com>
      Message-Id: <20180215103822.15179-1-david@redhat.com>
      Reviewed-by: NRichard Henderson <richard.henderson@linaro.org>
      Signed-off-by: NCornelia Huck <cohuck@redhat.com>
      21fc97c5
    • D
      s390x/tcg: fix disabling/enabling DAT · f26852aa
      David Hildenbrand 提交于
      Currently, all memory accesses go via the MMU of the address space
      (primary, secondary, ...). This is bad, because we don't flush the TLB
      when disabling/enabling DAT. So we could add a tlb flush. However it
      is easier to simply select the MMU we already have in place for real
      memory access.
      
      All we have to do is point at the right MMU and allow to execute these
      pages.
      Signed-off-by: NDavid Hildenbrand <david@redhat.com>
      Message-Id: <20180213161240.19891-1-david@redhat.com>
      Reviewed-by: NRichard Henderson <richard.henderson@linaro.org>
      [CH: get rid of tabs]
      Signed-off-by: NCornelia Huck <cohuck@redhat.com>
      f26852aa
    • C
      s390x/cpu: expose the guest crash information · 4ada99ad
      Christian Borntraeger 提交于
      This patch is the s390 implementation of guest crash information,
      similar to commit d187e08d ("i386/cpu: add crash-information QOM
      property") and the related commits. We will detect several crash
      reasons, with the "disabled wait" being the most important one, since
      this is used by all s390 guests as a "panic like" notification.
      
      Demonstrate these ways with examples as follows.
      
        1. crash-information QOM property;
      
        Run qemu with -qmp unix:qmp-sock,server, then use utility "qmp-shell"
        to execute "qom-get" command, and might get the result like,
      
        (QEMU) (QEMU) qom-get path=/machine/unattached/device[0] \
            property=crash-information
        {"return": {"core": 0, "reason": "disabled-wait", "psw-mask": 562956395872256, \
            "type": "s390", "psw-addr": 1102832}}
      
        2. GUEST_PANICKED event reporting;
      
        Run qemu with a socket option, and telnet or nc to that,
        -chardev socket,id=qmp,port=4444,host=localhost,server \
        -mon chardev=qmp,mode=control,pretty=on \
        Negotiating the mode by { "execute": "qmp_capabilities" }, and the crash
        information will be reported on a guest crash event like,
      
        {
          "timestamp": {
              "seconds": 1518004739,
              "microseconds": 552563
          },
          "event": "GUEST_PANICKED",
          "data": {
              "action": "pause",
              "info": {
                  "core": 0,
                  "psw-addr": 1102832,
                  "reason": "disabled-wait",
                  "psw-mask": 562956395872256,
                  "type": "s390"
              }
          }
        }
      
        3. log;
      
        Run qemu with the parameters: -D <logfile> -d guest_errors, to
        specify the logfile and log item. The results might be,
      
        Guest crashed on cpu 0: disabled-wait
        PSW: 0x0002000180000000 0x000000000010d3f0
      Co-authored-by: NJing Liu <liujbjl@linux.vnet.ibm.com>
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Message-Id: <20180209122543.25755-1-borntraeger@de.ibm.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      [CH: tweaked qapi comment]
      Signed-off-by: NCornelia Huck <cohuck@redhat.com>
      4ada99ad
  12. 21 2月, 2018 1 次提交
  13. 19 2月, 2018 1 次提交
    • M
      mem: add share parameter to memory-backend-ram · 06329cce
      Marcel Apfelbaum 提交于
      Currently only file backed memory backend can
      be created with a "share" flag in order to allow
      sharing guest RAM with other processes in the host.
      
      Add the "share" flag also to RAM Memory Backend
      in order to allow remapping parts of the guest RAM
      to different host virtual addresses. This is needed
      by the RDMA devices in order to remap non-contiguous
      QEMU virtual addresses to a contiguous virtual address range.
      
      Moved the "share" flag to the Host Memory base class,
      modified phys_mem_alloc to include the new parameter
      and a new interface memory_region_init_ram_shared_nomigrate.
      
      There are no functional changes if the new flag is not used.
      Reviewed-by: NEduardo Habkost <ehabkost@redhat.com>
      Signed-off-by: NMarcel Apfelbaum <marcel@redhat.com>
      06329cce
  14. 09 2月, 2018 13 次提交