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:   Thu, 6 Jul 2017 17:05:39 +0900
From:   Michel Dänzer <michel@...nzer.net>
To:     Keith Packard <keithp@...thp.com>,
        Dave Airlie <airlied@...hat.com>,
        Daniel Vetter <daniel@...ll.ch>
Cc:     linux-kernel@...r.kernel.org, dri-devel@...ts.freedesktop.org
Subject: Re: [PATCH 1/3] drm: Widen vblank count to 64 bits. Change vblank
 time precision to ns

On 06/07/17 04:45 PM, Michel Dänzer wrote:
> On 06/07/17 07:10 AM, Keith Packard wrote:
>> This modifies the datatypes used by the vblank code to provide both 64
>> bits of vblank count and to increase the resolution of the vblank
>> timestamp from microseconds to nanoseconds.
>>
>> The driver interfaces have also been changed to return 64-bits of
>> vblank count; fortunately all of the code necessary to widen that value
>> was already included to handle devices returning fewer than 32-bits.
>>
>> This will provide the necessary datatypes for the Vulkan API.
>>
>> Signed-off-by: Keith Packard <keithp@...thp.com>
> 
> [...]
> 
>> @@ -1492,9 +1515,11 @@ int drm_wait_vblank(struct drm_device *dev, void *data,
>>  
>>  	switch (vblwait->request.type & _DRM_VBLANK_TYPES_MASK) {
>>  	case _DRM_VBLANK_RELATIVE:
>> -		vblwait->request.sequence += seq;
>> +		req_seq = seq + vblwait->request.sequence;
>>  		vblwait->request.type &= ~_DRM_VBLANK_RELATIVE;
> 
> Subtle breakage here: vblwait->request.sequence must still get updated
> for _DRM_VBLANK_RELATIVE, in case we're interrupted by a signal.

BTW, this got me thinking that we should probably treat
_DRM_VBLANK_NEXTONMISS the same way, i.e. clear the flag after updating
vblwait->request.sequence. Otherwise there could theoretically (though
unlikely) be an infinite loop:

ioctl with _DRM_VBLANK_NEXTONMISS, target missed => wait for next vblank
wait interrupted by signal
lather, rinse, repeat


I'd advise against adding a "next on miss" flag for the new ioctl until
there is specific demand for that.


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ