From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HhBZi-0000Lh-Vz for qemu-devel@nongnu.org; Thu, 26 Apr 2007 17:32:27 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HhBZi-0000KS-7a for qemu-devel@nongnu.org; Thu, 26 Apr 2007 17:32:26 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HhBZi-0000K4-2v for qemu-devel@nongnu.org; Thu, 26 Apr 2007 17:32:26 -0400 Received: from nz-out-0506.google.com ([64.233.162.232]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HhBTu-0006Sh-TC for qemu-devel@nongnu.org; Thu, 26 Apr 2007 17:26:27 -0400 Received: by nz-out-0506.google.com with SMTP id i11so2276978nzi for ; Thu, 26 Apr 2007 14:26:14 -0700 (PDT) Message-ID: Date: Thu, 26 Apr 2007 16:26:12 -0500 From: "Atif Hashmi" Subject: Re: [Qemu-devel] Re: Detecting an assembly instruction in QEMU In-Reply-To: <83a4d4ca0704260703u78a43f5co11004fc6c98dd49f@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_201920_5844859.1177622772972" References: <83a4d4ca0704170249l83c5d7bqe0b0f8cc8b5a4a58@mail.gmail.com> <83a4d4ca0704220609m33ebfda7m825dab6d0992be28@mail.gmail.com> <83a4d4ca0704240234q6f8ecf59gbfa91432a2fee08@mail.gmail.com> <83a4d4ca0704260703u78a43f5co11004fc6c98dd49f@mail.gmail.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org ------=_Part_201920_5844859.1177622772972 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi Eduardo, I think I could not explain my question regarding "addl %ebx, (%eax)". What I wanted to ask was that this instruction also accesses the memory and I also need to intercept it within a transaction. Incase of "addl %ebx, (%eax)", Are the functions under "/* CPU memory access without any memory or io remapping */" called in case of this instruction. Secondly, there is a function in "exec.c" called "cpu_physical_memory_rw". Is it easier to hack into this fuction to intercept the memory references. Thanks, Atif On 4/26/07, Eduardo Felipe wrote: > > > > 2007/4/25, Atif Hashmi : > > > > Instructions like addl %ebx, (%eax) are also considered to be memory > > refernce instructions. Do these type of instructions also refer to the > > functions that you mentioned. > > > No. You are using __asm_volatile("mov %al %al") to mark the start of your > transaction and __asm_volatile("mov %bl %bl") to mark the end. What I > meant is that your compiler could generate mov %al,%al or mov %bl,%bl in any > other place for whatever reason when it compiles C code. Also your guest OS > or any other program running in it can use these two instructions too. Both > cases would affect in what you intend to do. > > Secondly, what is the purpose of undef ASM_SOFTMMU > > > If ASM_SOFTMMU is defined, pure assembly memory access routines are used > (faster). If it is not defined, alternative C routines are used, which are > slower but easier to modify. > > Regards, > Eduardo > > > > ------=_Part_201920_5844859.1177622772972 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi Eduardo,

I think I could not explain my question regarding "addl %ebx, (%eax)". What I wanted to ask was that this instruction also accesses the memory and I also need to intercept it within a transaction. Incase of "addl %ebx, (%eax)", Are the functions under "/* CPU memory access without any memory or io remapping */" called in case of this instruction.

Secondly, there is a function in "exec.c" called "cpu_physical_memory_rw". Is it easier to hack into this fuction to intercept the memory references.

Thanks,
Atif

On 4/26/07, Eduardo Felipe <edusaper@gmail.com> wrote:


2007/4/25, Atif Hashmi <atifhashmi@gmail.com>:
Instructions like addl %ebx, (%eax) are also considered to be memory refernce instructions. Do these type of instructions also refer to the functions that you mentioned.

No. You are using __asm_volatile("mov %al %al") to mark the start of your transaction and __asm_volatile("mov %bl %bl") to mark the end. What I meant is that your compiler could generate mov %al,%al or mov %bl,%bl in any other place for whatever reason when it compiles C code. Also your guest OS or any other program running in it can use these two instructions too. Both cases would affect in what you intend to do.

Secondly, what is the purpose of undef ASM_SOFTMMU

If ASM_SOFTMMU is defined, pure assembly memory access routines are used (faster). If it is not defined, alternative C routines are used, which are slower but easier to modify.

Regards,
Eduardo
 



------=_Part_201920_5844859.1177622772972--