Crash when detached thread exits with bionic and QEMU usermode

2020-05-15 Thread Michael Goffioul
Not sure this is a bug in QEMU usermode, but I've tracked a crash that happens when running ARM guest code linked against bionic (from Android). More specifically when a detached thread exits. In bionic, threads are created with the flag CLONE_CHILD_CLEARTID [1]. When a detached thread exits norma

Problem with QEMU usermode + jemalloc

2020-05-12 Thread Michael Goffioul
Hi, I'm running into a problem using QEMU in usermode and jemalloc (this is in the context of an ARM-to-x86 translation layer for Android). The issue is discussed here: https://github.com/jemalloc/jemalloc/issues/1844 In a nutshell, the lack of madvise implementation is making jemalloc return no

Re: Invalid ARM instruction for clang-compiled Android code

2019-11-15 Thread Michael Goffioul
On Fri, Nov 15, 2019 at 6:03 AM Peter Maydell wrote: > On Fri, 15 Nov 2019 at 05:03, Michael Goffioul > wrote: > > When running QEMU user mode on some code compiled by clang (dynamic > linker from AOSP-10), the emulator chokes on this instruction: > > > >9aa92:

Re: Invalid ARM instruction for clang-compiled Android code

2019-11-15 Thread Michael Goffioul
On Fri, Nov 15, 2019 at 6:03 AM Peter Maydell wrote: > Richard, I think we're tripping over the check you added > in commit af2882289951e. Specifically: > > +/* We UNDEF for these UNPREDICTABLE cases. */ > +if (a->rd == 15 || a->rn == 15 || a->rt == 15 > +|| a->rd == a->rn || a->

How to clone CPUState in a new thread?

2019-11-07 Thread Michael Goffioul
[originally posted on qemu-discuss] === (initial) Hi, I'm working on a project that wants to replace houdini (ARM-to-x86 translation layer for Android from Intel) with a free open-source implementation. I'm trying to leverage qemu user-mode to achieve that, but it requires code changes to allow