From owner-svn-src-stable-12@freebsd.org Fri Apr 24 13:25:03 2020 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 46C5E2B4300; Fri, 24 Apr 2020 13:25:03 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 497vzg1731z4LJg; Fri, 24 Apr 2020 13:25:03 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 21B2A1E917; Fri, 24 Apr 2020 13:25:03 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 03ODP2rL076464; Fri, 24 Apr 2020 13:25:02 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 03ODP2jc076462; Fri, 24 Apr 2020 13:25:02 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202004241325.03ODP2jc076462@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 24 Apr 2020 13:25:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r360256 - in stable/12/sys: kern sys X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/12/sys: kern sys X-SVN-Commit-Revision: 360256 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Apr 2020 13:25:03 -0000 Author: kevans Date: Fri Apr 24 13:25:02 2020 New Revision: 360256 URL: https://svnweb.freebsd.org/changeset/base/360256 Log: MFC r360140, r360155: kqueue timer/data fixes r360140: kqueue: fix conversion of timer data to sbintime This unbreaks the i386 kqueue timer tests after a recent change switched NOTE_ABSTIME over to using microseconds. Notably, the data argument (which holds useconds) is an int64_t, but we were passing it to timer2sbintime which takes an intptr_t. Perhaps in a previous incarnation, intptr_t would have made sense, but now it just leads to the timestamp getting truncated and subsequently rejected when it no longer fits in an intptr_t. r360155: kevent32: fix the split of data into data1/data2 The current situation results in intermittent breakage if data gets split up with the sign bit set on the data1 half of it, as PAIR32TO64 will then: data1 | (data2 << 32) -> resulting in data1 getting sign-extended when it's implicitly widened and clobbering the result. AFAICT, there's no compelling reason for these to be signed. This was most exposed by flakiness in the kqueue timer tests under compat32 after the ABSTIME test got switched over to using a better clock and microseconds. Modified: stable/12/sys/kern/kern_event.c stable/12/sys/sys/event.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_event.c ============================================================================== --- stable/12/sys/kern/kern_event.c Fri Apr 24 13:24:19 2020 (r360255) +++ stable/12/sys/kern/kern_event.c Fri Apr 24 13:25:02 2020 (r360256) @@ -619,7 +619,7 @@ knote_fork(struct knlist *list, int pid) (NOTE_SECONDS | NOTE_MSECONDS | NOTE_USECONDS | NOTE_NSECONDS) static sbintime_t -timer2sbintime(intptr_t data, int flags) +timer2sbintime(int64_t data, int flags) { int64_t secs; Modified: stable/12/sys/sys/event.h ============================================================================== --- stable/12/sys/sys/event.h Fri Apr 24 13:24:19 2020 (r360255) +++ stable/12/sys/sys/event.h Fri Apr 24 13:25:02 2020 (r360256) @@ -111,7 +111,7 @@ struct kevent32 { #ifndef __amd64__ uint32_t pad0; #endif - int32_t data1, data2; + uint32_t data1, data2; uint32_t udata; /* opaque user data identifier */ #ifndef __amd64__ uint32_t pad1;