1. 08 3月, 2019 1 次提交
  2. 13 2月, 2019 1 次提交
  3. 15 1月, 2019 1 次提交
  4. 11 1月, 2019 1 次提交
  5. 17 12月, 2018 1 次提交
    • E
      ivshmem-test: Drop dependence on global_qtest · 24c01ffa
      Eric Blake 提交于
      Managing parallel connections to two different monitors via
      the implicit global_qtest makes it hard to copy-and-paste code
      to tests that are not aware of the implicit state.  Since we
      have already fixed qpci to avoid global_qtest, we can now
      simplify by not using global_qtest anywhere in ivshmem-test.
      
      We can assert that the conversion is correct by checking that
      global_qtest remains NULL throughout the test (a later patch
      that changes global_qtest to not be a public global variable
      will drop the assertions).
      Signed-off-by: NEric Blake <eblake@redhat.com>
      [thuth: Dropped the changes to test_ivshmem_hotplug() - will be fixed later]
      Signed-off-by: NThomas Huth <thuth@redhat.com>
      24c01ffa
  6. 16 8月, 2018 1 次提交
    • M
      tests: Clean up string interpolation around qtest_qmp_device_add() · 82cab70b
      Markus Armbruster 提交于
      Leaving interpolation into JSON to qmp() is more robust than building
      QMP input manually, as explained in the commit before previous.
      
      qtest_qmp_device_add() and its wrappers interpolate into JSON as
      follows:
      
      * qtest_qmp_device_add() interpolates members into a JSON object.
      
      * So do its wrappers qpci_plug_device_test() and usb_test_hotplug().
      
      * usb_test_hotplug() additionally interpolates strings and numbers
        into JSON strings.
      
      Clean them up:
      
      * Have qtest_qmp_device_add() take its extra device properties as
        arguments for qdict_from_jsonf_nofail() instead of a string
        containing JSON members.
      
      * Drop qpci_plug_device_test(), use qtest_qmp_device_add()
        directly.
      
      * Change usb_test_hotplug() parameter @port to string, to avoid
        interpolation.  Interpolate @hcd_id separately.
      
      Bonus: gets rid of a non-literal format string.  A step towards
      compile-time format string checking without triggering
      -Wformat-nonliteral.
      
      Cc: Thomas Huth <thuth@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-Id: <20180806065344.7103-15-armbru@redhat.com>
      82cab70b
  7. 29 6月, 2018 1 次提交
  8. 14 2月, 2018 1 次提交
  9. 31 1月, 2017 2 次提交
  10. 28 10月, 2016 2 次提交
    • D
      libqos: Change PCI accessors to take opaque BAR handle · b4ba67d9
      David Gibson 提交于
      The usual use model for the libqos PCI functions is to map a specific PCI
      BAR using qpci_iomap() then pass the returned token into IO accessor
      functions.  This, and the fact that iomap() returns a (void *) which
      actually contains a PCI space address, kind of suggests that the return
      value from iomap is supposed to be an opaque token.
      
      ..except that the callers expect to be able to add offsets to it.  Which
      also assumes the compiler will support pointer arithmetic on a (void *),
      and treat it as working with byte offsets.
      
      To clarify this situation change iomap() and the IO accessors to take
      a definitely opaque BAR handle (enforced with a wrapper struct) along with
      an offset within the BAR.  This changes both the functions and all the
      callers.
      
      There were a number of places that checked if iomap() returned non-NULL,
      and or initialized it to NULL before hand.  Since iomap() already assert()s
      if it fails to map the BAR, these tests were mostly pointless and are
      removed.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Reviewed-by: NGreg Kurz <groug@kaod.org>
      b4ba67d9
    • D
      tests: Use qpci_mem{read,write} in ivshmem-test · 204e54b8
      David Gibson 提交于
      ivshmem implements a block of shared memory in a PCI BAR.  Currently our
      test case accesses this using qtest_mem{read,write}.  However, deducing
      the correct addresses for these requires making assumptions about the
      internel format returned by qpci_iomap(), along with some ugly casts.
      
      This patch changes the test to use the new qpci_mem{read,write} interfaces
      which is neater.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Reviewed-by: NLaurent Vivier <lvivier@redhat.com>
      Reviewed-by: NGreg Kurz <groug@kaod.org>
      204e54b8
  11. 06 10月, 2016 1 次提交
  12. 17 6月, 2016 1 次提交
  13. 07 6月, 2016 1 次提交
  14. 22 3月, 2016 6 次提交
    • 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: Receive shared memory synchronously in realize() · 3a55fc0f
      Markus Armbruster 提交于
      When configured for interrupts (property "chardev" given), we receive
      the shared memory from an ivshmem server.  We do so asynchronously
      after realize() completes, by setting up callbacks with
      qemu_chr_add_handlers().
      
      Keeping server I/O out of realize() that way avoids delays due to a
      slow server.  This is probably relevant only for hot plug.
      
      However, this funny "no shared memory, yet" state of the device also
      causes a raft of issues that are hard or impossible to work around:
      
      * The guest is exposed to this state: when we enter and leave it its
        shared memory contents is apruptly replaced, and device register
        IVPosition changes.
      
        This is a known issue.  We document that guests should not access
        the shared memory after device initialization until the IVPosition
        register becomes non-negative.
      
        For cold plug, the funny state is unlikely to be visible in
        practice, because we normally receive the shared memory long before
        the guest gets around to mess with the device.
      
        For hot plug, the timing is tighter, but the relative slowness of
        PCI device configuration has a good chance to hide the funny state.
      
        In either case, guests complying with the documented procedure are
        safe.
      
      * Migration becomes racy.
      
        If migration completes before the shared memory setup completes on
        the source, shared memory contents is silently lost.  Fortunately,
        migration is rather unlikely to win this race.
      
        If the shared memory's ramblock arrives at the destination before
        shared memory setup completes, migration fails.
      
        There is no known way for a management application to wait for
        shared memory setup to complete.
      
        All you can do is retry failed migration.  You can improve your
        chances by leaving more time between running the destination QEMU
        and the migrate command.
      
        To mitigate silent memory loss, you need to ensure the server
        initializes shared memory exactly the same on source and
        destination.
      
        These issues are entirely undocumented so far.
      
      I'd expect the server to be almost always fast enough to hide these
      issues.  But then rare catastrophic races are in a way the worst kind.
      
      This is way more trouble than I'm willing to take from any device.
      Kill the funny state by receiving shared memory synchronously in
      realize().  If your hot plug hangs, go kill your ivshmem server.
      
      For easier review, this commit only makes the receive synchronous, it
      doesn't add the necessary error propagation.  Without that, the funny
      state persists.  The next commit will do that, and kill it off for
      real.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-Id: <1458066895-20632-26-git-send-email-armbru@redhat.com>
      3a55fc0f
    • M
      ivshmem-test: Improve test cases /ivshmem/server-* · 41b65e5e
      Markus Armbruster 提交于
      Document missing test: behavior with MSI-X present but not enabled.
      
      For MSI-X, we test and clear the interrupt pending bit before testing
      the interrupt.  For INTx, we only clear.  Change to test and clear for
      consistency.
      
      Test MSI-X vector 1 in addition to vector 0.
      
      Improve comments.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-Id: <1458066895-20632-10-git-send-email-armbru@redhat.com>
      41b65e5e
    • M
      ivshmem-test: Clean up wait for devices to become operational · 14c5d49a
      Markus Armbruster 提交于
      test_ivshmem_server() waits until the first byte in BAR 2 contains the
      0x42 we put into shared memory.  Works because the byte reads zero
      until the device maps the shared memory gotten from the server.
      
      Check the IVPosition register instead: it's initially -1, and becomes
      non-negative right when the device maps the share memory, so no
      change, just cleaner, because it's what guest software is supposed to
      do.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-Id: <1458066895-20632-9-git-send-email-armbru@redhat.com>
      14c5d49a
    • M
      ivshmem-test: Improve test case /ivshmem/single · 4958fe5d
      Markus Armbruster 提交于
      Test state of registers after reset.
      
      Test reading Interrupt Status clears it.
      
      Test (invalid) read of Doorbell.
      
      Add more comments.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-Id: <1458066895-20632-8-git-send-email-armbru@redhat.com>
      4958fe5d
    • M
      tests/libqos/pci-pc: Fix qpci_pc_iomap() to map BARs aligned · 99826172
      Markus Armbruster 提交于
      qpci_pc_iomap() maps BARs one after the other, without padding.  This
      is wrong.  PCI Local Bus Specification Revision 3.0, 6.2.5.1. Address
      Maps: "all address spaces used are a power of two in size and are
      naturally aligned".  That's because the size of a BAR is given by the
      number of address bits the device decodes, and the BAR needs to be
      mapped at a multiple of that size to ensure the address decoding
      works.
      
      Fix qpci_pc_iomap() accordingly.  This takes care of a FIXME in
      ivshmem-test.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-Id: <1458066895-20632-7-git-send-email-armbru@redhat.com>
      99826172
  15. 19 3月, 2016 1 次提交
  16. 16 2月, 2016 1 次提交
  17. 02 2月, 2016 2 次提交
  18. 25 11月, 2015 2 次提交
  19. 12 11月, 2015 1 次提交
  20. 26 10月, 2015 2 次提交
  21. 25 10月, 2015 1 次提交