[PATCH 0/5] Hexagon: ll/sc fixes, emit TCG barriers, TLB locks

Brian Cain posted 5 patches 1 month, 3 weeks ago
Failed in applying to current master (apply log)
include/hw/hexagon/hexagon_tlb.h |  5 +++-
hw/hexagon/hexagon_tlb.c         | 27 ++++++++++++++++++++-
linux-user/hexagon/cpu_loop.c    |  4 ++++
target/hexagon/cpu.c             |  3 +++
target/hexagon/hex_mmu.c         |  6 ++---
target/hexagon/translate.c       | 15 ++++++++++++
tests/tcg/hexagon/atomics.c      | 40 ++++++++++++++++++++++++++++++++
7 files changed, 94 insertions(+), 6 deletions(-)
[PATCH 0/5] Hexagon: ll/sc fixes, emit TCG barriers, TLB locks
Posted by Brian Cain 1 month, 3 weeks ago
While preparing to enable MTTCG, audits and testing revealed gaps and
bugs in our implementation.

LL/SC reservations should have been cleared at traps/exceptions.

TLB accesses should hold a lock to make the operations atomic.

Hexagon instructions with barrier or acquire/release semantics should emit
corresponding TCG semantics.

Brian Cain (5):
  target/hexagon: emit explicit TCG memory barriers
  target/hexagon: clear LL/SC reservations at context boundaries
  hw/hexagon: protect the shared architectural TLB
  target/hexagon: publish TLB updates before flushing
  tests/tcg/hexagon: cover LL/SC reservation clearing

 include/hw/hexagon/hexagon_tlb.h |  5 +++-
 hw/hexagon/hexagon_tlb.c         | 27 ++++++++++++++++++++-
 linux-user/hexagon/cpu_loop.c    |  4 ++++
 target/hexagon/cpu.c             |  3 +++
 target/hexagon/hex_mmu.c         |  6 ++---
 target/hexagon/translate.c       | 15 ++++++++++++
 tests/tcg/hexagon/atomics.c      | 40 ++++++++++++++++++++++++++++++++
 7 files changed, 94 insertions(+), 6 deletions(-)

-- 
2.34.1

Re: [PATCH 0/5] Hexagon: ll/sc fixes, emit TCG barriers, TLB locks
Posted by Marco Liebel 1 month, 3 weeks ago
On Sat, Sep 26, 2026 at 9:43 PM Brian Cain <brian.cain@oss.qualcomm.com> wrote:
>
> While preparing to enable MTTCG, audits and testing revealed gaps and
> bugs in our implementation.
>
> LL/SC reservations should have been cleared at traps/exceptions.
>
> TLB accesses should hold a lock to make the operations atomic.
>
> Hexagon instructions with barrier or acquire/release semantics should emit
> corresponding TCG semantics.
>
> Brian Cain (5):
>   target/hexagon: emit explicit TCG memory barriers
>   target/hexagon: clear LL/SC reservations at context boundaries
>   hw/hexagon: protect the shared architectural TLB
>   target/hexagon: publish TLB updates before flushing
>   tests/tcg/hexagon: cover LL/SC reservation clearing
>
>  include/hw/hexagon/hexagon_tlb.h |  5 +++-
>  hw/hexagon/hexagon_tlb.c         | 27 ++++++++++++++++++++-
>  linux-user/hexagon/cpu_loop.c    |  4 ++++
>  target/hexagon/cpu.c             |  3 +++
>  target/hexagon/hex_mmu.c         |  6 ++---
>  target/hexagon/translate.c       | 15 ++++++++++++
>  tests/tcg/hexagon/atomics.c      | 40 ++++++++++++++++++++++++++++++++
>  7 files changed, 94 insertions(+), 6 deletions(-)
>
> --
> 2.34.1

Reviewed-by: Marco Liebel <marco.liebel@oss.qualcomm.com>
Re: [PATCH 0/5] Hexagon: ll/sc fixes, emit TCG barriers, TLB locks
Posted by Marco Liebel 1 month, 3 weeks ago
On Sat, Sep 26, 2026 at 9:43 PM Brian Cain <brian.cain@oss.qualcomm.com> wrote:
>
> While preparing to enable MTTCG, audits and testing revealed gaps and
> bugs in our implementation.
>

Which tests revealed those gaps/bugs?

Commits LGTM
Re: [PATCH 0/5] Hexagon: ll/sc fixes, emit TCG barriers, TLB locks
Posted by Brian Cain 1 month, 3 weeks ago
On 10/2/2026 12:29 PM, Marco Liebel wrote:
> On Sat, Sep 26, 2026 at 9:43 PM Brian Cain <brian.cain@oss.qualcomm.com> wrote:
>> While preparing to enable MTTCG, audits and testing revealed gaps and
>> bugs in our implementation.
>>
> Which tests revealed those gaps/bugs?

Mostly the qemu-hexagon-testing test cases but also h2.  This commit 
series is necessary-but-not-sufficient to pass those, so we'll enable 
them after we enable some other features too.


> Commits LGTM

Can you add an official R-b that will get picked up by tools like b4?  
Just on the cover letter is fine, if it applies to all of the patches in 
the series.