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

Merge dev to qemu-cheri #259

Open
wants to merge 14 commits into
base: qemu-cheri
Choose a base branch
from
Open

Merge dev to qemu-cheri #259

wants to merge 14 commits into from

Commits on Jun 18, 2024

  1. Fix program counter reported for Arm32 instruction tracing

    It was logging the next address rather than the current one so was
    always off by 4.
    arichardson committed Jun 18, 2024
    Configuration menu
    Copy the full SHA
    b168573 View commit details
    Browse the repository at this point in the history

Commits on Jul 2, 2024

  1. Log changes to most Arm32 registers

    This does not include a full audit of all writes (helpers that
    directly modify registers are not included), but at least handles
    the common case where store_reg() is called.
    arichardson committed Jul 2, 2024
    Configuration menu
    Copy the full SHA
    90d7e31 View commit details
    Browse the repository at this point in the history

Commits on Jul 17, 2024

  1. Configuration menu
    Copy the full SHA
    c785485 View commit details
    Browse the repository at this point in the history
  2. Jenkinsfile: Get latest release's version from cheribsdInfo

    This bumps it to 23.11 and will automatically pick up 24.05 soon.
    jrtc27 committed Jul 17, 2024
    Configuration menu
    Copy the full SHA
    f1098ba View commit details
    Browse the repository at this point in the history

Commits on Jul 24, 2024

  1. Configuration menu
    Copy the full SHA
    4e7686c View commit details
    Browse the repository at this point in the history

Commits on Jul 29, 2024

  1. tls: add macros for coroutine-safe TLS variables

    Compiler optimizations can cache TLS values across coroutine yield
    points, resulting in stale values from the previous thread when a
    coroutine is re-entered by a new thread.
    
    Serge Guelton developed an __attribute__((noinline)) wrapper and tested
    it with clang and gcc. I formatted his idea according to QEMU's coding
    style and wrote documentation.
    
    The compiler can still optimize based on analyzing noinline code, so an
    asm volatile barrier with an output constraint is required to prevent
    unwanted optimizations.
    
    Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1952483
    Suggested-by: Serge Guelton <sguelton@redhat.com>
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    Message-Id: <20220222140150.27240-2-stefanha@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    (cherry picked from commit 7d29c341c9d402cf0bcb3a3b76fce0c09dd24e94)
    stefanhaRH authored and arichardson committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    833dc72 View commit details
    Browse the repository at this point in the history
  2. rcu: use coroutine TLS macros

    RCU may be used from coroutines. Standard __thread variables cannot be
    used by coroutines. Use the coroutine TLS macros instead.
    
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    Message-Id: <20220222140150.27240-4-stefanha@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    (cherry picked from commit 17c78154b0ba2237c37f3e4a95140b754cb6ac8b)
    stefanhaRH authored and arichardson committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    a3dabe5 View commit details
    Browse the repository at this point in the history
  3. cpus: use coroutine TLS macros for iothread_locked

    qemu_mutex_iothread_locked() may be used from coroutines. Standard
    __thread variables cannot be used by coroutines. Use the coroutine TLS
    macros instead.
    
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    Message-Id: <20220222140150.27240-5-stefanha@redhat.com>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    (cherry picked from commit d5d2b15ecf62c662985983ca065ddeeec48fd248)
    stefanhaRH authored and arichardson committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    0d10619 View commit details
    Browse the repository at this point in the history
  4. coroutine-ucontext: use QEMU_DEFINE_STATIC_CO_TLS()

    Thread-Local Storage variables cannot be used directly from coroutine
    code because the compiler may optimize TLS variable accesses across
    qemu_coroutine_yield() calls. When the coroutine is re-entered from
    another thread the TLS variables from the old thread must no longer be
    used.
    
    Use QEMU_DEFINE_STATIC_CO_TLS() for the current and leader variables.
    
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    Message-Id: <20220307153853.602859-2-stefanha@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    (cherry picked from commit 34145a307d849d0b6734d0222a7aa0bb9eef7407)
    stefanhaRH authored and arichardson committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    034b9d3 View commit details
    Browse the repository at this point in the history
  5. coroutine: use QEMU_DEFINE_STATIC_CO_TLS()

    Thread-Local Storage variables cannot be used directly from coroutine
    code because the compiler may optimize TLS variable accesses across
    qemu_coroutine_yield() calls. When the coroutine is re-entered from
    another thread the TLS variables from the old thread must no longer be
    used.
    
    Use QEMU_DEFINE_STATIC_CO_TLS() for the current and leader variables.
    The alloc_pool QSLIST needs a typedef so the return value of
    get_ptr_alloc_pool() can be stored in a local variable.
    
    One example of why this code is necessary: a coroutine that yields
    before calling qemu_coroutine_create() to create another coroutine is
    affected by the TLS issue.
    
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    Message-Id: <20220307153853.602859-3-stefanha@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    (cherry picked from commit ac387a08a9c9f6b36757da912f0339c25f421f90)
    stefanhaRH authored and arichardson committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    d799e49 View commit details
    Browse the repository at this point in the history
  6. coroutine-win32: use QEMU_DEFINE_STATIC_CO_TLS()

    Thread-Local Storage variables cannot be used directly from coroutine
    code because the compiler may optimize TLS variable accesses across
    qemu_coroutine_yield() calls. When the coroutine is re-entered from
    another thread the TLS variables from the old thread must no longer be
    used.
    
    Use QEMU_DEFINE_STATIC_CO_TLS() for the current and leader variables.
    
    I think coroutine-win32.c could get away with __thread because the
    variables are only used in situations where either the stale value is
    correct (current) or outside coroutine context (loading leader when
    current is NULL). Due to the difficulty of being sure that this is
    really safe in all scenarios it seems worth converting it anyway.
    
    Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
    Message-Id: <20220307153853.602859-4-stefanha@redhat.com>
    Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
    Signed-off-by: Kevin Wolf <kwolf@redhat.com>
    (cherry picked from commit c1fe694357a328c807ae3cc6961c19e923448fcc)
    stefanhaRH authored and arichardson committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    6846c33 View commit details
    Browse the repository at this point in the history

Commits on Nov 6, 2024

  1. Configuration menu
    Copy the full SHA
    b731976 View commit details
    Browse the repository at this point in the history
  2. target/arm: Fix PC for AArch64 (including Morello) WFI trapping

    Upstream's code is env->pc -= insn_len, like the AArch32 case, which is
    doing a binary subtraction on the promoted (to target_ulong, i.e.
    64-bit) insn_len. However, by using a unary minus downstream, we instead
    negate the 32-bit value prior to promoting (again to target_ulong, the
    type for the callee's argument) and thus, given insn_len is unsigned,
    that means we zero-extend rather than sign-extend. This has the result
    of causing PC to be 2^32 more than it should be.
    jrtc27 committed Nov 6, 2024
    Configuration menu
    Copy the full SHA
    15fef07 View commit details
    Browse the repository at this point in the history

Commits on Nov 24, 2024

  1. target/arm: Honor HCR_E2H and HCR_TGE in ats_write64()

    We need to check HCR_E2H and HCR_TGE to select the right MMU index for
    the correct translation regime.
    
    To check for EL2&0 translation regime:
    - For S1E0*, S1E1* and S12E* ops, check both HCR_E2H and HCR_TGE
    - For S1E2* ops, check only HCR_E2H
    
    Signed-off-by: Ake Koomsin <ake@igel.co.jp>
    Message-id: 20221101064250.12444-1-ake@igel.co.jp
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    
    (cherry picked from commit 638d5dbd78ea81c943959e2f2c65c109e5278a78)
    Ake Koomsin authored and jrtc27 committed Nov 24, 2024
    Configuration menu
    Copy the full SHA
    6c09189 View commit details
    Browse the repository at this point in the history