Skip to content
Permalink

Comparing changes

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

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: qemu/qemu
base: ce721d21f1cb
Choose a base ref
...
head repository: qemu/qemu
compare: cdcbc5327279
Choose a head ref
  • 2 commits
  • 3 files changed
  • 1 contributor

Commits on Jul 25, 2023

  1. hw/arm/smmu: Handle big-endian hosts correctly

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

    A lot of the code called from helper_exception_bkpt_insn() is written
    assuming A-profile, but we will also call this helper on M-profile
    CPUs when they execute a BKPT insn.  This used to work by accident,
    but recent changes mean that we will hit an assert when some of this
    code calls down into lower level functions that end up calling
    arm_security_space_below_el3(), arm_el_is_aa64(), and other functions
    that now explicitly assert that the guest CPU is not M-profile.
    
    Handle M-profile directly to avoid the assertions:
     * in arm_debug_target_el(), M-profile debug exceptions always
       go to EL1
     * in arm_debug_exception_fsr(), M-profile always uses the short
       format FSR (compare commit d7fe699, though in this case
       the code in arm_v7m_cpu_do_interrupt() does not need to
       look at the FSR value at all)
    
    Cc: qemu-stable@nongnu.org
    Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1775
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Message-id: 20230721143239.1753066-1-peter.maydell@linaro.org
    (cherry picked from commit 5d78893)
    Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
    pm215 authored and Michael Tokarev committed Jul 25, 2023
    Copy the full SHA
    cdcbc53 View commit details
    Browse the repository at this point in the history