lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cf12a0c4-21bd-4568-9dc8-daaa2392bd94@amd.com>
Date: Fri, 6 Dec 2024 10:54:59 +0530
From: Ravi Bangoria <ravi.bangoria@....com>
To: peterz@...radead.org, mingo@...hat.com, namhyung@...nel.org
Cc: acme@...nel.org, eranian@...gle.com, mark.rutland@....com,
 alexander.shishkin@...ux.intel.com, jolsa@...nel.org, irogers@...gle.com,
 adrian.hunter@...el.com, kan.liang@...ux.intel.com, tglx@...utronix.de,
 bp@...en8.de, dave.hansen@...ux.intel.com, x86@...nel.org, hpa@...or.com,
 linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org,
 santosh.shukla@....com, ananth.narayan@....com, sandipan.das@....com,
 Ravi Bangoria <ravi.bangoria@....com>
Subject: Re: [PATCH v2 10/10] perf test amd ibs: Add sample period unit test

On 06-Dec-24 10:47 AM, Ravi Bangoria wrote:
> IBS Fetch and IBS Op pmus has various constraints on supported sample
> periods. Add perf unit tests to test those.
> 
> Running it in parallel with other tests causes intermittent failures.
> Mark it exclusive to force it to run sequentially.

The verbose mode of unit test is quite exhaustive so I've not added it
in the commit description. Here is the sample output on a Zen5 machine:

Without patches:

  $ sudo ./perf test -vv 112
   75: AMD IBS sample period:
  --- start ---
  test child forked, pid 7368
  Using CPUID AuthenticAMD-26-2-1
  
  IBS config tests:
  -----------------
  Fetch PMU tests:
  0xffff            : Ok   (nr samples: 1224)
  0x1000            : Ok   (nr samples: 19866)
  0xff              : Ok   (nr samples: 40738)
  0x1               : Ok   (nr samples: 40945)
  0x0               : Ok
  0x10000           : Ok
  Op PMU tests:
  0x0               : Ok
  0x1               : Fail
  0x8               : Fail
  0x9               : Ok   (nr samples: 40543)
  0xf               : Ok   (nr samples: 40543)
  0x1000            : Ok   (nr samples: 20267)
  0xffff            : Ok   (nr samples: 1289)
  0x10000           : Ok
  0x100000          : Fail (nr samples: 17)
  0xf00000          : Fail (nr samples: 1)
  0xf0ffff          : Fail (nr samples: 1)
  0x1f0ffff         : Fail (nr samples: 1)
  0x7f0ffff         : Fail (nr samples: 0)
  0x8f0ffff         : Ok
  0x17f0ffff        : Ok
  
  IBS sample period constraint tests:
  -----------------------------------
  Fetch PMU test:
  freq 0, sample_freq       0: Ok
  freq 0, sample_freq       1: Fail
  freq 0, sample_freq      15: Fail
  freq 0, sample_freq      16: Ok   (nr samples: 1604)
  freq 0, sample_freq      17: Ok   (nr samples: 1604)
  freq 0, sample_freq     143: Ok   (nr samples: 1232)
  freq 0, sample_freq     144: Ok   (nr samples: 1274)
  freq 0, sample_freq     145: Ok   (nr samples: 1241)
  freq 0, sample_freq    1234: Ok   (nr samples: 1261)
  freq 0, sample_freq   65520: Ok   (nr samples: 2660)
  freq 0, sample_freq   65535: Ok   (nr samples: 2635)
  freq 0, sample_freq   65552: Ok   (nr samples: 2633)
  freq 0, sample_freq 8388607: Ok   (nr samples: 31)
  freq 1, sample_freq       0: Ok
  freq 1, sample_freq       1: Ok   (nr samples: 4)
  freq 1, sample_freq      15: Ok   (nr samples: 4)
  freq 1, sample_freq      16: Ok   (nr samples: 4)
  freq 1, sample_freq      17: Ok   (nr samples: 4)
  freq 1, sample_freq     143: Ok   (nr samples: 5)
  freq 1, sample_freq     144: Ok   (nr samples: 5)
  freq 1, sample_freq     145: Ok   (nr samples: 5)
  freq 1, sample_freq    1234: Ok   (nr samples: 8)
  freq 1, sample_freq   65520: Ok   (nr samples: 541)
  freq 1, sample_freq   65535: Ok   (nr samples: 622)
  freq 1, sample_freq   65552: Ok   (nr samples: 720)
  freq 1, sample_freq 8388607: Ok
  Op PMU test:
  freq 0, sample_freq       0: Ok
  freq 0, sample_freq       1: Fail
  freq 0, sample_freq      15: Fail
  freq 0, sample_freq      16: Fail
  freq 0, sample_freq      17: Fail
  freq 0, sample_freq     143: Fail
  freq 0, sample_freq     144: Ok   (nr samples: 2005)
  freq 0, sample_freq     145: Ok   (nr samples: 1604)
  freq 0, sample_freq    1234: Ok   (nr samples: 1604)
  freq 0, sample_freq   65520: Ok   (nr samples: 2547)
  freq 0, sample_freq   65535: Ok   (nr samples: 2532)
  freq 0, sample_freq   65552: Ok   (nr samples: 2469)
  freq 0, sample_freq 8388607: Ok   (nr samples: 30)
  freq 1, sample_freq       0: Ok
  freq 1, sample_freq       1: Fail (nr samples: 4)
  freq 1, sample_freq      15: Fail (nr samples: 4)
  freq 1, sample_freq      16: Fail (nr samples: 4)
  freq 1, sample_freq      17: Fail (nr samples: 4)
  freq 1, sample_freq     143: Fail (nr samples: 5)
  freq 1, sample_freq     144: Fail (nr samples: 5)
  freq 1, sample_freq     145: Fail (nr samples: 5)
  freq 1, sample_freq    1234: Fail (nr samples: 6)
  freq 1, sample_freq   65520: Fail (nr samples: 602)
  freq 1, sample_freq   65535: Fail (nr samples: 618)
  freq 1, sample_freq   65552: Fail (nr samples: 622)
  freq 1, sample_freq 8388607: Ok
  
  IBS ioctl() tests:
  ------------------
  Fetch PMU tests
  ioctl(period = 0x0      ): Ok
  ioctl(period = 0x1      ): Fail
  ioctl(period = 0xf      ): Fail
  ioctl(period = 0x10     ): Ok
  ioctl(period = 0x11     ): Fail
  ioctl(period = 0x1f     ): Fail
  ioctl(period = 0x20     ): Ok
  ioctl(period = 0x80     ): Ok
  ioctl(period = 0x8f     ): Fail
  ioctl(period = 0x90     ): Ok
  ioctl(period = 0x91     ): Fail
  ioctl(period = 0x100    ): Ok
  ioctl(period = 0xfff0   ): Ok
  ioctl(period = 0xffff   ): Fail
  ioctl(period = 0x10000  ): Ok
  ioctl(period = 0x1fff0  ): Ok
  ioctl(period = 0x1fff5  ): Fail
  ioctl(freq   = 0x0      ): Ok
  ioctl(freq   = 0x1      ): Ok
  ioctl(freq   = 0xf      ): Ok
  ioctl(freq   = 0x10     ): Ok
  ioctl(freq   = 0x11     ): Ok
  ioctl(freq   = 0x1f     ): Ok
  ioctl(freq   = 0x20     ): Ok
  ioctl(freq   = 0x80     ): Ok
  ioctl(freq   = 0x8f     ): Ok
  ioctl(freq   = 0x90     ): Ok
  ioctl(freq   = 0x91     ): Ok
  ioctl(freq   = 0x100    ): Ok
  Op PMU tests
  ioctl(period = 0x0      ): Ok
  ioctl(period = 0x1      ): Fail
  ioctl(period = 0xf      ): Fail
  ioctl(period = 0x10     ): Fail
  ioctl(period = 0x11     ): Fail
  ioctl(period = 0x1f     ): Fail
  ioctl(period = 0x20     ): Fail
  ioctl(period = 0x80     ): Fail
  ioctl(period = 0x8f     ): Fail
  ioctl(period = 0x90     ): Ok
  ioctl(period = 0x91     ): Fail
  ioctl(period = 0x100    ): Ok
  ioctl(period = 0xfff0   ): Ok
  ioctl(period = 0xffff   ): Fail
  ioctl(period = 0x10000  ): Ok
  ioctl(period = 0x1fff0  ): Ok
  ioctl(period = 0x1fff5  ): Fail
  ioctl(freq   = 0x0      ): Ok
  ioctl(freq   = 0x1      ): Ok
  ioctl(freq   = 0xf      ): Ok
  ioctl(freq   = 0x10     ): Ok
  ioctl(freq   = 0x11     ): Ok
  ioctl(freq   = 0x1f     ): Ok
  ioctl(freq   = 0x20     ): Ok
  ioctl(freq   = 0x80     ): Ok
  ioctl(freq   = 0x8f     ): Ok
  ioctl(freq   = 0x90     ): Ok
  ioctl(freq   = 0x91     ): Ok
  ioctl(freq   = 0x100    ): Ok
  
  IBS freq (negative) tests:
  --------------------------
  freq 1, sample_freq 200000: Fail
  
  IBS L3MissOnly test: (takes a while)
  --------------------
  Fetch L3MissOnly: Fail (nr_samples: 1159)
  Op L3MissOnly:    Ok   (nr_samples: 1205)
  ---- end(-1) ----
   75: AMD IBS sample period                                           : FAILED!


With patches:

  $ sudo ./perf test -vv 112
  112: AMD IBS sample period:
  --- start ---
  test child forked, pid 44042
  Using CPUID AuthenticAMD-26-2-1
  
  IBS config tests:
  -----------------
  Fetch PMU tests:
  0xffff            : Ok   (nr samples: 1278)
  0x1000            : Ok   (nr samples: 20129)
  0xff              : Ok   (nr samples: 40529)
  0x1               : Ok   (nr samples: 40443)
  0x0               : Ok
  0x10000           : Ok
  Op PMU tests:
  0x0               : Ok
  0x1               : Ok
  0x8               : Ok
  0x9               : Ok   (nr samples: 40443)
  0xf               : Ok   (nr samples: 40761)
  0x1000            : Ok   (nr samples: 20808)
  0xffff            : Ok   (nr samples: 1261)
  0x10000           : Ok
  0x100000          : Ok   (nr samples: 1276)
  0xf00000          : Ok   (nr samples: 87)
  0xf0ffff          : Ok   (nr samples: 77)
  0x1f0ffff         : Ok   (nr samples: 39)
  0x7f0ffff         : Ok   (nr samples: 8)
  0x8f0ffff         : Ok
  0x17f0ffff        : Ok
  
  IBS sample period constraint tests:
  -----------------------------------
  Fetch PMU test:
  freq 0, sample_freq       0: Ok
  freq 0, sample_freq       1: Ok
  freq 0, sample_freq      15: Ok
  freq 0, sample_freq      16: Ok   (nr samples: 1272)
  freq 0, sample_freq      17: Ok   (nr samples: 1272)
  freq 0, sample_freq     143: Ok   (nr samples: 1590)
  freq 0, sample_freq     144: Ok   (nr samples: 1272)
  freq 0, sample_freq     145: Ok   (nr samples: 1272)
  freq 0, sample_freq    1234: Ok   (nr samples: 1272)
  freq 0, sample_freq    4103: Ok   (nr samples: 1272)
  freq 0, sample_freq   65520: Ok   (nr samples: 2530)
  freq 0, sample_freq   65535: Ok   (nr samples: 2339)
  freq 0, sample_freq   65552: Ok   (nr samples: 2546)
  freq 0, sample_freq 8388607: Ok   (nr samples: 30)
  freq 1, sample_freq       0: Ok
  freq 1, sample_freq       1: Ok   (nr samples: 4)
  freq 1, sample_freq      15: Ok   (nr samples: 4)
  freq 1, sample_freq      16: Ok   (nr samples: 4)
  freq 1, sample_freq      17: Ok   (nr samples: 4)
  freq 1, sample_freq     143: Ok   (nr samples: 5)
  freq 1, sample_freq     144: Ok   (nr samples: 5)
  freq 1, sample_freq     145: Ok   (nr samples: 5)
  freq 1, sample_freq    1234: Ok   (nr samples: 9)
  freq 1, sample_freq    4103: Ok   (nr samples: 36)
  freq 1, sample_freq   65520: Ok   (nr samples: 954)
  freq 1, sample_freq   65535: Ok   (nr samples: 1590)
  freq 1, sample_freq   65552: Ok   (nr samples: 1272)
  freq 1, sample_freq 8388607: Ok
  Op PMU test:
  freq 0, sample_freq       0: Ok
  freq 0, sample_freq       1: Ok
  freq 0, sample_freq      15: Ok
  freq 0, sample_freq      16: Ok
  freq 0, sample_freq      17: Ok
  freq 0, sample_freq     143: Ok
  freq 0, sample_freq     144: Ok   (nr samples: 1272)
  freq 0, sample_freq     145: Ok   (nr samples: 1272)
  freq 0, sample_freq    1234: Ok   (nr samples: 1272)
  freq 0, sample_freq    4103: Ok   (nr samples: 1272)
  freq 0, sample_freq   65520: Ok   (nr samples: 2599)
  freq 0, sample_freq   65535: Ok   (nr samples: 2558)
  freq 0, sample_freq   65552: Ok   (nr samples: 2480)
  freq 0, sample_freq 8388607: Ok   (nr samples: 31)
  freq 1, sample_freq       0: Ok
  freq 1, sample_freq       1: Ok   (nr samples: 4)
  freq 1, sample_freq      15: Ok   (nr samples: 4)
  freq 1, sample_freq      16: Ok   (nr samples: 4)
  freq 1, sample_freq      17: Ok   (nr samples: 4)
  freq 1, sample_freq     143: Ok   (nr samples: 5)
  freq 1, sample_freq     144: Ok   (nr samples: 5)
  freq 1, sample_freq     145: Ok   (nr samples: 5)
  freq 1, sample_freq    1234: Ok   (nr samples: 8)
  freq 1, sample_freq    4103: Ok   (nr samples: 30)
  freq 1, sample_freq   65520: Ok   (nr samples: 577)
  freq 1, sample_freq   65535: Ok   (nr samples: 585)
  freq 1, sample_freq   65552: Ok   (nr samples: 577)
  freq 1, sample_freq 8388607: Ok
  
  IBS ioctl() tests:
  ------------------
  Fetch PMU tests
  ioctl(period = 0x0      ): Ok
  ioctl(period = 0x1      ): Ok
  ioctl(period = 0xf      ): Ok
  ioctl(period = 0x10     ): Ok
  ioctl(period = 0x11     ): Ok
  ioctl(period = 0x1f     ): Ok
  ioctl(period = 0x20     ): Ok
  ioctl(period = 0x80     ): Ok
  ioctl(period = 0x8f     ): Ok
  ioctl(period = 0x90     ): Ok
  ioctl(period = 0x91     ): Ok
  ioctl(period = 0x100    ): Ok
  ioctl(period = 0xfff0   ): Ok
  ioctl(period = 0xffff   ): Ok
  ioctl(period = 0x10000  ): Ok
  ioctl(period = 0x1fff0  ): Ok
  ioctl(period = 0x1fff5  ): Ok
  ioctl(freq   = 0x0      ): Ok
  ioctl(freq   = 0x1      ): Ok
  ioctl(freq   = 0xf      ): Ok
  ioctl(freq   = 0x10     ): Ok
  ioctl(freq   = 0x11     ): Ok
  ioctl(freq   = 0x1f     ): Ok
  ioctl(freq   = 0x20     ): Ok
  ioctl(freq   = 0x80     ): Ok
  ioctl(freq   = 0x8f     ): Ok
  ioctl(freq   = 0x90     ): Ok
  ioctl(freq   = 0x91     ): Ok
  ioctl(freq   = 0x100    ): Ok
  Op PMU tests
  ioctl(period = 0x0      ): Ok
  ioctl(period = 0x1      ): Ok
  ioctl(period = 0xf      ): Ok
  ioctl(period = 0x10     ): Ok
  ioctl(period = 0x11     ): Ok
  ioctl(period = 0x1f     ): Ok
  ioctl(period = 0x20     ): Ok
  ioctl(period = 0x80     ): Ok
  ioctl(period = 0x8f     ): Ok
  ioctl(period = 0x90     ): Ok
  ioctl(period = 0x91     ): Ok
  ioctl(period = 0x100    ): Ok
  ioctl(period = 0xfff0   ): Ok
  ioctl(period = 0xffff   ): Ok
  ioctl(period = 0x10000  ): Ok
  ioctl(period = 0x1fff0  ): Ok
  ioctl(period = 0x1fff5  ): Ok
  ioctl(freq   = 0x0      ): Ok
  ioctl(freq   = 0x1      ): Ok
  ioctl(freq   = 0xf      ): Ok
  ioctl(freq   = 0x10     ): Ok
  ioctl(freq   = 0x11     ): Ok
  ioctl(freq   = 0x1f     ): Ok
  ioctl(freq   = 0x20     ): Ok
  ioctl(freq   = 0x80     ): Ok
  ioctl(freq   = 0x8f     ): Ok
  ioctl(freq   = 0x90     ): Ok
  ioctl(freq   = 0x91     ): Ok
  ioctl(freq   = 0x100    ): Ok
  
  IBS freq (negative) tests:
  --------------------------
  freq 1, sample_freq 200000: Ok
  
  IBS L3MissOnly test: (takes a while)
  --------------------
  Fetch L3MissOnly: Ok   (nr_samples: 1408)
  Op L3MissOnly:    Ok   (nr_samples: 1456)
  ---- end(0) ----
  112: AMD IBS sample period                                           : Ok

Thanks,
Ravi

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ