Re: [gem5-users] Instrumenting ROI in Syscall emulation mode

2019-06-13 Thread Victor Kariofillis
I found the solution. Besides dropping the flag when compiling the
microbenchmark as you said, I removed the same flag from the Makefile.x86
and recompiled. Also in the microbenchmark, I removed the incude of
m5_mmap.h and calling map_m5_mem() in main. Thanks Jason for the
suggestion.

On Thu, 13 Jun 2019 at 13:52, Victor Kariofillis 
wrote:

> Hi Jason,
>
> Sadly removing that flag didn't make a difference. I'm still getting an
> mmap warning (when running it with sudo). I also tried removing the flag
> (-DM5OP_ADDR=0x) from util/m5/Makefile.x86, but it made no
> difference. I'm gonna post my changes in case someone is interested.
>
> This is the microbenchmark.
> https://filebin.net/cb5jsu1fakpdo163/gem5_array.pdf?t=d6gmvy5e
>
> This are the instructions I'm following (heavily based on the blogpost)
> https://filebin.net/cb5jsu1fakpdo163/instructions.pdf?t=d6gmvy5e
>
> And finally these are the changes (diff) that I made in gem5 for
> implementing the pseudo instructions. (I know the pseudo instructions don't
> do anything currently. I'm just trying to get them to work before
> implementing any functionality.)
> https://filebin.net/cb5jsu1fakpdo163/diff.pdf?t=d6gmvy5e
>
> Thanks.
>
> On Thu, 13 Jun 2019 at 11:40, Jason Lowe-Power 
> wrote:
>
>> Hi Victor,
>>
>> Drop the -DM5OP_ADDR define when you're compiling. That will force the
>> m5ops to use the pseudo instruction implementation instead of the MMIO
>> implementation. MMIO is required when using KVM, but no other time.
>>
>> Cheers,
>> Jason
>>
>> On Wed, Jun 12, 2019 at 2:38 PM Victor Kariofillis <
>> vickariofil...@gmail.com> wrote:
>>
>>> Hi Andrea,
>>>
>>> I can't get my microbenchmark to run with gem5. If I execute it without
>>> sudo, I get a "Can't open /dev/mem: Permission denied". If I execute it
>>> with sudo on its own, it seems to finish fine. But when I want to execute
>>> it with gem5, I get a segfault.
>>>
>>> "warn: mmap: writing to shared mmap region is currently unsupported. The
>>> write succeeds on the target, but it will not be propagated to the host or
>>> shared mappings
>>> warn: mmap: failed to map file into host address space
>>> panic: Tried to read unmapped address 0x55ff.
>>> PC: 0x400879, Instr:   MOV_R_M : ld   rax, DS:[rax + r11]
>>> Memory Usage: 678516 KBytes
>>> Program aborted at tick 86427000"
>>>
>>> I built my microbenchmark like this:
>>>
>>> 1) gcc -O2 -DM5OP_ADDR=0x -Ipath/to/gem5/include -c
>>> gem5_array.cpp -o gem5_array.o
>>> 2) gcc gem5_array.o -o gem5_array path/to/gem5/util/m5/m5op_x86.o
>>> path/to/gem5/util/m5/m5_mmap.o
>>>
>>> I don't only want to get the stats for the ROI in the stats file. I'm
>>> using some debug flags, so in the output of gem5, I want to see only the
>>> printouts from inside the ROI. I'm not sure I would achieve that.
>>>
>>> Thanks,
>>> Victor
>>> ___
>>> gem5-users mailing list
>>> gem5-users@gem5.org
>>> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
>>
>> ___
>> gem5-users mailing list
>> gem5-users@gem5.org
>> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
>
>
___
gem5-users mailing list
gem5-users@gem5.org
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

Re: [gem5-users] Instrumenting ROI in Syscall emulation mode

2019-06-13 Thread Victor Kariofillis
Hi Jason,

Sadly removing that flag didn't make a difference. I'm still getting an
mmap warning (when running it with sudo). I also tried removing the flag
(-DM5OP_ADDR=0x) from util/m5/Makefile.x86, but it made no
difference. I'm gonna post my changes in case someone is interested.

This is the microbenchmark.
https://filebin.net/cb5jsu1fakpdo163/gem5_array.pdf?t=d6gmvy5e

This are the instructions I'm following (heavily based on the blogpost)
https://filebin.net/cb5jsu1fakpdo163/instructions.pdf?t=d6gmvy5e

And finally these are the changes (diff) that I made in gem5 for
implementing the pseudo instructions. (I know the pseudo instructions don't
do anything currently. I'm just trying to get them to work before
implementing any functionality.)
https://filebin.net/cb5jsu1fakpdo163/diff.pdf?t=d6gmvy5e

Thanks.

On Thu, 13 Jun 2019 at 11:40, Jason Lowe-Power  wrote:

> Hi Victor,
>
> Drop the -DM5OP_ADDR define when you're compiling. That will force the
> m5ops to use the pseudo instruction implementation instead of the MMIO
> implementation. MMIO is required when using KVM, but no other time.
>
> Cheers,
> Jason
>
> On Wed, Jun 12, 2019 at 2:38 PM Victor Kariofillis <
> vickariofil...@gmail.com> wrote:
>
>> Hi Andrea,
>>
>> I can't get my microbenchmark to run with gem5. If I execute it without
>> sudo, I get a "Can't open /dev/mem: Permission denied". If I execute it
>> with sudo on its own, it seems to finish fine. But when I want to execute
>> it with gem5, I get a segfault.
>>
>> "warn: mmap: writing to shared mmap region is currently unsupported. The
>> write succeeds on the target, but it will not be propagated to the host or
>> shared mappings
>> warn: mmap: failed to map file into host address space
>> panic: Tried to read unmapped address 0x55ff.
>> PC: 0x400879, Instr:   MOV_R_M : ld   rax, DS:[rax + r11]
>> Memory Usage: 678516 KBytes
>> Program aborted at tick 86427000"
>>
>> I built my microbenchmark like this:
>>
>> 1) gcc -O2 -DM5OP_ADDR=0x -Ipath/to/gem5/include -c
>> gem5_array.cpp -o gem5_array.o
>> 2) gcc gem5_array.o -o gem5_array path/to/gem5/util/m5/m5op_x86.o
>> path/to/gem5/util/m5/m5_mmap.o
>>
>> I don't only want to get the stats for the ROI in the stats file. I'm
>> using some debug flags, so in the output of gem5, I want to see only the
>> printouts from inside the ROI. I'm not sure I would achieve that.
>>
>> Thanks,
>> Victor
>> ___
>> gem5-users mailing list
>> gem5-users@gem5.org
>> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
>
> ___
> gem5-users mailing list
> gem5-users@gem5.org
> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
___
gem5-users mailing list
gem5-users@gem5.org
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

Re: [gem5-users] Instrumenting ROI in Syscall emulation mode

2019-06-13 Thread Jason Lowe-Power
Hi Victor,

Drop the -DM5OP_ADDR define when you're compiling. That will force the
m5ops to use the pseudo instruction implementation instead of the MMIO
implementation. MMIO is required when using KVM, but no other time.

Cheers,
Jason

On Wed, Jun 12, 2019 at 2:38 PM Victor Kariofillis 
wrote:

> Hi Andrea,
>
> I can't get my microbenchmark to run with gem5. If I execute it without
> sudo, I get a "Can't open /dev/mem: Permission denied". If I execute it
> with sudo on its own, it seems to finish fine. But when I want to execute
> it with gem5, I get a segfault.
>
> "warn: mmap: writing to shared mmap region is currently unsupported. The
> write succeeds on the target, but it will not be propagated to the host or
> shared mappings
> warn: mmap: failed to map file into host address space
> panic: Tried to read unmapped address 0x55ff.
> PC: 0x400879, Instr:   MOV_R_M : ld   rax, DS:[rax + r11]
> Memory Usage: 678516 KBytes
> Program aborted at tick 86427000"
>
> I built my microbenchmark like this:
>
> 1) gcc -O2 -DM5OP_ADDR=0x -Ipath/to/gem5/include -c gem5_array.cpp
> -o gem5_array.o
> 2) gcc gem5_array.o -o gem5_array path/to/gem5/util/m5/m5op_x86.o
> path/to/gem5/util/m5/m5_mmap.o
>
> I don't only want to get the stats for the ROI in the stats file. I'm
> using some debug flags, so in the output of gem5, I want to see only the
> printouts from inside the ROI. I'm not sure I would achieve that.
>
> Thanks,
> Victor
> ___
> gem5-users mailing list
> gem5-users@gem5.org
> http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
___
gem5-users mailing list
gem5-users@gem5.org
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

Re: [gem5-users] Instrumenting ROI in Syscall emulation mode

2019-06-12 Thread Victor Kariofillis
Hi Andrea,

I can't get my microbenchmark to run with gem5. If I execute it without
sudo, I get a "Can't open /dev/mem: Permission denied". If I execute it
with sudo on its own, it seems to finish fine. But when I want to execute
it with gem5, I get a segfault.

"warn: mmap: writing to shared mmap region is currently unsupported. The
write succeeds on the target, but it will not be propagated to the host or
shared mappings
warn: mmap: failed to map file into host address space
panic: Tried to read unmapped address 0x55ff.
PC: 0x400879, Instr:   MOV_R_M : ld   rax, DS:[rax + r11]
Memory Usage: 678516 KBytes
Program aborted at tick 86427000"

I built my microbenchmark like this:

1) gcc -O2 -DM5OP_ADDR=0x -Ipath/to/gem5/include -c gem5_array.cpp
-o gem5_array.o
2) gcc gem5_array.o -o gem5_array path/to/gem5/util/m5/m5op_x86.o
path/to/gem5/util/m5/m5_mmap.o

I don't only want to get the stats for the ROI in the stats file. I'm using
some debug flags, so in the output of gem5, I want to see only the
printouts from inside the ROI. I'm not sure I would achieve that.

Thanks,
Victor
___
gem5-users mailing list
gem5-users@gem5.org
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

Re: [gem5-users] Instrumenting ROI in Syscall emulation mode

2019-06-11 Thread Andrea Mondelli
Hi Victor,

I use checkpoints with SE.py , can you describe your problem?
Is it related to the various “—work-{begin | end}-*” parameters in Options.py?

Il giorno 10 giu 2019, alle ore 12:43, Victor Kariofillis 
mailto:vickariofil...@gmail.com>> ha scritto:

Hi,

I have already implemented pseudo instructions for full system mode based on 
this
 tutorial. It is time consuming though to test everything after I make even a 
small change. Is there any way to implement the same functionality for syscall 
mode?

Thank you,
Victor
___
gem5-users mailing list
gem5-users@gem5.org
https://nam02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fm5sim.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fgem5-usersdata=02%7C01%7Candrea.mondelli%40ucf.edu%7Ca57bf639a174456d6bf608d6edc2da2c%7Cbb932f15ef3842ba91fcf3c59d5dd1f1%7C0%7C0%7C636957818488668401sdata=wsObMK66hrfKJJoYwy1NWigx8HvwmLno6o8aMpfyHqU%3Dreserved=0


Bests,
A.

___
gem5-users mailing list
gem5-users@gem5.org
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users