Re: [Qemu-devel] Counting barrier instructions in ARM

2014-10-17 Thread Alex Bennée
Pranith Kumar writes: > Hi Peter, > > On Thu, Oct 16, 2014 at 4:05 AM, Peter Maydell > wrote: >> On 16 October 2014 03:45, Pranith Kumar wrote: >>> The problem I am facing is that this seems to be crashing when run with a >>> multi-threaded executable. >> >> This is nothing to do with your ch

Re: [Qemu-devel] Counting barrier instructions in ARM

2014-10-16 Thread Pranith Kumar
On Wed, Oct 15, 2014 at 10:12 PM, Max Filippov wrote: > On Thu, Oct 16, 2014 at 6:00 AM, Pranith Kumar wrote: +tcg_gen_add_i32(cpu_fence_count, cpu_fence_count, 1); >>> >>> tcg_gen_addi_i32, as you're adding an immediate. >>> Enabling TCG debug would catch such errors. >>> Not sure i

Re: [Qemu-devel] Counting barrier instructions in ARM

2014-10-16 Thread Pranith Kumar
Hi Peter, On Thu, Oct 16, 2014 at 4:05 AM, Peter Maydell wrote: > On 16 October 2014 03:45, Pranith Kumar wrote: >> The problem I am facing is that this seems to be crashing when run with a >> multi-threaded executable. > > This is nothing to do with your changes -- user-mode QEMU does not > sup

Re: [Qemu-devel] Counting barrier instructions in ARM

2014-10-16 Thread Peter Maydell
On 16 October 2014 03:45, Pranith Kumar wrote: > The problem I am facing is that this seems to be crashing when run with a > multi-threaded executable. This is nothing to do with your changes -- user-mode QEMU does not support multi-threaded guest executables. QEMU may crash, hang, or stop with a

Re: [Qemu-devel] Counting barrier instructions in ARM

2014-10-15 Thread Max Filippov
On Thu, Oct 16, 2014 at 6:00 AM, Pranith Kumar wrote: >>> +tcg_gen_add_i32(cpu_fence_count, cpu_fence_count, 1); >> >> tcg_gen_addi_i32, as you're adding an immediate. >> Enabling TCG debug would catch such errors. >> Not sure if that will fix crashing, but it should improve accuracy (: >

Re: [Qemu-devel] Counting barrier instructions in ARM

2014-10-15 Thread Pranith Kumar
Hi Max, On Wed, Oct 15, 2014 at 9:54 PM, Max Filippov wrote: > Hi, > > On Thu, Oct 16, 2014 at 5:45 AM, Pranith Kumar wrote: >> Is there something obviously wrong with what I am trying to do? Any help is >> highly appreciated. >> --- a/target-arm/translate.c >> +++ b/target-arm/translate.c >> @@

Re: [Qemu-devel] Counting barrier instructions in ARM

2014-10-15 Thread Max Filippov
Hi, On Thu, Oct 16, 2014 at 5:45 AM, Pranith Kumar wrote: > Is there something obviously wrong with what I am trying to do? Any help is > highly appreciated. > --- a/target-arm/translate.c > +++ b/target-arm/translate.c > @@ -7568,6 +7574,7 @@ static void disas_arm_insn(CPUARMState * env, > Disa

[Qemu-devel] Counting barrier instructions in ARM

2014-10-15 Thread Pranith Kumar
Hello, I am trying to count the number of barrier instructions (dmb) which are being executed in an multi-threaded ARM executable. I am running the executable using qemu user mode with the following patch applied. Basically I created two counters in the ARM cpu state and incrementing them by gene