[gem5-users] Limit debug output to certain instruction address range

2024-02-21 Thread Hossam ElAtali via gem5-users
Hi,

I'm currently experimenting with Spectre on gem5, and I'm dumping debugging 
output using the O3PipeView flag. However, I get a lot of output for 
instructions that are not relevant to the attack sequence. I was wondering if 
it's possible to limit the debugging output to a certain instruction address 
range. I know I can limit it to a tick range, but I'd like to dump every 
instance of the attack, not just a specific one. I have the instruction 
addresses for the attack and it would be great if I can just use that.

Another option would be to dynamically enable and disable debugging output (or 
the O3PipeView flag, at least) using an m5op.

Yet another option is a way to enable/disable debugging in the config script 
mid-simulation. This would allow me to exit the simulation using an m5op before 
the instructions, enable debugging in the config script, continue, exit using 
an m5op after the instructions, disable debugging, etc.

Any help is greatly appreciated. Thank you.

Best,
Hossam
___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org


[gem5-users] Re: Limit debug output to certain instruction address range

2024-02-21 Thread Hossam ElAtali via gem5-users
Hi Jason,

Thanks for the very quick response!

I managed to surround the ROI with m5op instructions to issue WORKBEGIN and 
WORKEND events,  but now the stats.txt​ file is getting out of hand. It dumps 
stats every time the simulation pauses. Is there a way to make it not dump on 
every event or disable it altogether? I tried using the --stats-file​ command 
line option with an empty string but that caused a crash. I also tried 
truncating and/or deleting the file in the event handler in the config script 
(using the open and truncate python functions), but that did nothing (my guess 
is because the file is already open elsewhere).

Thanks again!

Best,
Hossam

From: Jason Lowe-Power 
Sent: Wednesday, February 21, 2024 1:59 PM
To: The gem5 Users mailing list 
Cc: Hossam ElAtali 
Subject: Re: [gem5-users] Limit debug output to certain instruction address 
range

Hi Hossam,

>  Yet another option is a way to enable/disable debugging in the config script 
> mid-simulation. This would allow me to exit the simulation using an m5op 
> before the instructions, enable debugging in the config script, continue, 
> exit using an m5op after the instructions, disable debugging, etc.

You can definitely do this.

You can use the m5.trace.enable()  and m5.trace.disable() functions in python 
to enable and disable the debug output. You can use m5 ops to exit the 
simulation as you mentioned as well and then call these functions.

Cheers,
Jason

On Wed, Feb 21, 2024 at 10:46 AM Hossam ElAtali via gem5-users 
mailto:gem5-users@gem5.org>> wrote:
Hi,

I'm currently experimenting with Spectre on gem5, and I'm dumping debugging 
output using the O3PipeView flag. However, I get a lot of output for 
instructions that are not relevant to the attack sequence. I was wondering if 
it's possible to limit the debugging output to a certain instruction address 
range. I know I can limit it to a tick range, but I'd like to dump every 
instance of the attack, not just a specific one. I have the instruction 
addresses for the attack and it would be great if I can just use that.

Another option would be to dynamically enable and disable debugging output (or 
the O3PipeView flag, at least) using an m5op.

Yet another option is a way to enable/disable debugging in the config script 
mid-simulation. This would allow me to exit the simulation using an m5op before 
the instructions, enable debugging in the config script, continue, exit using 
an m5op after the instructions, disable debugging, etc.

Any help is greatly appreciated. Thank you.

Best,
Hossam
___
gem5-users mailing list -- gem5-users@gem5.org<mailto:gem5-users@gem5.org>
To unsubscribe send an email to 
gem5-users-le...@gem5.org<mailto:gem5-users-le...@gem5.org>
___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org


[gem5-users] Spectre v2 / BTB

2024-03-22 Thread Hossam ElAtali via gem5-users
Hi,

I was wondering if anyone was able to get a PoC for Spectre v2/BTB working on 
gem5. I was able to get Spectre v1 and ret2spec to work, but not Spectre v2. I 
tried multiple PoCs, cache thresholds, and gem5 configurations (both se and fs; 
with different branch predictors) but none seem to work. The problem is that 
the misspeculated gadget is not executed, not that the flush+reload channel 
does not work. This is supported by the fact that the other working variants 
use the same flush+reload code and parameters.

Here are the PoCs I tried, all on x86:


  *
Spectre v2/BTB (all not working):
 *
https://github.com/Anton-Cao/spectrev2-poc
 *
https://github.com/IAIK/transientfail/tree/master/pocs/spectre/BTB/sa_ip
 *
https://github.com/google/safeside/blob/main/demos/spectre_v1_btb_sa.cc
  *
Spectre v1/PHT:
 *
https://github.com/Eugnis/spectre-attack (working)
 *
https://github.com/IAIK/transientfail/tree/master/pocs/spectre/PHT/sa_ip 
(working but fails with some branch predictors)
 *
https://github.com/google/safeside/blob/main/demos/spectre_v1_pht_sa.cc 
(working)
  *
ret2spec:
 *
https://github.com/google/safeside/blob/main/demos/ret2spec_sa.cc (working)

Any help would be appreciated. Thank you.

Best,
Hossam
___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org


[gem5-users] Re: Mounting X86 Disk Image

2024-04-02 Thread Hossam ElAtali via gem5-users
Hi Sam,

I ran into this issue before and was able to create a fix for it. Here's the 
link to the pull request that has the changes: 
https://github.com/gem5/gem5/pull/990

Hope it helps!

Best,
Hossam

From: Thomas, Samuel via gem5-users 
Sent: Sunday, March 17, 2024 10:25 PM
To: gem5 users mailing list 
Cc: Thomas, Samuel 
Subject: [gem5-users] Mounting X86 Disk Image

Hi all,

I'm trying to build an x86 disk image that I can mount and install a benchmark 
to run. I have tried downloading the pre-installed image from 
https://storage.googleapis.com/dist.gem5.org/dist/develop/images/x86/ubuntu-18-04/x86-ubuntu.img.gz
 and building from the gem5-resources source using the instructions from the 
README, but in both cases when I run ``sudo python3 util/gem5img.py mount 
x86-ubuntu.img temp'' I get the following error:

```
%> /usr/sbin/losetup /dev/loop20 x86-ubuntu.img
No partition description was found in sfdisk output:
  label: dos
  label-id: 0xeb7b110b
  device: /dev/loop20
  unit: sectors
  sector-size: 512

  /dev/loop20p1 : start=2048, size= 4190208, type=83, bootable
Could not determine size of first partition.
'''

Is there something obvious that I'm doing wrong here?

Thank you for your help!

Best,
Sam Thomas
___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org