Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update 8.1 #33

Closed
wants to merge 118 commits into from
Closed

Commits on Aug 23, 2023

  1. target/s390x: Fix the "ignored match" case in VSTRS

    Currently the emulation of VSTRS recognizes partial matches in presence
    of \0 in the haystack, which, according to PoP, is not correct:
    
        If the ZS flag is one and a zero byte was detected
        in the second operand, then there can not be a
        partial match ...
    
    Add a check for this. While at it, fold a number of explicitly handled
    special cases into the generic logic.
    
    Cc: [email protected]
    Reported-by: Claudio Fontana <[email protected]>
    Closes: https://lists.gnu.org/archive/html/qemu-devel/2023-08/msg00633.html
    Fixes: 1d706f3 ("target/s390x: vxeh2: vector string search")
    Signed-off-by: Ilya Leoshkevich <[email protected]>
    Message-Id: <[email protected]>
    Tested-by: Claudio Fontana <[email protected]>
    Acked-by: David Hildenbrand <[email protected]>
    Signed-off-by: Thomas Huth <[email protected]>
    (cherry picked from commit 791b2b6)
    Signed-off-by: Michael Tokarev <[email protected]>
    iii-i authored and Michael Tokarev committed Aug 23, 2023
    Configuration menu
    Copy the full SHA
    5980189 View commit details
    Browse the repository at this point in the history
  2. target/s390x: Use a 16-bit immediate in VREP

    Unlike most other instructions that contain an immediate element index,
    VREP's one is 16-bit, and not 4-bit. The code uses only 8 bits, so
    using, e.g., 0x101 does not lead to a specification exception.
    
    Fix by checking all 16 bits.
    
    Cc: [email protected]
    Fixes: 28d0873 ("s390x/tcg: Implement VECTOR REPLICATE")
    Signed-off-by: Ilya Leoshkevich <[email protected]>
    Message-Id: <[email protected]>
    Reviewed-by: David Hildenbrand <[email protected]>
    Signed-off-by: Thomas Huth <[email protected]>
    (cherry picked from commit 23e87d4)
    Signed-off-by: Michael Tokarev <[email protected]>
    iii-i authored and Michael Tokarev committed Aug 23, 2023
    Configuration menu
    Copy the full SHA
    880e82e View commit details
    Browse the repository at this point in the history
  3. target/s390x: Fix VSTL with a large length

    The length is always truncated to 16 bytes. Do not probe more than
    that.
    
    Cc: [email protected]
    Fixes: 0e0a5b4 ("s390x/tcg: Implement VECTOR STORE WITH LENGTH")
    Signed-off-by: Ilya Leoshkevich <[email protected]>
    Message-Id: <[email protected]>
    Reviewed-by: David Hildenbrand <[email protected]>
    Signed-off-by: Thomas Huth <[email protected]>
    (cherry picked from commit 6db3518)
    Signed-off-by: Michael Tokarev <[email protected]>
    iii-i authored and Michael Tokarev committed Aug 23, 2023
    Configuration menu
    Copy the full SHA
    c12eddb View commit details
    Browse the repository at this point in the history
  4. target/s390x: Check reserved bits of VFMIN/VFMAX's M5

    VFMIN and VFMAX should raise a specification exceptions when bits 1-3
    of M5 are set.
    
    Cc: [email protected]
    Fixes: da48075 ("s390x/tcg: Implement VECTOR FP (MAXIMUM|MINIMUM)")
    Signed-off-by: Ilya Leoshkevich <[email protected]>
    Message-Id: <[email protected]>
    Reviewed-by: David Hildenbrand <[email protected]>
    Signed-off-by: Thomas Huth <[email protected]>
    (cherry picked from commit 6a2ea61)
    Signed-off-by: Michael Tokarev <[email protected]>
    iii-i authored and Michael Tokarev committed Aug 23, 2023
    Configuration menu
    Copy the full SHA
    14a8213 View commit details
    Browse the repository at this point in the history
  5. include/hw/virtio/virtio-gpu: Fix virtio-gpu with blob on big endian …

    …hosts
    
    Using "-device virtio-gpu,blob=true" currently does not work on big
    endian hosts (like s390x). The guest kernel prints an error message
    like:
    
     [drm:virtio_gpu_dequeue_ctrl_func [virtio_gpu]] *ERROR* response 0x1200 (command 0x10c)
    
    and the display stays black. When running QEMU with "-d guest_errors",
    it shows an error message like this:
    
     virtio_gpu_create_mapping_iov: nr_entries is too big (83886080 > 16384)
    
    which indicates that this value has not been properly byte-swapped.
    And indeed, the virtio_gpu_create_blob_bswap() function (that should
    swap the fields in the related structure) fails to swap some of the
    entries. After correctly swapping all missing values here, too, the
    virtio-gpu device is now also working with blob=true on s390x hosts.
    
    Fixes: e0933d9 ("virtio-gpu: Add virtio_gpu_resource_create_blob")
    Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=2230469
    Message-Id: <[email protected]>
    Reviewed-by: Marc-André Lureau <[email protected]>
    Signed-off-by: Thomas Huth <[email protected]>
    (cherry picked from commit d194362)
    Signed-off-by: Michael Tokarev <[email protected]>
    huth authored and Michael Tokarev committed Aug 23, 2023
    Configuration menu
    Copy the full SHA
    01f6417 View commit details
    Browse the repository at this point in the history

Commits on Aug 24, 2023

  1. kvm: Introduce kvm_arch_get_default_type hook

    kvm_arch_get_default_type() returns the default KVM type. This hook is
    particularly useful to derive a KVM type that is valid for "none"
    machine model, which is used by libvirt to probe the availability of
    KVM.
    
    For MIPS, the existing mips_kvm_type() is reused. This function ensures
    the availability of VZ which is mandatory to use KVM on the current
    QEMU.
    
    Cc: [email protected]
    Signed-off-by: Akihiko Odaki <[email protected]>
    Message-id: [email protected]
    Reviewed-by: Peter Maydell <[email protected]>
    [PMM: added doc comment for new function]
    Signed-off-by: Peter Maydell <[email protected]>
    Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
    (cherry picked from commit 5e0d659)
    Signed-off-by: Michael Tokarev <[email protected]>
    akihikodaki authored and Michael Tokarev committed Aug 24, 2023
    Configuration menu
    Copy the full SHA
    34808d0 View commit details
    Browse the repository at this point in the history
  2. accel/kvm: Specify default IPA size for arm64

    Before this change, the default KVM type, which is used for non-virt
    machine models, was 0.
    
    The kernel documentation says:
    > On arm64, the physical address size for a VM (IPA Size limit) is
    > limited to 40bits by default. The limit can be configured if the host
    > supports the extension KVM_CAP_ARM_VM_IPA_SIZE. When supported, use
    > KVM_VM_TYPE_ARM_IPA_SIZE(IPA_Bits) to set the size in the machine type
    > identifier, where IPA_Bits is the maximum width of any physical
    > address used by the VM. The IPA_Bits is encoded in bits[7-0] of the
    > machine type identifier.
    >
    > e.g, to configure a guest to use 48bit physical address size::
    >
    >     vm_fd = ioctl(dev_fd, KVM_CREATE_VM, KVM_VM_TYPE_ARM_IPA_SIZE(48));
    >
    > The requested size (IPA_Bits) must be:
    >
    >  ==   =========================================================
    >   0   Implies default size, 40bits (for backward compatibility)
    >   N   Implies N bits, where N is a positive integer such that,
    >       32 <= N <= Host_IPA_Limit
    >  ==   =========================================================
    
    > Host_IPA_Limit is the maximum possible value for IPA_Bits on the host
    > and is dependent on the CPU capability and the kernel configuration.
    > The limit can be retrieved using KVM_CAP_ARM_VM_IPA_SIZE of the
    > KVM_CHECK_EXTENSION ioctl() at run-time.
    >
    > Creation of the VM will fail if the requested IPA size (whether it is
    > implicit or explicit) is unsupported on the host.
    https://docs.kernel.org/virt/kvm/api.html#kvm-create-vm
    
    So if Host_IPA_Limit < 40, specifying 0 as the type will fail. This
    actually confused libvirt, which uses "none" machine model to probe the
    KVM availability, on M2 MacBook Air.
    
    Fix this by using Host_IPA_Limit as the default type when
    KVM_CAP_ARM_VM_IPA_SIZE is available.
    
    Cc: [email protected]
    Signed-off-by: Akihiko Odaki <[email protected]>
    Message-id: [email protected]
    Reviewed-by: Peter Maydell <[email protected]>
    Signed-off-by: Peter Maydell <[email protected]>
    (cherry picked from commit 1ab445a)
    Signed-off-by: Michael Tokarev <[email protected]>
    akihikodaki authored and Michael Tokarev committed Aug 24, 2023
    Configuration menu
    Copy the full SHA
    c8e381d View commit details
    Browse the repository at this point in the history
  3. target/arm: Fix SME ST1Q

    A typo, noted in the bug report, resulting in an
    incorrect write offset.
    
    Cc: [email protected]
    Fixes: 7390e0e ("target/arm: Implement SME LD1, ST1")
    Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1833
    Signed-off-by: Richard Henderson <[email protected]>
    Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
    Message-id: [email protected]
    Signed-off-by: Peter Maydell <[email protected]>
    (cherry picked from commit 4b3520f)
    Signed-off-by: Michael Tokarev <[email protected]>
    rth7680 authored and Michael Tokarev committed Aug 24, 2023
    Configuration menu
    Copy the full SHA
    7012e20 View commit details
    Browse the repository at this point in the history
  4. target/arm: Fix 64-bit SSRA

    Typo applied byte-wise shift instead of double-word shift.
    
    Cc: [email protected]
    Fixes: 631e565 ("target/arm: Create gen_gvec_[us]sra")
    Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1737
    Signed-off-by: Richard Henderson <[email protected]>
    Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
    Message-id: [email protected]
    Signed-off-by: Peter Maydell <[email protected]>
    (cherry picked from commit cd1e4db)
    Signed-off-by: Michael Tokarev <[email protected]>
    rth7680 authored and Michael Tokarev committed Aug 24, 2023
    Configuration menu
    Copy the full SHA
    63188a0 View commit details
    Browse the repository at this point in the history
  5. docs/about/license: Update LICENSE URL

    In early 2021 (see commit 2ad7843 "docs: update README to use
    GitLab repo URLs") almost all of the code base was converted to
    point to GitLab instead of git.qemu.org. During 2023, git.qemu.org
    switched from a git mirror to a http redirect to GitLab (see [1]).
    
    Update the LICENSE URL to match its previous content, displaying
    the file raw content similarly to gitweb 'blob_plain' format ([2]).
    
    [1] https://lore.kernel.org/qemu-devel/CABgObfZu3mFc8tM20K-yXdt7F-7eV-uKZN4sKDarSeu7DYoRbA@mail.gmail.com/
    [2] https://git-scm.com/docs/gitweb#Documentation/gitweb.txt-blobplain
    
    Reviewed-by: Daniel P. Berrangé <[email protected]>
    Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
    Reviewed-by: Thomas Huth <[email protected]>
    Reviewed-by: Stefan Hajnoczi <[email protected]>
    Signed-off-by: Stefan Hajnoczi <[email protected]>
    Message-ID: <[email protected]>
    (cherry picked from commit 09a3fff)
    Signed-off-by: Michael Tokarev <[email protected]>
    philmd authored and Michael Tokarev committed Aug 24, 2023
    Configuration menu
    Copy the full SHA
    441106e View commit details
    Browse the repository at this point in the history

Commits on Aug 30, 2023

  1. softmmu: Assert data in bounds in iotlb_to_section

    Acked-by: Alex Bennée <[email protected]>
    Suggested-by: Alex Bennée <[email protected]>
    Signed-off-by: Richard Henderson <[email protected]>
    (cherry picked from commit 86e4f93)
    Signed-off-by: Michael Tokarev <[email protected]>
    rth7680 authored and Michael Tokarev committed Aug 30, 2023
    Configuration menu
    Copy the full SHA
    5691fbf View commit details
    Browse the repository at this point in the history

Commits on Sep 21, 2023

  1. block-migration: Ensure we don't crash during migration cleanup

    We can fail the blk_insert_bs() at init_blk_migration(), leaving the
    BlkMigDevState without a dirty_bitmap and BlockDriverState. Account
    for the possibly missing elements when doing cleanup.
    
    Fix the following crashes:
    
    Thread 1 "qemu-system-x86" received signal SIGSEGV, Segmentation fault.
    0x0000555555ec83ef in bdrv_release_dirty_bitmap (bitmap=0x0) at ../block/dirty-bitmap.c:359
    359         BlockDriverState *bs = bitmap->bs;
     #0  0x0000555555ec83ef in bdrv_release_dirty_bitmap (bitmap=0x0) at ../block/dirty-bitmap.c:359
     qemu#1  0x0000555555bba331 in unset_dirty_tracking () at ../migration/block.c:371
     qemu#2  0x0000555555bbad98 in block_migration_cleanup_bmds () at ../migration/block.c:681
    
    Thread 1 "qemu-system-x86" received signal SIGSEGV, Segmentation fault.
    0x0000555555e971ff in bdrv_op_unblock (bs=0x0, op=BLOCK_OP_TYPE_BACKUP_SOURCE, reason=0x0) at ../block.c:7073
    7073        QLIST_FOREACH_SAFE(blocker, &bs->op_blockers[op], list, next) {
     #0  0x0000555555e971ff in bdrv_op_unblock (bs=0x0, op=BLOCK_OP_TYPE_BACKUP_SOURCE, reason=0x0) at ../block.c:7073
     qemu#1  0x0000555555e9734a in bdrv_op_unblock_all (bs=0x0, reason=0x0) at ../block.c:7095
     qemu#2  0x0000555555bbae13 in block_migration_cleanup_bmds () at ../migration/block.c:690
    
    Signed-off-by: Fabiano Rosas <[email protected]>
    Message-id: [email protected]
    Signed-off-by: Stefan Hajnoczi <[email protected]>
    (cherry picked from commit f187609)
    Signed-off-by: Michael Tokarev <[email protected]>
    Fabiano Rosas authored and Michael Tokarev committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    86d7b08 View commit details
    Browse the repository at this point in the history
  2. target/arm: properly document FEAT_CRC32

    This is a mandatory feature for Armv8.1 architectures but we don't
    state the feature clearly in our emulation list. Also include
    FEAT_CRC32 comment in aarch64_max_tcg_initfn for ease of grepping.
    
    Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
    Signed-off-by: Alex Bennée <[email protected]>
    Message-id: [email protected]
    Cc: [email protected]
    Message-Id: <[email protected]>
    [PMM: pluralize 'instructions' in docs]
    Signed-off-by: Peter Maydell <[email protected]>
    (cherry picked from commit 9e771a2)
    Signed-off-by: Michael Tokarev <[email protected]>
    stsquad authored and Michael Tokarev committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    645b87f View commit details
    Browse the repository at this point in the history
  3. linux-user: Adjust brk for load_bias

    PIE executables are usually linked at offset 0 and are
    relocated somewhere during load.  The hiaddr needs to
    be adjusted to keep the brk next to the executable.
    
    Cc: [email protected]
    Fixes: 1f356e8 ("linux-user: Adjust initial brk when interpreter is close to executable")
    Tested-by: Helge Deller <[email protected]>
    Reviewed-by: Ilya Leoshkevich <[email protected]>
    Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
    Signed-off-by: Richard Henderson <[email protected]>
    (cherry picked from commit aec338d)
    Signed-off-by: Michael Tokarev <[email protected]>
    rth7680 authored and Michael Tokarev committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    e5e77f2 View commit details
    Browse the repository at this point in the history
  4. target/i386: raise FERR interrupt with iothread locked

    Otherwise tcg_handle_interrupt() triggers an assertion failure:
    
      qemu#5  0x0000555555c97369 in tcg_handle_interrupt (cpu=0x555557434cb0, mask=2) at ../accel/tcg/tcg-accel-ops.c:83
      qemu#6  tcg_handle_interrupt (cpu=0x555557434cb0, mask=2) at ../accel/tcg/tcg-accel-ops.c:81
      qemu#7  0x0000555555b4d58b in pic_irq_request (opaque=<optimized out>, irq=<optimized out>, level=1) at ../hw/i386/x86.c:555
      qemu#8  0x0000555555b4f218 in gsi_handler (opaque=0x5555579423d0, n=13, level=1) at ../hw/i386/x86.c:611
      qemu#9  0x00007fffa42bde14 in code_gen_buffer ()
      qemu#10 0x0000555555c724bb in cpu_tb_exec (cpu=cpu@entry=0x555557434cb0, itb=<optimized out>, tb_exit=tb_exit@entry=0x7fffe9bfd658) at ../accel/tcg/cpu-exec.c:457
    
    Cc: [email protected]
    Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1808
    Reported-by: NyanCatTW1 <https://gitlab.com/a0939712328>
    Co-developed-by: Richard Henderson <[email protected]>'
    Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
    Signed-off-by: Paolo Bonzini <[email protected]>
    (cherry picked from commit c1f27a0)
    Signed-off-by: Michael Tokarev <[email protected]>
    bonzini authored and Michael Tokarev committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    e975434 View commit details
    Browse the repository at this point in the history
  5. ui/dbus: Properly dispose touch/mouse dbus objects

    Fixes: 142ca62 ("ui: add a D-Bus display backend")
    Fixes: de9f844 ("ui/dbus: Expose a touch device interface")
    
    Signed-off-by: Bilal Elmoussaoui <[email protected]>
    Reviewed-by: Marc-André Lureau <[email protected]>
    Message-Id: <[email protected]>
    (cherry picked from commit cb6ccdc)
    Signed-off-by: Michael Tokarev <[email protected]>
    bilelmoussaoui authored and Michael Tokarev committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    0175121 View commit details
    Browse the repository at this point in the history
  6. ppc/vof: Fix missed fields in VOF cleanup

    Failing to reset the of_instance_last makes ihandle allocation continue
    to increase, which causes record-replay replay fail to match the
    recorded trace.
    
    Not resetting claimed_base makes VOF eventually run out of memory after
    some resets.
    
    Cc: Alexey Kardashevskiy <[email protected]>
    Fixes: fc8c745 ("spapr: Implement Open Firmware client interface")
    Signed-off-by: Nicholas Piggin <[email protected]>
    Reviewed-by: Alexey Kardashevskiy <[email protected]>
    Signed-off-by: Cédric Le Goater <[email protected]>
    (cherry picked from commit 7b8589d)
    Signed-off-by: Michael Tokarev <[email protected]>
    npiggin authored and Michael Tokarev committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    6864f05 View commit details
    Browse the repository at this point in the history
  7. hw/ppc/e500: fix broken snapshot replay

    ppce500_reset_device_tree is registered for system reset, but after
    c4b0753 this function rerandomizes rng-seed via
    qemu_guest_getrandom_nofail. And when loading a snapshot, it tries to read
    EVENT_RANDOM that doesn't exist, so we have an error:
    
      qemu-system-ppc: Missing random event in the replay log
    
    To fix this, use qemu_register_reset_nosnapshotload instead of
    qemu_register_reset.
    
    Reported-by: Vitaly Cheptsov <[email protected]>
    Fixes: c4b0753 ("hw/ppc: pass random seed to fdt ")
    Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1634
    Signed-off-by: Maksim Kostin <[email protected]>
    Reviewed-by: Nicholas Piggin <[email protected]>
    Signed-off-by: Cédric Le Goater <[email protected]>
    (cherry picked from commit 6ec65b6)
    Signed-off-by: Michael Tokarev <[email protected]>
    Maksim Kostin authored and Michael Tokarev committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    5358980 View commit details
    Browse the repository at this point in the history
  8. target/ppc: Flush inputs to zero with NJ in ppc_store_vscr

    Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1779
    Signed-off-by: Richard Henderson <[email protected]>
    Reviewed-by: Nicholas Piggin <[email protected]>
    Signed-off-by: Cédric Le Goater <[email protected]>
    (cherry picked from commit af03aeb)
    Signed-off-by: Michael Tokarev <[email protected]>
    rth7680 authored and Michael Tokarev committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    9f54fef View commit details
    Browse the repository at this point in the history
  9. target/ppc: Fix LQ, STQ register-pair order for big-endian

    LQ, STQ have the same register-pair ordering as LQARX/STQARX., which is
    the even (lower) register contains the most significant bits. This is
    not implemented correctly for big-endian.
    
    do_ldst_quad() has variables low_addr_gpr and high_addr_gpr which is
    confusing because they are low and high addresses, whereas LQARX/STQARX.
    and most such things use the low and high values for lo/hi variables.
    The conversion to native 128-bit memory access functions missed this
    strangeness.
    
    Fix this by changing the if condition, and change the variable names to
    hi/lo to match convention.
    
    Cc: [email protected]
    Reported-by: Ivan Warren <[email protected]>
    Fixes: 57b38ff ("target/ppc: Use tcg_gen_qemu_{ld,st}_i128 for LQARX, LQ, STQ")
    Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1836
    Signed-off-by: Nicholas Piggin <[email protected]>
    Reviewed-by: Richard Henderson <[email protected]>
    Signed-off-by: Cédric Le Goater <[email protected]>
    (cherry picked from commit 7182093)
    Signed-off-by: Michael Tokarev <[email protected]>
    npiggin authored and Michael Tokarev committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    f64f1f8 View commit details
    Browse the repository at this point in the history
  10. hw/ide/core: set ERR_STAT in unsupported command completion

    Currently, the first time sending an unsupported command
    (e.g. READ LOG DMA EXT) will not have ERR_STAT set in the completion.
    Sending the unsupported command again, will correctly have ERR_STAT set.
    
    When ide_cmd_permitted() returns false, it calls ide_abort_command().
    ide_abort_command() first calls ide_transfer_stop(), which will call
    ide_transfer_halt() and ide_cmd_done(), after that ide_abort_command()
    sets ERR_STAT in status.
    
    ide_cmd_done() for AHCI will call ahci_write_fis_d2h() which writes the
    current status in the FIS, and raises an IRQ. (The status here will not
    have ERR_STAT set!).
    
    Thus, we cannot call ide_transfer_stop() before setting ERR_STAT, as
    ide_transfer_stop() will result in the FIS being written and an IRQ
    being raised.
    
    The reason why it works the second time, is that ERR_STAT will still
    be set from the previous command, so when writing the FIS, the
    completion will correctly have ERR_STAT set.
    
    Set ERR_STAT before writing the FIS (calling cmd_done), so that we will
    raise an error IRQ correctly when receiving an unsupported command.
    
    Signed-off-by: Niklas Cassel <[email protected]>
    Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
    Message-id: [email protected]
    Signed-off-by: John Snow <[email protected]>
    (cherry picked from commit c3461c6)
    Signed-off-by: Michael Tokarev <[email protected]>
    floatious authored and Michael Tokarev committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    c2e0495 View commit details
    Browse the repository at this point in the history
  11. hw/ide/ahci: write D2H FIS when processing NCQ command

    The way that BUSY + PxCI is cleared for NCQ (FPDMA QUEUED) commands is
    described in SATA 3.5a Gold:
    
    11.15 FPDMA QUEUED command protocol
    DFPDMAQ2: ClearInterfaceBsy
    "Transmit Register Device to Host FIS with the BSY bit cleared to zero
    and the DRQ bit cleared to zero and Interrupt bit cleared to zero to
    mark interface ready for the next command."
    
    PxCI is currently cleared by handle_cmd(), but we don't write the D2H
    FIS to the FIS Receive Area that actually caused PxCI to be cleared.
    
    Similar to how ahci_pio_transfer() calls ahci_write_fis_pio() with an
    additional parameter to write a PIO Setup FIS without raising an IRQ,
    add a parameter to ahci_write_fis_d2h() so that ahci_write_fis_d2h()
    also can write the FIS to the FIS Receive Area without raising an IRQ.
    
    Change process_ncq_command() to call ahci_write_fis_d2h() without
    raising an IRQ (similar to ahci_pio_transfer()), such that the FIS
    Receive Area is in sync with the PxTFD shadow register.
    
    E.g. Linux reads status and error fields from the FIS Receive Area
    directly, so it is wise to keep the FIS Receive Area and the PxTFD
    shadow register in sync.
    
    Signed-off-by: Niklas Cassel <[email protected]>
    Message-id: [email protected]
    Signed-off-by: John Snow <[email protected]>
    (cherry picked from commit 2967dc8)
    Signed-off-by: Michael Tokarev <[email protected]>
    floatious authored and Michael Tokarev committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    1efefd1 View commit details
    Browse the repository at this point in the history
  12. hw/ide/ahci: simplify and document PxCI handling

    The AHCI spec states that:
    For NCQ, PxCI is cleared on command queued successfully.
    
    For non-NCQ, PxCI is cleared on command completed successfully.
    (A non-NCQ command that completes with error does not clear PxCI.)
    
    The current QEMU implementation either clears PxCI in check_cmd(),
    or in ahci_cmd_done().
    
    check_cmd() will clear PxCI for a command if handle_cmd() returns 0.
    handle_cmd() will return -1 if BUSY or DRQ is set.
    
    The QEMU implementation for NCQ commands will currently not set BUSY
    or DRQ, so they will always have PxCI cleared by handle_cmd().
    ahci_cmd_done() will never even get called for NCQ commands.
    
    Non-NCQ commands are executed by ide_bus_exec_cmd().
    Non-NCQ commands in QEMU are implemented either in a sync or in an async
    way.
    
    For non-NCQ commands implemented in a sync way, the command handler will
    return true, and when ide_bus_exec_cmd() sees that a command handler
    returns true, it will call ide_cmd_done() (which will call
    ahci_cmd_done()). For a command implemented in a sync way,
    ahci_cmd_done() will do nothing (since busy_slot is not set). Instead,
    after ide_bus_exec_cmd() has finished, check_cmd() will clear PxCI for
    these commands.
    
    For non-NCQ commands implemented in an async way (using either aiocb or
    pio_aiocb), the command handler will return false, ide_bus_exec_cmd()
    will not call ide_cmd_done(), instead it is expected that the async
    callback function will call ide_cmd_done() once the async command is
    done. handle_cmd() will set busy_slot, if and only if BUSY or DRQ is
    set, and this is checked _after_ ide_bus_exec_cmd() has returned.
    handle_cmd() will return -1, so check_cmd() will not clear PxCI.
    When the async callback calls ide_cmd_done() (which will call
    ahci_cmd_done()), it will see that busy_slot is set, and
    ahci_cmd_done() will clear PxCI.
    
    This seems racy, since busy_slot is set _after_ ide_bus_exec_cmd() has
    returned. The callback might come before busy_slot gets set. And it is
    quite confusing that ahci_cmd_done() will be called for all non-NCQ
    commands when the command is done, but will only clear PxCI in certain
    cases, even though it will always write a D2H FIS and raise an IRQ.
    
    Even worse, in the case where ahci_cmd_done() does not clear PxCI, it
    still raises an IRQ. Host software might thus read an old PxCI value,
    since PxCI is cleared (by check_cmd()) after the IRQ has been raised.
    
    Try to simplify this by always setting busy_slot for non-NCQ commands,
    such that ahci_cmd_done() will always be responsible for clearing PxCI
    for non-NCQ commands.
    
    For NCQ commands, clear PxCI when we receive the D2H FIS, but before
    raising the IRQ, see AHCI 1.3.1, section 5.3.8, states RegFIS:Entry and
    RegFIS:ClearCI.
    
    Signed-off-by: Niklas Cassel <[email protected]>
    Message-id: [email protected]
    Signed-off-by: John Snow <[email protected]>
    (cherry picked from commit e2a5d9b)
    Signed-off-by: Michael Tokarev <[email protected]>
    floatious authored and Michael Tokarev committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    16cc959 View commit details
    Browse the repository at this point in the history
  13. hw/ide/ahci: PxSACT and PxCI is cleared when PxCMD.ST is cleared

    According to AHCI 1.3.1 definition of PxSACT:
    This field is cleared when PxCMD.ST is written from a '1' to a '0' by
    software. This field is not cleared by a COMRESET or a software reset.
    
    According to AHCI 1.3.1 definition of PxCI:
    This field is also cleared when PxCMD.ST is written from a '1' to a '0'
    by software.
    
    Clearing PxCMD.ST is part of the error recovery procedure, see
    AHCI 1.3.1, section "6.2 Error Recovery".
    
    If we don't clear PxCI on error recovery, the previous command will
    incorrectly still be marked as pending after error recovery.
    
    Signed-off-by: Niklas Cassel <[email protected]>
    Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
    Message-id: [email protected]
    Signed-off-by: John Snow <[email protected]>
    (cherry picked from commit d73b84d)
    Signed-off-by: Michael Tokarev <[email protected]>
    floatious authored and Michael Tokarev committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    4fbd5a5 View commit details
    Browse the repository at this point in the history
  14. hw/ide/ahci: PxCI should not get cleared when ERR_STAT is set

    For NCQ, PxCI is cleared on command queued successfully.
    For non-NCQ, PxCI is cleared on command completed successfully.
    Successfully means ERR_STAT, BUSY and DRQ are all cleared.
    
    A command that has ERR_STAT set, does not get to clear PxCI.
    See AHCI 1.3.1, section 5.3.8, states RegFIS:Entry and RegFIS:ClearCI,
    and 5.3.16.5 ERR:FatalTaskfile.
    
    In the case of non-NCQ commands, not clearing PxCI is needed in order
    for host software to be able to see which command slot that failed.
    
    Signed-off-by: Niklas Cassel <[email protected]>
    Message-id: [email protected]
    Signed-off-by: John Snow <[email protected]>
    (cherry picked from commit 1a16ce6)
    Signed-off-by: Michael Tokarev <[email protected]>
    floatious authored and Michael Tokarev committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    4448c34 View commit details
    Browse the repository at this point in the history
  15. hw/ide/ahci: fix ahci_write_fis_sdb()

    When there is an error, we need to raise a TFES error irq, see AHCI 1.3.1,
    5.3.13.1 SDB:Entry.
    
    If ERR_STAT is set, we jump to state ERR:FatalTaskfile, which will raise
    a TFES IRQ unconditionally, regardless if the I bit is set in the FIS or
    not.
    
    Thus, we should never raise a normal IRQ after having sent an error IRQ.
    
    It is valid to signal successfully completed commands as finished in the
    same SDB FIS that generates the error IRQ. The important thing is that
    commands that did not complete successfully (e.g. commands that were
    aborted, do not get the finished bit set).
    
    Before this commit, there was never a TFES IRQ raised on NCQ error.
    
    Signed-off-by: Niklas Cassel <[email protected]>
    Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
    Message-id: [email protected]
    Signed-off-by: John Snow <[email protected]>
    (cherry picked from commit 7e85cb0)
    Signed-off-by: Michael Tokarev <[email protected]>
    floatious authored and Michael Tokarev committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    e8f5ca5 View commit details
    Browse the repository at this point in the history
  16. hw/ide/ahci: fix broken SError handling

    When encountering an NCQ error, you should not write the NCQ tag to the
    SError register. This is completely wrong.
    
    The SError register has a clear definition, where each bit represents a
    different error, see PxSERR definition in AHCI 1.3.1.
    
    If we write a random value (like the NCQ tag) in SError, e.g. Linux will
    read SError, and will trigger arbitrary error handling depending on the
    NCQ tag that happened to be executing.
    
    In case of success, ncq_cb() will call ncq_finish().
    In case of error, ncq_cb() will call ncq_err() (which will clear
    ncq_tfs->used), and then call ncq_finish(), thus using ncq_tfs->used is
    sufficient to tell if finished should get set or not.
    
    Signed-off-by: Niklas Cassel <[email protected]>
    Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
    Message-id: [email protected]
    Signed-off-by: John Snow <[email protected]>
    (cherry picked from commit 9f89423)
    Signed-off-by: Michael Tokarev <[email protected]>
    floatious authored and Michael Tokarev committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    d536158 View commit details
    Browse the repository at this point in the history
  17. hw/i2c/aspeed: Fix Tx count and Rx size error in buffer pool mode

    Fixed inconsistency between the regisiter bit field definition header file
    and the ast2600 datasheet. The reg name is I2CD1C:Pool Buffer Control
    Register in old register mode and  I2CC0C: Master/Slave Pool Buffer Control
    Register in new register mode. They share bit field
    [12:8]:Transmit Data Byte Count and bit field
    [29:24]:Actual Received Pool Buffer Size according to the datasheet.
    According to the ast2600 datasheet,the actual Tx count is
    Transmit Data Byte Count plus 1, and the max Rx size is
    Receive Pool Buffer Size plus 1, both in Pool Buffer Control Register.
    The version before forgot to plus 1, and mistake Rx count for Rx size.
    
    Signed-off-by: Hang Yu <[email protected]>
    Fixes: 3be3d6c ("aspeed: i2c: Migrate to registerfields API")
    Reviewed-by: Cédric Le Goater <[email protected]>
    Signed-off-by: Cédric Le Goater <[email protected]>
    (cherry picked from commit 97b8aa5)
    Signed-off-by: Michael Tokarev <[email protected]>
    Hang Yu authored and Michael Tokarev committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    9dc6f05 View commit details
    Browse the repository at this point in the history
  18. hw/i2c/aspeed: Fix TXBUF transmission start position error

    According to the ast2600 datasheet and the linux aspeed i2c driver,
    the TXBUF transmission start position should be TXBUF[0] instead
    of TXBUF[1],so the arg pool_start is useless,and the address is not
    included in TXBUF.So even if Tx Count equals zero,there is at least
    1 byte data needs to be transmitted,and M_TX_CMD should not be cleared
    at this condition.The driver url is:
    https://github.com/AspeedTech-BMC/linux/blob/aspeed-master-v5.15/drivers/i2c/busses/i2c-ast2600.c
    
    Signed-off-by: Hang Yu <[email protected]>
    Fixes: 6054fc7 ("aspeed/i2c: Add support for pool buffer transfers")
    Reviewed-by: Cédric Le Goater <[email protected]>
    Signed-off-by: Cédric Le Goater <[email protected]>
    (cherry picked from commit 961faf3)
    Signed-off-by: Michael Tokarev <[email protected]>
    Hang Yu authored and Michael Tokarev committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    25ec23a View commit details
    Browse the repository at this point in the history
  19. qemu-options.hx: Rephrase the descriptions of the -hd* and -cdrom opt…

    …ions
    
    The current description says that these options will create a device
    on the IDE bus, which is only true on x86. So rephrase these sentences
    a little bit to speak of "default bus" instead.
    
    Signed-off-by: Thomas Huth <[email protected]>
    Reviewed-by: Alex Bennée <[email protected]>
    Signed-off-by: Michael Tokarev <[email protected]>
    (cherry picked from commit bcd8e24)
    Signed-off-by: Michael Tokarev <[email protected]>
    huth authored and Michael Tokarev committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    01bf87c View commit details
    Browse the repository at this point in the history
  20. docs tests: Fix use of migrate_set_parameter

    docs/multi-thread-compression.txt uses parameter names with
    underscores instead of dashes.  Wrong since day one.
    
    docs/rdma.txt, tests/qemu-iotests/181, and tests/qtest/test-hmp.c are
    wrong the same way since commit cbde7be (v6.0.0).  Hard to see,
    as test-hmp doesn't check whether the commands work, and iotest 181
    appears to be unaffected.
    
    Fixes: 263170e (docs: Add a doc about multiple thread compression)
    Fixes: cbde7be (migrate: remove QMP/HMP commands for speed, downtime and cache size)
    Signed-off-by: Markus Armbruster <[email protected]>
    Reviewed-by: Thomas Huth <[email protected]>
    Signed-off-by: Michael Tokarev <[email protected]>
    (cherry picked from commit b21a6e3)
    Signed-off-by: Michael Tokarev <[email protected]>
    Markus Armbruster authored and Michael Tokarev committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    6356785 View commit details
    Browse the repository at this point in the history
  21. hw/net/vmxnet3: Fix guest-triggerable assert()

    The assert() that checks for valid MTU sizes can be triggered by
    the guest (e.g. with the reproducer code from the bug ticket
    https://gitlab.com/qemu-project/qemu/-/issues/517 ). Let's avoid
    this problem by simply logging the error and refusing to activate
    the device instead.
    
    Fixes: d05dcd9 ("net: vmxnet3: validate configuration values during activate")
    Signed-off-by: Thomas Huth <[email protected]>
    Cc: [email protected]
    Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
    Signed-off-by: Michael Tokarev <[email protected]>
    [Mjt: change format specifier from %d to %u for uint32_t argument]
    (cherry picked from commit 90a0778)
    Signed-off-by: Michael Tokarev <[email protected]>
    huth authored and Michael Tokarev committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    93d4107 View commit details
    Browse the repository at this point in the history
  22. qxl: don't assert() if device isn't yet initialized

    If the PCI BAR isn't yet mapped or was unmapped, QXL_IO_SET_MODE will
    assert(). Instead, report a guest bug and keep going.
    
    This can be reproduced with:
    
    cat << EOF | ./qemu-system-x86_64 -vga qxl -m 2048 -nodefaults -qtest stdio
    outl 0xcf8 0x8000101c
    outl 0xcfc 0xc000
    outl 0xcf8 0x80001001
    outl 0xcfc 0x01000000
    outl 0xc006 0x00
    EOF
    
    Fixes: https://gitlab.com/qemu-project/qemu/-/issues/1829
    
    Signed-off-by: Marc-André Lureau <[email protected]>
    Reviewed-by: Thomas Huth <[email protected]>
    Cc: [email protected]
    Signed-off-by: Michael Tokarev <[email protected]>
    (cherry picked from commit 95bef68)
    Signed-off-by: Michael Tokarev <[email protected]>
    elmarco authored and Michael Tokarev committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    eeee989 View commit details
    Browse the repository at this point in the history
  23. virtio: Drop out of coroutine context in virtio_load()

    virtio_load() as a whole should run in coroutine context because it
    reads from the migration stream and we don't want this to block.
    
    However, it calls virtio_set_features_nocheck() and devices don't
    expect their .set_features callback to run in a coroutine and therefore
    call functions that may not be called in coroutine context. To fix this,
    drop out of coroutine context for calling virtio_set_features_nocheck().
    
    Without this fix, the following crash was reported:
    
      #0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
      qemu#1  0x00007efc738c05d3 in __pthread_kill_internal (signo=6, threadid=<optimized out>) at pthread_kill.c:78
      qemu#2  0x00007efc73873d26 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
      qemu#3  0x00007efc738477f3 in __GI_abort () at abort.c:79
      qemu#4  0x00007efc7384771b in __assert_fail_base (fmt=0x7efc739dbcb8 "", assertion=assertion@entry=0x560aebfbf5cf "!qemu_in_coroutine()",
         file=file@entry=0x560aebfcd2d4 "../block/graph-lock.c", line=line@entry=275, function=function@entry=0x560aebfcd34d "void bdrv_graph_rdlock_main_loop(void)") at assert.c:92
      qemu#5  0x00007efc7386ccc6 in __assert_fail (assertion=0x560aebfbf5cf "!qemu_in_coroutine()", file=0x560aebfcd2d4 "../block/graph-lock.c", line=275,
         function=0x560aebfcd34d "void bdrv_graph_rdlock_main_loop(void)") at assert.c:101
      qemu#6  0x0000560aebcd8dd6 in bdrv_register_buf ()
      qemu#7  0x0000560aeb97ed97 in ram_block_added.llvm ()
      qemu#8  0x0000560aebb8303f in ram_block_add.llvm ()
      qemu#9  0x0000560aebb834fa in qemu_ram_alloc_internal.llvm ()
      qemu#10 0x0000560aebb2ac98 in vfio_region_mmap ()
      qemu#11 0x0000560aebb3ea0f in vfio_bars_register ()
      qemu#12 0x0000560aebb3c628 in vfio_realize ()
      qemu#13 0x0000560aeb90f0c2 in pci_qdev_realize ()
      qemu#14 0x0000560aebc40305 in device_set_realized ()
      qemu#15 0x0000560aebc48e07 in property_set_bool.llvm ()
      qemu#16 0x0000560aebc46582 in object_property_set ()
      qemu#17 0x0000560aebc4cd58 in object_property_set_qobject ()
      qemu#18 0x0000560aebc46ba7 in object_property_set_bool ()
      qemu#19 0x0000560aeb98b3ca in qdev_device_add_from_qdict ()
      qemu#20 0x0000560aebb1fbaf in virtio_net_set_features ()
      qemu#21 0x0000560aebb46b51 in virtio_set_features_nocheck ()
      qemu#22 0x0000560aebb47107 in virtio_load ()
      qemu#23 0x0000560aeb9ae7ce in vmstate_load_state ()
      qemu#24 0x0000560aeb9d2ee9 in qemu_loadvm_state_main ()
      qemu#25 0x0000560aeb9d45e1 in qemu_loadvm_state ()
      qemu#26 0x0000560aeb9bc32c in process_incoming_migration_co.llvm ()
      qemu#27 0x0000560aebeace56 in coroutine_trampoline.llvm ()
    
    Cc: [email protected]
    Buglink: https://issues.redhat.com/browse/RHEL-832
    Signed-off-by: Kevin Wolf <[email protected]>
    Message-ID: <[email protected]>
    Reviewed-by: Stefan Hajnoczi <[email protected]>
    Signed-off-by: Kevin Wolf <[email protected]>
    (cherry picked from commit 92e2e6a)
    Signed-off-by: Michael Tokarev <[email protected]>
    kevmw authored and Michael Tokarev committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    df33ce9 View commit details
    Browse the repository at this point in the history
  24. arm64: Restore trapless ptimer access

    Due to recent KVM changes, QEMU is setting a ptimer offset resulting
    in unintended trap and emulate access and a consequent performance
    hit. Filter out the PTIMER_CNT register to restore trapless ptimer
    access.
    
    Quoting Andrew Jones:
    
    Simply reading the CNT register and writing back the same value is
    enough to set an offset, since the timer will have certainly moved
    past whatever value was read by the time it's written.  QEMU
    frequently saves and restores all registers in the get-reg-list array,
    unless they've been explicitly filtered out (with Linux commit
    680232a94c12, KVM_REG_ARM_PTIMER_CNT is now in the array). So, to
    restore trapless ptimer accesses, we need a QEMU patch to filter out
    the register.
    
    See
    https://lore.kernel.org/kvmarm/[email protected]/T/#m0770023762a821db2a3f0dd0a7dc6aa54e0d0da9
    for additional context.
    
    Cc: [email protected]
    Signed-off-by: Andrew Jones <[email protected]>
    Signed-off-by: Colton Lewis <[email protected]>
    Reviewed-by: Richard Henderson <[email protected]>
    Tested-by: Colton Lewis <[email protected]>
    Message-id: [email protected]
    Signed-off-by: Peter Maydell <[email protected]>
    (cherry picked from commit 682814e)
    Signed-off-by: Michael Tokarev <[email protected]>
    coltonlewis authored and Michael Tokarev committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    9832a67 View commit details
    Browse the repository at this point in the history
  25. hw/char/riscv_htif: Fix printing of console characters on big endian …

    …hosts
    
    The character that should be printed is stored in the 64 bit "payload"
    variable. The code currently tries to print it by taking the address
    of the variable and passing this pointer to qemu_chr_fe_write(). However,
    this only works on little endian hosts where the least significant bits
    are stored on the lowest address. To do this in a portable way, we have
    to store the value in an uint8_t variable instead.
    
    Fixes: 5033606 ("RISC-V HTIF Console")
    Signed-off-by: Thomas Huth <[email protected]>
    Reviewed-by: Alistair Francis <[email protected]>
    Reviewed-by: Bin Meng <[email protected]>
    Reviewed-by: Daniel Henrique Barboza <[email protected]>
    Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
    Message-Id: <[email protected]>
    Signed-off-by: Alistair Francis <[email protected]>
    (cherry picked from commit c255946)
    Signed-off-by: Michael Tokarev <[email protected]>
    huth authored and Michael Tokarev committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    3d6251f View commit details
    Browse the repository at this point in the history
  26. hw/char/riscv_htif: Fix the console syscall on big endian hosts

    Values that have been read via cpu_physical_memory_read() from the
    guest's memory have to be swapped in case the host endianess differs
    from the guest.
    
    Fixes: a6e13e3 ("riscv_htif: Support console output via proxy syscall")
    Signed-off-by: Thomas Huth <[email protected]>
    Reviewed-by: Alistair Francis <[email protected]>
    Reviewed-by: Bin Meng <[email protected]>
    Reviewed-by: Daniel Henrique Barboza <[email protected]>
    Message-Id: <[email protected]>
    Signed-off-by: Alistair Francis <[email protected]>
    (cherry picked from commit 058096f)
    Signed-off-by: Michael Tokarev <[email protected]>
    huth authored and Michael Tokarev committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    b9f8329 View commit details
    Browse the repository at this point in the history
  27. target/riscv/cpu.c: add zmmul isa string

    zmmul was promoted from experimental to ratified in commit 6d00ffa.
    Add a riscv,isa string for it.
    
    Fixes: 6d00ffa ("target/riscv: move zmmul out of the experimental properties")
    Signed-off-by: Daniel Henrique Barboza <[email protected]>
    Reviewed-by: Weiwei Li <[email protected]>
    Reviewed-by: Alistair Francis <[email protected]>
    Message-Id: <[email protected]>
    Signed-off-by: Alistair Francis <[email protected]>
    (cherry picked from commit 50f9464)
    Signed-off-by: Michael Tokarev <[email protected]>
    danielhb authored and Michael Tokarev committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    987e90c View commit details
    Browse the repository at this point in the history
  28. target/riscv: Fix page_check_range use in fault-only-first

    Commit bef6f00(accel/tcg: Return bool from page_check_range) converts
    integer return value to bool type. However, it wrongly converted the use
    of the API in riscv fault-only-first, where page_check_range < = 0, should
    be converted to !page_check_range.
    
    Signed-off-by: LIU Zhiwei <[email protected]>
    Reviewed-by: Richard Henderson <[email protected]>
    Message-ID: <[email protected]>
    Signed-off-by: Alistair Francis <[email protected]>
    (cherry picked from commit 4cc9f28)
    Signed-off-by: Michael Tokarev <[email protected]>
    romanheros authored and Michael Tokarev committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    6c24b60 View commit details
    Browse the repository at this point in the history
  29. target/riscv: Fix zfa fleq.d and fltq.d

    Commit a47842d ("riscv: Add support for the Zfa extension") implemented the zfa extension.
    However, it has some typos for fleq.d and fltq.d. Both of them misused the fltq.s
    helper function.
    
    Fixes: a47842d ("riscv: Add support for the Zfa extension")
    Signed-off-by: LIU Zhiwei <[email protected]>
    Reviewed-by: Daniel Henrique Barboza <[email protected]>
    Reviewed-by: Weiwei Li <[email protected]>
    Message-ID: <[email protected]>
    Signed-off-by: Alistair Francis <[email protected]>
    (cherry picked from commit eda633a)
    Signed-off-by: Michael Tokarev <[email protected]>
    romanheros authored and Michael Tokarev committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    8ae2012 View commit details
    Browse the repository at this point in the history
  30. hw/intc: Fix upper/lower mtime write calculation

    When writing the upper mtime, we should keep the original lower mtime
    whose value is given by cpu_riscv_read_rtc() instead of
    cpu_riscv_read_rtc_raw(). The same logic applies to writes to lower mtime.
    
    Signed-off-by: Jason Chien <[email protected]>
    Reviewed-by: Alistair Francis <[email protected]>
    Message-ID: <[email protected]>
    Signed-off-by: Alistair Francis <[email protected]>
    (cherry picked from commit e0922b7)
    Signed-off-by: Michael Tokarev <[email protected]>
    Jason Chien authored and Michael Tokarev committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    566dac7 View commit details
    Browse the repository at this point in the history
  31. hw/intc: Make rtc variable names consistent

    The variables whose values are given by cpu_riscv_read_rtc() should be named
    "rtc". The variables whose value are given by cpu_riscv_read_rtc_raw()
    should be named "rtc_r".
    
    Signed-off-by: Jason Chien <[email protected]>
    Reviewed-by: Alistair Francis <[email protected]>
    Message-ID: <[email protected]>
    Signed-off-by: Alistair Francis <[email protected]>
    (cherry picked from commit 9382a9e)
    Signed-off-by: Michael Tokarev <[email protected]>
    Jason Chien authored and Michael Tokarev committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    60a7f5c View commit details
    Browse the repository at this point in the history
  32. linux-user/riscv: Use abi type for target_ucontext

    We should not use types dependend on host arch for target_ucontext.
    This bug is found when run rv32 applications.
    
    Signed-off-by: LIU Zhiwei <[email protected]>
    Reviewed-by: Richard Henderson <[email protected]>
    Reviewed-by: Daniel Henrique Barboza <[email protected]>
    Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
    Message-ID: <[email protected]>
    Signed-off-by: Alistair Francis <[email protected]>
    (cherry picked from commit ae7d4d6)
    Signed-off-by: Michael Tokarev <[email protected]>
    romanheros authored and Michael Tokarev committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    2947da7 View commit details
    Browse the repository at this point in the history
  33. hw/riscv: virt: Fix riscv,pmu DT node path

    On a dtb dumped from the virt machine, dt-validate complains:
    soc: pmu: {'riscv,event-to-mhpmcounters': [[1, 1, 524281], [2, 2, 524284], [65561, 65561, 524280], [65563, 65563, 524280], [65569, 65569, 524280]], 'compatible': ['riscv,pmu']} should not be valid under {'type': 'object'}
            from schema $id: http://devicetree.org/schemas/simple-bus.yaml#
    That's pretty cryptic, but running the dtb back through dtc produces
    something a lot more reasonable:
    Warning (simple_bus_reg): /soc/pmu: missing or empty reg/ranges property
    
    Moving the riscv,pmu node out of the soc bus solves the problem.
    
    Signed-off-by: Conor Dooley <[email protected]>
    Acked-by: Alistair Francis <[email protected]>
    Reviewed-by: Daniel Henrique Barboza <[email protected]>
    Message-ID: <20230727-groom-decline-2c57ce42841c@spud>
    Signed-off-by: Alistair Francis <[email protected]>
    (cherry picked from commit 9ff3140)
    Signed-off-by: Michael Tokarev <[email protected]>
    ConchuOD authored and Michael Tokarev committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    b822207 View commit details
    Browse the repository at this point in the history
  34. target/riscv: fix satp_mode_finalize() when satp_mode.supported = 0

    In the same emulated RISC-V host, the 'host' KVM CPU takes 4 times
    longer to boot than the 'rv64' KVM CPU.
    
    The reason is an unintended behavior of riscv_cpu_satp_mode_finalize()
    when satp_mode.supported = 0, i.e. when cpu_init() does not set
    satp_mode_max_supported(). satp_mode_max_from_map(map) does:
    
    31 - __builtin_clz(map)
    
    This means that, if satp_mode.supported = 0, satp_mode_supported_max
    wil be '31 - 32'. But this is C, so satp_mode_supported_max will gladly
    set it to UINT_MAX (4294967295). After that, if the user didn't set a
    satp_mode, set_satp_mode_default_map(cpu) will make
    
    cfg.satp_mode.map = cfg.satp_mode.supported
    
    So satp_mode.map = 0. And then satp_mode_map_max will be set to
    satp_mode_max_from_map(cpu->cfg.satp_mode.map), i.e. also UINT_MAX. The
    guard "satp_mode_map_max > satp_mode_supported_max" doesn't protect us
    here since both are UINT_MAX.
    
    And finally we have 2 loops:
    
            for (int i = satp_mode_map_max - 1; i >= 0; --i) {
    
    Which are, in fact, 2 loops from UINT_MAX -1 to -1. This is where the
    extra delay when booting the 'host' CPU is coming from.
    
    Commit 43d1de3 already set a precedence for satp_mode.supported = 0
    in a different manner. We're doing the same here. If supported == 0,
    interpret as 'the CPU wants the OS to handle satp mode alone' and skip
    satp_mode_finalize().
    
    We'll also put a guard in satp_mode_max_from_map() to assert out if map
    is 0 since the function is not ready to deal with it.
    
    Cc: Alexandre Ghiti <[email protected]>
    Fixes: 6f23aae ("riscv: Allow user to set the satp mode")
    Signed-off-by: Daniel Henrique Barboza <[email protected]>
    Reviewed-by: Andrew Jones <[email protected]>
    Message-ID: <[email protected]>
    Signed-off-by: Alistair Francis <[email protected]>
    (cherry picked from commit 3a2fc23)
    Signed-off-by: Michael Tokarev <[email protected]>
    danielhb authored and Michael Tokarev committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    1d4fb58 View commit details
    Browse the repository at this point in the history
  35. target/riscv/pmp.c: respect mseccfg.RLB for pmpaddrX changes

    When the rule-lock bypass (RLB) bit is set in the mseccfg CSR, the PMP
    configuration lock bits must not apply. While this behavior is
    implemented for the pmpcfgX CSRs, this bit is not respected for
    changes to the pmpaddrX CSRs. This patch ensures that pmpaddrX CSR
    writes work even on locked regions when the global rule-lock bypass is
    enabled.
    
    Signed-off-by: Leon Schuermann <[email protected]>
    Reviewed-by: Mayuresh Chitale <[email protected]>
    Reviewed-by: Alistair Francis <[email protected]>
    Message-ID: <[email protected]>
    Signed-off-by: Alistair Francis <[email protected]>
    (cherry picked from commit 4e3adce)
    Signed-off-by: Michael Tokarev <[email protected]>
    Leon Schuermann authored and Michael Tokarev committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    7385e00 View commit details
    Browse the repository at this point in the history
  36. target/riscv: Allocate itrigger timers only once

    riscv_trigger_init() had been called on reset events that can happen
    several times for a CPU and it allocated timers for itrigger. If old
    timers were present, they were simply overwritten by the new timers,
    resulting in a memory leak.
    
    Divide riscv_trigger_init() into two functions, namely
    riscv_trigger_realize() and riscv_trigger_reset() and call them in
    appropriate timing. The timer allocation will happen only once for a
    CPU in riscv_trigger_realize().
    
    Fixes: 5a4ae64 ("target/riscv: Add itrigger support when icount is enabled")
    Signed-off-by: Akihiko Odaki <[email protected]>
    Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
    Reviewed-by: LIU Zhiwei <[email protected]>
    Reviewed-by: Alistair Francis <[email protected]>
    Message-ID: <[email protected]>
    Signed-off-by: Alistair Francis <[email protected]>
    (cherry picked from commit a7c272d)
    Signed-off-by: Michael Tokarev <[email protected]>
    akihikodaki authored and Michael Tokarev committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    cae7dc1 View commit details
    Browse the repository at this point in the history
  37. virtio-gpu/win32: set the destroy function on load

    Don't forget to unmap the resource memory.
    
    Fixes: commit 9462ff4 ("virtio-gpu/win32: allocate shareable 2d resources/images")
    
    Signed-off-by: Marc-André Lureau <[email protected]>
    (cherry picked from commit 04562ee)
    Signed-off-by: Michael Tokarev <[email protected]>
    elmarco authored and Michael Tokarev committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    d4919bb View commit details
    Browse the repository at this point in the history
  38. ui: fix crash when there are no active_console

    Thread 1 "qemu-system-x86" received signal SIGSEGV, Segmentation fault.
    0x0000555555888630 in dpy_ui_info_supported (con=0x0) at ../ui/console.c:812
    812	    return con->hw_ops->ui_info != NULL;
    (gdb) bt
    #0  0x0000555555888630 in dpy_ui_info_supported (con=0x0) at ../ui/console.c:812
    qemu#1  0x00005555558a44b1 in protocol_client_msg (vs=0x5555578c76c0, data=0x5555581e93f0 <incomplete sequence \373>, len=24) at ../ui/vnc.c:2585
    qemu#2  0x00005555558a19ac in vnc_client_read (vs=0x5555578c76c0) at ../ui/vnc.c:1607
    qemu#3  0x00005555558a1ac2 in vnc_client_io (ioc=0x5555581eb0e0, condition=G_IO_IN, opaque=0x5555578c76c0) at ../ui/vnc.c:1635
    
    Fixes:
    https://issues.redhat.com/browse/RHEL-2600
    
    Signed-off-by: Marc-André Lureau <[email protected]>
    Reviewed-by: Albert Esteve <[email protected]>
    (cherry picked from commit 48a35e1)
    Signed-off-by: Michael Tokarev <[email protected]>
    elmarco authored and Michael Tokarev committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    8b47922 View commit details
    Browse the repository at this point in the history
  39. s390x/ap: fix missing subsystem reset registration

    A subsystem reset contains a reset of AP resources which has been
    missing.  Adding the AP bridge to the list of device types that need
    reset fixes this issue.
    
    Reviewed-by: Jason J. Herne <[email protected]>
    Reviewed-by: Tony Krowiak <[email protected]>
    Signed-off-by: Janosch Frank <[email protected]>
    Fixes: a51b315 ("s390x/ap: base Adjunct Processor (AP) object model")
    Message-ID: <[email protected]>
    Signed-off-by: Thomas Huth <[email protected]>
    (cherry picked from commit 297ec01)
    Signed-off-by: Michael Tokarev <[email protected]>
    frankjaa authored and Michael Tokarev committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    60da830 View commit details
    Browse the repository at this point in the history
  40. meson: Fix targetos match for illumos and Solaris.

    qemu 8.1.0 breaks on illumos platforms due to _XOPEN_SOURCE and others no longer being set correctly, leading to breakage such as:
    
      https://us-central.manta.mnx.io/pkgsrc/public/reports/trunk/tools/20230908.1404/qemu-8.1.0/build.log
    
    This is a result of meson conversion which incorrectly matches against 'solaris' instead of 'sunos' for uname.
    
    First time submitting a patch here, hope I did it correctly.  Thanks.
    
    Signed-off-by: Jonathan Perkin <[email protected]>
    Message-ID: <[email protected]>
    Cc: [email protected]
    Signed-off-by: Paolo Bonzini <[email protected]>
    (cherry picked from commit fb0a8b0)
    Signed-off-by: Michael Tokarev <[email protected]>
    (Mjt: omit net/meson.build change before v8.1.0-279-g73258b3864, adjust context befor v8.1.0-288-g2fc36530de)
    jperkin authored and Michael Tokarev committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    56270e5 View commit details
    Browse the repository at this point in the history
  41. tpm: fix crash when FD >= 1024 and unnecessary errors due to EINTR

    Replace select() with poll() to fix a crash when QEMU has a large number
    of FDs. Also use RETRY_ON_EINTR to avoid unnecessary errors due to EINTR.
    
    Cc: [email protected]
    Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2020133
    Fixes: 56a3c24 ("tpm: Probe for connected TPM 1.2 or TPM 2")
    Signed-off-by: Marc-André Lureau <[email protected]>
    Reviewed-by: Michael Tokarev <[email protected]>
    Reviewed-by: Stefan Berger <[email protected]>
    Signed-off-by: Stefan Berger <[email protected]>
    (cherry picked from commit 8e32ddf)
    Signed-off-by: Michael Tokarev <[email protected]>
    elmarco authored and Michael Tokarev committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    045fa84 View commit details
    Browse the repository at this point in the history
  42. Update version for 8.1.1 release

    Signed-off-by: Michael Tokarev <[email protected]>
    Michael Tokarev committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    6bb4a8a View commit details
    Browse the repository at this point in the history

Commits on Sep 25, 2023

  1. hw/ppc: Introduce functions for conversion between timebase and nanos…

    …econds
    
    These calculations are repeated several times, and they will become
    a little more complicated with subsequent changes.
    
    Signed-off-by: Nicholas Piggin <[email protected]>
    Signed-off-by: Cédric Le Goater <[email protected]>
    (cherry picked from commit 7798f5c)
    Signed-off-by: Michael Tokarev <[email protected]>
    npiggin authored and Michael Tokarev committed Sep 25, 2023
    Configuration menu
    Copy the full SHA
    ded5ede View commit details
    Browse the repository at this point in the history
  2. host-utils: Add muldiv64_round_up

    This will be used for converting time intervals in different base units
    to host units, for the purpose of scheduling timers to emulate target
    timers. Timers typically must not fire before their requested expiry
    time but may fire some time afterward, so rounding up is the right way
    to implement these.
    
    Signed-off-by: Nicholas Piggin <[email protected]>
    Reviewed-by: Richard Henderson <[email protected]>
    [ clg: renamed __muldiv64() to muldiv64_rounding() ]
    Signed-off-by: Cédric Le Goater <[email protected]>
    (cherry picked from commit 47de6c4)
    Signed-off-by: Michael Tokarev <[email protected]>
    npiggin authored and Michael Tokarev committed Sep 25, 2023
    Configuration menu
    Copy the full SHA
    4bff0a8 View commit details
    Browse the repository at this point in the history
  3. hw/ppc: Round up the decrementer interval when converting to ns

    The rule of timers is typically that they should never expire before the
    timeout, but some time afterward. Rounding timer intervals up when doing
    conversion is the right thing to do.
    
    Under most circumstances it is impossible observe the decrementer
    interrupt before the dec register has triggered. However with icount
    timing, problems can arise. For example setting DEC to 0 can schedule
    the timer for now, causing it to fire before any more instructions
    have been executed and DEC is still 0.
    
    Signed-off-by: Nicholas Piggin <[email protected]>
    Signed-off-by: Cédric Le Goater <[email protected]>
    (cherry picked from commit eab0888)
    Signed-off-by: Michael Tokarev <[email protected]>
    npiggin authored and Michael Tokarev committed Sep 25, 2023
    Configuration menu
    Copy the full SHA
    73b7a81 View commit details
    Browse the repository at this point in the history
  4. hw/ppc: Avoid decrementer rounding errors

    The decrementer register contains a relative time in timebase units.
    When writing to DECR this is converted and stored as an absolute value
    in nanosecond units, reading DECR converts back to relative timebase.
    
    The tb<->ns conversion of the relative part can cause rounding such that
    a value writen to the decrementer can read back a different, with time
    held constant. This is a particular problem for a deterministic icount
    and record-replay trace.
    
    Fix this by storing the absolute value in timebase units rather than
    nanoseconds. The math before:
      store:  decr_next = now_ns + decr * ns_per_sec / tb_per_sec
      load:        decr = (decr_next - now_ns) * tb_per_sec / ns_per_sec
      load(store): decr = decr * ns_per_sec / tb_per_sec * tb_per_sec /
                          ns_per_sec
    
    After:
      store:  decr_next = now_ns * tb_per_sec / ns_per_sec + decr
      load:        decr = decr_next - now_ns * tb_per_sec / ns_per_sec
      load(store): decr = decr
    
    Fixes: 9fddaa0 ("PowerPC merge: real time TB and decrementer - faster and simpler exception handling (Jocelyn Mayer)")
    Signed-off-by: Nicholas Piggin <[email protected]>
    Signed-off-by: Cédric Le Goater <[email protected]>
    (cherry picked from commit 8e0a5ac)
    Signed-off-by: Michael Tokarev <[email protected]>
    npiggin authored and Michael Tokarev committed Sep 25, 2023
    Configuration menu
    Copy the full SHA
    0e35c81 View commit details
    Browse the repository at this point in the history
  5. target/ppc: Sign-extend large decrementer to 64-bits

    When storing a large decrementer value with the most significant
    implemented bit set, it is to be treated as a negative and sign
    extended.
    
    This isn't hit for book3s DEC because of another bug, fixing it
    in the next patch exposes this one and can cause additional
    problems, so fix this first. It can be hit with HDECR and other
    edge triggered types.
    
    Fixes: a8dafa5 ("target/ppc: Implement large decrementer support for TCG")
    Signed-off-by: Nicholas Piggin <[email protected]>
    [ clg: removed extra cpu and pcc variables shadowing local variables ]
    Signed-off-by: Cédric Le Goater <[email protected]>
    (cherry picked from commit c8fbc6b)
    Signed-off-by: Michael Tokarev <[email protected]>
    npiggin authored and Michael Tokarev committed Sep 25, 2023
    Configuration menu
    Copy the full SHA
    97fec8f View commit details
    Browse the repository at this point in the history
  6. hw/ppc: Always store the decrementer value

    When writing a value to the decrementer that raises an exception, the
    irq is raised, but the value is not stored so the store doesn't appear
    to have changed the register when it is read again.
    
    Always store the write value to the register.
    
    Fixes: e81a982 ("PPC: Clean up DECR implementation")
    Signed-off-by: Nicholas Piggin <[email protected]>
    Signed-off-by: Cédric Le Goater <[email protected]>
    (cherry picked from commit febb71d)
    Signed-off-by: Michael Tokarev <[email protected]>
    npiggin authored and Michael Tokarev committed Sep 25, 2023
    Configuration menu
    Copy the full SHA
    1c2343c View commit details
    Browse the repository at this point in the history
  7. hw/ppc: Reset timebase facilities on machine reset

    Lower interrupts, delete timers, and set time facility registers
    back to initial state on machine reset.
    
    This is not so important for record-replay since timebase and
    decrementer are migrated, but it gives a cleaner reset state.
    
    Cc: Mark Cave-Ayland <[email protected]>
    Cc: BALATON Zoltan <[email protected]>
    Signed-off-by: Nicholas Piggin <[email protected]>
    [ clg: checkpatch.pl fixes ]
    Signed-off-by: Cédric Le Goater <[email protected]>
    (cherry picked from commit 30d0647)
    Signed-off-by: Michael Tokarev <[email protected]>
    npiggin authored and Michael Tokarev committed Sep 25, 2023
    Configuration menu
    Copy the full SHA
    b6fa8e4 View commit details
    Browse the repository at this point in the history
  8. hw/ppc: Read time only once to perform decrementer write

    Reading the time more than once to perform an operation always increases
    complexity and fragility due to introduced deltas. Simplify the
    decrementer write by reading the clock once for the operation.
    
    Signed-off-by: Nicholas Piggin <[email protected]>
    Signed-off-by: Cédric Le Goater <[email protected]>
    (cherry picked from commit ea62f8a)
    Signed-off-by: Michael Tokarev <[email protected]>
    npiggin authored and Michael Tokarev committed Sep 25, 2023
    Configuration menu
    Copy the full SHA
    fb9e035 View commit details
    Browse the repository at this point in the history

Commits on Oct 2, 2023

  1. linux-user/hppa: clear the PSW 'N' bit when delivering signals

    qemu-hppa may crash when delivering a signal. It can be demonstrated with
    this program. Compile the program with "hppa-linux-gnu-gcc -O2 signal.c"
    and run it with "qemu-hppa -one-insn-per-tb a.out". It reports that the
    address of the flag is 0xb4 and it crashes when attempting to touch it.
    
    #include <stdio.h>
    #include <stdlib.h>
    #include <sys/time.h>
    #include <signal.h>
    
    sig_atomic_t flag;
    
    void sig(int n)
    {
    	printf("&flag: %p\n", &flag);
    	flag = 1;
    }
    
    int main(void)
    {
    	struct sigaction sa;
    	struct itimerval it;
    
    	sa.sa_handler = sig;
    	sigemptyset(&sa.sa_mask);
    	sa.sa_flags = SA_RESTART;
    	if (sigaction(SIGALRM, &sa, NULL)) perror("sigaction"), exit(1);
    
    	it.it_interval.tv_sec = 0;
    	it.it_interval.tv_usec = 100;
    	it.it_value.tv_sec = it.it_interval.tv_sec;
    	it.it_value.tv_usec = it.it_interval.tv_usec;
    
    	if (setitimer(ITIMER_REAL, &it, NULL)) perror("setitimer"), exit(1);
    
    	while (1) {
    	}
    }
    
    The reason for the crash is that the signal handling routine doesn't clear
    the 'N' flag in the PSW. If the signal interrupts a thread when the 'N'
    flag is set, the flag remains set at the beginning of the signal handler
    and the first instruction of the signal handler is skipped.
    
    Signed-off-by: Mikulas Patocka <[email protected]>
    Acked-by: Helge Deller <[email protected]>
    Cc: [email protected]
    Signed-off-by: Helge Deller <[email protected]>
    (cherry picked from commit 2529497)
    Signed-off-by: Michael Tokarev <[email protected]>
    Mikulas Patocka authored and Michael Tokarev committed Oct 2, 2023
    Configuration menu
    Copy the full SHA
    f7f97b9 View commit details
    Browse the repository at this point in the history
  2. linux-user/hppa: lock both words of function descriptor

    The code in setup_rt_frame reads two words at haddr, but locks only one.
    This patch fixes it to lock both.
    
    Signed-off-by: Mikulas Patocka <[email protected]>
    Acked-by: Helge Deller <[email protected]>
    Cc: [email protected]
    Signed-off-by: Helge Deller <[email protected]>
    (cherry picked from commit 5b1270e)
    Signed-off-by: Michael Tokarev <[email protected]>
    Mikulas Patocka authored and Michael Tokarev committed Oct 2, 2023
    Configuration menu
    Copy the full SHA
    fda70be View commit details
    Browse the repository at this point in the history
  3. hw/cxl: Fix CFMW config memory leak

    Allocate targets and targets[n] resources when all sanity checks are
    passed to avoid memory leaks.
    
    Cc: [email protected]
    Suggested-by: Philippe Mathieu-Daudé <[email protected]>
    Signed-off-by: Li Zhijian <[email protected]>
    Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
    Signed-off-by: Jonathan Cameron <[email protected]>
    Reviewed-by: Fan Ni <[email protected]>
    Signed-off-by: Michael Tokarev <[email protected]>
    (cherry picked from commit 7b165fa)
    Signed-off-by: Michael Tokarev <[email protected]>
    zhijianli88 authored and Michael Tokarev committed Oct 2, 2023
    Configuration menu
    Copy the full SHA
    6970f5b View commit details
    Browse the repository at this point in the history
  4. hw/cxl: Fix out of bound array access

    According to cxl_interleave_ways_enc(), fw->num_targets is allowed to be up
    to 16. This also corresponds to CXL r3.0 spec. So, the fw->target_hbs[]
    array is iterated from 0 to 15. But it is statically declared of length 8.
    Thus, out of bound array access may occur.
    
    Fixes: c28db9e ("hw/pci-bridge: Make PCIe and CXL PXB Devices inherit from TYPE_PXB_DEV")
    Signed-off-by: Dmitry Frolov <[email protected]>
    Reviewed-by: Michael Tokarev <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Cc: [email protected]
    Signed-off-by: Jonathan Cameron <[email protected]>
    Signed-off-by: Michael Tokarev <[email protected]>
    (cherry picked from commit de5bbfc)
    Signed-off-by: Michael Tokarev <[email protected]>
    Dmitry Frolov authored and Michael Tokarev committed Oct 2, 2023
    Configuration menu
    Copy the full SHA
    f59caec View commit details
    Browse the repository at this point in the history
  5. file-posix: Clear bs->bl.zoned on error

    bs->bl.zoned is what indicates whether the zone information is present
    and valid; it is the only thing that raw_refresh_zoned_limits() sets if
    CONFIG_BLKZONED is not defined, and it is also the only thing that it
    sets if CONFIG_BLKZONED is defined, but there are no zones.
    
    Make sure that it is always set to BLK_Z_NONE if there is an error
    anywhere in raw_refresh_zoned_limits() so that we do not accidentally
    announce zones while our information is incomplete or invalid.
    
    This also fixes a memory leak in the last error path in
    raw_refresh_zoned_limits().
    
    Signed-off-by: Hanna Czenczek <[email protected]>
    Message-Id: <[email protected]>
    Reviewed-by: Sam Li <[email protected]>
    (cherry picked from commit 56d1a02)
    Signed-off-by: Michael Tokarev <[email protected]>
    XanClic authored and Michael Tokarev committed Oct 2, 2023
    Configuration menu
    Copy the full SHA
    c2e6a00 View commit details
    Browse the repository at this point in the history
  6. file-posix: Check bs->bl.zoned for zone info

    Instead of checking bs->wps or bs->bl.zone_size for whether zone
    information is present, check bs->bl.zoned.  That is the flag that
    raw_refresh_zoned_limits() reliably sets to indicate zone support.  If
    it is set to something other than BLK_Z_NONE, other values and objects
    like bs->wps and bs->bl.zone_size must be non-null/zero and valid; if it
    is not, we cannot rely on their validity.
    
    Signed-off-by: Hanna Czenczek <[email protected]>
    Message-Id: <[email protected]>
    Reviewed-by: Sam Li <[email protected]>
    (cherry picked from commit 4b5d80f)
    Signed-off-by: Michael Tokarev <[email protected]>
    XanClic authored and Michael Tokarev committed Oct 2, 2023
    Configuration menu
    Copy the full SHA
    825af96 View commit details
    Browse the repository at this point in the history
  7. file-posix: Fix zone update in I/O error path

    We must check that zone information is present before running
    update_zones_wp().
    
    Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2234374
    Fixes: Coverity CID 1512459
    Signed-off-by: Hanna Czenczek <[email protected]>
    Message-Id: <[email protected]>
    Reviewed-by: Sam Li <[email protected]>
    (cherry picked from commit deab5c9)
    Signed-off-by: Michael Tokarev <[email protected]>
    XanClic authored and Michael Tokarev committed Oct 2, 2023
    Configuration menu
    Copy the full SHA
    31a4714 View commit details
    Browse the repository at this point in the history
  8. file-posix: Simplify raw_co_prw's 'out' zone code

    We duplicate the same condition three times here, pull it out to the top
    level.
    
    Signed-off-by: Hanna Czenczek <[email protected]>
    Message-Id: <[email protected]>
    Reviewed-by: Sam Li <[email protected]>
    (cherry picked from commit d31b50a)
    Signed-off-by: Michael Tokarev <[email protected]>
    XanClic authored and Michael Tokarev committed Oct 2, 2023
    Configuration menu
    Copy the full SHA
    8ef6104 View commit details
    Browse the repository at this point in the history
  9. tests/file-io-error: New test

    This is a regression test for
    https://bugzilla.redhat.com/show_bug.cgi?id=2234374.
    
    All this test needs to do is trigger an I/O error inside of file-posix
    (specifically raw_co_prw()).  One reliable way to do this without
    requiring special privileges is to use a FUSE export, which allows us to
    inject any error that we want, e.g. via blkdebug.
    
    Signed-off-by: Hanna Czenczek <[email protected]>
    Message-Id: <[email protected]>
    [hreitz: Fixed test to be skipped when there is no FUSE support, to
             suppress fusermount's allow_other warning, and to be skipped
             with $IMGOPTSSYNTAX enabled]
    Signed-off-by: Hanna Czenczek <[email protected]>
    (cherry picked from commit 3804484)
    Signed-off-by: Michael Tokarev <[email protected]>
    XanClic authored and Michael Tokarev committed Oct 2, 2023
    Configuration menu
    Copy the full SHA
    8a04330 View commit details
    Browse the repository at this point in the history
  10. include/exec: Widen tlb_hit/tlb_hit_page()

    tlb_addr is changed from target_ulong to uint64_t to match the type of
    a CPUTLBEntry value, and the addressed is changed to vaddr.
    
    Signed-off-by: Anton Johansson <[email protected]>
    Reviewed-by: Richard Henderson <[email protected]>
    Message-Id: <[email protected]>
    Signed-off-by: Richard Henderson <[email protected]>
    (cherry picked from commit c78edb5)
    Signed-off-by: Michael Tokarev <[email protected]>
    Anton Johansson authored and Michael Tokarev committed Oct 2, 2023
    Configuration menu
    Copy the full SHA
    cb6ed2f View commit details
    Browse the repository at this point in the history
  11. hw/arm/boot: Set SCR_EL3.FGTEn when booting kernel

    Just like d7ef5e1 sets SCR_EL3.HXEn for FEAT_HCX, this commit
    handles SCR_EL3.FGTEn for FEAT_FGT:
    
    When we direct boot a kernel on a CPU which emulates EL3, we need to
    set up the EL3 system registers as the Linux kernel documentation
    specifies:
        https://www.kernel.org/doc/Documentation/arm64/booting.rst
    
    > For CPUs with the Fine Grained Traps (FEAT_FGT) extension present:
    > - If EL3 is present and the kernel is entered at EL2:
    >   - SCR_EL3.FGTEn (bit 27) must be initialised to 0b1.
    
    Cc: [email protected]
    Signed-off-by: Fabian Vogt <[email protected]>
    Message-id: [email protected]
    Reviewed-by: Peter Maydell <[email protected]>
    Signed-off-by: Peter Maydell <[email protected]>
    (cherry picked from commit 32b2143)
    Signed-off-by: Michael Tokarev <[email protected]>
    Vogtinator authored and Michael Tokarev committed Oct 2, 2023
    Configuration menu
    Copy the full SHA
    d0cd94e View commit details
    Browse the repository at this point in the history
  12. target/arm: Don't skip MTE checks for LDRT/STRT at EL0

    The LDRT/STRT "unprivileged load/store" instructions behave like
    normal ones if executed at EL0. We handle this correctly for
    the load/store semantics, but get the MTE checking wrong.
    
    We always look at s->mte_active[is_unpriv] to see whether we should
    be doing MTE checks, but in hflags.c when we set the TB flags that
    will be used to fill the mte_active[] array we only set the
    MTE0_ACTIVE bit if UNPRIV is true (i.e.  we are not at EL0).
    
    This means that a LDRT at EL0 will see s->mte_active[1] as 0,
    and will not do MTE checks even when MTE is enabled.
    
    To avoid the translate-time code having to do an explicit check on
    s->unpriv to see if it is OK to index into the mte_active[] array,
    duplicate MTE_ACTIVE into MTE0_ACTIVE when UNPRIV is false.
    
    (This isn't a very serious bug because generally nobody executes
    LDRT/STRT at EL0, because they have no use there.)
    
    Cc: [email protected]
    Signed-off-by: Peter Maydell <[email protected]>
    Reviewed-by: Richard Henderson <[email protected]>
    Message-id: [email protected]
    (cherry picked from commit 903dbef)
    Signed-off-by: Michael Tokarev <[email protected]>
    pm215 authored and Michael Tokarev committed Oct 2, 2023
    Configuration menu
    Copy the full SHA
    7329cc1 View commit details
    Browse the repository at this point in the history
  13. meson.build: Make keyutils independent from keyring

    Commit 0db0fbb ("Add conditional dependency for libkeyutils")
    tried to provide a possibility for the user to disable keyutils
    if not required by makeing it depend on the keyring feature. This
    looked reasonable at a first glance (the unit test in tests/unit/
    needs both), but the condition in meson.build fails if the feature
    is meant to be detected automatically, and there is also another
    spot in backends/meson.build where keyutils is used independently
    from keyring. So let's remove the dependency on keyring again and
    introduce a proper meson build option instead.
    
    Cc: [email protected]
    Fixes: 0db0fbb ("Add conditional dependency for libkeyutils")
    Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1842
    Message-ID: <[email protected]>
    Reviewed-by: "Daniel P. Berrangé" <[email protected]>
    Signed-off-by: Thomas Huth <[email protected]>
    (cherry picked from commit c64023b)
    Signed-off-by: Michael Tokarev <[email protected]>
    huth authored and Michael Tokarev committed Oct 2, 2023
    Configuration menu
    Copy the full SHA
    0215e8e View commit details
    Browse the repository at this point in the history
  14. accel/tcg: mttcg remove false-negative halted assertion

    mttcg asserts that an execution ending with EXCP_HALTED must have
    cpu->halted. However between the event or instruction that sets
    cpu->halted and requests exit and the assertion here, an
    asynchronous event could clear cpu->halted.
    
    This leads to crashes running AIX on ppc/pseries because it uses
    H_CEDE/H_PROD hcalls, where H_CEDE sets self->halted = 1 and
    H_PROD sets other cpu->halted = 0 and kicks it.
    
    H_PROD could be turned into an interrupt to wake, but several other
    places in ppc, sparc, and semihosting follow what looks like a similar
    pattern setting halted = 0 directly. So remove this assertion.
    
    Reported-by: Ivan Warren <[email protected]>
    Signed-off-by: Nicholas Piggin <[email protected]>
    Message-Id: <[email protected]>
    [rth: Keep the case label and adjust the comment.]
    Signed-off-by: Richard Henderson <[email protected]>
    (cherry picked from commit 0e59034)
    Signed-off-by: Michael Tokarev <[email protected]>
    npiggin authored and Michael Tokarev committed Oct 2, 2023
    Configuration menu
    Copy the full SHA
    b9b84b2 View commit details
    Browse the repository at this point in the history
  15. hw/scsi/scsi-disk: Disallow block sizes smaller than 512 [CVE-2023-42467

    ]
    
    We are doing things like
    
        nb_sectors /= (s->qdev.blocksize / BDRV_SECTOR_SIZE);
    
    in the code here (e.g. in scsi_disk_emulate_mode_sense()), so if
    the blocksize is smaller than BDRV_SECTOR_SIZE (=512), this crashes
    with a division by 0 exception. Thus disallow block sizes of 256
    bytes to avoid this situation.
    
    Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1813
    CVE: 2023-42467
    Signed-off-by: Thomas Huth <[email protected]>
    Message-ID: <[email protected]>
    Signed-off-by: Paolo Bonzini <[email protected]>
    (cherry picked from commit 7cfcc79)
    Signed-off-by: Michael Tokarev <[email protected]>
    huth authored and Michael Tokarev committed Oct 2, 2023
    Configuration menu
    Copy the full SHA
    6b7fa3c View commit details
    Browse the repository at this point in the history
  16. ui/vnc: fix debug output for invalid audio message

    The debug message was cut and pasted from the invalid audio format
    case, but the audio message is at bytes 2-3.
    
    Reviewed-by: Daniel P. Berrangé <[email protected]>
    Signed-off-by: Paolo Bonzini <[email protected]>
    (cherry picked from commit 0cb9c58)
    Signed-off-by: Michael Tokarev <[email protected]>
    bonzini authored and Michael Tokarev committed Oct 2, 2023
    Configuration menu
    Copy the full SHA
    17f3a62 View commit details
    Browse the repository at this point in the history
  17. ui/vnc: fix handling of VNC_FEATURE_XVP

    VNC_FEATURE_XVP was not shifted left before adding it to vs->features,
    so it was never enabled; but it was also checked the wrong way with
    a logical AND instead of vnc_has_feature.  Fix both places.
    
    Signed-off-by: Paolo Bonzini <[email protected]>
    (cherry picked from commit 477b301)
    Signed-off-by: Michael Tokarev <[email protected]>
    bonzini authored and Michael Tokarev committed Oct 2, 2023
    Configuration menu
    Copy the full SHA
    3b86b92 View commit details
    Browse the repository at this point in the history
  18. migration: Fix race that dest preempt thread close too early

    We hit intermit CI issue on failing at migration-test over the unit test
    preempt/plain:
    
    qemu-system-x86_64: Unable to read from socket: Connection reset by peer
    Memory content inconsistency at 5b43000 first_byte = bd last_byte = bc current = 4f hit_edge = 1
    **
    ERROR:../tests/qtest/migration-test.c:300:check_guests_ram: assertion failed: (bad == 0)
    (test program exited with status code -6)
    
    Fabiano debugged into it and found that the preempt thread can quit even
    without receiving all the pages, which can cause guest not receiving all
    the pages and corrupt the guest memory.
    
    To make sure preempt thread finished receiving all the pages, we can rely
    on the page_requested_count being zero because preempt channel will only
    receive requested page faults. Note, not all the faulted pages are required
    to be sent via the preempt channel/thread; imagine the case when a
    requested page is just queued into the background main channel for
    migration, the src qemu will just still send it via the background channel.
    
    Here instead of spinning over reading the count, we add a condvar so the
    main thread can wait on it if that unusual case happened, without burning
    the cpu for no good reason, even if the duration is short; so even if we
    spin in this rare case is probably fine.  It's just better to not do so.
    
    The condvar is only used when that special case is triggered.  Some memory
    ordering trick is needed to guarantee it from happening (against the
    preempt thread status field), so the main thread will always get a kick
    when that triggers correctly.
    
    Closes: https://gitlab.com/qemu-project/qemu/-/issues/1886
    Debugged-by: Fabiano Rosas <[email protected]>
    Signed-off-by: Peter Xu <[email protected]>
    Signed-off-by: Fabiano Rosas <[email protected]>
    Signed-off-by: Stefan Hajnoczi <[email protected]>
    Message-ID: <[email protected]>
    (cherry picked from commit cf02f29)
    Signed-off-by: Michael Tokarev <[email protected]>
    xzpeter authored and Michael Tokarev committed Oct 2, 2023
    Configuration menu
    Copy the full SHA
    0b246f8 View commit details
    Browse the repository at this point in the history
  19. migration: Fix possible race when setting rp_state.error

    We don't need to set the rp_state.error right after a shutdown because
    qemu_file_shutdown() always sets the QEMUFile error, so the return
    path thread would have seen it and set the rp error itself.
    
    Setting the error outside of the thread is also racy because the
    thread could clear it after we set it.
    
    Reviewed-by: Peter Xu <[email protected]>
    Signed-off-by: Fabiano Rosas <[email protected]>
    Signed-off-by: Stefan Hajnoczi <[email protected]>
    Message-ID: <[email protected]>
    (cherry picked from commit 28a8347)
    Signed-off-by: Michael Tokarev <[email protected]>
    Fabiano Rosas authored and Michael Tokarev committed Oct 2, 2023
    Configuration menu
    Copy the full SHA
    cc3a334 View commit details
    Browse the repository at this point in the history
  20. migration: Fix possible races when shutting down the return path

    We cannot call qemu_file_shutdown() on the return path file without
    taking the file lock. The return path thread could be running it's
    cleanup code and have just cleared the from_dst_file pointer.
    
    Checking ms->to_dst_file for errors could also race with
    migrate_fd_cleanup() which clears the to_dst_file pointer.
    
    Protect both accesses by taking the file lock.
    
    This was caught by inspection, it should be rare, but the next patches
    will start calling this code from other places, so let's do the
    correct thing.
    
    Reviewed-by: Peter Xu <[email protected]>
    Signed-off-by: Fabiano Rosas <[email protected]>
    Signed-off-by: Stefan Hajnoczi <[email protected]>
    Message-ID: <[email protected]>
    (cherry picked from commit 639decf)
    Signed-off-by: Michael Tokarev <[email protected]>
    Fabiano Rosas authored and Michael Tokarev committed Oct 2, 2023
    Configuration menu
    Copy the full SHA
    f5480c4 View commit details
    Browse the repository at this point in the history
  21. migration: Fix possible race when shutting down to_dst_file

    It's not safe to call qemu_file_shutdown() on the to_dst_file without
    first checking for the file's presence under the lock. The cleanup of
    this file happens at postcopy_pause() and migrate_fd_cleanup() which
    are not necessarily running in the same thread as migrate_fd_cancel().
    
    Reviewed-by: Peter Xu <[email protected]>
    Signed-off-by: Fabiano Rosas <[email protected]>
    Signed-off-by: Stefan Hajnoczi <[email protected]>
    Message-ID: <[email protected]>
    (cherry picked from commit 7478fb0)
    Signed-off-by: Michael Tokarev <[email protected]>
    Fabiano Rosas authored and Michael Tokarev committed Oct 2, 2023
    Configuration menu
    Copy the full SHA
    73393af View commit details
    Browse the repository at this point in the history
  22. migration: Remove redundant cleanup of postcopy_qemufile_src

    This file is owned by the return path thread which is already doing
    cleanup.
    
    Reviewed-by: Peter Xu <[email protected]>
    Signed-off-by: Fabiano Rosas <[email protected]>
    Signed-off-by: Stefan Hajnoczi <[email protected]>
    Message-ID: <[email protected]>
    (cherry picked from commit b3b1011)
    Signed-off-by: Michael Tokarev <[email protected]>
    Fabiano Rosas authored and Michael Tokarev committed Oct 2, 2023
    Configuration menu
    Copy the full SHA
    d37260b View commit details
    Browse the repository at this point in the history
  23. migration: Consolidate return path closing code

    We'll start calling the await_return_path_close_on_source() function
    from other parts of the code, so move all of the related checks and
    tracepoints into it.
    
    Reviewed-by: Peter Xu <[email protected]>
    Signed-off-by: Fabiano Rosas <[email protected]>
    Signed-off-by: Stefan Hajnoczi <[email protected]>
    Message-ID: <[email protected]>
    (cherry picked from commit d50f5dc)
    Signed-off-by: Michael Tokarev <[email protected]>
    Fabiano Rosas authored and Michael Tokarev committed Oct 2, 2023
    Configuration menu
    Copy the full SHA
    1ad3fa1 View commit details
    Browse the repository at this point in the history
  24. migration: Replace the return path retry logic

    Replace the return path retry logic with finishing and restarting the
    thread. This fixes a race when resuming the migration that leads to a
    segfault.
    
    Currently when doing postcopy we consider that an IO error on the
    return path file could be due to a network intermittency. We then keep
    the thread alive but have it do cleanup of the 'from_dst_file' and
    wait on the 'postcopy_pause_rp' semaphore. When the user issues a
    migrate resume, a new return path is opened and the thread is allowed
    to continue.
    
    There's a race condition in the above mechanism. It is possible for
    the new return path file to be setup *before* the cleanup code in the
    return path thread has had a chance to run, leading to the *new* file
    being closed and the pointer set to NULL. When the thread is released
    after the resume, it tries to dereference 'from_dst_file' and crashes:
    
    Thread 7 "return path" received signal SIGSEGV, Segmentation fault.
    [Switching to Thread 0x7fffd1dbf700 (LWP 9611)]
    0x00005555560e4893 in qemu_file_get_error_obj (f=0x0, errp=0x0) at ../migration/qemu-file.c:154
    154         return f->last_error;
    
    (gdb) bt
     #0  0x00005555560e4893 in qemu_file_get_error_obj (f=0x0, errp=0x0) at ../migration/qemu-file.c:154
     qemu#1  0x00005555560e4983 in qemu_file_get_error (f=0x0) at ../migration/qemu-file.c:206
     qemu#2  0x0000555555b9a1df in source_return_path_thread (opaque=0x555556e06000) at ../migration/migration.c:1876
     qemu#3  0x000055555602e14f in qemu_thread_start (args=0x55555782e780) at ../util/qemu-thread-posix.c:541
     qemu#4  0x00007ffff38d76ea in start_thread (arg=0x7fffd1dbf700) at pthread_create.c:477
     qemu#5  0x00007ffff35efa6f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
    
    Here's the race (important bit is open_return_path happening before
    migration_release_dst_files):
    
    migration                 | qmp                         | return path
    --------------------------+-----------------------------+---------------------------------
    			    qmp_migrate_pause()
    			     shutdown(ms->to_dst_file)
    			      f->last_error = -EIO
    migrate_detect_error()
     postcopy_pause()
      set_state(PAUSED)
      wait(postcopy_pause_sem)
    			    qmp_migrate(resume)
    			    migrate_fd_connect()
    			     resume = state == PAUSED
    			     open_return_path <-- TOO SOON!
    			     set_state(RECOVER)
    			     post(postcopy_pause_sem)
    							(incoming closes to_src_file)
    							res = qemu_file_get_error(rp)
    							migration_release_dst_files()
    							ms->rp_state.from_dst_file = NULL
      post(postcopy_pause_rp_sem)
    							postcopy_pause_return_path_thread()
    							  wait(postcopy_pause_rp_sem)
    							rp = ms->rp_state.from_dst_file
    							goto retry
    							qemu_file_get_error(rp)
    							SIGSEGV
    -------------------------------------------------------------------------------------------
    
    We can keep the retry logic without having the thread alive and
    waiting. The only piece of data used by it is the 'from_dst_file' and
    it is only allowed to proceed after a migrate resume is issued and the
    semaphore released at migrate_fd_connect().
    
    Move the retry logic to outside the thread by waiting for the thread
    to finish before pausing the migration.
    
    Reviewed-by: Peter Xu <[email protected]>
    Signed-off-by: Fabiano Rosas <[email protected]>
    Signed-off-by: Stefan Hajnoczi <[email protected]>
    Message-ID: <[email protected]>
    (cherry picked from commit ef796ee)
    Signed-off-by: Michael Tokarev <[email protected]>
    Fabiano Rosas authored and Michael Tokarev committed Oct 2, 2023
    Configuration menu
    Copy the full SHA
    dec7785 View commit details
    Browse the repository at this point in the history
  25. migration: Move return path cleanup to main migration thread

    Now that the return path thread is allowed to finish during a paused
    migration, we can move the cleanup of the QEMUFiles to the main
    migration thread.
    
    Reviewed-by: Peter Xu <[email protected]>
    Signed-off-by: Fabiano Rosas <[email protected]>
    Signed-off-by: Stefan Hajnoczi <[email protected]>
    Message-ID: <[email protected]>
    (cherry picked from commit 36e9aab)
    Signed-off-by: Michael Tokarev <[email protected]>
    Fabiano Rosas authored and Michael Tokarev committed Oct 2, 2023
    Configuration menu
    Copy the full SHA
    4ade907 View commit details
    Browse the repository at this point in the history
  26. softmmu: Use async_run_on_cpu in tcg_commit

    After system startup, run the update to memory_dispatch
    and the tlb_flush on the cpu.  This eliminates a race,
    wherein a running cpu sees the memory_dispatch change
    but has not yet seen the tlb_flush.
    
    Since the update now happens on the cpu, we need not use
    qatomic_rcu_read to protect the read of memory_dispatch.
    
    Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1826
    Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1834
    Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1846
    Tested-by: Alex Bennée <[email protected]>
    Reviewed-by: Alex Bennée <[email protected]>
    Signed-off-by: Richard Henderson <[email protected]>
    (cherry picked from commit 0d58c66)
    Signed-off-by: Michael Tokarev <[email protected]>
    rth7680 authored and Michael Tokarev committed Oct 2, 2023
    Configuration menu
    Copy the full SHA
    d9ec18a View commit details
    Browse the repository at this point in the history
  27. accel/tcg: Avoid load of icount_decr if unused

    With CF_NOIRQ and without !CF_USE_ICOUNT, the load isn't used.
    Avoid emitting it.
    
    Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
    Signed-off-by: Richard Henderson <[email protected]>
    (cherry picked from commit f47a90d)
    Signed-off-by: Michael Tokarev <[email protected]>
    rth7680 authored and Michael Tokarev committed Oct 2, 2023
    Configuration menu
    Copy the full SHA
    837ca79 View commit details
    Browse the repository at this point in the history
  28. accel/tcg: Hoist CF_MEMI_ONLY check outside translation loop

    The condition checked is loop invariant; check it only once.
    
    Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
    Signed-off-by: Richard Henderson <[email protected]>
    (cherry picked from commit 5d97e94)
    Signed-off-by: Michael Tokarev <[email protected]>
    rth7680 authored and Michael Tokarev committed Oct 2, 2023
    Configuration menu
    Copy the full SHA
    de11111 View commit details
    Browse the repository at this point in the history
  29. accel/tcg: Track current value of can_do_io in the TB

    Simplify translator_io_start by recording the current
    known value of can_do_io within DisasContextBase.
    
    Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
    Signed-off-by: Richard Henderson <[email protected]>
    (cherry picked from commit 0ca41cc)
    Signed-off-by: Michael Tokarev <[email protected]>
    rth7680 authored and Michael Tokarev committed Oct 2, 2023
    Configuration menu
    Copy the full SHA
    a98097d View commit details
    Browse the repository at this point in the history
  30. accel/tcg: Improve setting of can_do_io at start of TB

    Initialize can_do_io to true if this the TB has CF_LAST_IO
    and will consist of a single instruction.  This avoids a
    set to 0 followed immediately by a set to 1.
    
    Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
    Signed-off-by: Richard Henderson <[email protected]>
    (cherry picked from commit a2f99d4)
    Signed-off-by: Michael Tokarev <[email protected]>
    rth7680 authored and Michael Tokarev committed Oct 2, 2023
    Configuration menu
    Copy the full SHA
    6c2e2e4 View commit details
    Browse the repository at this point in the history
  31. accel/tcg: Always set CF_LAST_IO with CF_NOIRQ

    Without this we can get see loops through cpu_io_recompile,
    in which the cpu makes no progress.
    
    Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
    Signed-off-by: Richard Henderson <[email protected]>
    (cherry picked from commit 200c1f9)
    Signed-off-by: Michael Tokarev <[email protected]>
    rth7680 authored and Michael Tokarev committed Oct 2, 2023
    Configuration menu
    Copy the full SHA
    d6cca99 View commit details
    Browse the repository at this point in the history
  32. accel/tcg: Always require can_do_io

    Require i/o as the last insn of a TranslationBlock always,
    not only with icount.  This is required for i/o that alters
    the address space, such as a pci config space write.
    
    Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1866
    Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
    Signed-off-by: Richard Henderson <[email protected]>
    (cherry picked from commit 18a536f)
    Signed-off-by: Michael Tokarev <[email protected]>
    rth7680 authored and Michael Tokarev committed Oct 2, 2023
    Configuration menu
    Copy the full SHA
    9fb45b0 View commit details
    Browse the repository at this point in the history
  33. target/tricore: Fix RCPW/RRPW_INSERT insns for width = 0

    we would crash if width was 0 for these insns, as tcg_gen_deposit() is
    undefined for that case. For TriCore, width = 0 is a mov from the src reg
    to the dst reg, so we special case this here.
    
    Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
    Reviewed-by: Richard Henderson <[email protected]>
    Signed-off-by: Bastian Koppelmann <[email protected]>
    Message-ID: <[email protected]>
    (cherry picked from commit 23fa6f5)
    Signed-off-by: Michael Tokarev <[email protected]>
    bkoppelmann authored and Michael Tokarev committed Oct 2, 2023
    Configuration menu
    Copy the full SHA
    d1b867c View commit details
    Browse the repository at this point in the history

Commits on Oct 3, 2023

  1. optionrom: Remove build-id section

    Our linker script for optionroms specifies only the placement of the
    .text section, leaving the linker free to place the remaining sections
    at arbitrary places in the file.
    
    Since at least binutils 2.39, the .note.gnu.build-id section is now
    being placed at the start of the file, which causes label addresses to
    be shifted. For linuxboot_dma.bin that means that the PnP header
    (among others) will not be found when determining the type of ROM at
    optionrom_setup():
    
    (0x1c is the label _pnph, where the magic "PnP" is)
    
    $ xxd /usr/share/qemu/linuxboot_dma.bin | grep "PnP"
    00000010: 0000 0000 0000 0000 0000 1c00 2450 6e50  ............$PnP
    
    $ xxd pc-bios/optionrom/linuxboot_dma.bin | grep "PnP"
    00000010: 0000 0000 0000 0000 0000 4c00 2450 6e50  ............$PnP
                                       ^bad
    
    Using a freshly built linuxboot_dma.bin ROM results in a broken boot:
    
      SeaBIOS (version rel-1.16.2-0-gea1b7a073390-prebuilt.qemu.org)
      Booting from Hard Disk...
      Boot failed: could not read the boot disk
    
      Booting from Floppy...
      Boot failed: could not read the boot disk
    
      No bootable device.
    
    We're not using the build-id section, so pass the --build-id=none
    option to the linker to remove it entirely.
    
    Note: In theory, this same issue could happen with any other
    section. The ideal solution would be to have all unused sections
    discarded in the linker script. However that would be a larger change,
    specially for the pvh rom which uses the .bss and COMMON sections so
    I'm addressing only the immediate issue here.
    
    Reported-by: Vasiliy Ulyanov <[email protected]>
    Signed-off-by: Fabiano Rosas <[email protected]>
    Reviewed-by: Thomas Huth <[email protected]>
    Message-ID: <[email protected]>
    Signed-off-by: Paolo Bonzini <[email protected]>
    (cherry picked from commit 35ed01b)
    Signed-off-by: Michael Tokarev <[email protected]>
    (mjt: remove unrelated stable@vger)
    Fabiano Rosas authored and Michael Tokarev committed Oct 3, 2023
    Configuration menu
    Copy the full SHA
    ee7ce8a View commit details
    Browse the repository at this point in the history
  2. esp: use correct type for esp_dma_enable() in sysbus_esp_gpio_demux()

    The call to esp_dma_enable() was being made with the SYSBUS_ESP type instead of
    the ESP type. This meant that when GPIO 1 was being used to trigger a DMA
    request from an external DMA controller, the setting of ESPState's dma_enabled
    field would clobber unknown memory whilst the dma_cb callback pointer would
    typically return NULL so the DMA request would never start.
    
    Signed-off-by: Mark Cave-Ayland <[email protected]>
    Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
    Reviewed-by: Thomas Huth <[email protected]>
    Message-ID: <[email protected]>
    Signed-off-by: Paolo Bonzini <[email protected]>
    (cherry picked from commit b86dc5c)
    Signed-off-by: Michael Tokarev <[email protected]>
    mcayland authored and Michael Tokarev committed Oct 3, 2023
    Configuration menu
    Copy the full SHA
    8194d58 View commit details
    Browse the repository at this point in the history
  3. esp: restrict non-DMA transfer length to that of available data

    In the case where a SCSI layer transfer is incorrectly terminated, it is
    possible for a TI command to cause a SCSI buffer overflow due to the
    expected transfer data length being less than the available data in the
    FIFO. When this occurs the unsigned async_len variable underflows and
    becomes a large offset which writes past the end of the allocated SCSI
    buffer.
    
    Restrict the non-DMA transfer length to be the smallest of the expected
    transfer length and the available FIFO data to ensure that it is no longer
    possible for the SCSI buffer overflow to occur.
    
    Signed-off-by: Mark Cave-Ayland <[email protected]>
    Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1810
    Reviewed-by: Thomas Huth <[email protected]>
    Message-ID: <[email protected]>
    Signed-off-by: Paolo Bonzini <[email protected]>
    (cherry picked from commit 77668e4)
    Signed-off-by: Michael Tokarev <[email protected]>
    mcayland authored and Michael Tokarev committed Oct 3, 2023
    Configuration menu
    Copy the full SHA
    e855a6e View commit details
    Browse the repository at this point in the history
  4. scsi-disk: ensure that FORMAT UNIT commands are terminated

    Otherwise when a FORMAT UNIT command is issued, the SCSI layer can become
    confused because it can find itself in the situation where it thinks there
    is still data to be transferred which can cause the next emulated SCSI
    command to fail.
    
    Signed-off-by: Mark Cave-Ayland <[email protected]>
    Fixes: 6ab7176 ("scsi-disk: add FORMAT UNIT command")
    Tested-by: Thomas Huth <[email protected]>
    Message-ID: <[email protected]>
    Signed-off-by: Paolo Bonzini <[email protected]>
    (cherry picked from commit be2b619)
    Signed-off-by: Michael Tokarev <[email protected]>
    mcayland authored and Michael Tokarev committed Oct 3, 2023
    Configuration menu
    Copy the full SHA
    f9f1d09 View commit details
    Browse the repository at this point in the history

Commits on Oct 4, 2023

  1. subprojects/berkeley-testfloat-3: Update to fix a problem with compil…

    …er warnings
    
    Update the berkeley-testfloat-3 wrap to include a patch provided by
    Olaf Hering. This fixes a problem with "control reaches end of non-void
    function [-Werror=return-type]" compiler warning/errors that are now
    enabled by default in certain versions of GCC.
    
    Reported-by: Olaf Hering <[email protected]>
    Message-Id: <[email protected]>
    Signed-off-by: Thomas Huth <[email protected]>
    (cherry picked from commit c01196b)
    Signed-off-by: Michael Tokarev <[email protected]>
    huth authored and Michael Tokarev committed Oct 4, 2023
    Configuration menu
    Copy the full SHA
    6831048 View commit details
    Browse the repository at this point in the history
  2. target/i386: generalize operand size "ph" for use in CVTPS2PD

    CVTPS2PD only loads a half-register for memory, like CVTPH2PS.  It can
    reuse the "ph" packed half-precision size to load a half-register,
    but rename it to "xh" because it is now a variation of "x" (it is not
    used only for half-precision values).
    
    Signed-off-by: Paolo Bonzini <[email protected]>
    (cherry picked from commit a48b269)
    Signed-off-by: Michael Tokarev <[email protected]>
    bonzini authored and Michael Tokarev committed Oct 4, 2023
    Configuration menu
    Copy the full SHA
    db2d4bc View commit details
    Browse the repository at this point in the history
  3. target/i386: fix memory operand size for CVTPS2PD

    CVTPS2PD only loads a half-register for memory, unlike the other
    operations under 0x0F 0x5A.  "Unpack" the group into separate
    emission functions instead of using gen_unary_fp_sse.
    
    Signed-off-by: Paolo Bonzini <[email protected]>
    (cherry picked from commit abd4188)
    Signed-off-by: Michael Tokarev <[email protected]>
    bonzini authored and Michael Tokarev committed Oct 4, 2023
    Configuration menu
    Copy the full SHA
    1e58398 View commit details
    Browse the repository at this point in the history

Commits on Oct 5, 2023

  1. win32: avoid discarding the exception handler

    In all likelihood, the compiler with lto doesn't see the function being
    used, from assembly macro __try1. Help it by marking the function has
    being used.
    
    Resolves:
    https://gitlab.com/qemu-project/qemu/-/issues/1904
    
    Fixes: commit d89f30b ("win32: wrap socket close() with an exception handler")
    
    Signed-off-by: Marc-André Lureau <[email protected]>
    Reviewed-by: Thomas Huth <[email protected]>
    (cherry picked from commit 75b773d)
    Signed-off-by: Michael Tokarev <[email protected]>
    (mjt: trivial context fixup in include/qemu/compiler.h)
    elmarco authored and Michael Tokarev committed Oct 5, 2023
    Configuration menu
    Copy the full SHA
    ab63145 View commit details
    Browse the repository at this point in the history
  2. hw/display/ramfb: plug slight guest-triggerable leak on mode setting

    The fw_cfg DMA write callback in ramfb prepares a new display surface in
    QEMU; this new surface is put to use ("swapped in") upon the next display
    update. At that time, the old surface (if any) is released.
    
    If the guest triggers the fw_cfg DMA write callback at least twice between
    two adjacent display updates, then the second callback (and further such
    callbacks) will leak the previously prepared (but not yet swapped in)
    display surface.
    
    The issue can be shown by:
    
    (1) starting QEMU with "-trace displaysurface_free", and
    
    (2) running the following program in the guest UEFI shell:
    
    > #include <Library/ShellCEntryLib.h>           // ShellAppMain()
    > #include <Library/UefiBootServicesTableLib.h> // gBS
    > #include <Protocol/GraphicsOutput.h>          // EFI_GRAPHICS_OUTPUT_PROTOCOL
    >
    > INTN
    > EFIAPI
    > ShellAppMain (
    >   IN UINTN   Argc,
    >   IN CHAR16  **Argv
    >   )
    > {
    >   EFI_STATUS                    Status;
    >   VOID                          *Interface;
    >   EFI_GRAPHICS_OUTPUT_PROTOCOL  *Gop;
    >   UINT32                        Mode;
    >
    >   Status = gBS->LocateProtocol (
    >                   &gEfiGraphicsOutputProtocolGuid,
    >                   NULL,
    >                   &Interface
    >                   );
    >   if (EFI_ERROR (Status)) {
    >     return 1;
    >   }
    >
    >   Gop = Interface;
    >
    >   Mode = 1;
    >   for ( ; ;) {
    >     Status = Gop->SetMode (Gop, Mode);
    >     if (EFI_ERROR (Status)) {
    >       break;
    >     }
    >
    >     Mode = 1 - Mode;
    >   }
    >
    >   return 1;
    > }
    
    The symptom is then that:
    
    - only one trace message appears periodically,
    
    - the time between adjacent messages keeps increasing -- implying that
      some list structure (containing the leaked resources) keeps growing,
    
    - the "surface" pointer is ever different.
    
    > [email protected]:displaysurface_free surface=0x7f2fcc09a7c0
    > [email protected]:displaysurface_free surface=0x7f2fcc9dac10
    > [email protected]:displaysurface_free surface=0x7f2fcc441dd0
    > [email protected]:displaysurface_free surface=0x7f2fcc0363d0
    > [email protected]:displaysurface_free surface=0x7f2fcc413a80
    > [email protected]:displaysurface_free surface=0x7f2fcc09cd00
    > [email protected]:displaysurface_free surface=0x7f2fcc1395f0
    > [email protected]:displaysurface_free surface=0x7f2fcc1cae50
    > [email protected]:displaysurface_free surface=0x7f2fcc42fc50
    > [email protected]:displaysurface_free surface=0x7f2fcc45dcc0
    > [email protected]:displaysurface_free surface=0x7f2fcc70b9d0
    > [email protected]:displaysurface_free surface=0x7f2fcc82acc0
    > [email protected]:displaysurface_free surface=0x7f2fcc369c00
    > [email protected]:displaysurface_free surface=0x7f2fcc32b910
    > [email protected]:displaysurface_free surface=0x7f2fcc0d5a20
    > [email protected]:displaysurface_free surface=0x7f2fcc086c40
    > [email protected]:displaysurface_free surface=0x7f2fccc72020
    > [email protected]:displaysurface_free surface=0x7f2fcc185160
    > [email protected]:displaysurface_free surface=0x7f2fcc23a7e0
    > [email protected]:displaysurface_free surface=0x7f2fcc3ec870
    > [email protected]:displaysurface_free surface=0x7f2fcc634960
    > [email protected]:displaysurface_free surface=0x7f2fcc26b140
    > [email protected]:displaysurface_free surface=0x7f2fcc321700
    > [email protected]:displaysurface_free surface=0x7f2fccaad100
    
    We figured this wasn't a CVE-worthy problem, as only small amounts of
    memory were leaked (the framebuffer itself is mapped from guest RAM, QEMU
    only allocates administrative structures), plus libvirt restricts QEMU
    memory footprint anyway, thus the guest can only DoS itself.
    
    Plug the leak, by releasing the last prepared (not yet swapped in) display
    surface, if any, in the fw_cfg DMA write callback.
    
    Regarding the "reproducer", with the fix in place, the log is flooded with
    trace messages (one per fw_cfg write), *and* the trace message alternates
    between just two "surface" pointer values (i.e., nothing is leaked, the
    allocator flip-flops between two objects in effect).
    
    This issue appears to date back to the introducion of ramfb (995b301,
    "hw/display: add ramfb, a simple boot framebuffer living in guest ram",
    2018-06-18).
    
    Cc: Gerd Hoffmann <[email protected]> (maintainer:ramfb)
    Cc: [email protected]
    Fixes: 995b301
    Signed-off-by: Laszlo Ersek <[email protected]>
    Acked-by: Laszlo Ersek <[email protected]>
    Reviewed-by: Gerd Hoffmann <[email protected]>
    Reviewed-by: Marc-André Lureau <[email protected]>
    Message-ID: <[email protected]>
    (cherry picked from commit e0288a7)
    Signed-off-by: Michael Tokarev <[email protected]>
    lersek authored and Michael Tokarev committed Oct 5, 2023
    Configuration menu
    Copy the full SHA
    7771e35 View commit details
    Browse the repository at this point in the history
  3. chardev/char-pty: Avoid losing bytes when the other side just (re-)co…

    …nnected
    
    When starting a guest via libvirt with "virsh start --console ...",
    the first second of the console output is missing. This is especially
    annoying on s390x that only has a text console by default and no graphical
    output - if the bios fails to boot here, the information about what went
    wrong is completely lost.
    
    One part of the problem (there is also some things to be done on the
    libvirt side) is that QEMU only checks with a 1 second timer whether
    the other side of the pty is already connected, so the first second of
    the console output is always lost.
    
    This likely used to work better in the past, since the code once checked
    for a re-connection during write, but this has been removed in commit
    f8278c7 ("char-pty: remove the check for connection on write") to avoid
    some locking.
    
    To ease the situation here at least a little bit, let's check with g_poll()
    whether we could send out the data anyway, even if the connection has not
    been marked as "connected" yet. The file descriptor is marked as non-blocking
    anyway since commit fac6688 ("Do not hang on full PTY"), so this should
    not cause any trouble if the other side is not ready for receiving yet.
    
    With this patch applied, I can now successfully see the bios output of
    a s390x guest when running it with "virsh start --console" (with a patched
    version of virsh that fixes the remaining issues there, too).
    
    Reported-by: Marc Hartmayer <[email protected]>
    Signed-off-by: Thomas Huth <[email protected]>
    Reviewed-by: Daniel P. Berrangé <[email protected]>
    Message-Id: <[email protected]>
    (cherry picked from commit 4f7689f)
    Signed-off-by: Michael Tokarev <[email protected]>
    huth authored and Michael Tokarev committed Oct 5, 2023
    Configuration menu
    Copy the full SHA
    19159a7 View commit details
    Browse the repository at this point in the history

Commits on Oct 6, 2023

  1. linux-user/hppa: Fix struct target_sigcontext layout

    Use abi_ullong not uint64_t so that the alignment of the field
    and therefore the layout of the struct is correct.
    
    Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
    Signed-off-by: Richard Henderson <[email protected]>
    (cherry picked from commit 33bc4fa)
    Signed-off-by: Michael Tokarev <[email protected]>
    rth7680 authored and Michael Tokarev committed Oct 6, 2023
    Configuration menu
    Copy the full SHA
    2990ba5 View commit details
    Browse the repository at this point in the history
  2. vdpa net: zero vhost_vdpa iova_tree pointer at cleanup

    Not zeroing it causes a SIGSEGV if the live migration is cancelled, at
    net device restart.
    
    This is caused because CVQ tries to reuse the iova_tree that is present
    in the first vhost_vdpa device at the end of vhost_vdpa_net_cvq_start.
    As a consequence, it tries to access an iova_tree that has been already
    free.
    
    Fixes: 00ef422 ("vdpa net: move iova tree creation from init to start")
    Reported-by: Yanhui Ma <[email protected]>
    Signed-off-by: Eugenio Pérez <[email protected]>
    Message-Id: <[email protected]>
    Acked-by: Jason Wang <[email protected]>
    Tested-by: Lei Yang <[email protected]>
    Reviewed-by: Si-Wei Liu <[email protected]>
    Reviewed-by: Michael S. Tsirkin <[email protected]>
    Signed-off-by: Michael S. Tsirkin <[email protected]>
    (cherry picked from commit 0a7a164)
    Signed-off-by: Michael Tokarev <[email protected]>
    eugpermar authored and Michael Tokarev committed Oct 6, 2023
    Configuration menu
    Copy the full SHA
    809d599 View commit details
    Browse the repository at this point in the history
  3. vdpa net: fix error message setting virtio status

    It incorrectly prints "error setting features", probably because a copy
    paste miss.
    
    Fixes: 152128d ("vdpa: move CVQ isolation check to net_init_vhost_vdpa")
    Reported-by: Peter Maydell <[email protected]>
    Signed-off-by: Eugenio Pérez <[email protected]>
    Message-Id: <[email protected]>
    Tested-by: Lei Yang <[email protected]>
    Reviewed-by: Michael S. Tsirkin <[email protected]>
    Signed-off-by: Michael S. Tsirkin <[email protected]>
    Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
    (cherry picked from commit cbc9ae8)
    Signed-off-by: Michael Tokarev <[email protected]>
    eugpermar authored and Michael Tokarev committed Oct 6, 2023
    Configuration menu
    Copy the full SHA
    197cc86 View commit details
    Browse the repository at this point in the history
  4. vdpa net: stop probing if cannot set features

    Otherwise it continues the CVQ isolation probing.
    
    Fixes: 152128d ("vdpa: move CVQ isolation check to net_init_vhost_vdpa")
    Reported-by: Peter Maydell <[email protected]>
    Signed-off-by: Eugenio Pérez <[email protected]>
    Message-Id: <[email protected]>
    Tested-by: Lei Yang <[email protected]>
    Reviewed-by: Michael S. Tsirkin <[email protected]>
    Signed-off-by: Michael S. Tsirkin <[email protected]>
    Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
    (cherry picked from commit f108588)
    Signed-off-by: Michael Tokarev <[email protected]>
    eugpermar authored and Michael Tokarev committed Oct 6, 2023
    Configuration menu
    Copy the full SHA
    e6d9dd1 View commit details
    Browse the repository at this point in the history
  5. vdpa net: follow VirtIO initialization properly at cvq isolation probing

    This patch solves a few issues.  The most obvious is that the feature
    set was done previous to ACKNOWLEDGE | DRIVER status bit set.  Current
    vdpa devices are permissive with this, but it is better to follow the
    standard.
    
    Fixes: 152128d ("vdpa: move CVQ isolation check to net_init_vhost_vdpa")
    Signed-off-by: Eugenio Pérez <[email protected]>
    Message-Id: <[email protected]>
    Tested-by: Lei Yang <[email protected]>
    Reviewed-by: Michael S. Tsirkin <[email protected]>
    Signed-off-by: Michael S. Tsirkin <[email protected]>
    (cherry picked from commit 845ec38)
    Signed-off-by: Michael Tokarev <[email protected]>
    eugpermar authored and Michael Tokarev committed Oct 6, 2023
    Configuration menu
    Copy the full SHA
    fe3afc0 View commit details
    Browse the repository at this point in the history
  6. amd_iommu: Fix APIC address check

    An MSI from I/O APIC may not exactly equal to APIC_DEFAULT_ADDRESS. In
    fact, Windows 17763.3650 configures I/O APIC to set the dest_mode bit.
    Cover the range assigned to APIC.
    
    Fixes: 577c470 ("x86_iommu/amd: Prepare for interrupt remap support")
    Signed-off-by: Akihiko Odaki <[email protected]>
    Message-Id: <[email protected]>
    Reviewed-by: Michael S. Tsirkin <[email protected]>
    Signed-off-by: Michael S. Tsirkin <[email protected]>
    (cherry picked from commit 0114c45)
    Signed-off-by: Michael Tokarev <[email protected]>
    akihikodaki authored and Michael Tokarev committed Oct 6, 2023
    Configuration menu
    Copy the full SHA
    2adbc3b View commit details
    Browse the repository at this point in the history

Commits on Oct 10, 2023

  1. vfio/display: Fix missing update to set backing fields

    The below referenced commit renames scanout_width/height to
    backing_width/height, but also promotes these fields in various portions
    of the egl interface.  Meanwhile vfio dmabuf support has never used the
    previous scanout fields and is therefore missed in the update.  This
    results in a black screen when transitioning from ramfb to dmabuf display
    when using Intel vGPU with these features.
    
    Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1891
    Link: https://lists.gnu.org/archive/html/qemu-devel/2023-08/msg02726.html
    Fixes: 9ac06df ("virtio-gpu-udmabuf: correct naming of QemuDmaBuf size properties")
    Signed-off-by: Alex Williamson <[email protected]>
    Tested-by: Cédric Le Goater <[email protected]>
    Signed-off-by: Cédric Le Goater <[email protected]>
    (cherry picked from commit 931150e)
    Signed-off-by: Michael Tokarev <[email protected]>
    awilliam authored and Michael Tokarev committed Oct 10, 2023
    Configuration menu
    Copy the full SHA
    0f1d63d View commit details
    Browse the repository at this point in the history
  2. util/log: re-allow switching away from stderr log file

    Commit 59bde21 ("util/log: do not close and reopen log files when
    flags are turned off") prevented switching away from stderr on a
    subsequent invocation of qemu_set_log_internal(). This prevented
    switching away from stderr with the 'logfile' monitor command as well
    as an invocation like
    > ./qemu-system-x86_64 -trace 'qemu_mutex_lock,file=log'
    from opening the specified log file.
    
    Fixes: 59bde21 ("util/log: do not close and reopen log files when flags are turned off")
    Signed-off-by: Fiona Ebner <[email protected]>
    Message-ID: <[email protected]>
    Signed-off-by: Paolo Bonzini <[email protected]>
    (cherry picked from commit f05142d)
    Signed-off-by: Michael Tokarev <[email protected]>
    foxmox authored and Michael Tokarev committed Oct 10, 2023
    Configuration menu
    Copy the full SHA
    d8b9e0c View commit details
    Browse the repository at this point in the history

Commits on Oct 11, 2023

  1. migration/qmp: Fix crash on setting tls-authz with null

    QEMU will crash if anyone tries to set tls-authz (which is a type
    StrOrNull) with 'null' value.  Fix it in the easy way by converting it to
    qstring just like the other two tls parameters.
    
    Cc: [email protected] # v4.0+
    Fixes: d2f1d29 ("migration: add support for a "tls-authz" migration parameter")
    Reviewed-by: Daniel P. Berrangé <[email protected]>
    Reviewed-by: Fabiano Rosas <[email protected]>
    Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
    Reviewed-by: Juan Quintela <[email protected]>
    Signed-off-by: Peter Xu <[email protected]>
    Signed-off-by: Juan Quintela <[email protected]>
    Message-ID: <[email protected]>
    (cherry picked from commit 86dec71)
    Signed-off-by: Michael Tokarev <[email protected]>
    xzpeter authored and Michael Tokarev committed Oct 11, 2023
    Configuration menu
    Copy the full SHA
    b617071 View commit details
    Browse the repository at this point in the history
  2. hw/audio/es1370: reset current sample counter

    Reset the current sample counter when writing the Channel Sample
    Count Register. The Linux ens1370 driver and the AROS sb128
    driver expect the current sample counter counts down from sample
    count to 0 after a write to the Channel Sample Count Register.
    Currently the current sample counter starts from 0 after a reset
    or the last count when the counter was stopped.
    
    The current sample counter is used to raise an interrupt whenever
    a complete buffer was transferred. When the counter starts with a
    value lower than the reload value, the interrupt triggeres before
    the buffer was completly transferred. This may lead to corrupted
    audio streams.
    
    Tested-by: Rene Engel <[email protected]>
    Signed-off-by: Volker Rümelin <[email protected]>
    Reviewed-by: Marc-André Lureau <[email protected]>
    Tested-by: BALATON Zoltan <[email protected]>
    Message-Id: <[email protected]>
    (cherry picked from commit 00e3b29)
    Signed-off-by: Michael Tokarev <[email protected]>
    Volker Rümelin authored and Michael Tokarev committed Oct 11, 2023
    Configuration menu
    Copy the full SHA
    5dddba9 View commit details
    Browse the repository at this point in the history

Commits on Oct 13, 2023

  1. roms: use PYTHON to invoke python

    python3 may not be the expected python version.
    Use PYTHON to invoke python.
    
    Fixes: 22e1153 ("edk2: replace build scripts")
    
    Signed-off-by: Olaf Hering <[email protected]>
    Signed-off-by: Michael Tokarev <[email protected]>
    (cherry picked from commit 17b8d8a)
    olafhering authored and Michael Tokarev committed Oct 13, 2023
    Configuration menu
    Copy the full SHA
    2e42ba0 View commit details
    Browse the repository at this point in the history
  2. disas/riscv: Fix the typo of inverted order of pmpaddr13 and pmpaddr14

    Fix the inverted order of pmpaddr13 and pmpaddr14 in csr_name().
    
    Signed-off-by: Alvin Chang <[email protected]>
    Reviewed-by: Alistair Francis <[email protected]>
    Message-ID: <[email protected]>
    Signed-off-by: Alistair Francis <[email protected]>
    (cherry picked from commit cffa995)
    Signed-off-by: Michael Tokarev <[email protected]>
    gagachang authored and Michael Tokarev committed Oct 13, 2023
    Configuration menu
    Copy the full SHA
    a8c0d82 View commit details
    Browse the repository at this point in the history
  3. target/riscv: Fix vfwmaccbf16.vf

    The operator (fwmacc16) of vfwmaccbf16.vf helper function should be
    replaced by fwmaccbf16.
    
    Fixes: adf772b ("target/riscv: Add support for Zvfbfwma extension")
    Signed-off-by: Max Chou <[email protected]>
    Reviewed-by: LIU Zhiwei <[email protected]>
    Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
    Message-ID: <[email protected]>
    Signed-off-by: Alistair Francis <[email protected]>
    (cherry picked from commit 837570c)
    Signed-off-by: Michael Tokarev <[email protected]>
    rnax authored and Michael Tokarev committed Oct 13, 2023
    Configuration menu
    Copy the full SHA
    cc33ee4 View commit details
    Browse the repository at this point in the history

Commits on Oct 16, 2023

  1. Update version for 8.1.2 release

    Signed-off-by: Michael Tokarev <[email protected]>
    Michael Tokarev committed Oct 16, 2023
    Configuration menu
    Copy the full SHA
    78385bc View commit details
    Browse the repository at this point in the history