Skip to content
Snippets Groups Projects
  1. Aug 16, 2019
    • Markus Armbruster's avatar
      qapi: Split error.json off common.json · abb3d37d
      Markus Armbruster authored
      
      In my "build everything" tree, changing a type in qapi/common.json
      triggers a recompile of some 3600 out of 6600 objects (not counting
      tests and objects that don't depend on qemu/osdep.h).
      
      One common dependency is QapiErrorClass: it's used only in in
      qapi/error.h, which uses nothing else, and is widely included.
      
      Move QapiErrorClass from common.json to new error.json.  Touching
      common.json now recompiles only some 2900 objects.
      
      Cc: Eric Blake <eblake@redhat.com>
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      Tested-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      Message-Id: <20190812052359.30071-4-armbru@redhat.com>
      abb3d37d
    • Markus Armbruster's avatar
      Include generated QAPI headers less · 2ae16a6a
      Markus Armbruster authored
      
      Some of the generated qapi-types-MODULE.h are included all over the
      place.  Changing a QAPI type can trigger massive recompiling.  Top
      scorers recompile more than 1000 out of some 6600 objects (not
      counting tests and objects that don't depend on qemu/osdep.h):
      
          6300 qapi/qapi-builtin-types.h
          5700 qapi/qapi-types-run-state.h
          3900 qapi/qapi-types-common.h
          3300 qapi/qapi-types-sockets.h
          3000 qapi/qapi-types-misc.h
          3000 qapi/qapi-types-crypto.h
          3000 qapi/qapi-types-job.h
          3000 qapi/qapi-types-block-core.h
          2800 qapi/qapi-types-block.h
          1300 qapi/qapi-types-net.h
      
      Clean up headers to include generated QAPI headers only where needed.
      Impact is negligible except for hw/qdev-properties.h.
      
      This header includes qapi/qapi-types-block.h and
      qapi/qapi-types-misc.h.  They are used only in expansions of property
      definition macros such as DEFINE_PROP_BLOCKDEV_ON_ERROR() and
      DEFINE_PROP_OFF_AUTO().  Moving their inclusion from
      hw/qdev-properties.h to the users of these macros avoids pointless
      recompiles.  This is how other property definition macros, such as
      DEFINE_PROP_NETDEV(), already work.
      
      Improves things for some of the top scorers:
      
          3600 qapi/qapi-types-common.h
          2800 qapi/qapi-types-sockets.h
           900 qapi/qapi-types-misc.h
          2200 qapi/qapi-types-crypto.h
          2100 qapi/qapi-types-job.h
          2100 qapi/qapi-types-block-core.h
           270 qapi/qapi-types-block.h
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      Tested-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      Message-Id: <20190812052359.30071-3-armbru@redhat.com>
      2ae16a6a
    • Markus Armbruster's avatar
      include: Make headers more self-contained · ec150c7e
      Markus Armbruster authored
      Back in 2016, we discussed[1] rules for headers, and these were
      generally liked:
      
      1. Have a carefully curated header that's included everywhere first.  We
         got that already thanks to Peter: osdep.h.
      
      2. Headers should normally include everything they need beyond osdep.h.
         If exceptions are needed for some reason, they must be documented in
         the header.  If all that's needed from a header is typedefs, put
         those into qemu/typedefs.h instead of including the header.
      
      3. Cyclic inclusion is forbidden.
      
      This patch gets include/ closer to obeying 2.
      
      It's actually extracted from my "[RFC] Baby steps towards saner
      headers" series[2], which demonstrates a possible path towards
      checking 2 automatically.  It passes the RFC test there.
      
      [1] Message-ID: <87h9g8j57d.fsf@blackfin.pond.sub.org>
          https://lists.nongnu.org/archive/html/qemu-devel/2016-03/msg03345.html
      [2] Message-Id: <20190711122827.18970-1-armbru@redhat.com>
          https://lists.nongnu.org/archive/html/qemu-devel/2019-07/msg02715.html
      
      
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarAlistair Francis <alistair.francis@wdc.com>
      Message-Id: <20190812052359.30071-2-armbru@redhat.com>
      Tested-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      ec150c7e
  2. Aug 15, 2019
  3. Aug 13, 2019
    • Peter Maydell's avatar
      f28ed74f
    • Bin Meng's avatar
      riscv: roms: Fix make rules for building sifive_u bios · 02db1be1
      Bin Meng authored
      
      Currently the make rules are wrongly using qemu/virt opensbi image
      for sifive_u machine. Correct it.
      
      Signed-off-by: default avatarBin Meng <bmeng.cn@gmail.com>
      Reviewed-by: default avatarChih-Min Chao <chihmin.chao@sifive.com>
      Reviewed-by: default avatarAlistair Francis <alistair.francis@wdc.com>
      Message-id: 1564812484-20385-1-git-send-email-bmeng.cn@gmail.com
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      02db1be1
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-4.1-20190813' into staging · 968ff692
      Peter Maydell authored
      
      ppc patch queue 2019-08-13 (last minute qemu-4.1 fixes)
      
      Here's a very, very last minute pull request for qemu-4.1.  This fixes
      two nasty bugs with the XIVE interrupt controller in "dual" mode
      (where the guest decides which interrupt controller it wants to use).
      One occurs when resetting the guest while I/O is active, and the other
      with migration of hotplugged CPUs.
      
      The timing here is very unfortunate.  Alas, we only spotted these bugs
      very late, and I was sick last week, delaying analysis and fix even
      further.
      
      This series hasn't had nearly as much testing as I'd really like, but
      I'd still like to squeeze it into qemu-4.1 if possible, since
      definitely fixing two bad bugs seems like an acceptable tradeoff for
      the risk of introducing different bugs.
      
      # gpg: Signature made Tue 13 Aug 2019 07:56:42 BST
      # gpg:                using RSA key 75F46586AE61A66CC44E87DC6C38CACA20D9B392
      # gpg: Good signature from "David Gibson <david@gibson.dropbear.id.au>" [full]
      # gpg:                 aka "David Gibson (Red Hat) <dgibson@redhat.com>" [full]
      # gpg:                 aka "David Gibson (ozlabs.org) <dgibson@ozlabs.org>" [full]
      # gpg:                 aka "David Gibson (kernel.org) <dwg@kernel.org>" [unknown]
      # Primary key fingerprint: 75F4 6586 AE61 A66C C44E  87DC 6C38 CACA 20D9 B392
      
      * remotes/dgibson/tags/ppc-for-4.1-20190813:
        spapr/xive: Fix migration of hot-plugged CPUs
        spapr: Reset CAS & IRQ subsystem after devices
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      968ff692
    • Cédric Le Goater's avatar
      spapr/xive: Fix migration of hot-plugged CPUs · 310cda5b
      Cédric Le Goater authored
      
      The migration sequence of a guest using the XIVE exploitation mode
      relies on the fact that the states of all devices are restored before
      the machine is. This is not true for hot-plug devices such as CPUs
      which state come after the machine. This breaks migration because the
      thread interrupt context registers are not correctly set.
      
      Fix migration of hotplugged CPUs by restoring their context in the
      'post_load' handler of the XiveTCTX model.
      
      Fixes: 277dd3d7 ("spapr/xive: add migration support for KVM")
      Signed-off-by: default avatarCédric Le Goater <clg@kaod.org>
      Message-Id: <20190813064853.29310-1-clg@kaod.org>
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      310cda5b
    • David Gibson's avatar
      spapr: Reset CAS & IRQ subsystem after devices · 25c9780d
      David Gibson authored
      
      This fixes a nasty regression in qemu-4.1 for the 'pseries' machine,
      caused by the new "dual" interrupt controller model.  Specifically,
      qemu can crash when used with KVM if a 'system_reset' is requested
      while there's active I/O in the guest.
      
      The problem is that in spapr_machine_reset() we:
      
      1. Reset the CAS vector state
      	spapr_ovec_cleanup(spapr->ov5_cas);
      
      2. Reset all devices
      	qemu_devices_reset()
      
      3. Reset the irq subsystem
      	spapr_irq_reset();
      
      However (1) implicitly changes the interrupt delivery mode, because
      whether we're using XICS or XIVE depends on the CAS state.  We don't
      properly initialize the new irq mode until (3) though - in particular
      setting up the KVM devices.
      
      During (2), we can temporarily drop the BQL allowing some irqs to be
      delivered which will go to an irq system that's not properly set up.
      
      Specifically, if the previous guest was in (KVM) XIVE mode, the CAS
      reset will put us back in XICS mode.  kvm_kernel_irqchip() still
      returns true, because XIVE was using KVM, however XICs doesn't have
      its KVM components intialized and kernel_xics_fd == -1.  When the irq
      is delivered it goes via ics_kvm_set_irq() which assert()s that
      kernel_xics_fd != -1.
      
      This change addresses the problem by delaying the CAS reset until
      after the devices reset.  The device reset should quiesce all the
      devices so we won't get irqs delivered while we mess around with the
      IRQ.  The CAS reset and irq re-initialize should also now be under the
      same BQL critical section so nothing else should be able to interrupt
      it either.
      
      We also move the spapr_irq_msi_reset() used in one of the legacy irq
      modes, since it logically makes sense at the same point as the
      spapr_irq_reset() (it's essentially an equivalent operation for older
      machine types).  Since we don't need to switch between different
      interrupt controllers for those old machine types it shouldn't
      actually be broken in those cases though.
      
      Cc: Cédric Le Goater <clg@kaod.org>
      
      Fixes: b2e22477 "spapr: add a 'reset' method to the sPAPR IRQ backend"
      Fixes: 13db0cd9 "spapr: introduce a new sPAPR IRQ backend supporting
                       XIVE and XICS"
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      25c9780d
  4. Aug 12, 2019
    • Gerd Hoffmann's avatar
      display/bochs: fix pcie support · 5e7bcdcf
      Gerd Hoffmann authored
      
      Set QEMU_PCI_CAP_EXPRESS unconditionally in init(), then clear it in
      realize() in case the device is not connected to a PCIe bus.
      
      This makes sure the pci config space allocation is big enough, so
      accessing the PCIe extended config space doesn't overflow the pci
      config space buffer.
      
      PCI(e) config space is guest writable.  Writes are limited by
      write mask (which probably is also filled with random stuff),
      so the guest can only flip enabled bits.  But I suspect it
      still might be exploitable, so rather serious because it might
      be a host escape for the guest.  On the other hand the device
      is probably not yet in widespread use.
      
      (For a QEMU version without this commit, a mitigation for the
      bug is available: use "-device bochs-display" as a conventional pci
      device only.)
      
      Cc: qemu-stable@nongnu.org
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      Message-id: 20190812065221.20907-2-kraxel@redhat.com
      Reviewed-by: default avatarAlex Williamson <alex.williamson@redhat.com>
      Reviewed-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      5e7bcdcf
  5. Aug 06, 2019
  6. Aug 05, 2019
  7. Aug 03, 2019
  8. Aug 02, 2019
  9. Jul 30, 2019
Loading