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]
Date:   Tue, 3 Mar 2020 09:36:47 -0800
From:   Jacob Keller <jacob.e.keller@...el.com>
To:     Jakub Kicinski <kuba@...nel.org>
Cc:     linux-pci@...r.kernel.org, netdev@...r.kernel.org,
        Bjorn Helgaas <bhelgaas@...gle.com>,
        David Miller <davem@...emloft.net>
Subject: Re: [PATCH v2 6/6] nfp: Use pci_get_dsn()

On 3/2/2020 7:40 PM, Jakub Kicinski wrote:
> On Mon,  2 Mar 2020 18:25:05 -0800 Jacob Keller wrote:
>> Use the newly added pci_get_dsn() function for obtaining the 64-bit
>> Device Serial Number in the nfp6000_read_serial and
>> nfp_6000_get_interface functions.
>>
>> pci_get_dsn() reports the Device Serial number as a u64 value created by
>> combining two pci_read_config_dword functions. The lower 16 bits
>> represent the device interface value, and the next 48 bits represent the
>> serial value. Use put_unaligned_be32 and put_unaligned_be16 to convert
>> the serial value portion into a Big Endian formatted serial u8 array.
>>
>> Signed-off-by: Jacob Keller <jacob.e.keller@...el.com>
>> Cc: Jakub Kicinski <kuba@...nel.org>
> 
> Reviewed-by: Jakub Kicinski <kuba@...nel.org>
> 
> Thanks!
> 
>> -	pci_read_config_dword(pdev, pos + 4, &reg);
>> -	put_unaligned_be16(reg >> 16, serial + 4);
>> -	pci_read_config_dword(pdev, pos + 8, &reg);
>> -	put_unaligned_be32(reg, serial);
>> +	put_unaligned_be32((u32)(dsn >> 32), serial);
>> +	put_unaligned_be16((u16)(dsn >> 16), serial + 4);
> 
> nit: the casts and extra brackets should be unnecessary, in case
>      you're respinning..
> 

Ah, yea because the argument will get converted properly by the
function. It's a bit of a habit since we use one of the -W warnings that
warns about implicit conversions that use truncation. I can remove them
if I need to respin.

It looks like this got picked up by one of the kbuild bots but got
applied without the main PCI patch that implemented pci_get_dsn.

Thanks,
Jake

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ