From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=58848 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PeZaM-00067c-PG for qemu-devel@nongnu.org; Sun, 16 Jan 2011 15:52:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PeZaL-0004nZ-7d for qemu-devel@nongnu.org; Sun, 16 Jan 2011 15:52:26 -0500 Received: from mail-wy0-f173.google.com ([74.125.82.173]:51038) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PeZaK-0004nK-BZ for qemu-devel@nongnu.org; Sun, 16 Jan 2011 15:52:25 -0500 Received: by wyg36 with SMTP id 36so4843795wyg.4 for ; Sun, 16 Jan 2011 12:52:19 -0800 (PST) Message-ID: <4D335A31.2090105@gmail.com> Date: Sun, 16 Jan 2011 21:50:57 +0100 From: Stefano Bonifazi MIME-Version: 1.0 Subject: Re: [Qemu-devel] TCG flow vs dyngen References: <000001cbb58c$221f5a00$011aa8c0@side35ya3cah0n> <4D330D01.9060801@gmail.com> <4D33203B.6080505@gmail.com> <4D3340AB.60001@gmail.com> In-Reply-To: <4D3340AB.60001@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: =?UTF-8?B?UmFwaGHDq2wgTGVmw6h2cmU=?= , qemu-devel@nongnu.org Hi! In case you are interested in helping me, I'll give you a big piece of news I've just got (even my teacher is not informed yet! :) ) I've just managed to make more than one instance of qemu-user run at the same time linking the target code with a specified address for the code section (-Ttext address of ld). It works fine and this proves my idea that the problem is within the elf loader.. Making it relocate the target code properly would fix the problem ;) Now let's work on it :) Regards, Stefano B. On 01/16/2011 08:02 PM, Stefano Bonifazi wrote: > Thank you very much for Your fast reply! > > > On 01/16/2011 07:29 PM, Peter Maydell wrote: >> Linux doesn't seem to have dlmopen > http://www.unix.com/man-page/All/3c/dlmopen/ > > #define __USE_GNU > #include > > lib_handle1 = dlmopen(LM_ID_NEWLM,"./libqemu-ppc.so", RTLD_NOW); > > I am developing that on a clean ubuntu 10.10 >> but google suggests that it puts the library in its own namespace >> but not its own address space. > I need to make the different instances of qemu-user exchange data .. > obviously keeping all of them in the same address space would be the > easiest way (unless I have to change all qemu code ;) ) Running each > qemu as its own >> process and using interprocess communication for whatever >> coordination you need between the various instances seems >> more likely to be workable to me. This will also fix your "can't run >> more than one binary in succession" problem, because you can >> just have the first qemu run and exit as normal and launch a >> second qemu to run the second binary. >> >> -- PMM > Exactly, it was the easiest way also for me.. and I've already done > it, works smoothly .. the only big problem is that it is not good for > my teacher.. he says it should work the dynamic library way o.O > Working with libraries even solved the problem of consecutive runs, > though according to me it is not good a software when you must reboot > it for making it run again fine.. sounds more Windows style :D > Clearly it makes memory "dirty" and do not clean after the target > process completes its execution.. leaving the OS care about it. > I tried zeroing all global variables before starting a new execution > without results (other than making it stall) .. After very long time > spent trying to find a solution I think the problem should be with the > mmap' ings stuff in the loader .. the same reason why 2 different > libraries with their own namespaces clash according to me.. the elf > loaders work globally within the unique address space .. I think for a > guru of loaders-linkers should not be so difficult to patch it.. but > not for a student who almost heard about them for the first time ;) > Any help is very appreciated :) > Thank you again! > Stefano B. > > >