1. 19 1月, 2017 3 次提交
    • L
      fw-cfg: bump "x-file-slots" to 0x20 for 2.9+ machine types · a5b3ebfd
      Laszlo Ersek 提交于
      More precisely, the "x-file-slots" count is bumped for all machine types
      that:
      (a) use fw_cfg, and
      (b) are not versioned (hence migration is not expected to work for them
          across QEMU releases anyway), or have version 2.9.
      
      This affects machine types implemented in the following source files:
      
      - "hw/arm/virt.c". The "virt-*" machine type is versioned, and the <= 2.8
        versions already depend on HW_COMPAT_2_8 (see commit e353aac5).
        Therefore adding the "x-file-slots" compat values to HW_COMPAT_2_8
        suffices.
      
      - "hw/i386/pc.c". The "pc-i440fx-*" (including "pc-*") and "pc-q35-*"
        machine types are versioned. Modifying HW_COMPAT_2_8 is sufficient here
        too (see commit "pc: Add 2.9 machine-types"). The "isapc" machtype is
        not versioned. The "xenfv" machine type, which uses fw_cfg for direct
        kernel booting, is also not versioned.
      
      - "hw/ppc/mac_newworld.c". The "mac99" machine type is not versioned.
      
      - "hw/ppc/mac_oldworld.c". The "g3beige" machine type is not versioned.
      
      - "hw/sparc/sun4m.c". None of the 9 machine types defined in this file
        appear versioned.
      
      - "hw/sparc64/sun4u.c". None of the 3 machine types defined in this file
        appear versioned.
      
      Cc: "Gabriel L. Somlo" <somlo@cmu.edu>
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Cc: Alexander Graf <agraf@suse.de>
      Cc: Anthony Perard <anthony.perard@citrix.com>
      Cc: Artyom Tarasenko <atar4qemu@gmail.com>
      Cc: David Gibson <david@gibson.dropbear.id.au>
      Cc: Eduardo Habkost <ehabkost@redhat.com>
      Cc: Gerd Hoffmann <kraxel@redhat.com>
      Cc: Igor Mammedov <imammedo@redhat.com>
      Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Peter Maydell <peter.maydell@linaro.org>
      Cc: Stefano Stabellini <sstabellini@kernel.org>
      Signed-off-by: NLaszlo Ersek <lersek@redhat.com>
      Acked-by: NGabriel Somlo <somlo@cmu.edu>
      Tested-by: NGabriel Somlo <somlo@cmu.edu>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      Reviewed-by: NEduardo Habkost <ehabkost@redhat.com>
      a5b3ebfd
    • L
      fw-cfg: turn FW_CFG_FILE_SLOTS into a device property · e12f3a13
      Laszlo Ersek 提交于
      We'd like to raise the value of FW_CFG_FILE_SLOTS. Doing it naively could
      lead to problems with backward migration: a more recent QEMU (running an
      older machine type) would allow the guest, in fw_cfg_select(), to select a
      high key value that is unavailable in the same machine type implemented by
      the older (target) QEMU. On the target host, fw_cfg_data_read() for
      example could dereference nonexistent entries.
      
      As first step, size the FWCfgState.entries[*] and FWCfgState.entry_order
      arrays dynamically. All three array sizes will be influenced by the new
      field FWCfgState.file_slots (and matching device property).
      
      Make the following changes:
      
      - Replace the FW_CFG_FILE_SLOTS macro with FW_CFG_FILE_SLOTS_MIN (minimum
        count of fw_cfg file slots) in the header file. The value remains 0x10.
      
      - Replace all uses of FW_CFG_FILE_SLOTS with a helper function called
        fw_cfg_file_slots(), returning the new property.
      
      - Eliminate the macro FW_CFG_MAX_ENTRY, and replace all its uses with a
        helper function called fw_cfg_max_entry().
      
      - In the MMIO- and IO-mapped realize functions both, allocate all three
        arrays dynamically, based on the new property.
      
      - The new property defaults to FW_CFG_FILE_SLOTS_MIN. This is going to be
        customized in the following patches.
      
      Cc: "Gabriel L. Somlo" <somlo@cmu.edu>
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Cc: Gerd Hoffmann <kraxel@redhat.com>
      Cc: Igor Mammedov <imammedo@redhat.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NLaszlo Ersek <lersek@redhat.com>
      Acked-by: NGabriel Somlo <somlo@cmu.edu>
      Tested-by: NGabriel Somlo <somlo@cmu.edu>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      Reviewed-by: NEduardo Habkost <ehabkost@redhat.com>
      e12f3a13
    • M
      fw-cfg: support writeable blobs · baf2d5bf
      Michael S. Tsirkin 提交于
      Useful to send guest data back to QEMU.
      
      Changes from Laszlo Ersek <lersek@redhat.com>:
      - rebase the patch from Michael Tsirkin's original postings at [1] and [2]
        to the following patches:
        - loader: Allow a custom AddressSpace when loading ROMs
        - loader: Add AddressSpace loading support to uImages
        - loader: fix handling of custom address spaces when adding ROM blobs
      - reject such writes immediately that would exceed the end of the array,
        rather than performing a partial write before setting the error bit: see
        the (len != dma.length) condition
      - document the write interface
      
      [1] http://lists.nongnu.org/archive/html/qemu-devel/2016-02/msg04968.html
      [2] http://lists.nongnu.org/archive/html/qemu-devel/2016-03/msg02735.html
      
      Cc: "Gabriel L. Somlo" <somlo@cmu.edu>
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Cc: Gerd Hoffmann <kraxel@redhat.com>
      Cc: Igor Mammedov <imammedo@redhat.com>
      Cc: Michael Walle <michael@walle.cc>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Peter Maydell <peter.maydell@linaro.org>
      Cc: Shannon Zhao <zhaoshenglong@huawei.com>
      Cc: qemu-arm@nongnu.org
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NLaszlo Ersek <lersek@redhat.com>
      Reviewed-by: NMarcel Apfelbaum <marcel@redhat.com>
      Acked-by: NGabriel Somlo <somlo@cmu.edu>
      Tested-by: NGabriel Somlo <somlo@cmu.edu>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      Reviewed-by: NEduardo Habkost <ehabkost@redhat.com>
      baf2d5bf
  2. 10 1月, 2017 1 次提交
  3. 30 11月, 2016 1 次提交
  4. 15 11月, 2016 2 次提交
  5. 02 11月, 2016 2 次提交
  6. 28 10月, 2016 1 次提交
  7. 04 10月, 2016 1 次提交
  8. 10 8月, 2016 1 次提交
  9. 18 7月, 2016 1 次提交
  10. 24 6月, 2016 2 次提交
  11. 18 5月, 2016 1 次提交
  12. 19 4月, 2016 1 次提交
    • M
      fw_cfg: Adopt /opt/RFQDN convention · 63d3145a
      Markus Armbruster 提交于
      FW CFG's primary user is QEMU, which uses it to expose configuration
      information (in the widest sense) to Firmware.  Thus the name FW CFG.
      
      FW CFG can also be used by others for their own purposes.  QEMU is
      merely acting as transport then.  Names starting with opt/ are
      reserved for such uses.  There is no provision, however, to guide safe
      sharing among different such users.
      
      Fix that, loosely following QMP precedence: names should start with
      opt/RFQDN/, where RFQDN is a reverse fully qualified domain name you
      control.
      
      Based on a more ambitious patch from Michael Tsirkin.
      
      Cc: Gerd Hoffmann <kraxel@redhat.com>
      Cc: Gabriel L. Somlo <somlo@cmu.edu>
      Cc: Laszlo Ersek <lersek@redhat.com>
      Cc: Michael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      Acked-by: NGabriel Somlo <somlo@cmu.edu>
      Reviewed-by: NLaszlo Ersek <lersek@redhat.com>
      63d3145a
  13. 14 4月, 2016 2 次提交
  14. 22 3月, 2016 5 次提交
    • M
      ivshmem: Require master to have ID zero · 62a830b6
      Markus Armbruster 提交于
      Migration with ivshmem needs to be carefully orchestrated to work.
      Exactly one peer (the "master") migrates to the destination, all other
      peers need to unplug (and disconnect), migrate, plug back (and
      reconnect).  This is sort of documented in qemu-doc.
      
      If peers connect on the destination before migration completes, the
      shared memory can get messed up.  This isn't documented anywhere.  Fix
      that in qemu-doc.
      
      To avoid messing up register IVPosition on migration, the server must
      assign the same ID on source and destination.  ivshmem-spec.txt leaves
      ID assignment unspecified, however.
      
      Amend ivshmem-spec.txt to require the first client to receive ID zero.
      The example ivshmem-server complies: it always assigns the first
      unused ID.
      
      For a bit of additional safety, enforce ID zero for the master.  This
      does nothing when we're not using a server, because the ID is zero for
      all peers then.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-Id: <1458066895-20632-40-git-send-email-armbru@redhat.com>
      62a830b6
    • M
      ivshmem: Split ivshmem-plain, ivshmem-doorbell off ivshmem · 5400c02b
      Markus Armbruster 提交于
      ivshmem can be configured with and without interrupt capability
      (a.k.a. "doorbell").  The two configurations have largely disjoint
      options, which makes for a confusing (and badly checked) user
      interface.  Moreover, the device can't tell the guest whether its
      doorbell is enabled.
      
      Create two new device models ivshmem-plain and ivshmem-doorbell, and
      deprecate the old one.
      
      Changes from ivshmem:
      
      * PCI revision is 1 instead of 0.  The new revision is fully backwards
        compatible for guests.  Guests may elect to require at least
        revision 1 to make sure they're not exposed to the funny "no shared
        memory, yet" state.
      
      * Property "role" replaced by "master".  role=master becomes
        master=on, role=peer becomes master=off.  Default is off instead of
        auto.
      
      * Property "use64" is gone.  The new devices always have 64 bit BARs.
      
      Changes from ivshmem to ivshmem-plain:
      
      * The Interrupt Pin register in PCI config space is zero (does not use
        an interrupt pin) instead of one (uses INTA).
      
      * Property "x-memdev" is renamed to "memdev".
      
      * Properties "shm" and "size" are gone.  Use property "memdev"
        instead.
      
      * Property "msi" is gone.  The new device can't have MSI-X capability.
        It can't interrupt anyway.
      
      * Properties "ioeventfd" and "vectors" are gone.  They're meaningless
        without interrupts anyway.
      
      Changes from ivshmem to ivshmem-doorbell:
      
      * Property "msi" is gone.  The new device always has MSI-X capability.
      
      * Property "ioeventfd" defaults to on instead of off.
      
      * Property "size" is gone.  The new device can only map all the shared
        memory received from the server.
      
      Guests can easily find out whether the device is configured for
      interrupts by checking for MSI-X capability.
      
      Note: some code added in sub-optimal places to make the diff easier to
      review.  The next commit will move it to more sensible places.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-Id: <1458066895-20632-37-git-send-email-armbru@redhat.com>
      5400c02b
    • M
      ivshmem: Propagate errors through ivshmem_recv_setup() · 1309cf44
      Markus Armbruster 提交于
      This kills off the funny state described in the previous commit.
      
      Simplify ivshmem_io_read() accordingly, and update documentation.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <1458066895-20632-27-git-send-email-armbru@redhat.com>
      Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      1309cf44
    • M
      ivshmem: Don't destroy the chardev on version mismatch · 71c26581
      Markus Armbruster 提交于
      Yes, the chardev is commonly useless after we read a bad version from
      it, but destroying it is inappropriate anyway: the user created it, so
      the user should be able to hold on to it as long as he likes.  We
      don't destroy it on other errors.  Screwed up in commit 5105b1d8.
      
      Stop reading instead.
      
      Also note QEMU's behavior in ivshmem-spec.txt.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-Id: <1458066895-20632-16-git-send-email-armbru@redhat.com>
      71c26581
    • M
      ivshmem: Rewrite specification document · fdee2025
      Markus Armbruster 提交于
      This started as an attempt to update ivshmem_device_spec.txt for
      clarity, accuracy and completeness while working on its code, and
      quickly became a full rewrite.  Since the diff would be useless
      anyway, I'm using the opportunity to rename the file to
      ivshmem-spec.txt.
      
      I tried hard to ensure the new text contradicts neither the old text
      nor the code.  If the new text contradicts the old text but not the
      code, it's probably a bug in the old text.  If the new text
      contradicts both, its probably a bug in the new text.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-Id: <1458066895-20632-11-git-send-email-armbru@redhat.com>
      fdee2025
  15. 11 3月, 2016 1 次提交
  16. 08 3月, 2016 1 次提交
  17. 22 2月, 2016 1 次提交
  18. 22 12月, 2015 1 次提交
  19. 15 12月, 2015 1 次提交
  20. 25 11月, 2015 1 次提交
    • M
      vhost-user: clarify start and enable · c61f09ed
      Michael S. Tsirkin 提交于
      It seems that we currently have some duplication between
      started and enabled states.
      
      The actual reason is that enable is not documented correctly:
      what it does is connecting ring to the backend.
      
      This is important for MQ, because a Linux guest expects TX
      packets to be completed even if it disables some queues
      temporarily.
      
      Cc: Yuanhan Liu <yuanhan.liu@linux.intel.com>
      Cc: Victor Kaplansky <victork@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      c61f09ed
  21. 17 11月, 2015 1 次提交
  22. 16 11月, 2015 1 次提交
  23. 12 11月, 2015 2 次提交
  24. 26 10月, 2015 1 次提交
  25. 25 10月, 2015 2 次提交
  26. 22 10月, 2015 2 次提交
  27. 19 10月, 2015 1 次提交