qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question about atomics


From: Warner Losh
Subject: Re: Question about atomics
Date: Sun, 13 Mar 2022 23:42:09 -0600



On Sun, Mar 13, 2022 at 10:36 PM Richard Henderson <richard.henderson@linaro.org> wrote:
On 3/13/22 21:09, Warner Losh wrote:
> Oh? Out of paranoia, how can I verify that this is the case when compiled on FreeBSD?
> Perhaps the atomic sequence FreeBSD uses differs a little from Linux and we don't trigger
> that code?

$ objdump -dr libqemu-arm-*-user.fa.p/accel_tcg_user-exec.c.o

0000000000001490 <helper_atomic_cmpxchgl_le>:
...
     14b7:       e8 04 ec ff ff          callq  c0 <atomic_mmu_lookup.constprop.0>
     14bc:       48 89 c2                mov    %rax,%rdx
     14bf:       44 89 e0                mov    %r12d,%eax
     14c2:       f0 44 0f b1 32          lock cmpxchg %r14d,(%rdx)

Looks like this compiles correctly on FreeBSD... We have something similar:

    1f69:       41 89 f1                mov    %esi,%r9d
    1f6c:       48 8b 3d 00 00 00 00    mov    0x0(%rip),%rdi        # 1f73 <helper_atomic_cmpxchgl_le+0x53>
    1f73:       64 48 8b 34 25 00 00    mov    %fs:0x0,%rsi
    1f7a:       00 00
    1f7c:       48 89 8e 00 00 00 00    mov    %rcx,0x0(%rsi)
    1f83:       89 d0                   mov    %edx,%eax
    1f85:       f0 46 0f b1 04 0f       lock cmpxchg %r8d,(%rdi,%r9,1)

Warner
 
r~

reply via email to

[Prev in Thread] Current Thread [Next in Thread]