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: <080c4b23-f285-0f31-5815-e4da3f157009@amd.com>
Date: Fri, 16 Jun 2023 12:01:50 -0700
From: Brett Creeley <bcreeley@....com>
To: "Tian, Kevin" <kevin.tian@...el.com>,
 Brett Creeley <brett.creeley@....com>,
 "kvm@...r.kernel.org" <kvm@...r.kernel.org>,
 "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
 "alex.williamson@...hat.com" <alex.williamson@...hat.com>,
 "jgg@...dia.com" <jgg@...dia.com>, "yishaih@...dia.com"
 <yishaih@...dia.com>,
 "shameerali.kolothum.thodi@...wei.com" <shameerali.kolothum.thodi@...wei.com>
Cc: "shannon.nelson@....com" <shannon.nelson@....com>
Subject: Re: [PATCH v10 vfio 3/7] vfio/pds: register with the pds_core PF

On 6/16/2023 12:04 AM, Tian, Kevin wrote:
> Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
> 
> 
>> From: Brett Creeley <brett.creeley@....com>
>> Sent: Saturday, June 3, 2023 6:03 AM
>>
>> +
>> +int pds_vfio_register_client_cmd(struct pds_vfio_pci_device *pds_vfio)
>> +{
>> +     struct pci_dev *pdev = pds_vfio_to_pci_dev(pds_vfio);
>> +     char devname[PDS_DEVNAME_LEN];
>> +     int ci;
>> +
>> +     snprintf(devname, sizeof(devname), "%s.%d-%u",
>> PDS_LM_DEV_NAME,
>> +              pci_domain_nr(pdev->bus), pds_vfio->pci_id);
>> +
>> +     ci = pds_client_register(pci_physfn(pdev), devname);
>> +     if (ci <= 0)
>> +             return ci;
> 
> 'ci' cannot be 0 since pds_client_register() already converts 0 into
> -EIO.

Yeah, Shameer already mentioned this and I have already fixed this issue 
for the next revision. Thanks.

> 
> btw the description of pds_client_register() is wrong. It said return
> 0 on success. should be positive client_id on success.

Yeah, this was also mentioned by Shameer. I will submit a follow on 
patch that updates the documentation in pds_client_register(). Thanks.

> 
>>
>> +struct pci_dev *pds_vfio_to_pci_dev(struct pds_vfio_pci_device *pds_vfio)
>> +{
>> +     return pds_vfio->vfio_coredev.pdev;
>> +}
> 
> Does this wrapper actually save the length?o

It wasn't so much about length but encapsulating the multiple 
de-references and multiple uses into a function call.

> 
>>
>> +     dev_dbg(&pdev->dev,
>> +             "%s: PF %#04x VF %#04x (%d) vf_id %d domain %d
>> pds_vfio %p\n",
>> +             __func__, pci_dev_id(pdev->physfn), pds_vfio->pci_id,
>> +             pds_vfio->pci_id, pds_vfio->vf_id, pci_domain_nr(pdev->bus),
>> +             pds_vfio);
> 
> why printing pds_vfio->pci_id twice?

Will fix. Thanks.

> 
>>
>> +#define PDS_LM_DEV_NAME              PDS_CORE_DRV_NAME "."
>> PDS_DEV_TYPE_LM_STR
>> +
> 
> should this name include a 'vfio' string?

This aligns with what our DSC/firmware expects, so no it's not needed.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ