qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* Question about atomics
@ 2022-03-08  4:18 Warner Losh
  2022-03-08  5:00 ` Richard Henderson
  0 siblings, 1 reply; 16+ messages in thread
From: Warner Losh @ 2022-03-08  4:18 UTC (permalink / raw)
  To: QEMU Developers

[-- Attachment #1: Type: text/plain, Size: 1394 bytes --]

I have a question related to the user-mode emulation and atomics. I asked
on IRC, but thinking about it, I think it may be too complex to discuss in
that medium...

In FreeBSD we have a system call that uses host atomic operations to
interact memory that userland also interacts with using atomic operations.

In bsd-user we call the kernel with a special flag for dealing with 32-bit
processes running on a 64-bit kernel. In this case, we use 32-bit-sized
atomics to set variables in the address space of the bsd-user guest. This
is used when running armv7 binaries on amd64 hosts.

First question: Is this expected to work? I know I'm a bit vague, so as a
followup question: If there's restrictions on this, what might they be? Do
some classes of atomic operations work, while others may fail or need
additional cooperation? Are there any conformance tests I could compile for
FreeBSD/armv7 to test the hypothesis that atomic operations are misbehaving?

I'm asking because I'm seeing a rare, but not rare enough, race that's
corrupting state in ways that only appear to be possible when pthread
mutexes aren't working (which only break when atomic operations are
broken). So far my efforts to narrow this down has been unsuccessful and
I'm looking to both understand qemu/tcm better as well as to reduce the
problem space to search...

Thanks for any help you might be able to give.

Warner

[-- Attachment #2: Type: text/html, Size: 1630 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2022-03-14  5:44 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-08  4:18 Question about atomics Warner Losh
2022-03-08  5:00 ` Richard Henderson
2022-03-08 14:09   ` Warner Losh
2022-03-08 14:26     ` Paolo Bonzini
2022-03-08 16:29       ` Warner Losh
2022-03-13  4:59         ` Warner Losh
2022-03-13 16:47           ` Richard Henderson
2022-03-13 16:57             ` Warner Losh
2022-03-13 17:03               ` Richard Henderson
2022-03-13 18:29                 ` Warner Losh
2022-03-13 20:19                   ` Richard Henderson
2022-03-14  4:09                     ` Warner Losh
2022-03-14  4:36                       ` Richard Henderson
2022-03-14  5:42                         ` Warner Losh
2022-03-14  4:43                       ` Richard Henderson
2022-03-14  5:34                         ` Warner Losh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).