Re: [Qemu-devel] ldub_code(s->pc++)

2012-04-05 Thread James Greensky
Get an unsigned byte from guest memory image after translating from guest virtual to host virtual address and verifying code read permissions. -Jim On Thu, Apr 5, 2012 at 1:26 PM, Davide wrote: > What does "ldub_code(s->pc++);" do??? >

Re: [Qemu-devel] TCG register allocator

2012-01-25 Thread James Greensky
On Wed, Jan 25, 2012 at 11:10 AM, Xin Tong wrote: > cpu_restore_state() calls gen_intermediate_code_pc() to > request a retranslation of the TB with extra info to allow > us to do a host-PC-to-guest-PC lookup >  * Note that gen_intermediate_code_pc() overwrites the generated > code that already ex

[Qemu-devel] helper function and mmu

2012-01-24 Thread James Greensky
Hello all, I have a quick question that I hope somebody can shed some light on. Inside of helper functions, can you have a page fault that must be serviced by the OS? I ask because I cannot see how the cpu state is restored inside of a helper function. Inside tlb_fill, when invoked not from a helpe

Re: [Qemu-devel] icount and tb chaining

2012-01-24 Thread James Greensky
On Thu, Jan 19, 2012 at 2:32 AM, 陳韋任 wrote: >> What i mean here is that in gen-icount.h, the icount_decr.u32 field is >> exhausted and jumps out to the cpu-exec loop. This is where you would >> fall into tb_add_jump with the second argument being 2, and only if >> icount_extra was greater than zer

Re: [Qemu-devel] icount and tb chaining

2012-01-18 Thread James Greensky
On Tue, Jan 17, 2012 at 7:22 PM, 陳韋任 wrote: >> previously returned tb. This is usually 0/1. When running icount, you >> can also get a 2 value in these least significant digits, indicating >> that the translation block was restarted due to the >> icount_decr.u16.low field being exhausted but havin

Re: [Qemu-devel] icount and tb chaining

2012-01-18 Thread James Greensky
On Tue, Jan 17, 2012 at 7:03 PM, 陳韋任 wrote: >> if (!tb->jmp_next[n]) { <--- what if n is 2? >> >> This is my question, if n is two, it would actually be checking the >> jmp_first field immediatedly following the jmp_next array in the tb >> structure.  This function only updates the jmp_first field

Re: [Qemu-devel] icount and tb chaining

2012-01-17 Thread James Greensky
On Tue, Jan 17, 2012 at 10:50 AM, Peter Maydell wrote: > 2012/1/13 James Greensky : >> Sure, usually a tb chain is setup after a subsequent tb is >> found/constructed in the loop in cpu_exec when a tb returns. >> Taken/non-taken branch chaining is implemented by indicating th

Re: [Qemu-devel] icount and tb chaining

2012-01-17 Thread James Greensky
On Tue, Jan 17, 2012 at 7:06 AM, 陳韋任 wrote: >> a jump with the least significant bits = 2. This falls through to tb >> add jump, which then updates the jmp_first field of the current tb. > > I don't know if tb_add_jump's second parameter will be two or not, but > look at TranslationBlock (exec-al

Re: [Qemu-devel] icount and tb chaining

2012-01-13 Thread James Greensky
; On Thu, Jan 12, 2012 at 11:00:43AM -0800, James Greensky wrote: >> Hello all, I have a question about icount and tb chaining that I hope >> somebody can clear up. In cpu-exec.c, when the icount_decr.u16.low >> counter expires, it passes back the current tb as the next_tb and ad

[Qemu-devel] icount and tb chaining

2012-01-12 Thread James Greensky
Hello all, I have a question about icount and tb chaining that I hope somebody can clear up.  In cpu-exec.c, when the icount_decr.u16.low counter expires, it passes back the current tb as the next_tb and add a jump with the least significant bits = 2. This falls through to tb add jump, which then u

[Qemu-devel] icount and tb chaining

2012-01-12 Thread James Greensky
Hello all, I have a question about icount and tb chaining that I hope somebody can clear up. In cpu-exec.c, when the icount_decr.u16.low counter expires, it passes back the current tb as the next_tb and add a jump with the least significant bits = 2. This falls through to tb add jump, which then u

Re: [Qemu-devel] Hooking memory access in TCG

2011-02-26 Thread James Greensky
You want to hook the tcg_gen_qemu_ functions such as tcg_gen_qemu_ld8s in tcg-op.h Jim On Sat, Feb 26, 2011 at 8:25 AM, felix.matenaar@rwth-aachen < felix.maten...@rwth-aachen.de> wrote: > Hi *, > > i am currently trying to trace guest memory access (i386-softmmu). tcg > README says tcg_gen_(st|

[Qemu-devel] Storing instructions executed in CPUState

2010-12-15 Thread James Greensky
Hello, I am attempting to fold a cache model into Qemu. For this I need to store the instructions executed between actual lds/sts to Qemu memory, for performance reasons. I figured that a buffer in the CPUState could accommodate this requirement, however tcg only gives the ability to ld/st from h