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: <f18a97f0-a629-21c2-a772-b098262629e5@os.amperecomputing.com>
Date:   Thu, 16 Nov 2023 11:02:20 -0800 (PST)
From:   Ilkka Koskinen <ilkka@...amperecomputing.com>
To:     Shuai Xue <xueshuai@...ux.alibaba.com>
cc:     Ilkka Koskinen <ilkka@...amperecomputing.com>,
        kaishen@...ux.alibaba.com, helgaas@...nel.org,
        yangyicong@...wei.com, will@...nel.org,
        Jonathan.Cameron@...wei.com, baolin.wang@...ux.alibaba.com,
        robin.murphy@....com, chengyou@...ux.alibaba.com,
        linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-pci@...r.kernel.org, rdunlap@...radead.org,
        mark.rutland@....com, zhuo.song@...ux.alibaba.com,
        renyu.zj@...ux.alibaba.com
Subject: Re: [PATCH v10 4/5] drivers/perf: add DesignWare PCIe PMU driver



On Thu, 16 Nov 2023, Shuai Xue wrote:
> On 2023/11/16 11:50, Ilkka Koskinen wrote:
>>> +static int dwc_pcie_pmu_probe(struct platform_device *plat_dev)
>>> +{
>>> +    struct pci_dev *pdev = plat_dev->dev.platform_data;
>>> +    struct dwc_pcie_pmu *pcie_pmu;
>>> +    char *name;
>>> +    u32 bdf, val;
>>> +    u16 vsec;
>>> +    int ret;
>>> +
>>> +    vsec = pci_find_vsec_capability(pdev, PCI_VENDOR_ID_ALIBABA,
>>> +                    DWC_PCIE_VSEC_RAS_DES_ID);
>>
>> You nicely changed to use vendor list in this version but here the driver still tries to find Alibaba specific capability.
>
> Sorry, I missed here.
>
>> I guess, you could search again using the vendor list. The other option would be to make dwc_pcie_match_des_cap() to return the vendor id, pass it to dwc_pcie_register_dev(), which would add it to device's platform data with
>> the pointer to the pci device.
>
> The dwc_pcie_pmu_probe() is called by device which has DWC_PCIE_VSEC_RAS_DES_ID cap.
> So I guess I can use pdev->vendor directly here, e.g?
>
> 	pci_find_vsec_capability(pdev, pdev->vendor, DWC_PCIE_VSEC_RAS_DES_ID);


Oh, right. That seems correct.

Cheers, Ilkka

>
> Best Regards,
> Shuai
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ