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: <62399b9c-d5ef-4c56-4592-d2cf1af503d6@amd.com>
Date:   Thu, 1 Dec 2022 14:43:26 +0530
From:   Ravi Bangoria <ravi.bangoria@....com>
To:     "Liang, Kan" <kan.liang@...ux.intel.com>
Cc:     acme@...nel.org, irogers@...gle.com, jolsa@...hat.com,
        namhyung@...nel.org, peterz@...radead.org, mark.rutland@....com,
        adrian.hunter@...el.com, alexander.shishkin@...ux.intel.com,
        carsten.haitzler@....com, leo.yan@...aro.org, maddy@...ux.ibm.com,
        kjain@...ux.ibm.com, atrajeev@...ux.vnet.ibm.com,
        tmricht@...ux.ibm.com, linux-perf-users@...r.kernel.org,
        linux-kernel@...r.kernel.org, sandipan.das@....com,
        ananth.narayan@....com, santosh.shukla@....com,
        Ravi Bangoria <ravi.bangoria@....com>
Subject: Re: [PATCH v2 2/2] perf test: Add event group test

Hi Kan,

Thanks for the review.

>> +static int setup_uncore_event(void)
>> +{
>> +	struct perf_pmu *pmu;
>> +
>> +	if (list_empty(&pmus))
>> +		perf_pmu__scan(NULL);
>> +
>> +	perf_pmus__for_each_pmu(pmu) {
>> +		if (pmu->is_uncore) {
> 
> Always using the first uncore PMU may trigger false alarm on some Intel
> platforms. For example, Intel has free running uncore PMUs (e.g.,
> uncore_imc_free_running_0), which only supports special event encoding
> 0xff. The config 0 must fails.
> You may want to add the below check to ignore the free running uncore PMUs.
>                         if (strstr(pmu->name, "free_running"))
>                                 continue;
> 
> 
> Also, some uncore PMUs only support two counters. But the test assumes
> that the number of counters > 2. You may want to limit the size of the
> group for 2 for a pure uncore group.

That seems hacky. Instead of ignoring, would it be possible to provide
a list of testable pmus? Example with random values:

  /* Uncore pmus that support more than 3 counters */
  static struct uncore_pmus {
      char *name;
      unsigned long config;
  } uncore_pmus[] = {
      { "amd_l3",         0x0  },
      { "amd_df",         0x0  },
      { "uncore_imc_xxx", 0xff },   /* Intel */
      { "intel_xxx_pmu2", 0xff },   /* Intel */
      { "abc_pmu1",       0x0  },   /* Arm */
      { "hv_24x7",        0xa  },   /* PowerPC */
      { ...                    },
  };

  perf_pmus__for_each_pmu(pmu) {
      if (pmu present in uncore_pmus[])
          type[2] = pmu->type;
          config[2] = pmu->config;
  }

Ofcourse, this should work for all architectures. Arm, PowerPC, s390 folks?

Thanks,
Ravi

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ