Skip to content

Commits

Permalink
virtio-vhost-u…
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Commits on Apr 16, 2019

  1. virtio-vhost-user: implement UUID config field

    Add a UUID that will allow for stable device identification by the guest
    driver, regardless of the assigned PCI address.
    
    Signed-off-by: Nikos Dragazis <ndragazis@arrikto.com>
    ndragazis committed Apr 16, 2019
    Copy the full SHA
    f9ab08c View commit details
    Browse the repository at this point in the history
  2. virtio-vhost-user: fix bug during termination of master VM

    The problem is that the master QEMU process hangs after guest shutdown.
    This patch fixes this bug.
    
    This patch incorporates the following changes:
    
    1. parse GET_VRING_BASE messages
    According to the vhost-user protocol specification, the master sends
    GET_VRING_BASE messages to indicate the stop of the vring operations.
    The virtio-vhost-user device should parse those messages and cleanup the
    kickfds/callfds associated with the vq_idx of each message.
    
    2. change the cleanup procedure for the kickfds/callfds
    The problem with the event_notifier_cleanup() function is that it does
    not reset the rfd in case the rfd and the wfd have the same value.
    However, the event_notifier_get_fd() always returns the rfd value. So,
    instead of using event_notifier_cleanup(), we have to manually close the
    rfd eventfd and reset its value to -1.
    
    3. set the kickfds into non-blocking mode, just like the callfds
    Otherwise, the master QEMU process hangs during VM shutdown.
    
    Signed-off-by: Nikos Dragazis <ndragazis@arrikto.com>
    ndragazis committed Apr 16, 2019
    Copy the full SHA
    db3e7ad View commit details
    Browse the repository at this point in the history
  3. virtio-vhost-user: use ioeventfd mechanism for the callfds

    Optimize the VRING_CALL doorbells with ioeventfd to avoid entering QEMU.
    
    Signed-off-by: Nikos Dragazis <ndragazis@arrikto.com>
    ndragazis committed Apr 16, 2019
    Copy the full SHA
    a537786 View commit details
    Browse the repository at this point in the history
  4. virtio-vhost-user: move guest notifier into virtio-vhost-user-pci.c

    The guest notifier handler sends interrupts (either legacy or MSI-X) to
    the guest driver in response to master virtqueue kicks. This is a PCI
    transport-specific operation and thereby should be part of the
    virtio-vhost-user-pci.c code.
    
    After moving the guest notifier handler, the code in virtio-vhost-user.c
    doesn't need to have access to the VirtIOVhostUserPCI type. Therefore,
    this patch moves its definition from virtio-pci.h into
    virtio-vhost-user-pci.c.
    
    Signed-off-by: Nikos Dragazis <ndragazis@arrikto.com>
    ndragazis committed Apr 16, 2019
    Copy the full SHA
    6a76ce6 View commit details
    Browse the repository at this point in the history
  5. virtio-vhost-user: move PCI-specific code into virtio-vhost-user-pci.c

    The code for setting up the PCIMemoryRegions and the virtio PCI
    capabilities for the additional device resources (doorbells,
    notifications, shared memory) is PCI transport specific. Move this code
    along with the read/write handlers for the MemoryRegions into
    hw/virtio/virtio-vhost-user-pci.c. The setting up of the virtio
    capabilities and the associated PCIMemoryRegions becomes part of the
    realization of the TYPE_VIRTIO_VHOST_USER_PCI object.
    
    Signed-off-by: Nikos Dragazis <ndragazis@arrikto.com>
    ndragazis committed Apr 16, 2019
    Copy the full SHA
    2248671 View commit details
    Browse the repository at this point in the history
  6. virtio-vhost-user: improve the device

    This patch improves the device by adding two features:
    
    1. add virtio PCI capabilities for the additional device resources
    (doorbells, notifications, shared memory). This is better than just
    hardcoding a BAR with magic offsets into virtio-vhost-user.
    
    2. Implement slave guest interrupts in response to master virtqueue
    notifications via the kickfds. This allows using interrupt-driven guest
    drivers for the virtio-vhost-user device except for poll-mode drivers.
    
    Both the above enhancements are part of the device's virtio spec.
    
    Signed-off-by: Nikos Dragazis <ndragazis@arrikto.com>
    ndragazis committed Apr 16, 2019
    Copy the full SHA
    e4b5fa3 View commit details
    Browse the repository at this point in the history
  7. virtio-vhost-user: add virtio-vhost-user device

    The virtio-vhost-user device lets a guest act as a vhost device backend.
    It works by tunneling vhost-user protocol messages into a guest.  The
    new device syntax is as follows:
    
      -chardev socket,id=chardev0,path=vhost-user.sock,server,nowait \
      -device virtio-vhost-user-pci,chardev=chardev0
    
    The VIRTIO device specification is here:
    https://stefanha.github.io/virtio/vhost-user-slave.html#x1-2830007
    
    For more information about virtio-vhost-user, see
    https://wiki.qemu.org/Features/VirtioVhostUser.
    
    Signed-off-by: Nikos Dragazis <ndragazis@arrikto.com>
    ndragazis committed Apr 16, 2019
    Copy the full SHA
    45f574b View commit details
    Browse the repository at this point in the history
  8. vhost-user: share the vhost-user protocol related structures

    Put the vhost-user protocol related data structures to vhost-user.h,
    so that they can be used in other implementations (e.g. a slave
    implementation).
    
    Signed-off-by: Nikos Dragazis <ndragazis@arrikto.com>
    ndragazis committed Apr 16, 2019
    Copy the full SHA
    e835bc5 View commit details
    Browse the repository at this point in the history
  9. Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into s…

    …taging
    
    Block layer patches:
    
    - qcow2: Fix potential corruption for preallocated resize with external data file
    
    # gpg: Signature made Tue 16 Apr 2019 15:23:35 BST
    # gpg:                using RSA key 7F09B272C88F2FD6
    # gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" [full]
    # Primary key fingerprint: DC3D EB15 9A9A F95D 3D74  56FE 7F09 B272 C88F 2FD6
    
    * remotes/kevin/tags/for-upstream:
      qcow2: Fix preallocation bdrv_pwrite to wrong file
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    pm215 committed Apr 16, 2019
    Copy the full SHA
    dbfc49b View commit details
    Browse the repository at this point in the history
  10. qcow2: Fix preallocation bdrv_pwrite to wrong file

    With an external data file, preallocate_co() must write the final byte
    to the external data file, not to the qcow2 image file.
    
    This is harmless for preallocation of newly created images (only the
    qcow2 file size is increased to the virtual disk size while it should be
    much smaller), but with preallocated resize, it could in theory cause
    visible corruption if the metadata of the image is larger than the data
    (e.g. lots of bitmaps).
    
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Kevin Wolf committed Apr 16, 2019
    Copy the full SHA
    93e32b3 View commit details
    Browse the repository at this point in the history
  11. socket: allow wait=false for client socket

    Commit 767abe7 ("chardev: forbid 'wait' option with client sockets")
    is a bit too strict. Current libvirt always set wait=false, and will
    thus fail to add client chardev.
    
    Make the code more permissive, allowing wait=false with client socket
    chardevs. Deprecate usage of 'wait' with client sockets.
    
    Fixes: 767abe7
    Cc: Daniel P. Berrangé <berrange@redhat.com>
    Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
    Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
    Message-id: 20190415163337.2795-1-marcandre.lureau@redhat.com
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    elmarco authored and pm215 committed Apr 16, 2019
    Copy the full SHA
    a9b305b View commit details
    Browse the repository at this point in the history
  12. Merge remote-tracking branch 'remotes/thibault/tags/samuel-thibault' …

    …into staging
    
    Slirp updates
    
    Dr. David Alan Gilbert (1):
      slirp: Gcc 9 -O3 fix
    
    # gpg: Signature made Mon 15 Apr 2019 19:05:39 BST
    # gpg:                using RSA key E61DBB15D4172BDEC97E92D9DB550E89F0FA54F3
    # gpg: Good signature from "Samuel Thibault <samuel.thibault@aquilenet.fr>" [unknown]
    # gpg:                 aka "Samuel Thibault <sthibault@debian.org>" [marginal]
    # gpg:                 aka "Samuel Thibault <samuel.thibault@gnu.org>" [unknown]
    # gpg:                 aka "Samuel Thibault <samuel.thibault@inria.fr>" [marginal]
    # gpg:                 aka "Samuel Thibault <samuel.thibault@labri.fr>" [marginal]
    # gpg:                 aka "Samuel Thibault <samuel.thibault@ens-lyon.org>" [marginal]
    # gpg:                 aka "Samuel Thibault <samuel.thibault@u-bordeaux.fr>" [unknown]
    # gpg: WARNING: This key is not certified with sufficiently trusted signatures!
    # gpg:          It is not certain that the signature belongs to the owner.
    # Primary key fingerprint: 900C B024 B679 31D4 0F82  304B D017 8C76 7D06 9EE6
    #      Subkey fingerprint: E61D BB15 D417 2BDE C97E  92D9 DB55 0E89 F0FA 54F3
    
    * remotes/thibault/tags/samuel-thibault:
      slirp: Gcc 9 -O3 fix
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    pm215 committed Apr 16, 2019
    Copy the full SHA
    677746b View commit details
    Browse the repository at this point in the history

Commits on Apr 15, 2019

  1. slirp: Gcc 9 -O3 fix

    Gcc 9 needs some convincing that sopreprbuf really is going to fill
    in iov in the call from soreadbuf, even though the failure case
    shouldn't happen.
    
    Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
    Message-Id: <20190415121740.9881-1-dgilbert@redhat.com>
    Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
    dagrh authored and sthibaul committed Apr 15, 2019
    Copy the full SHA
    6fabae6 View commit details
    Browse the repository at this point in the history

Commits on Apr 12, 2019

  1. Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into s…

    …taging
    
    Block layer patches:
    
    - iotests fixes
    
    # gpg: Signature made Fri 12 Apr 2019 17:04:09 BST
    # gpg:                using RSA key 7F09B272C88F2FD6
    # gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" [full]
    # Primary key fingerprint: DC3D EB15 9A9A F95D 3D74  56FE 7F09 B272 C88F 2FD6
    
    * remotes/kevin/tags/for-upstream:
      iotest: Fix 241 to run in generic directory
      iotests: Let 245 pass on tmpfs
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    pm215 committed Apr 12, 2019
    Copy the full SHA
    afccfc0 View commit details
    Browse the repository at this point in the history
  2. iotest: Fix 241 to run in generic directory

    Filter the qemu-nbd server output to get rid of a direct reference
    to my build directory.
    
    Fixes: e9dce9c
    Reported-by: Max Reitz <mreitz@redhat.com>
    Signed-off-by: Eric Blake <eblake@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    ebblake authored and Kevin Wolf committed Apr 12, 2019
    Copy the full SHA
    9749636 View commit details
    Browse the repository at this point in the history
  3. iotests: Let 245 pass on tmpfs

    tmpfs does not support O_DIRECT.  Detect this case, and skip flipping
    @direct if the filesystem does not support it.
    
    Fixes: bf3e50f
    Signed-off-by: Max Reitz <mreitz@redhat.com>
    Reviewed-by: Alberto Garcia <berto@igalia.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    XanClic authored and Kevin Wolf committed Apr 12, 2019
    Copy the full SHA
    23e1d05 View commit details
    Browse the repository at this point in the history
  4. qemu-img: fix .hx and .texi disparity

    It turns out that having options listed in three places continues to be
    a bad idea. I'm still toying with the idea of an improved infrastructure
    here, but in the meantime, another bandaid.
    
    There are three locations:
    (1) .hx file, formatted as texi
    (2) .hx file, formatted as human readable.
    (3) .texi file, as section headers, formatted as texi.
    
    You can compare the two summaries within the .hx file like so:
    
    Human-readable command summaries:
    `./qemu-img --help | grep 'Command syntax' -A14`
    Detokenized texi command summaries:
    `grep "@item" qemu-img-cmds.hx | sed -E 's|@var\{([^\}]*?)\}|\1|g'`
    
    You can compare the two separate texi summaries like so:
    
    Texi command summaries:
    `grep "@item" qemu-img-cmds.hx"`
    Texi command headers:
    grep -E "@item.*@var" qemu-img.texi | tail -14
    
    Signed-off-by: John Snow <jsnow@redhat.com>
    Reviewed-by: Markus Armbruster <armbru@redhat.com>
    Message-id: 20190409210655.777-1-jsnow@redhat.com
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    jnsnow authored and pm215 committed Apr 12, 2019
    Copy the full SHA
    13c24ed View commit details
    Browse the repository at this point in the history
  5. curses: fix wchar_t printf warning

    On some systems wchar_t is "long int", on others just "int".
    So go cast to "long int" and adjust the printf format accordingly.
    
    Reported-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Message-id: 20190402073018.17747-1-kraxel@redhat.com
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    kraxel authored and pm215 committed Apr 12, 2019
    Copy the full SHA
    e1be985 View commit details
    Browse the repository at this point in the history
  6. Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-4.0-201904…

    …12' into staging
    
    ppc patch queue for 2018-04-12
    
    Here's a last minute pull request for 4.0.  Turns out my last pull
    request, to fix a regression in extended config space access for the
    pseries machine didn't fix things hard enough.  This PR has a single
    patch which improves the fix to work in more cases.
    
    It's a ghastly, ghastly hack, but it's simple and localized.  I
    already have patches almost ready to go in 4.1 that provides a simpler
    and cleaner solution to all this.
    
    # gpg: Signature made Fri 12 Apr 2019 06:34:16 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.0-20190412:
      spapr_pci: Fix broken naming of PCI bus
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    pm215 committed Apr 12, 2019
    Copy the full SHA
    9e4a484 View commit details
    Browse the repository at this point in the history
  7. spapr_pci: Fix broken naming of PCI bus

    Recent commit 5cf0d32 fixed a regression which was preventing the
    guest to access the extended config space of a PCIe device. This was
    done by introducing a new PCI bus subtype for PAPR. The original fix
    was causing PCI busses to be named "spapr-pci-host-bridge-root-bus.N"
    instead of "pci.N", which was making upper layers unhappy of course.
    This got worked around by hardcoding the PCI bus name to "pci.0", but
    this only works for the default PHB. And we're now hitting:
    
    # qemu-system-ppc64 \
                 -device spapr-pci-host-bridge,index=1 \
                 -device e1000e,bus=pci.0 \
                 -device e1000e,bus=pci.1
    qemu-system-ppc64: -device e1000e,bus=pci.1: Bus 'pci.1' not found
    
    David already posted some patches [1] to control PCI extended config
    space accesses with a new flag in the base PCI bus class instead of
    subtyping. These patches are a bit more intrusive though, and
    are targetted for 4.1.
    
    When no name is passed to pci_register_bus(), the core device code
    generates a lowercase name based on the QOM typename. The typename
    for the base PCI bus class is "PCI", hence the "pci.0", "pci.1"
    bus names. Rename the type of the PAPR PCI bus to "pci", so that
    the QOM code can generate proper names. This is a hack but it is
    enough to fix the regression. And all this will be reworked properly
    in 4.1.
    
    [1] https://patchwork.ozlabs.org/project/qemu-devel/list/?series=100486
    
    Fixes: 5cf0d32
    Signed-off-by: Greg Kurz <groug@kaod.org>
    Message-Id: <155500034416.646888.1307366522340665522.stgit@bahia.lab.toulouse-stg.fr.ibm.com>
    Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
    gkurz authored and dgibson committed Apr 12, 2019
    Copy the full SHA
    4560116 View commit details
    Browse the repository at this point in the history

Commits on Apr 10, 2019

  1. Update version for v4.0.0-rc3 release

    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    pm215 committed Apr 10, 2019
    Copy the full SHA
    532cc6d View commit details
    Browse the repository at this point in the history
  2. Merge remote-tracking branch 'remotes/alistair/tags/pull-device-tree-…

    …20190409-1' into staging
    
    Single device tree fix for 4.0
    
    A single patch to avoid an overflow when loading device trees.
    
    # gpg: Signature made Wed 10 Apr 2019 00:52:16 BST
    # gpg:                using RSA key F6C4AC46D4934868D3B8CE8F21E10D29DF977054
    # gpg: Good signature from "Alistair Francis <alistair@alistair23.me>" [full]
    # Primary key fingerprint: F6C4 AC46 D493 4868 D3B8  CE8F 21E1 0D29 DF97 7054
    
    * remotes/alistair/tags/pull-device-tree-20190409-1:
      device_tree: Fix integer overflowing in load_device_tree()
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    pm215 committed Apr 10, 2019
    Copy the full SHA
    6523516 View commit details
    Browse the repository at this point in the history

Commits on Apr 9, 2019

  1. device_tree: Fix integer overflowing in load_device_tree()

    If the value of get_image_size() exceeds INT_MAX / 2 - 10000, the
    computation of @dt_size overflows to a negative number, which then
    gets converted to a very large size_t for g_malloc0() and
    load_image_size().  In the (fortunately improbable) case g_malloc0()
    succeeds and load_image_size() survives, we'd assign the negative
    number to *sizep.  What that would do to the callers I can't say, but
    it's unlikely to be good.
    
    Fix by rejecting images whose size would overflow.
    
    Reported-by: Kurtis Miller <kurtis.miller@nccgroup.com>
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
    Message-Id: <20190409174018.25798-1-armbru@redhat.com>
    Markus Armbruster authored and alistair23 committed Apr 9, 2019
    Copy the full SHA
    065e629 View commit details
    Browse the repository at this point in the history
  2. migration/ram.c: Fix use-after-free in multifd_recv_unfill_packet()

    Coverity points out (CID 1400442) that in this code:
    
        if (packet->pages_alloc > p->pages->allocated) {
            multifd_pages_clear(p->pages);
            multifd_pages_init(packet->pages_alloc);
        }
    
    we free p->pages in multifd_pages_clear() but continue to
    use it in the following code. We also leak memory, because
    multifd_pages_init() returns the pointer to a new MultiFDPages_t
    struct but we are ignoring its return value.
    
    Fix both of these bugs by adding the missing assignment of
    the newly created struct to p->pages.
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Juan Quintela <quintela@redhat.com>
    Message-id: 20190409151830.6024-1-peter.maydell@linaro.org
    Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    pm215 committed Apr 9, 2019
    Copy the full SHA
    f151f8a View commit details
    Browse the repository at this point in the history
  3. Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into…

    … staging
    
    * fixes for Alpine and SuSE
    * fix crash when hot-plugging nvdimm on older machine types
    
    # gpg: Signature made Tue 09 Apr 2019 17:34:27 BST
    # gpg:                using RSA key BFFBD25F78C7AE83
    # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" [full]
    # gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>" [full]
    # Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4  E2F7 7E15 100C CD36 69B1
    #      Subkey fingerprint: F133 3857 4B66 2389 866C  7682 BFFB D25F 78C7 AE83
    
    * remotes/bonzini/tags/for-upstream:
      tests: Make check-block a phony target
      hw/i386/pc: Fix crash when hot-plugging nvdimm on older machine types
      include/qemu/bswap.h: Use __builtin_memcpy() in accessor functions
      roms: Allow passing configure options to the EDK2 build tools
      roms: Rename the EFIROM variable to avoid clashing with iPXE
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    pm215 committed Apr 9, 2019
    Copy the full SHA
    4b9a21c View commit details
    Browse the repository at this point in the history
  4. tests: Make check-block a phony target

    Fixes: b93b63f "test makefile overhaul"
    
    Signed-off-by: Markus Armbruster <armbru@redhat.com>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Message-Id: <20190319072104.32591-1-armbru@redhat.com>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Markus Armbruster authored and bonzini committed Apr 9, 2019
    Copy the full SHA
    3e20c81 View commit details
    Browse the repository at this point in the history
  5. hw/i386/pc: Fix crash when hot-plugging nvdimm on older machine types

    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: 9040e6d
    Signed-off-by: Thomas Huth <thuth@redhat.com>
    Message-Id: <20190407092314.11066-1-thuth@redhat.com>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    huth authored and bonzini committed Apr 9, 2019
    Copy the full SHA
    ae90949 View commit details
    Browse the repository at this point in the history
  6. include/qemu/bswap.h: Use __builtin_memcpy() in accessor functions

    In the accessor functions ld*_he_p() and st*_he_p() we use memcpy()
    to perform a load or store to a pointer which might not be aligned
    for the size of the type. We rely on the compiler to optimize this
    memcpy() into an efficient load or store instruction where possible.
    This is required for good performance, but at the moment it is also
    required for correct operation, because some users of these functions
    require that the access is atomic if the pointer is aligned, which
    will only be the case if the compiler has optimized out the memcpy().
    (The particular example where we discovered this is the virtio
    vring_avail_idx() which calls virtio_lduw_phys_cached() which
    eventually ends up calling lduw_he_p().)
    
    Unfortunately some compile environments, such as the fortify-source
    setup used in Alpine Linux, define memcpy() to a wrapper function
    in a way that inhibits this compiler optimization.
    
    The correct long-term fix here is to add a set of functions for
    doing atomic accesses into AddressSpaces (and to other relevant
    families of accessor functions like the virtio_*_phys_cached()
    ones), and make sure that callsites which want atomic behaviour
    use the correct functions.
    
    In the meantime, switch to using __builtin_memcpy() in the
    bswap.h accessor functions. This will make us robust against things
    like this fortify library in the short term. In the longer term
    it will mean that we don't end up with these functions being really
    badly-performing even if the semantics of the out-of-line memcpy()
    are correct.
    
    Reported-by: Fernando Casas Schössow <casasfernando@outlook.com>
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Message-Id: <20190318112938.8298-1-peter.maydell@linaro.org>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    pm215 authored and bonzini committed Apr 9, 2019
    Copy the full SHA
    77b1757 View commit details
    Browse the repository at this point in the history
  7. roms: Allow passing configure options to the EDK2 build tools

    Since commit f590a81 we build the EDK2 EfiRom utility
    unconditionally.
    
    Some distributions require to use extra compiler/linker flags,
    i.e. SUSE which enforces the PIE protection (see [*]).
    
    EDK2 build tools already provide a set of variables for that,
    use them to allow the caller to easily inject compiler/linker
    options..
    
    Now build scripts can pass extra options, example:
    
      $ make -C roms \
          EDK2_BASETOOLS_OPTFLAGS='-fPIE' \
          efirom
    
    [*] https://lists.opensuse.org/opensuse-factory/2017-06/msg00403.html
    
    Reported-by: Olaf Hering <olaf@aepfle.de>
    Suggested-by: Laszlo Ersek <lersek@redhat.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <20190409134536.15548-3-philmd@redhat.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Reviewed-by: Laszlo Ersek <lersek@redhat.com>
    Reviewed-by: Igor Mammedov <imammedo@redhat.com>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    philmd authored and bonzini committed Apr 9, 2019
    Copy the full SHA
    1cab464 View commit details
    Browse the repository at this point in the history
  8. roms: Rename the EFIROM variable to avoid clashing with iPXE

    The iPXE's 'veryclean' recipe removes $(EFIROM) even if the EFIROM
    macro originates from elsewhere:
    
      $ git checkout f590a81~
      $ make -C roms clean EFIROM=$(type -P EfiRom)
      make: Entering directory '/source/qemu/roms'
      [...]
      make -C ipxe/src veryclean
      make[1]: Entering directory '/source/qemu/roms/ipxe/src'
      rm -f bin{,-*}/*.* bin{,-*}/.certificate.* bin{,-*}/.certificates.* bin{,-*}/.private_key.* bin{,-*}/errors bin{,-*}/NIC ./util/zbin ./util/elf2efi32 ./util/elf2efi64 /usr/bin/EfiRom ./util/efifatbin ./util/iccfix ./util/einfo TAGS bin{,-*}/symtab
      rm: cannot remove '/usr/bin/EfiRom': Permission denied
      make[1]: *** [Makefile.housekeeping:1564: clean] Error 1
      make[1]: Leaving directory '/source/qemu/roms/ipxe/src'
      make: *** [Makefile:152: clean] Error 2
      make: Leaving directory '/source/qemu/roms'
    
    Before f590a81 this variable could be overridden or unset,
    and the 'veryclean' Makefile rule would not complain.
    
    Commit f590a81 enforces this variable to the Intel EfiRom
    tool provided by the EDK2 project.
    
    To avoid the name clash and make the difference between the
    projects obvious, rename the variable used by the EDK2 project
    as EDK2_EFIROM.
    
    Fixes: f590a81
    Reported-by: Olaf Hering <olaf@aepfle.de>
    Reviewed-by: Laszlo Ersek <lersek@redhat.com>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <20190409134536.15548-2-philmd@redhat.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    philmd authored and bonzini committed Apr 9, 2019
    Copy the full SHA
    d912e79 View commit details
    Browse the repository at this point in the history
  9. target/i386: Generate #UD for LOCK on a register increment

    Fix a TCG crash due to attempting an atomic increment
    operation without having set up the address first.
    This is a similar case to that dealt with in commit
    e84fcd7, and we fix it in the same way.
    
    Fixes: https://bugs.launchpad.net/qemu/+bug/1807675
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Acked-by: Paolo Bonzini <pbonzini@redhat.com>
    Message-id: 20190328104750.25046-1-peter.maydell@linaro.org
    pm215 committed Apr 9, 2019
    Copy the full SHA
    8cb2ca3 View commit details
    Browse the repository at this point in the history
  10. Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-4.0-201904…

    …09' into staging
    
    ppc patch queue 2019-04-09
    
    This is a small, hard freeze, pull request which fixes a regression on
    the pseries machine handling of PCI-E extended config space accesses.
    
    # gpg: Signature made Tue 09 Apr 2019 08:00:36 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.0-20190409:
      spapr_pci: Fix extended config space accesses
      pci: Allow PCI bus subtypes to support extended config space accesses
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    pm215 committed Apr 9, 2019
    Copy the full SHA
    120cba7 View commit details
    Browse the repository at this point in the history
  11. Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-4.0…

    …-pull-request' into staging
    
    fix gettid() clash with new glibc
    
    # gpg: Signature made Mon 08 Apr 2019 20:36:06 BST
    # gpg:                using RSA key F30C38BD3F2FBE3C
    # gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" [full]
    # gpg:                 aka "Laurent Vivier <laurent@vivier.eu>" [full]
    # gpg:                 aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" [full]
    # Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C
    
    * remotes/vivier2/tags/linux-user-for-4.0-pull-request:
      linux-user: rename gettid() to sys_gettid() to avoid clash with glibc
      linux-user: assume __NR_gettid always exists
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    pm215 committed Apr 9, 2019
    Copy the full SHA
    248987f View commit details
    Browse the repository at this point in the history
  12. spapr_pci: Fix extended config space accesses

    The PAPR PHB acts as a legacy PCI bus but it allows PCIe extended
    config space accesses anyway (for pseries-2.9 and newer machine
    types).
    
    Introduce a specific PCI bus subtype to inform the common PCI code
    about that.
    
    Fixes: c2077e2
    Signed-off-by: Greg Kurz <groug@kaod.org>
    Message-Id: <155414130834.574858.16502276132110219890.stgit@bahia.lan>
    [dwg: Apply fix so we don't rename the default pci bus, breaking everything]
    Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
    gkurz authored and dgibson committed Apr 9, 2019
    Copy the full SHA
    5cf0d32 View commit details
    Browse the repository at this point in the history

Commits on Apr 8, 2019

  1. pci: Allow PCI bus subtypes to support extended config space accesses

    Some PHB implementations, eg. PAPR used on pseries machine, act like
    a regular PCI bus rather than a PCIe bus, but allow access to the
    PCIe extended config space anyway.
    
    Introduce a new PCI bus class method to modelize this behaviour and
    use it when adjusting the config space size limit during accesses.
    
    No behaviour change for existing PCI bus types.
    
    Signed-off-by: Greg Kurz <groug@kaod.org>
    Message-Id: <155414130271.574858.4253514266378127489.stgit@bahia.lan>
    Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
    gkurz authored and dgibson committed Apr 8, 2019
    Copy the full SHA
    1c685a9 View commit details
    Browse the repository at this point in the history
Older