From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HdbXe-0004md-SA for qemu-devel@nongnu.org; Mon, 16 Apr 2007 20:27:30 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HdbXc-0004m6-CG for qemu-devel@nongnu.org; Mon, 16 Apr 2007 20:27:29 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HdbXc-0004m3-6a for qemu-devel@nongnu.org; Mon, 16 Apr 2007 20:27:28 -0400 Received: from nz-out-0506.google.com ([64.233.162.227]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HdbSw-0002ER-6x for qemu-devel@nongnu.org; Mon, 16 Apr 2007 20:22:38 -0400 Received: by nz-out-0506.google.com with SMTP id i11so3285330nzi for ; Mon, 16 Apr 2007 17:22:37 -0700 (PDT) Message-ID: Date: Mon, 16 Apr 2007 19:22:37 -0500 From: "Atif Hashmi" Subject: Re: [Qemu-devel] Re: Detecting an assembly instruction in QEMU In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_51663_11400821.1176769357139" References: <83a4d4ca0704060515l172d6f9ep59b6467c6e49f250@mail.gmail.com> <83a4d4ca0704080713t596e4d83lbd1c495d92eda581@mail.gmail.com> <83a4d4ca0704081514v584660e4h8a36e5d1aee16d82@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_51663_11400821.1176769357139 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Sorry for my previous incomplete email Hi, I have another small question. Actually, I am implementing hardware transactional memory support in QEMU. I have implemented the following two helper functions functions in targer-i386/helper.c void helper_StartTransaction() void helper_CommitTransaction(); My application looks as follows. int main() { __asm_volatile("mov %al %al"); //is detected in translation.c and helper_StartTransaction is called //add the code here __asm_volatile("mov %bl %bl"); //is detected in translation.c and helper_CommitTransaction is called } In case a transaction fails, I detect it inside the code for helper_CommitTransaction(), now I need to jump back to the start of transaction. I do it by using setjmp inside helper_StartTransaction and calling longjmp inside CommitTransaction, Code for the two helper functions is as follows void helper_StartTransaction() { printf("StartTransaction Called\n"); if(setjmp(env->tm_jmp)) { printf("Transaction restart\"); } } void helper_CommitTransaction() { printf("CommitTransaction Called\n"); longjmp(env->tm_jmp, 0); } But this prints "Transaction restart" once and then the program finishes. This means that commit transaction is not called the second time. Could you please tell me what am I doing wrong? Regards, Atif On 4/16/07, Atif Hashmi wrote: > > > > On 4/8/07, Eduardo Felipe wrote: > > > > > > I recommend: > > > > http://fabrice.bellard.free.fr/qemu/user-doc.html > > > > Regards, > > Eduardo > > > > ------=_Part_51663_11400821.1176769357139 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Sorry for my previous incomplete email

Hi,

I have another small question. Actually, I am implementing hardware transactional memory support in QEMU. I have implemented the following two helper functions functions in targer-i386/helper.c

void helper_StartTransaction()
void helper_CommitTransaction();

My application looks as follows.
int main()
{
       __asm_volatile("mov %al %al"); //is detected in translation.c and helper_StartTransaction is called
       //add the code here
      __asm_volatile("mov %bl %bl"); //is detected in translation.c and helper_CommitTransaction is called
}

In case a transaction fails, I detect it inside the code for helper_CommitTransaction(), now I need to jump back to the start of transaction. I do it by using setjmp inside helper_StartTransaction and calling longjmp inside CommitTransaction, Code for the two helper functions is as follows

void helper_StartTransaction()
{
    printf("StartTransaction Called\n");
    if(setjmp(env->tm_jmp))
    {
      printf("Transaction restart\");
    }

}

void helper_CommitTransaction()
{
    printf("CommitTransaction Called\n");
    longjmp(env->tm_jmp, 0);
}
 
But this prints "Transaction restart" once and then the program finishes. This means that commit transaction is not called the second time. Could you please tell me what am I doing wrong?

Regards,
Atif
On 4/16/07, Atif Hashmi <atifhashmi@gmail.com> wrote:


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


------=_Part_51663_11400821.1176769357139--