Re: [Qemu-devel] Get only TCG code without execution

2012-02-09 Thread Jamie Lokier
陳韋任 wrote: > > As x86 doesn't use or need barrier instructions, when translating x86 > > to (say) run on ARM host, multi-threaded code that needs barriers > > isn't easy to detect, so barriers may be required between every memory > > access in the generated ARM code. > > Sounds awful to me. Rega

Re: [Qemu-devel] Get only TCG code without execution

2012-02-06 Thread 陳韋任
> As x86 doesn't use or need barrier instructions, when translating x86 > to (say) run on ARM host, multi-threaded code that needs barriers > isn't easy to detect, so barriers may be required between every memory > access in the generated ARM code. Sounds awful to me. Regardless current QEMU's s

Re: [Qemu-devel] Get only TCG code without execution

2012-02-02 Thread Rajat Goyal
Hi, I have modified QEMU to act as a TCG compiler and give me the TCG code for the whole binary. However, I cannot find a way to obtain the last address in the binary. The symbol table loaded into syminfos contains only the address of the last symbol. Not the address of the last machine instructio

Re: [Qemu-devel] Get only TCG code without execution

2012-01-20 Thread Jamie Lokier
陳韋任 wrote: > What's load/store exclusive implementation? It's how some architectures do atomic operations, instead of having atomic instructions like x86 does. > And as a general emulator, QEMU shouldn't implement any > architecture-specific memory model, right? What comes into my mind > is QEM

Re: [Qemu-devel] Get only TCG code without execution

2012-01-20 Thread Jamie Lokier
Peter Maydell wrote: > > "guest binaries don't actually rely that much on the memory model." > > > > I think the reason is those guest binaries are single thread. Memory model > > is > > important in multi-threaded case. BTW, our binary translator now can > > translate > > x86 binary to ARM bina

Re: [Qemu-devel] Get only TCG code without execution

2012-01-20 Thread 陳韋任
On Fri, Jan 20, 2012 at 09:09:46AM +, Peter Maydell wrote: > On 20 January 2012 06:12, 陳韋任 wrote: > >  Out of curiosity. What's ARM memory model? From the Wikipedia [1], it seems > > ARMv7 has the same memory model as IA64. > > The ARM memory model is the set of semantics for memory > accesse

Re: [Qemu-devel] Get only TCG code without execution

2012-01-20 Thread 陳韋任
> > I was not talking about semantics of individual instructions but semantics > > of the whole multi-threaded program. Multi-threaded programs can lead to > > several different (most of which are unintended) states of the CPU. What > > states are possible is described in a mathematically rigorous

Re: [Qemu-devel] Get only TCG code without execution

2012-01-20 Thread 陳韋任
> I was not talking about semantics of individual instructions but semantics > of the whole multi-threaded program. Multi-threaded programs can lead to > several different (most of which are unintended) states of the CPU. What > states are possible is described in a mathematically rigorous definiti

Re: [Qemu-devel] Get only TCG code without execution

2012-01-20 Thread Peter Maydell
On 20 January 2012 09:44, 陳韋任 wrote: > On Fri, Jan 20, 2012 at 09:09:46AM +, Peter Maydell wrote: >  AFAIK, LLVM defines it's own memory model [1] which is inspired by the C++11 > memory model. That's why I think instead of implementing architecture-specific > memory model, QEMU should define

Re: [Qemu-devel] Get only TCG code without execution

2012-01-20 Thread Peter Maydell
On 20 January 2012 06:12, 陳韋任 wrote: >  Out of curiosity. What's ARM memory model? From the Wikipedia [1], it seems > ARMv7 has the same memory model as IA64. The ARM memory model is the set of semantics for memory accesses as defined in the ARM Architecture Reference Manual (covering not just re

Re: [Qemu-devel] Get only TCG code without execution

2012-01-19 Thread Peter Maydell
On 19 January 2012 16:00, Rajat Goyal wrote: > Thank you so much for your help Peter. I was using version 0.15.1. On 1.0, > it works like a dream! Good. > I was not talking about semantics of individual instructions but semantics > of the whole multi-threaded program. Multi-threaded programs can

Re: [Qemu-devel] Get only TCG code without execution

2012-01-19 Thread Rajat Goyal
Thank you so much for your help Peter. I was using version 0.15.1. On 1.0, it works like a dream! I was not talking about semantics of individual instructions but semantics of the whole multi-threaded program. Multi-threaded programs can lead to several different (most of which are unintended) sta

Re: [Qemu-devel] Get only TCG code without execution

2012-01-17 Thread Peter Maydell
On 17 January 2012 01:04, 陳韋任 wrote: >> > What is the way out of this? The reason I need TCG code is because my >> > project work is to write a semantics for TCG micro-operations and then >> > compare my semantics with a semantics for ARM instructions being written by >> > someone else. To test my

Re: [Qemu-devel] Get only TCG code without execution

2012-01-17 Thread 陳韋任
> > What is the way out of this? The reason I need TCG code is because my > > project work is to write a semantics for TCG micro-operations and then > > compare my semantics with a semantics for ARM instructions being written by > > someone else. To test my semantics, I need the corresponding TCG c

Re: [Qemu-devel] Get only TCG code without execution

2012-01-16 Thread Peter Maydell
On 16 January 2012 12:23, Rajat Goyal wrote: > The situation is like this. The most basic multi-threaded program (using > pthreads) which just prints something like "I am Thread 1" and "I am Thread > 2" does not work over the QEMU user emulator. There are no output messages > saying "I am thread 1

Re: [Qemu-devel] Get only TCG code without execution

2012-01-16 Thread Rajat Goyal
Thanks for your text, Stefan. The situation is like this. The most basic multi-threaded program (using pthreads) which just prints something like "I am Thread 1" and "I am Thread 2" does not work over the QEMU user emulator. There are no output messages saying "I am thread 1" etc. when the program

Re: [Qemu-devel] Get only TCG code without execution

2012-01-16 Thread Stefan Hajnoczi
On Sun, Jan 15, 2012 at 11:09:18PM +, Rajat Goyal wrote: > I am doing a project to build a daemonic ARM emulator using QEMU. One of > the requirements is to get the complete TCG code for any multi-threaded ARM > program that I run on QEMU. I do not need QEMU to execute the program and > show me

Re: [Qemu-devel] Get only TCG code without execution

2012-01-16 Thread Mulyadi Santosa
Hi On Mon, Jan 16, 2012 at 06:09, Rajat Goyal wrote: Is there a way by which I can get the > complete TCG code for pthread parallel binaries in exchange for not making > QEMU execute the binary? The thing is, the way I see it, TCG is meant to be like JIT compiler. Whereas what you're going t

[Qemu-devel] Get only TCG code without execution

2012-01-15 Thread Rajat Goyal
I am doing a project to build a daemonic ARM emulator using QEMU. One of the requirements is to get the complete TCG code for any multi-threaded ARM program that I run on QEMU. I do not need QEMU to execute the program and show me the output. Just the entire TCG code. The latest version of qemu-arm