Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: qemu/qemu
base: cf51ff87b7f7
Choose a base ref
...
head repository: qemu/qemu
compare: daa3277175e7
Choose a head ref
  • 15 commits
  • 22 files changed
  • 7 contributors

Commits on Jul 31, 2023

  1. qemu-nbd: regression with arguments passing into nbd_client_thread()

    Unfortunately
        commit 03b6762
        (7.2:  6e216d2)
        Author: Denis V. Lunev <den@openvz.org>
        Date:   Mon Jul 17 16:55:40 2023 +0200
        qemu-nbd: pass structure into nbd_client_thread instead of plain char*
    has introduced a regression. struct NbdClientOpts resides on stack inside
    'if' block. This specifically means that this stack space could be reused
    once the execution will leave that block of the code.
    
    This means that parameters passed into nbd_client_thread could be
    overwritten at any moment.
    
    The patch moves the data to the namespace of main() function effectively
    preserving it for the whole process lifetime.
    
    Signed-off-by: Denis V. Lunev <den@openvz.org>
    CC: Eric Blake <eblake@redhat.com>
    CC: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
    CC: <qemu-stable@nongnu.org>
    Reviewed-by: Eric Blake <eblake@redhat.com>
    Message-ID: <20230727105828.324314-1-den@openvz.org>
    Signed-off-by: Eric Blake <eblake@redhat.com>
    (cherry picked from commit e5b815b)
    Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
    (Mjt: add reference to 6e216d2 for 7.2 branch)
    Denis V. Lunev authored and Michael Tokarev committed Jul 31, 2023
    Copy the full SHA
    3b80317 View commit details
    Browse the repository at this point in the history
  2. target/s390x: Make CKSM raise an exception if R2 is odd

    R2 designates an even-odd register pair; the instruction should raise
    a specification exception when R2 is not even.
    
    Cc: qemu-stable@nongnu.org
    Fixes: e023e83 ("s390x: translate engine for s390x CPU")
    Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
    Message-Id: <20230724082032.66864-2-iii@linux.ibm.com>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Reviewed-by: David Hildenbrand <david@redhat.com>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
    (cherry picked from commit 761b0aa)
    Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
    iii-i authored and Michael Tokarev committed Jul 31, 2023
    Copy the full SHA
    772caa5 View commit details
    Browse the repository at this point in the history
  3. target/s390x: Fix CLM with M3=0

    When the mask is zero, access exceptions should still be recognized for
    1 byte at the second-operand address. CC should be set to 0.
    
    Cc: qemu-stable@nongnu.org
    Fixes: defb0e3 ("s390x: Implement opcode helpers")
    Reviewed-by: David Hildenbrand <david@redhat.com>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
    Message-Id: <20230724082032.66864-3-iii@linux.ibm.com>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
    (cherry picked from commit 4b6e4c0)
    Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
    iii-i authored and Michael Tokarev committed Jul 31, 2023
    Copy the full SHA
    34009bf View commit details
    Browse the repository at this point in the history
  4. target/s390x: Fix CONVERT TO LOGICAL/FIXED with out-of-range inputs

    CONVERT TO LOGICAL/FIXED deviate from IEEE 754 in that they raise an
    inexact exception on out-of-range inputs. float_flag_invalid_cvti
    aligns nicely with that behavior, so convert it to
    S390_IEEE_MASK_INEXACT.
    
    Cc: qemu-stable@nongnu.org
    Fixes: defb0e3 ("s390x: Implement opcode helpers")
    Reviewed-by: David Hildenbrand <david@redhat.com>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
    Message-Id: <20230724082032.66864-4-iii@linux.ibm.com>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
    (cherry picked from commit 53684e3)
    Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
    iii-i authored and Michael Tokarev committed Jul 31, 2023
    Copy the full SHA
    7cf3358 View commit details
    Browse the repository at this point in the history
  5. target/s390x: Fix ICM with M3=0

    When the mask is zero, access exceptions should still be recognized for
    1 byte at the second-operand address. CC should be set to 0.
    
    Cc: qemu-stable@nongnu.org
    Fixes: e023e83 ("s390x: translate engine for s390x CPU")
    Reviewed-by: David Hildenbrand <david@redhat.com>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
    Message-Id: <20230724082032.66864-5-iii@linux.ibm.com>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
    (cherry picked from commit a202555)
    Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
    iii-i authored and Michael Tokarev committed Jul 31, 2023
    Copy the full SHA
    0ef0b83 View commit details
    Browse the repository at this point in the history
  6. target/s390x: Make MC raise specification exception when class >= 16

    MC requires bit positions 8-11 (upper 4 bits of class) to be zeros,
    otherwise it must raise a specification exception.
    
    Cc: qemu-stable@nongnu.org
    Fixes: 20d143e ("s390x/tcg: Implement MONITOR CALL")
    Reviewed-by: David Hildenbrand <david@redhat.com>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
    Message-Id: <20230724082032.66864-6-iii@linux.ibm.com>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
    (cherry picked from commit 9c028c0)
    Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
    (Mjt: context edit in target/s390x/tcg/translate.c)
    iii-i authored and Michael Tokarev committed Jul 31, 2023
    Copy the full SHA
    cdd6b6a View commit details
    Browse the repository at this point in the history
  7. target/s390x: Fix assertion failure in VFMIN/VFMAX with type 13

    Type 13 is reserved, so using it should result in specification
    exception. Due to an off-by-1 error the code triggers an assertion at a
    later point in time instead.
    
    Cc: qemu-stable@nongnu.org
    Fixes: da48075 ("s390x/tcg: Implement VECTOR FP (MAXIMUM|MINIMUM)")
    Reviewed-by: David Hildenbrand <david@redhat.com>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
    Message-Id: <20230724082032.66864-8-iii@linux.ibm.com>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
    (cherry picked from commit ff537b0)
    Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
    iii-i authored and Michael Tokarev committed Jul 31, 2023
    Copy the full SHA
    c1bdd3c View commit details
    Browse the repository at this point in the history
  8. target/loongarch: Fix the CSRRD CPUID instruction on big endian hosts

    The test in tests/avocado/machine_loongarch.py is currently failing
    on big endian hosts like s390x. By comparing the traces between running
    the QEMU_EFI.fd bios on a s390x and on a x86 host, it's quickly obvious
    that the CSRRD instruction for the CPUID is behaving differently. And
    indeed: The code currently does a long read (i.e. 64 bit) from the
    address that points to the CPUState->cpu_index field (with tcg_gen_ld_tl()
    in the trans_csrrd() function). But this cpu_index field is only an "int"
    (i.e. 32 bit). While this dirty pointer magic works on little endian hosts,
    it of course fails on big endian hosts. Fix it by using a proper helper
    function instead.
    
    Message-Id: <20230720175307.854460-1-thuth@redhat.com>
    Reviewed-by: Song Gao <gaosong@loongson.cn>
    Signed-off-by: Thomas Huth <thuth@redhat.com>
    (cherry picked from commit c34ad45)
    Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
    huth authored and Michael Tokarev committed Jul 31, 2023
    Copy the full SHA
    0c8e6ac View commit details
    Browse the repository at this point in the history
  9. virtio-pci: add handling of PCI ATS and Device-TLB enable/disable

    According to PCIe Address Translation Services specification 5.1.3.,
    ATS Control Register has Enable bit to enable/disable ATS. Guest may
    enable/disable PCI ATS and, accordingly, Device-TLB for the VirtIO PCI
    device. So, raise/lower a flag and call a trigger function to pass this
    event to a device implementation.
    
    Signed-off-by: Viktor Prutyanov <viktor@daynix.com>
    Message-Id: <20230512135122.70403-2-viktor@daynix.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    (cherry picked from commit 206e91d)
    Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
    (Mjt: include/hw/virtio/virtio.h: skip extra struct field added in 8.0)
    viktor-prutyanov authored and Michael Tokarev committed Jul 31, 2023
    Copy the full SHA
    6169347 View commit details
    Browse the repository at this point in the history
  10. vhost: register and change IOMMU flag depending on Device-TLB state

    The guest can disable or never enable Device-TLB. In these cases,
    it can't be used even if enabled in QEMU. So, check Device-TLB state
    before registering IOMMU notifier and select unmap flag depending on
    that. Also, implement a way to change IOMMU notifier flag if Device-TLB
    state is changed.
    
    Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=2001312
    Signed-off-by: Viktor Prutyanov <viktor@daynix.com>
    Acked-by: Jason Wang <jasowang@redhat.com>
    Message-Id: <20230626091258.24453-2-viktor@daynix.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    (cherry picked from commit ee071f6)
    Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
    viktor-prutyanov authored and Michael Tokarev committed Jul 31, 2023
    Copy the full SHA
    9a541b2 View commit details
    Browse the repository at this point in the history
  11. virtio-net: pass Device-TLB enable/disable events to vhost

    If vhost is enabled for virtio-net, Device-TLB enable/disable events
    must be passed to vhost for proper IOMMU unmap flag selection.
    
    Signed-off-by: Viktor Prutyanov <viktor@daynix.com>
    Acked-by: Jason Wang <jasowang@redhat.com>
    Message-Id: <20230626091258.24453-3-viktor@daynix.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    (cherry picked from commit cd9b834)
    Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
    viktor-prutyanov authored and Michael Tokarev committed Jul 31, 2023
    Copy the full SHA
    ec93426 View commit details
    Browse the repository at this point in the history
  12. hw/arm/smmu: Handle big-endian hosts correctly

    The implementation of the SMMUv3 has multiple places where it reads a
    data structure from the guest and directly operates on it without
    doing a guest-to-host endianness conversion.  Since all SMMU data
    structures are little-endian, this means that the SMMU doesn't work
    on a big-endian host.  In particular, this causes the Avocado test
      machine_aarch64_virt.py:Aarch64VirtMachine.test_alpine_virt_tcg_gic_max
    to fail on an s390x host.
    
    Add appropriate byte-swapping on reads and writes of guest in-memory
    data structures so that the device works correctly on big-endian
    hosts.
    
    As part of this we constrain queue_read() to operate only on Cmd
    structs and queue_write() on Evt structs, because in practice these
    are the only data structures the two functions are used with, and we
    need to know what the data structure is to be able to byte-swap its
    parts correctly.
    
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Tested-by: Thomas Huth <thuth@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
    Reviewed-by: Eric Auger <eric.auger@redhat.com>
    Message-id: 20230717132641.764660-1-peter.maydell@linaro.org
    Cc: qemu-stable@nongnu.org
    (cherry picked from commit c644554)
    Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
    pm215 authored and Michael Tokarev committed Jul 31, 2023
    Copy the full SHA
    8cce5d0 View commit details
    Browse the repository at this point in the history
  13. target/arm: Avoid writing to constant TCGv in trans_CSEL()

    In commit 0b188ea we changed the implementation of
    trans_CSEL() to use tcg_constant_i32(). However, this change
    was incorrect, because the implementation of the function
    sets up the TCGv_i32 rn and rm to be either zero or else
    a TCG temp created in load_reg(), and these TCG temps are
    then in both cases written to by the emitted TCG ops.
    The result is that we hit a TCG assertion:
    
    qemu-system-arm: ../../tcg/tcg.c:4455: tcg_reg_alloc_mov: Assertion `!temp_readonly(ots)' failed.
    
    (or on a non-debug build, just produce a garbage result)
    
    Adjust the code so that rn and rm are always writeable
    temporaries whether the instruction is using the special
    case "0" or a normal register as input.
    
    Cc: qemu-stable@nongnu.org
    Fixes: 0b188ea ("target/arm: Use tcg_constant in trans_CSEL")
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Message-id: 20230727103906.2641264-1-peter.maydell@linaro.org
    (cherry picked from commit 2b0d656)
    Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
    (Mjt: context fixup in target/arm/tcg/translate.c)
    pm215 authored and Michael Tokarev committed Jul 31, 2023
    Copy the full SHA
    26a49f9 View commit details
    Browse the repository at this point in the history

Commits on Aug 1, 2023

  1. target/ppc: Disable goto_tb with architectural singlestep

    The change to use translator_use_goto_tb went too far, as the
    CF_SINGLE_STEP flag managed by the translator only handles
    gdb single stepping and not the architectural single stepping
    modeled in DisasContext.singlestep_enabled.
    
    Fixes: 6e9cc37 ("target/ppc: Use translator_use_goto_tb")
    Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1795
    Reviewed-by: Cédric Le Goater <clg@kaod.org>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
    Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
    (cherry picked from commit 2e718e6)
    Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
    rth7680 authored and Michael Tokarev committed Aug 1, 2023
    Copy the full SHA
    d53d3f0 View commit details
    Browse the repository at this point in the history
  2. linux-user/armeb: Fix __kernel_cmpxchg() for armeb

    Commit 7f4f0d9 ("linux-user/arm: Implement __kernel_cmpxchg with host
    atomics") switched to use qatomic_cmpxchg() to swap a word with the memory
    content, but missed to endianess-swap the oldval and newval values when
    emulating an armeb CPU, which expects words to be stored in big endian in
    the guest memory.
    
    The bug can be verified with qemu >= v7.0 on any little-endian host, when
    starting the armeb binary of the upx program, which just hangs without
    this patch.
    
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Helge Deller <deller@gmx.de>
    Reported-by: "Markus F.X.J. Oberhumer" <markus@oberhumer.com>
    Reported-by: John Reiser <jreiser@BitWagon.com>
    Closes: upx/upx#687
    Message-Id: <ZMQVnqY+F+5sTNFd@p100>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
    (cherry picked from commit 38dd78c)
    Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
    hdeller authored and Michael Tokarev committed Aug 1, 2023
    Copy the full SHA
    daa3277 View commit details
    Browse the repository at this point in the history