1. 17 5月, 2017 2 次提交
    • E
      fdc: Remove user_creatable flag from sysbus-fdc & SUNW,fdtwo · 8ca97a1f
      Eduardo Habkost 提交于
      sysbus-fdc and SUNW,fdtwo devices need IRQs to be wired and mmio
      to be mapped, and can't be used with -device. Unset
      user_creatable on their device classes.
      
      Cc: John Snow <jsnow@redhat.com>
      Cc: Kevin Wolf <kwolf@redhat.com>
      Cc: Marcel Apfelbaum <marcel@redhat.com>
      Cc: Max Reitz <mreitz@redhat.com>
      Cc: qemu-block@nongnu.org
      Cc: Thomas Huth <thuth@redhat.com>
      Acked-by: NJohn Snow <jsnow@redhat.com>
      Reviewed-by: NThomas Huth <thuth@redhat.com>
      Acked-by: NMarcel Apfelbaum <marcel@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      Message-Id: <20170503203604.31462-6-ehabkost@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      8ca97a1f
    • E
      sysbus: Set user_creatable=false by default on TYPE_SYS_BUS_DEVICE · e4f4fb1e
      Eduardo Habkost 提交于
      commit 33cd52b5 unset
      cannot_instantiate_with_device_add_yet in TYPE_SYSBUS, making all
      sysbus devices appear on "-device help" and lack the "no-user"
      flag in "info qdm".
      
      To fix this, we can set user_creatable=false by default on
      TYPE_SYS_BUS_DEVICE, but this requires setting
      user_creatable=true explicitly on the sysbus devices that
      actually work with -device.
      
      Fortunately today we have just a few has_dynamic_sysbus=1
      machines: virt, pc-q35-*, ppce500, and spapr.
      
      virt, ppce500, and spapr have extra checks to ensure just a few
      device types can be instantiated:
      
      * virt supports only TYPE_VFIO_CALXEDA_XGMAC, TYPE_VFIO_AMD_XGBE.
      * ppce500 supports only TYPE_ETSEC_COMMON.
      * spapr supports only TYPE_SPAPR_PCI_HOST_BRIDGE.
      
      This patch sets user_creatable=true explicitly on those 4 device
      classes.
      
      Now, the more complex cases:
      
      pc-q35-*: q35 has no sysbus device whitelist yet (which is a
      separate bug). We are in the process of fixing it and building a
      sysbus whitelist on q35, but in the meantime we can fix the
      "-device help" and "info qdm" bugs mentioned above. Also, despite
      not being strictly necessary for fixing the q35 bug, reducing the
      list of user_creatable=true devices will help us be more
      confident when building the q35 whitelist.
      
      xen: We also have a hack at xen_set_dynamic_sysbus(), that sets
      has_dynamic_sysbus=true at runtime when using the Xen
      accelerator. This hack is only used to allow xen-backend devices
      to be dynamically plugged/unplugged.
      
      This means today we can use -device with the following 22 device
      types, that are the ones compiled into the qemu-system-x86_64 and
      qemu-system-i386 binaries:
      
      * allwinner-ahci
      * amd-iommu
      * cfi.pflash01
      * esp
      * fw_cfg_io
      * fw_cfg_mem
      * generic-sdhci
      * hpet
      * intel-iommu
      * ioapic
      * isabus-bridge
      * kvmclock
      * kvm-ioapic
      * kvmvapic
      * SUNW,fdtwo
      * sysbus-ahci
      * sysbus-fdc
      * sysbus-ohci
      * unimplemented-device
      * virtio-mmio
      * xen-backend
      * xen-sysdev
      
      This patch adds user_creatable=true explicitly to those devices,
      temporarily, just to keep 100% compatibility with existing
      behavior of q35. Subsequent patches will remove
      user_creatable=true from the devices that are really not meant to
      user-creatable on any machine, and remove the FIXME comment from
      the ones that are really supposed to be user-creatable. This is
      being done in separate patches because we still don't have an
      obvious list of devices that will be whitelisted by q35, and I
      would like to get each device reviewed individually.
      
      Cc: Alexander Graf <agraf@suse.de>
      Cc: Alex Williamson <alex.williamson@redhat.com>
      Cc: Alistair Francis <alistair.francis@xilinx.com>
      Cc: Beniamino Galvani <b.galvani@gmail.com>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
      Cc: David Gibson <david@gibson.dropbear.id.au>
      Cc: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
      Cc: Eduardo Habkost <ehabkost@redhat.com>
      Cc: Frank Blaschka <frank.blaschka@de.ibm.com>
      Cc: Gabriel L. Somlo <somlo@cmu.edu>
      Cc: Gerd Hoffmann <kraxel@redhat.com>
      Cc: Igor Mammedov <imammedo@redhat.com>
      Cc: Jason Wang <jasowang@redhat.com>
      Cc: John Snow <jsnow@redhat.com>
      Cc: Juergen Gross <jgross@suse.com>
      Cc: Kevin Wolf <kwolf@redhat.com>
      Cc: Laszlo Ersek <lersek@redhat.com>
      Cc: Marcel Apfelbaum <marcel@redhat.com>
      Cc: Markus Armbruster <armbru@redhat.com>
      Cc: Max Reitz <mreitz@redhat.com>
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Peter Maydell <peter.maydell@linaro.org>
      Cc: Pierre Morel <pmorel@linux.vnet.ibm.com>
      Cc: Prasad J Pandit <pjp@fedoraproject.org>
      Cc: qemu-arm@nongnu.org
      Cc: qemu-block@nongnu.org
      Cc: qemu-ppc@nongnu.org
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Rob Herring <robh@kernel.org>
      Cc: Shannon Zhao <zhaoshenglong@huawei.com>
      Cc: sstabellini@kernel.org
      Cc: Thomas Huth <thuth@redhat.com>
      Cc: Yi Min Zhao <zyimin@linux.vnet.ibm.com>
      Acked-by: NJohn Snow <jsnow@redhat.com>
      Acked-by: NJuergen Gross <jgross@suse.com>
      Acked-by: NMarcel Apfelbaum <marcel@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      Message-Id: <20170503203604.31462-3-ehabkost@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      [ehabkost: Small changes at sysbus_device_class_init() comments]
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      e4f4fb1e
  2. 11 5月, 2017 1 次提交
  3. 10 5月, 2017 1 次提交
  4. 09 5月, 2017 1 次提交
  5. 24 4月, 2017 1 次提交
  6. 22 4月, 2017 2 次提交
  7. 19 3月, 2017 1 次提交
  8. 01 3月, 2017 4 次提交
  9. 21 2月, 2017 3 次提交
  10. 18 2月, 2017 1 次提交
  11. 01 2月, 2017 3 次提交
  12. 27 1月, 2017 1 次提交
    • P
      pflash_cfi01: fix per-device sector length in CFI table · feb0b1aa
      Peter Maydell 提交于
      For configurations of the pflash_cfi01 device which set it up with a
      device-width not equal to the width (ie where we are emulating
      multiple narrow flash devices wired up in parallel), we were giving
      incorrect values in the CFI data table:
      
      (1) the sector length entry should specify the sector length for a
          single device, not the length for the overall collection of
          devices
      (2) the number of blocks per device must not be divided by the
          number of devices because the resulting device size would not
          match the overall size
      (3) this then means that the overall write block size must be
          modified depending on the number of devices because the entry is
          per device and when the guest writes into the flash it
          calculates the write size by using the CFI entry (write size
          per device) multiplied by the number of chips.
          (It would alternatively be possible to modify the write
          block size in the CFI table (currently hardcoded at 2048) and
          leave the overall write block size alone.)
      
      This commit corrects these bugs, and adds a hw-compat property
      to retain the old behaviour on 2.8 and earlier versions. (The
      only board we have which uses this sort of flash config and
      has machine versioning is the "virt" board -- the PC uses a
      single flash device and so behaviour is unaffected whether
      using old-multiple-chip-handling or not.)
      
      Here is a configuration example from the vexpress board:
      
      VEXPRESS_FLASH_SIZE = 64M
      VEXPRESS_FLASH_SECT_SIZE 256K
      num-blocks = VEXPRESS_FLASH_SIZE / VEXPRESS_FLASH_SECT_SIZE = 256
      sector-length = 256K
      width = 4
      device-width = 2
      
      The code will fill the CFI entry with the following entries:
        num-blocks = 256
        sector-length = 128K
        writeblock_size = 2048
      
      This results in two chips, each with 256 * 128K = 32M device size and
      a write block size of 2048.
      
      A sector erase will be sent to both chips, thus 256K must be erased.
      When the guest sends a block write command, it will write 4096 bytes
      data at once (2048 per device).
      Signed-off-by: NDavid Engraf <david.engraf@sysgo.com>
      Reviewed-by: NPeter Maydell <peter.maydell@linaro.org>
      [PMM: cleaned up and expanded commit message]
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      feb0b1aa
  13. 25 1月, 2017 1 次提交
  14. 20 1月, 2017 3 次提交
  15. 10 1月, 2017 1 次提交
    • J
      virtio: convert to use DMA api · 8607f5c3
      Jason Wang 提交于
      Currently, all virtio devices bypass IOMMU completely. This is because
      address_space_memory is assumed and used during DMA emulation. This
      patch converts the virtio core API to use DMA API. This idea is
      
      - introducing a new transport specific helper to query the dma address
        space. (only pci version is implemented).
      - query and use this address space during virtio device guest memory
        accessing when iommu platform (VIRTIO_F_IOMMU_PLATFORM) was enabled
        for this device.
      
      Cc: Michael S. Tsirkin <mst@redhat.com>
      Cc: Stefan Hajnoczi <stefanha@redhat.com>
      Cc: Kevin Wolf <kwolf@redhat.com>
      Cc: Amit Shah <amit.shah@redhat.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: qemu-block@nongnu.org
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      8607f5c3
  16. 09 1月, 2017 1 次提交
  17. 04 1月, 2017 1 次提交
  18. 27 12月, 2016 1 次提交
  19. 22 12月, 2016 1 次提交
    • Z
      hw/block/pflash_cfi*.c: fix confusing assert fail message · 8929fc3a
      Ziyue Yang 提交于
      The patch is to fix the confusing assert fail message caused by
      un-initialized device structure (from bite sized tasks).
      
      The bug can be reproduced by
      
      ./qemu-system-x86_64 -nographic -device cfi.pflash01
      
      The CFI hardware is dynamically loaded by QOM realizing mechanism,
      however the realizing function in pflash_cfi01_realize function
      requires the device being initialized manually before calling, like
      
      ./qemu-system-x86_64 -nographic
      -device cfi.pflash01,num-blocks=1024,sector-length=4096,name=testcard
      
      Once the initializing parameters are left off in the command, it will
      leave the device structure not initialized, which makes
      pflash_cfi01_realize try to realize a zero-volume card, causing
      
      /mnt/EXT_volume/projects/qemu/qemu-dev/exec.c:1378:
      find_ram_offset: Assertion `size != 0\' failed.
      
      Through my test, at least the flash device's block-number, sector-length
      and its name is needed for pflash_cfi01_realize to behave correctly. So
      I think the new asserts are needed to hint the QEMU user to specify
      the device's parameters correctly.
      Signed-off-by: NZiyue Yang <skiver.cloud.yzy@gmail.com>
      Message-Id: <1481810693-13733-1-git-send-email-skiver.cloud.yzy@gmail.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NZiyue Yang <yzylivezh@hotmail.com>
      8929fc3a
  20. 24 11月, 2016 1 次提交
  21. 18 11月, 2016 1 次提交
    • P
      virtio: set ISR on dataplane notifications · 83d768b5
      Paolo Bonzini 提交于
      Dataplane has been omitting forever the step of setting ISR when
      an interrupt is raised.  This caused little breakage, because the
      specification actually says that ISR may not be updated in MSI mode.
      
      Some versions of the Windows drivers however didn't clear MSI mode
      correctly, and proceeded using polling mode (using ISR, not the used
      ring index!) for crashdump and hibernation.  If it were just crashdump
      and hibernation it would not be a big deal, but recent releases of
      Windows do not really shut down, but rather log out and hibernate to
      make the next startup faster.  Hence, this manifested as a more serious
      hang during shutdown with e.g. Windows 8.1 and virtio-win 1.8.0 RPMs.
      Newer versions fixed this, while older versions do not use MSI at all.
      
      The failure has always been there for virtio dataplane, but it became
      visible after commits 9ffe337c ("virtio-blk: always use dataplane path
      if ioeventfd is active", 2016-10-30) and ad07cd69 ("virtio-scsi: always
      use dataplane path if ioeventfd is active", 2016-10-30) made virtio-blk
      and virtio-scsi always use the dataplane code under KVM.  The good news
      therefore is that it was not a bug in the patches---they were doing
      exactly what they were meant for, i.e. shake out remaining dataplane bugs.
      
      The fix is not hard, so it's worth arranging for the broken drivers.
      The virtio_should_notify+event_notifier_set pair that is common to
      virtio-blk and virtio-scsi dataplane is replaced with a new public
      function virtio_notify_irqfd that also sets ISR.  The irqfd emulation
      code now need not set ISR anymore, so virtio_irq is removed.
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Tested-by: NFarhan Ali <alifm@linux.vnet.ibm.com>
      Tested-by: NAlex Williamson <alex.williamson@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      83d768b5
  22. 31 10月, 2016 2 次提交
  23. 29 10月, 2016 4 次提交
  24. 28 10月, 2016 2 次提交