From nobody Fri Jun 17 19:37:03 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 622D685A53D; Fri, 17 Jun 2022 19:37:05 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LPq742hMwz3PDg; Fri, 17 Jun 2022 19:37:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655494624; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6vM+m/PoULMEKuJ1X+RipV2ypXKHwrRTYTb6yJt0SlI=; b=IdCJdKGck/vZDog55P07gU/Fawyf6frQ5p5Yj+qBMDFS76wmz9iTvWBVh6d9Zc8pCxPg7E d4020lE25bXXck9IXjeuq4DUm45PnxM+rGv6oyHmvTJurxT6VzsP2N+StGe02X4UsBFJnO zcH9dezupDnsHTgyzvwNCqRZiKBocF7kXH0TeHzvbd+kdC0bRHGFOIFmYw2JhXI31FcWxk dDLpsNzzAA+yW84vX44obRf9FctZb5fCFhi1BmBfhazAoHxGarvvEentRV2R9YAGc976ig tbpObgYniUKYi4y1Yt4uUvXO2eoQBCm9pib06dR1pvllMkzg8ZCnDrTyFQA4xQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F3E8725AB1; Fri, 17 Jun 2022 19:37:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 25HJb3vb012859; Fri, 17 Jun 2022 19:37:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25HJb3GN012858; Fri, 17 Jun 2022 19:37:03 GMT (envelope-from git) Date: Fri, 17 Jun 2022 19:37:03 GMT Message-Id: <202206171937.25HJb3GN012858@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: fb278faa0a02 - stable/13 - linux(4): Refactor the struct linux_futex_args. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: fb278faa0a02fe81f6e707de12bba6d23d6f0910 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655494624; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6vM+m/PoULMEKuJ1X+RipV2ypXKHwrRTYTb6yJt0SlI=; b=RH7jPcAlTPHIEgO6JnjZlHSJe30G9g9oeUHdeqkM1TRoaVdtfDcn+VcIQx9eZv1LZzhs1b /aZdDQU4P3hXVWUe2Hb5pSGPvIi8Dk47i3heN7VqvPA3KYicUyAwQkS7gZp74kI3Uvc7G5 lZI90dH4ntv5vFgbloK5Ms6xLdkhqJko6m5BViMRM9rUiz/AM6wM2meV1UiFXEJMSEt06r TZq/UeahmzmqGsmr/im9dWxD+l2cjMu/w0A22hYA/fK8EErA+RmIfdwhC8iaH9X7aQcahr dmMvhX7zGmDUrRXXocYAN12oJ6H/WQwaHESEHjyhDpsei5787OyLb4LJ1skVFA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1655494624; a=rsa-sha256; cv=none; b=Y49TqCE5jGYPZ0jnJowD033ZGmHHj3l9s08Qelzn1pPDMVaaVWLvrxZb56JZlGJKeyzGwm rHGplRfheMAL+YJSIOeuL2YoD5+GZF6m8FV672TLSqWHknRV8uWtr16iZm7FoaHhvsR1fa ql4C4FO1C5D77vJMSVrBGlJsBTiN6P3Pbb9UVzWd03cloA0SJnJBTZx/ixtht/TI5mXngC OJec67RVautB9ez1LYtv+Xmau6emWfB4KHSAisYPCWC+jb7/I2Dux76tQ0gnb1htLbBfHB 2x8U+K290xm7SqT5zi6YgUQ9TC99jRiqVyphOR9PVeqU98poWFxcjKWqDjP2rw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=fb278faa0a02fe81f6e707de12bba6d23d6f0910 commit fb278faa0a02fe81f6e707de12bba6d23d6f0910 Author: Dmitry Chagin AuthorDate: 2021-07-20 11:37:37 +0000 Commit: Dmitry Chagin CommitDate: 2022-06-17 19:33:10 +0000 linux(4): Refactor the struct linux_futex_args. Move flags and rtclock to the struct linux_futex_args. This will be used when I split linux_futex() into separate futex op functions. MFC after: 2 weeks (cherry picked from commit 1866eef48435eda506db32c88ed52605a4cb941a) --- sys/compat/linux/linux_futex.c | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/sys/compat/linux/linux_futex.c b/sys/compat/linux/linux_futex.c index d1fd7725650d..d89b9fd89f3b 100644 --- a/sys/compat/linux/linux_futex.c +++ b/sys/compat/linux/linux_futex.c @@ -228,6 +228,8 @@ static int fetch_robust_entry(struct linux_robust_list **, struct linux_futex_args { uint32_t *uaddr; int32_t op; + uint32_t flags; + bool clockrt; uint32_t val; struct timespec *ts; uint32_t *uaddr2; @@ -641,19 +643,19 @@ futex_atomic_op(struct thread *td, int encoded_op, uint32_t *uaddr) static int linux_futex(struct thread *td, struct linux_futex_args *args) { - int clockrt, nrwake, nrrequeue, op_ret, ret; + int nrwake, nrrequeue, op_ret, ret; struct linux_pemuldata *pem; struct waiting_proc *wp; struct futex *f, *f2; struct timespec kts; int error, save; - uint32_t flags, val; + uint32_t val; if (args->op & LINUX_FUTEX_PRIVATE_FLAG) { - flags = 0; + args->flags = 0; args->op &= ~LINUX_FUTEX_PRIVATE_FLAG; } else - flags = FUTEX_SHARED; + args->flags = FUTEX_SHARED; /* * Currently support for switching between CLOCK_MONOTONIC and @@ -661,9 +663,9 @@ linux_futex(struct thread *td, struct linux_futex_args *args) * FUTEX_CLOCK_REALTIME with any op except FUTEX_WAIT_BITSET and * FUTEX_WAIT_REQUEUE_PI. */ - clockrt = args->op & LINUX_FUTEX_CLOCK_REALTIME; + args->clockrt = args->op & LINUX_FUTEX_CLOCK_REALTIME; args->op = args->op & ~LINUX_FUTEX_CLOCK_REALTIME; - if (clockrt && args->op != LINUX_FUTEX_WAIT_BITSET && + if (args->clockrt && args->op != LINUX_FUTEX_WAIT_BITSET && args->op != LINUX_FUTEX_WAIT_REQUEUE_PI) { LIN_SDT_PROBE0(futex, linux_futex, unimplemented_clockswitch); @@ -685,7 +687,7 @@ linux_futex(struct thread *td, struct linux_futex_args *args) args->uaddr, args->val, args->val3); if (args->ts != NULL) { - if (clockrt) { + if (args->clockrt) { nanotime(&kts); timespecsub(args->ts, &kts, args->ts); } else if (args->op == LINUX_FUTEX_WAIT_BITSET) { @@ -696,7 +698,7 @@ linux_futex(struct thread *td, struct linux_futex_args *args) retry0: error = futex_get(args->uaddr, &wp, &f, - flags | FUTEX_CREATE_WP); + args->flags | FUTEX_CREATE_WP); if (error) return (error); @@ -737,7 +739,7 @@ retry0: args->uaddr, args->val, args->val3); error = futex_get(args->uaddr, NULL, &f, - flags | FUTEX_DONTCREATE); + args->flags | FUTEX_DONTCREATE); if (error) return (error); @@ -778,7 +780,8 @@ retry0: return (EINVAL); retry1: - error = futex_get(args->uaddr, NULL, &f, flags | FUTEX_DONTLOCK); + error = futex_get(args->uaddr, NULL, &f, + args->flags | FUTEX_DONTLOCK); if (error) return (error); @@ -790,7 +793,7 @@ retry1: * returned by FUTEX_CMP_REQUEUE. */ error = futex_get(args->uaddr2, NULL, &f2, - flags | FUTEX_DONTEXISTS | FUTEX_DONTLOCK); + args->flags | FUTEX_DONTEXISTS | FUTEX_DONTLOCK); if (error) { futex_put(f, NULL); return (error); @@ -837,11 +840,13 @@ retry1: return (EINVAL); retry2: - error = futex_get(args->uaddr, NULL, &f, flags | FUTEX_DONTLOCK); + error = futex_get(args->uaddr, NULL, &f, + args->flags | FUTEX_DONTLOCK); if (error) return (error); - error = futex_get(args->uaddr2, NULL, &f2, flags | FUTEX_DONTLOCK); + error = futex_get(args->uaddr2, NULL, &f2, + args->flags | FUTEX_DONTLOCK); if (error) { futex_put(f, NULL); return (error);