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: <459bc6a0-8046-e223-f88e-10e643a36dd7@linuxfoundation.org>
Date:   Wed, 28 Oct 2020 09:06:09 -0600
From:   Shuah Khan <skhan@...uxfoundation.org>
To:     "Rantala, Tommi T. (Nokia - FI/Espoo)" <tommi.t.rantala@...ia.com>,
        "shuah@...nel.org" <shuah@...nel.org>,
        "linux-kselftest@...r.kernel.org" <linux-kselftest@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Shuah Khan <skhan@...uxfoundation.org>
Subject: Re: [PATCH] selftests: intel_pstate: ftime() is deprecated

On 10/28/20 1:36 AM, Rantala, Tommi T. (Nokia - FI/Espoo) wrote:
> On Tue, 2020-10-27 at 14:08 -0600, Shuah Khan wrote:
>>
>>> @@ -73,8 +80,8 @@ int main(int argc, char **argv) {
>>>    	aperf = new_aperf-old_aperf;
>>>    	mperf = new_mperf-old_mperf;
>>>    
>>> -	start = before.time*1000 + before.millitm;
>>> -	finish = after.time*1000 + after.millitm;
>>> +	start = before.tv_sec*1000 + before.tv_nsec/1000000L;
>>> +	finish = after.tv_sec*1000 + after.tv_nsec/1000000L;
>>
>> Why not use timespec dNSEC_PER_MSEC define from  include/vdso/time64.h?
> 
> Hi,
> 
> If the define was available in the UAPI headers, then certainly would make
> sense to use it. But I would not mess with the kernel internal headers here.

Suggested the wrong file while looking up the define. I was thinking
linux/time64.h

However it isn't part of headers_install, so can't use that one.

Considering the number of places NSEC_PER_MSEC is hard coded
and defined in headers e.g: tools/include/linux/time64.h, probably
should be included in timespec block in time.h

Not something to worry about for this patch. Please add a NSEC_PER_MSEC
define for now in this file.

thanks,
-- Shuah






Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ