Re: [Qemu-devel] qemu log function to print out the registers of the guest

2012-08-28 Thread Max Filippov
On Mon, Aug 27, 2012 at 8:15 PM, Steven wrote: >> Guest code is accessed at the translation time by C functions and >> I guess there are other layers of address translation caching. I wouldn't >> try to interpret these _cmmu printouts and would instead instrument >> [cpu_]ld{{u,s}{b,w},l,q}_code m

Re: [Qemu-devel] qemu log function to print out the registers of the guest

2012-08-27 Thread Steven
I added a special opcode, which is not used by existing x86. When the process in the guest issues this opcode, the qemu starts to log its mmu access. On Mon, Aug 27, 2012 at 11:14 PM, 陳韋任 (Wei-Ren Chen) wrote: >> My final goal is to obtain the memory access trace for a particular >> process in

Re: [Qemu-devel] qemu log function to print out the registers of the guest

2012-08-27 Thread Wei-Ren Chen
> My final goal is to obtain the memory access trace for a particular > process in the guest, so your patch really helps, except for too many > kernel _mmu events. How do you know guest is running which process, and log it's memory access trace? Regards, chenwj -- Wei-Ren Chen (陳韋任) Computer

Re: [Qemu-devel] qemu log function to print out the registers of the guest

2012-08-27 Thread Steven
On Sat, Aug 25, 2012 at 4:41 PM, Max Filippov wrote: > On Sat, Aug 25, 2012 at 9:20 PM, Steven wrote: >> On Tue, Aug 21, 2012 at 3:18 AM, Max Filippov wrote: >>> On Tue, Aug 21, 2012 at 9:40 AM, Steven wrote: Hi, Max, I wrote a small program to verify your patch could catch all the lo

Re: [Qemu-devel] qemu log function to print out the registers of the guest

2012-08-25 Thread Max Filippov
On Sat, Aug 25, 2012 at 9:20 PM, Steven wrote: > On Tue, Aug 21, 2012 at 3:18 AM, Max Filippov wrote: >> On Tue, Aug 21, 2012 at 9:40 AM, Steven wrote: >>> Hi, Max, >>> I wrote a small program to verify your patch could catch all the load >>> instructions from the guest. However, I found some pr

Re: [Qemu-devel] qemu log function to print out the registers of the guest

2012-08-21 Thread Max Filippov
On Tue, Aug 21, 2012 at 9:40 AM, Steven wrote: > Hi, Max, > I wrote a small program to verify your patch could catch all the load > instructions from the guest. However, I found some problem from the > results. > > The guest OS and the emulated machine are both 32bit x86. My simple > program in th

Re: [Qemu-devel] qemu log function to print out the registers of the guest

2012-08-20 Thread Steven
Hi, Max, I wrote a small program to verify your patch could catch all the load instructions from the guest. However, I found some problem from the results. The guest OS and the emulated machine are both 32bit x86. My simple program in the guest declares an 1048576-element integer array, initialize

Re: [Qemu-devel] qemu log function to print out the registers of the guest

2012-08-19 Thread Wei-Ren Chen
On Fri, Aug 17, 2012 at 03:57:55PM +0400, Max Filippov wrote: > On Fri, Aug 17, 2012 at 3:14 PM, 陳韋任 (Wei-Ren Chen) > wrote: > >> > On Thu, Aug 16, 2012 at 7:49 PM, Steven wrote: > >> > [...] > >> >> I want to get the guest memory address in the instruction mov > >> >> 0x4(%ebx) %eax, whic is 0x

Re: [Qemu-devel] qemu log function to print out the registers of the guest

2012-08-17 Thread Max Filippov
On Fri, Aug 17, 2012 at 3:14 PM, 陳韋任 (Wei-Ren Chen) wrote: >> > On Thu, Aug 16, 2012 at 7:49 PM, Steven wrote: >> > [...] >> >> I want to get the guest memory address in the instruction mov >> >> 0x4(%ebx) %eax, whic is 0x4(%ebx). >> >> Since %ebx is not resolved until the execution time, the co

Re: [Qemu-devel] qemu log function to print out the registers of the guest

2012-08-17 Thread Wei-Ren Chen
> > On Thu, Aug 16, 2012 at 7:49 PM, Steven wrote: > > [...] > >> I want to get the guest memory address in the instruction mov > >> 0x4(%ebx) %eax, whic is 0x4(%ebx). > >> Since %ebx is not resolved until the execution time, the code in > >> softmmu_header.h does not generate any hit or miss inf

Re: [Qemu-devel] qemu log function to print out the registers of the guest

2012-08-17 Thread Wei-Ren Chen
> To verify what is translation time and what is the run time, I log the > register information before disassembling each guest code. I copied > some results from the log file, which is generated at run time of a > guest machine. > > EAX= EBX=6ffc > IN: > 0x

Re: [Qemu-devel] qemu log function to print out the registers of the guest

2012-08-16 Thread Max Filippov
On Fri, Aug 17, 2012 at 9:38 AM, Steven wrote: > Hi, Max, > I appreciate your help and got some results using your patch. But I > still have two questions as blow. > >>> I see that with the following patch >>> >>> diff --git a/softmmu_template.h b/softmmu_template.h >>> index b8bd700..2d02133 1006

Re: [Qemu-devel] qemu log function to print out the registers of the guest

2012-08-16 Thread Steven
Hi, Max, I appreciate your help and got some results using your patch. But I still have two questions as blow. >> I see that with the following patch >> >> diff --git a/softmmu_template.h b/softmmu_template.h >> index b8bd700..2d02133 100644 >> --- a/softmmu_template.h >> +++ b/softmmu_template.h

Re: [Qemu-devel] qemu log function to print out the registers of the guest

2012-08-16 Thread Max Filippov
On Thu, Aug 16, 2012 at 10:31 PM, Max Filippov wrote: > On Thu, Aug 16, 2012 at 9:49 PM, Steven wrote: >> On Thu, Aug 16, 2012 at 1:43 PM, Max Filippov wrote: >>> On Thu, Aug 16, 2012 at 9:37 PM, Max Filippov wrote: On Thu, Aug 16, 2012 at 9:29 PM, Steven wrote: > On Thu, Aug 16, 2012

Re: [Qemu-devel] qemu log function to print out the registers of the guest

2012-08-16 Thread Steven
On Thu, Aug 16, 2012 at 2:51 PM, Laurent Desnogues wrote: > On Thu, Aug 16, 2012 at 7:49 PM, Steven wrote: > [...] >> I want to get the guest memory address in the instruction mov >> 0x4(%ebx) %eax, whic is 0x4(%ebx). >> Since %ebx is not resolved until the execution time, the code in >> softmmu

Re: [Qemu-devel] qemu log function to print out the registers of the guest

2012-08-16 Thread Steven
On Thu, Aug 16, 2012 at 12:54 PM, Peter Maydell wrote: > On 16 August 2012 17:36, Steven wrote: >> I would like to get a trace of guest memory access. So I can not use >> "info registers". >> What I want to do is that when tcg fetches a load instruction at >> disas_insns(), the guest memory addre

Re: [Qemu-devel] qemu log function to print out the registers of the guest

2012-08-16 Thread Laurent Desnogues
On Thu, Aug 16, 2012 at 7:49 PM, Steven wrote: [...] > I want to get the guest memory address in the instruction mov > 0x4(%ebx) %eax, whic is 0x4(%ebx). > Since %ebx is not resolved until the execution time, the code in > softmmu_header.h does not generate any hit or miss information. > Do you k

Re: [Qemu-devel] qemu log function to print out the registers of the guest

2012-08-16 Thread Max Filippov
On Thu, Aug 16, 2012 at 9:49 PM, Steven wrote: > On Thu, Aug 16, 2012 at 1:43 PM, Max Filippov wrote: >> On Thu, Aug 16, 2012 at 9:37 PM, Max Filippov wrote: >>> On Thu, Aug 16, 2012 at 9:29 PM, Steven wrote: On Thu, Aug 16, 2012 at 1:00 PM, Max Filippov wrote: > On Thu, Aug 16, 2012

Re: [Qemu-devel] qemu log function to print out the registers of the guest

2012-08-16 Thread Max Filippov
On Thu, Aug 16, 2012 at 9:37 PM, Max Filippov wrote: > On Thu, Aug 16, 2012 at 9:29 PM, Steven wrote: >> On Thu, Aug 16, 2012 at 1:00 PM, Max Filippov wrote: >>> On Thu, Aug 16, 2012 at 8:36 PM, Steven wrote: On Thu, Aug 16, 2012 at 4:02 AM, 陳韋任 (Wei-Ren Chen) wrote: >> I would l

Re: [Qemu-devel] qemu log function to print out the registers of the guest

2012-08-16 Thread Steven
On Thu, Aug 16, 2012 at 1:43 PM, Max Filippov wrote: > On Thu, Aug 16, 2012 at 9:37 PM, Max Filippov wrote: >> On Thu, Aug 16, 2012 at 9:29 PM, Steven wrote: >>> On Thu, Aug 16, 2012 at 1:00 PM, Max Filippov wrote: On Thu, Aug 16, 2012 at 8:36 PM, Steven wrote: > On Thu, Aug 16, 2012

Re: [Qemu-devel] qemu log function to print out the registers of the guest

2012-08-16 Thread Max Filippov
On Thu, Aug 16, 2012 at 9:29 PM, Steven wrote: > On Thu, Aug 16, 2012 at 1:00 PM, Max Filippov wrote: >> On Thu, Aug 16, 2012 at 8:36 PM, Steven wrote: >>> On Thu, Aug 16, 2012 at 4:02 AM, 陳韋任 (Wei-Ren Chen) >>> wrote: > I would like to is there any function that could log the register

Re: [Qemu-devel] qemu log function to print out the registers of the guest

2012-08-16 Thread Steven
On Thu, Aug 16, 2012 at 1:00 PM, Max Filippov wrote: > On Thu, Aug 16, 2012 at 8:36 PM, Steven wrote: >> On Thu, Aug 16, 2012 at 4:02 AM, 陳韋任 (Wei-Ren Chen) >> wrote: I would like to is there any function that could log the register content of the guest machine, like "info registers" i

Re: [Qemu-devel] qemu log function to print out the registers of the guest

2012-08-16 Thread Steven
On Thu, Aug 16, 2012 at 1:15 PM, Peter Maydell wrote: > On 16 August 2012 18:13, Steven wrote: >> So the run time function should be tcg_out_qemu_ld, right? > > No, tcg_out_qemu_ld is a translate time function, which emits > the native (x86 in this case) instructions necessary to perform > a gues

Re: [Qemu-devel] qemu log function to print out the registers of the guest

2012-08-16 Thread Peter Maydell
On 16 August 2012 18:13, Steven wrote: > So the run time function should be tcg_out_qemu_ld, right? No, tcg_out_qemu_ld is a translate time function, which emits the native (x86 in this case) instructions necessary to perform a guest load. -- PMM

Re: [Qemu-devel] qemu log function to print out the registers of the guest

2012-08-16 Thread Steven
On Thu, Aug 16, 2012 at 12:54 PM, Peter Maydell wrote: > On 16 August 2012 17:36, Steven wrote: >> I would like to get a trace of guest memory access. So I can not use >> "info registers". >> What I want to do is that when tcg fetches a load instruction at >> disas_insns(), the guest memory addre

Re: [Qemu-devel] qemu log function to print out the registers of the guest

2012-08-16 Thread Max Filippov
On Thu, Aug 16, 2012 at 8:36 PM, Steven wrote: > On Thu, Aug 16, 2012 at 4:02 AM, 陳韋任 (Wei-Ren Chen) > wrote: >>> I would like to is there any function that could log the register >>> content of the guest machine, like "info registers" in the qemu >>> monitor mode. >> >> Why not check how "info

Re: [Qemu-devel] qemu log function to print out the registers of the guest

2012-08-16 Thread Peter Maydell
On 16 August 2012 17:36, Steven wrote: > I would like to get a trace of guest memory access. So I can not use > "info registers". > What I want to do is that when tcg fetches a load instruction at > disas_insns(), the guest memory address should be calculated. You cannot calculate the guest memor

Re: [Qemu-devel] qemu log function to print out the registers of the guest

2012-08-16 Thread Steven
On Thu, Aug 16, 2012 at 4:02 AM, 陳韋任 (Wei-Ren Chen) wrote: >> I would like to is there any function that could log the register >> content of the guest machine, like "info registers" in the qemu >> monitor mode. > > Why not check how "info registes" be implemented in QEMU? ;) > I guess you just

Re: [Qemu-devel] qemu log function to print out the registers of the guest

2012-08-16 Thread Wei-Ren Chen
> I would like to is there any function that could log the register > content of the guest machine, like "info registers" in the qemu > monitor mode. Why not check how "info registes" be implemented in QEMU? ;) I guess you just have to log env->regs or something like that. Regards, chenwj --

[Qemu-devel] qemu log function to print out the registers of the guest

2012-08-16 Thread Steven
Hi, I would like to is there any function that could log the register content of the guest machine, like "info registers" in the qemu monitor mode. Thanks. steven