qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefano Bonifazi <stefboombastic@gmail.com>
To: "Raphaël Lefèvre" <taylor.lefevre@gmail.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] TCG flow vs dyngen
Date: Sun, 16 Jan 2011 17:43:39 +0100	[thread overview]
Message-ID: <4D33203B.6080505@gmail.com> (raw)
In-Reply-To: <AANLkTimyZTwkYQd5vir56u87=LrsD9e2oQfNF0sf0Z+2@mail.gmail.com>


> Sorry for my belated on this discussion, after I searched for the
> topics you posted, it seems two main problems are unsolved? (Am I
> right?? I'm not sure...)
>
> 1. "I edited QEMU user, more exactly qemu-ppc launching the main function
> (inside main.c) from another c function I created, passing it the
> appropriate parameters. ...balabala" at Jan, 2011
>
> 2. "how can I check the number of target cpu cycles or target
> instructions executed inside qemu-user (i.e. qemu-ppc)?
> Is there any variable I can inspect for such informations?" at Dec, 2010
>
> If I'm not correct, please let me know where the problem is.
>
> Raphaël Lefèvre
Hi!
Thank you very much for Your concern!
Honestly I had lost hope in any help, I even contacted directly some 
developers in this mailing list without luck!
I am a student who needs to use qemu for a project where it will be used 
for its capabilities of running PowerPC code.
As you can imagine qemu goes far beyond the knowledge in electronics and 
computer science of a student. Nevertheless I have to do that!
I have been studying all the possible technical documents available in 
the internet, but it is really not much at all , not sufficient for 
getting the code and being able of understanding it .. It is in C, even 
not modular C++
Anyway with some help from this mailing list, and a lot of studying 
about assembly, loaders, compilers.. I am going on, though there are 
still big problems due of the nature of the QEMU code..
First of all, I am starting from qemu-user, more specifically, qemu-ppc 
as I don't need the full system capabilities, and it is easier for me to 
control the binary target memory with qemu-user.
Originally I started with a lot of work on libqemu .. until some 
developer here told me it was deprecated (though still in the source) 
and not working fine.
I edited the code of qemu-ppc so that another function of mine calls 
qemu-user main, with the appropriate parameters.. The pursued goal was 
to launch it several times with different target binaries in succession..
For some reason, I still can't find out, qemu code remembers the old 
code, running it instead of the new loaded binary.. and if I flush the 
cache of translated code before loading a new binary it stops and can't 
go on!
My workaround to this problem was compiling qemu-ppc as a dynamic 
library and load it at runtime.. I also managed to load multiple copies 
of it (with dlmopen each at a different address space) ..in fact I need 
to run more than one qemu-ppc at the same time but a new big problem 
popped up now: the target binary is loaded always at a fixed address.. 
no matter if another qemu-ppc already loaded code there.. it is like the 
internal elf loader can't understand those addresses are not available, 
and then relocate them ..
I tried to link (ld) the binary target elf as position independent code, 
but then qemu-ppc complains it can't find  /usr/lib/libc.so.1 and  
/usr/lib/ld.so.1

To sum up the problems are (in order of importance):
  - making the elf loader relocate the target code into other addresses 
when the default ones (I guess those embedded into the target binary 
when it is not compiled as position independent code) are taken
  - making qemu-user able of running more than one target binary in 
succession
  - counting qemu-user executed instructions

My university is a public one, so my project will be open to the 
community, I will also upload the documentation I am writing about qemu 
coming from the knowledge I am acquiring working on it, so that, I hope, 
other people will find less frustrating the first steps into developing 
qemu!

Any help will be more than welcome!

Thank you in advance!
Stefano B.

  reply	other threads:[~2011-01-16 16:43 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-16 14:46 [Qemu-devel] TCG flow vs dyngen Raphael Lefevre
2011-01-16 15:21 ` Stefano Bonifazi
2011-01-16 16:01   ` Raphaël Lefèvre
2011-01-16 16:43     ` Stefano Bonifazi [this message]
2011-01-16 18:29       ` Peter Maydell
2011-01-16 19:02         ` Stefano Bonifazi
2011-01-16 19:24           ` Peter Maydell
2011-01-24 13:20             ` [Qemu-devel] " Stefano Bonifazi
2011-01-16 20:50           ` [Qemu-devel] " Stefano Bonifazi
2011-01-16 21:08             ` Raphaël Lefèvre
2011-01-24 12:35               ` [Qemu-devel] " Stefano Bonifazi
2011-01-17 11:59             ` [Qemu-devel] " Lluís
2011-01-24 12:31               ` [Qemu-devel] " Stefano Bonifazi
2011-01-24 13:36                 ` Lluís
2011-01-24 14:00                   ` Stefano Bonifazi
2011-01-24 15:06                     ` Lluís
2011-01-24 17:23                       ` Stefano Bonifazi
2011-01-24 18:12                         ` Lluís
2011-01-16 19:16       ` [Qemu-devel] " Raphaël Lefèvre
2011-01-23 21:50     ` Rob Landley
2011-01-23 22:25       ` Stefano Bonifazi
2011-01-23 23:40         ` Rob Landley
2011-01-24 10:17           ` Stefano Bonifazi
2011-01-24 18:20             ` Rob Landley
2011-01-24 21:16               ` Stefano Bonifazi
2011-01-25  1:19                 ` Rob Landley
2011-01-25  8:53                   ` Stefano Bonifazi
2011-01-24 14:32       ` Peter Maydell
2011-01-24 14:56         ` Stefano Bonifazi
2011-01-24 15:15           ` Lluís
2011-01-24 18:02           ` Dushyant Bansal
2011-01-24 19:38             ` Stefano Bonifazi
2011-01-25  7:56               ` Dushyant Bansal
2011-01-25  9:04                 ` Stefano Bonifazi
2011-01-25  9:05                   ` Edgar E. Iglesias
2011-01-25  9:28                     ` Stefano Bonifazi
  -- strict thread matches above, loose matches on Subject: below --
2010-12-10 21:26 Stefano Bonifazi
2010-12-11 11:02 ` Blue Swirl
2010-12-11 12:29   ` Stefano Bonifazi
2010-12-11 13:11     ` Blue Swirl
2010-12-11 14:32       ` Stefano Bonifazi
2010-12-11 14:44         ` Blue Swirl
2010-12-14 20:17           ` Stefano Bonifazi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D33203B.6080505@gmail.com \
    --to=stefboombastic@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=taylor.lefevre@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).