1. 02 10月, 2019 1 次提交
    • A
      q35: Revert to kernel irqchip · 92fa1b1a
      Alex Williamson 提交于
      Backport of QEMU v4.1 commit for stable v4.0.1 release
      
      commit c87759ce
      Author: Alex Williamson <alex.williamson@redhat.com>
      Date:   Tue May 14 14:14:41 2019 -0600
      
          q35: Revert to kernel irqchip
      
          Commit b2fc91db ("q35: set split kernel irqchip as default") changed
          the default for the pc-q35-4.0 machine type to use split irqchip, which
          turned out to have disasterous effects on vfio-pci INTx support.  KVM
          resampling irqfds are registered for handling these interrupts, but
          these are non-functional in split irqchip mode.  We can't simply test
          for split irqchip in QEMU as userspace handling of this interrupt is a
          significant performance regression versus KVM handling (GeForce GPUs
          assigned to Windows VMs are non-functional without forcing MSI mode or
          re-enabling kernel irqchip).
      
          The resolution is to revert the change in default irqchip mode in the
          pc-q35-4.1 machine and create a pc-q35-4.0.1 machine for the 4.0-stable
          branch.  The qemu-q35-4.0 machine type should not be used in vfio-pci
          configurations for devices requiring legacy INTx support without
          explicitly modifying the VM configuration to use kernel irqchip.
      
      Link: https://bugs.launchpad.net/qemu/+bug/1826422
      Fixes: b2fc91db ("q35: set split kernel irqchip as default")
      Cc: qemu-stable@nongnu.org
      Reviewed-by: NPeter Xu <peterx@redhat.com>
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      (upstream commit c87759ce)
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      *add comments regarding AML mismatch warnings from
       tests/bios-tables-test.c
      Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
      92fa1b1a
  2. 10 4月, 2019 1 次提交
    • T
      hw/i386/pc: Fix crash when hot-plugging nvdimm on older machine types · ae909496
      Thomas Huth 提交于
      QEMU currently crashes when you try to hot-plug an "nvdimm" device
      on older machine types:
      
      $ qemu-system-x86_64 -monitor stdio -M pc-1.1
      QEMU 3.1.92 monitor - type 'help' for more information
      (qemu) device_add nvdimm,id=nvdimmn1
      qemu-system-x86_64: /home/thuth/devel/qemu/util/error.c:57: error_setv:
       Assertion `*errp == ((void *)0)' failed.
      Aborted (core dumped)
      
      The call to hotplug_handler_pre_plug() in pc_memory_pre_plug() has been
      added recently before the check whether nvdimm is enabled. It should
      be done after the check. And while we're at it, also check the errp
      after the hotplug_handler_pre_plug(), otherwise errors are silently
      ignored here.
      
      Fixes: 9040e6dfSigned-off-by: NThomas Huth <thuth@redhat.com>
      Message-Id: <20190407092314.11066-1-thuth@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      ae909496
  3. 13 3月, 2019 1 次提交
    • W
      i386, acpi: check acpi_memory_hotplug capacity in pre_plug · 9040e6df
      Wei Yang 提交于
      Currently we do device realization like below:
      
         hotplug_handler_pre_plug()
         dc->realize()
         hotplug_handler_plug()
      
      Before we do device realization and plug, we should allocate necessary
      resources and check if memory-hotplug-support property is enabled.
      
      At the piix4 and ich9, the memory-hotplug-support property is checked at
      plug stage. This means that device has been realized and mapped into guest
      address space 'pc_dimm_plug()' by the time acpi plug handler is called,
      where it might fail and crash QEMU due to reaching g_assert_not_reached()
      (piix4) or error_abort (ich9).
      
      Fix it by checking if memory hotplug is enabled at pre_plug stage
      where we can gracefully abort hotplug request.
      Signed-off-by: NWei Yang <richardw.yang@linux.intel.com>
      CC: Igor Mammedov <imammedo@redhat.com>
      CC: Eric Blake <eblake@redhat.com>
      Signed-off-by: NWei Yang <richardw.yang@linux.intel.com>
      
      Message-Id: <20190301033548.6691-1-richardw.yang@linux.intel.com>
      Reviewed-by: NIgor Mammedov <imammedo@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      9040e6df
  4. 12 3月, 2019 2 次提交
    • M
      pc: Support firmware configuration with -blockdev · ebc29e1b
      Markus Armbruster 提交于
      The PC machines put firmware in ROM by default.  To get it put into
      flash memory (required by OVMF), you have to use -drive
      if=pflash,unit=0,... and optionally -drive if=pflash,unit=1,...
      
      Why two -drive?  This permits setting up one part of the flash memory
      read-only, and the other part read/write.  It also makes upgrading
      firmware on the host easier.  Below the hood, it creates two separate
      flash devices, because we were too lazy to improve our flash device
      models to support sector protection.
      
      The problem at hand is to do the same with -blockdev somehow, as one
      more step towards deprecating -drive.
      
      Mapping -drive if=none,... to -blockdev is a solved problem.  With
      if=T other than if=none, -drive additionally configures a block device
      frontend.  For non-onboard devices, that part maps to -device.  Also a
      solved problem.  For onboard devices such as PC flash memory, we have
      an unsolved problem.
      
      This is actually an instance of a wider problem: our general device
      configuration interface doesn't cover onboard devices.  Instead, we have
      a zoo of ad hoc interfaces that are much more limited.  One of them is
      -drive, which we'd rather deprecate, but can't until we have suitable
      replacements for all its uses.
      
      Sadly, I can't attack the wider problem today.  So back to the narrow
      problem.
      
      My first idea was to reduce it to its solved buddy by using pluggable
      instead of onboard devices for the flash memory.  Workable, but it
      requires some extra smarts in firmware descriptors and libvirt.  Paolo
      had an idea that is simpler for libvirt: keep the devices onboard, and
      add machine properties for their block backends.
      
      The implementation is less than straightforward, I'm afraid.
      
      First, block backend properties are *qdev* properties.  Machines can't
      have those, as they're not devices.  I could duplicate these qdev
      properties as QOM properties, but I hate that.
      
      More seriously, the properties do not belong to the machine, they
      belong to the onboard flash devices.  Adding them to the machine would
      then require bad magic to somehow transfer them to the flash devices.
      Fortunately, QOM provides the means to handle exactly this case: add
      alias properties to the machine that forward to the onboard devices'
      properties.
      
      Properties need to be created in .instance_init() methods.  For PC
      machines, that's pc_machine_initfn().  To make alias properties work,
      we need to create the onboard flash devices there, too.  Requires
      several bug fixes, in the previous commits.  We also have to realize
      the devices.  More on that below.
      
      If the user sets pflash0, firmware resides in flash memory.
      pc_system_firmware_init() maps and realizes the flash devices.
      
      Else, firmware resides in ROM.  The onboard flash devices aren't used
      then.  pc_system_firmware_init() destroys them unrealized, along with
      the alias properties.
      
      The existing code to pick up drives defined with -drive if=pflash is
      replaced by code to desugar into the machine properties.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NPhilippe Mathieu-Daudé <philmd@redhat.com>
      Acked-by: NLaszlo Ersek <lersek@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Message-Id: <87ftrtux81.fsf@dusky.pond.sub.org>
      ebc29e1b
    • P
      pc_sysfw: Pass PCMachineState to pc_system_firmware_init() · 5e640a9e
      Philippe Mathieu-Daudé 提交于
      pc_system_firmware_init() parameter @isapc_ram_fw is PCMachineState
      member pci_enabled negated.  The next commit will need more of
      PCMachineState.  To prepare for that, pass a PCMachineState *, and
      drop the now redundant parameter @isapc_ram_fw.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NPhilippe Mathieu-Daudé <philmd@redhat.com>
      Reviewed-by: NLaszlo Ersek <lersek@redhat.com>
      Message-Id: <20190308131445.17502-11-armbru@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      5e640a9e
  5. 11 3月, 2019 4 次提交
  6. 06 3月, 2019 2 次提交
    • D
      qdev: Let the hotplug_handler_unplug() caller delete the device · 07578b0a
      David Hildenbrand 提交于
      When unplugging a device, at one point the device will be destroyed
      via object_unparent(). This will, one the one hand, unrealize the
      removed device hierarchy, and on the other hand, destroy/free the
      device hierarchy.
      
      When chaining hotplug handlers, we want to overwrite a bus hotplug
      handler by the machine hotplug handler, to be able to perform
      some part of the plug/unplug and to forward the calls to the bus hotplug
      handler.
      
      For now, the bus hotplug handler would trigger an object_unparent(), not
      allowing us to perform some unplug action on a device after we forwarded
      the call to the bus hotplug handler. The device would be gone at that
      point.
      
      machine_unplug_handler(dev)
          /* eventually do unplug stuff */
          bus_unplug_handler(dev)
          /* dev is gone, we can't do more unplug stuff */
      
      So move the object_unparent() to the original caller of the unplug. For
      now, keep the unrealize() at the original places of the
      object_unparent(). For implicitly chained hotplug handlers (e.g. pc
      code calling acpi hotplug handlers), the object_unparent() has to be
      done by the outermost caller. So when calling hotplug_handler_unplug()
      from inside an unplug handler, nothing is to be done.
      
      hotplug_handler_unplug(dev) -> calls machine_unplug_handler()
          machine_unplug_handler(dev) {
              /* eventually do unplug stuff */
              bus_unplug_handler(dev) -> calls unrealize(dev)
              /* we can do more unplug stuff but device already unrealized */
          }
      object_unparent(dev)
      
      In the long run, every unplug action should be factored out of the
      unrealize() function into the unplug handler (especially for PCI). Then
      we can get rid of the additonal unrealize() calls and object_unparent()
      will properly unrealize the device hierarchy after the device has been
      unplugged.
      
      hotplug_handler_unplug(dev) -> calls machine_unplug_handler()
          machine_unplug_handler(dev) {
              /* eventually do unplug stuff */
              bus_unplug_handler(dev) -> only unplugs, does not unrealize
              /* we can do more unplug stuff */
          }
      object_unparent(dev) -> will unrealize
      
      The original approach was suggested by Igor Mammedov for the PCI
      part, but I extended it to all hotplug handlers. I consider this one
      step into the right direction.
      
      To summarize:
      - object_unparent() on synchronous unplugs is done by common code
      -- "Caller of hotplug_handler_unplug"
      - object_unparent() on asynchronous unplugs ("unplug requests") has to
        be done manually
      -- "Caller of hotplug_handler_unplug"
      Reviewed-by: NIgor Mammedov <imammedo@redhat.com>
      Acked-by: NCornelia Huck <cohuck@redhat.com>
      Signed-off-by: NDavid Hildenbrand <david@redhat.com>
      Message-Id: <20190228122849.4296-2-david@redhat.com>
      Reviewed-by: NGreg Kurz <groug@kaod.org>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      07578b0a
    • W
      hw/i386/pc.c: remove unused function pc_acpi_init() · 49e5ef07
      Wei Yang 提交于
      Function pc_acpi_init() is not used anymore.
      
      Remove the definition and declaration.
      Signed-off-by: NWei Yang <richardw.yang@linux.intel.com>
      Reviewed-by: NPhilippe Mathieu-Daudé <philmd@redhat.com>
      Tested-by: NPhilippe Mathieu-Daudé <philmd@redhat.com>
      Reviewed-by: NIgor Mammedov <imammedo@redhat.com>
      Reviewed-by: NThomas Huth <thuth@redhat.com>
      Message-Id: <20190214084939.20640-2-richardw.yang@linux.intel.com>
      Signed-off-by: NLaurent Vivier <laurent@vivier.eu>
      49e5ef07
  7. 05 2月, 2019 7 次提交
  8. 29 1月, 2019 2 次提交
  9. 24 1月, 2019 1 次提交
  10. 14 1月, 2019 2 次提交
  11. 10 1月, 2019 2 次提交
  12. 09 1月, 2019 1 次提交
  13. 07 1月, 2019 14 次提交