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] [day] [month] [year] [list]
Message-ID: <CAEEQ3wkj=6WPNFpet=A9JppiO52agw6HZArwhfWsWS9JOY6Dng@mail.gmail.com>
Date: Sat, 1 Feb 2025 17:51:21 +0800
From: yunhui cui <cuiyunhui@...edance.com>
To: Will Deacon <will@...nel.org>
Cc: Shuai Xue <xueshuai@...ux.alibaba.com>, renyu.zj@...ux.alibaba.com, 
	mark.rutland@....com, linux-arm-kernel@...ts.infradead.org, 
	linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [External] Re: [PATCH] perf/dwc_pcie: fix duplicate pci_dev devices

Hi Will,

On Tue, Jan 28, 2025 at 12:52 AM Will Deacon <will@...nel.org> wrote:
>
> On Sun, Jan 26, 2025 at 09:54:35AM +0800, yunhui cui wrote:
> > Hi Will,
> >
> > On Fri, Jan 24, 2025 at 8:30 PM Will Deacon <will@...nel.org> wrote:
> > >
> > > On Fri, Jan 24, 2025 at 05:11:05PM +0800, yunhui cui wrote:
> > > > > >>>        vsec = dwc_pcie_des_cap(pdev);
> > > > > >>>        if (!vsec)
> > > > > >>>                return -ENODEV;
> > > > > >>>
> > > > > >>>        sbdf = plat_dev->id;
> > > > > >>> -     name = devm_kasprintf(&plat_dev->dev, GFP_KERNEL, "dwc_rootport_%x", sbdf);
> > > > > >>> +     name = devm_kasprintf(&plat_dev->dev, GFP_KERNEL, "dwc_rootport_%d_pmu", sbdf);
> > > > > >>
> > > > > >> A new name will break previous user tools.
> > > > > > This name isn't suitable. It can't clearly show which is the PMU
> > > > > > device. Userspace tools don't have binding relationships, like perf.
> > > > > > Tools must traverse PMU devices before use.
> > > > >
> > > > > The device is under /sys/bus/event_source/ which indates it is PMU device.
> > > > > As far as I know, most of PMU devices do not endup with a '_pmu' prefix.
> > > >
> > > > The point is the name "dwc_rootport_" is misleading, suggesting an
> > > > extra PCIE RP in the system. Best to change the name to intuitive
> > > > "xx_pmu".
> > >
> > > As pointed out above, changing the name will break userspace. So it's
> > > simply not an option, sorry.
> >
> > Could you specify what in the userspace is broken and give an example?
>
> Can't I just take the documented example from dwc_pcie_pmu.rst:
>
> $# perf stat -a -e dwc_rootport_13018/Rx_PCIe_TLP_Data_Payload/
>
> If I have a script that uses that command on a machine today, then
> applying your kernel patch will break the script, no?

Well, this is just a usage guide for the PCIe PMU and has no binding
with perf. In user space, the existing PCIe PMUs in the system should
be traversed first, and then perf stat/record ... can be executed.

It's okay not to change the name, but it's better to change
dwc_rootport_%x to dwc_rootport_%d to correspond with
platform_device_register_data(NULL, "dwc_pcie_pmu", ...). It'll be
more intuitive. What do you think?

>
> Will

Thanks,
Yunhui

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ