From nobody Fri Jun 17 19:37:48 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 5137885AB4B; Fri, 17 Jun 2022 19:37:49 +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 4LPq7w4QW5z3Pv1; Fri, 17 Jun 2022 19:37:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655494668; 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=r/HHZ3cU1fitZ8Qd1Z1OGlpPZJdP6VDvEFASzhZcPEY=; b=MY4qtQjCqmSusG18UOFWaQj9IwHRB/6WqVyBShAyTHvyAM4ZP2DLUA5LxcaY4rALPCGVMQ k36v0IAuPvaVIj8R4VMYDs/WEOKPWbr34EdCj/mfS49ewP5vhwV4dW2IBHmVyzUuhDR0Ff KpzLe7U6Iz2BkwNfgmSC4CSOwELTFsK5lDZ3bhCITjEX0MyfJT0BYkUyfwmdCnodVSXK45 WGgLgLOHjRqkekcl+rn7p2HTAkGuPuai70vHOOeOcsQzjuwpTuO3ri6QJaEdeCGDbGqoEO RbKxserwRA6YMZZBdnLtDd9UU7VLGxHPOgQHqZ2Qb2E2vvqF05xTXXqDoFITLQ== 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 6606A25A35; Fri, 17 Jun 2022 19:37:48 +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 25HJbmH0013839; Fri, 17 Jun 2022 19:37:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25HJbmqv013838; Fri, 17 Jun 2022 19:37:48 GMT (envelope-from git) Date: Fri, 17 Jun 2022 19:37:48 GMT Message-Id: <202206171937.25HJbmqv013838@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: 315b002b5304 - stable/13 - linux(4): Handle FUTEX_LOCK_PI2 oeration. 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: 315b002b530460b26f086ccdfb9b5f4205cd1808 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655494668; 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=r/HHZ3cU1fitZ8Qd1Z1OGlpPZJdP6VDvEFASzhZcPEY=; b=WpOlIb1fRGh5F5qrrKehHT2+rRho7cKyM48lpuoCH7KtKXPXTfG6CWozBQ/Fp93Jn8Hmxu YQdKCf/z95K3Un1agtoqt0NR6tCNAGxsOmOBplFHUN3vDIWZf1TJZP1BPltRegEKuwGNBM bWMsdXWKwQkHucyR4Ebg0eQbLWt7Iayx/K5RpQKAQQsYTYtGCdKMtEnrne2/PhfCyhhboM 91JQbC+bJoIkv7IyN2688vQ0q81tK/2a7j/YRNMNvBZn1HknrlMdX8ltZgJyZc8CGdpfOf 3dHuMTTy9LbUxjA50SyBJbmnHhbcNiTLPKWMla8Z2BlCwa0HZM638Yf4t+YYBw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1655494668; a=rsa-sha256; cv=none; b=PrfWrFkf/9fgy7mqaJidb6Un3aO8DYgAcFWC2s3G5G4feK2Wkn3r1KUYa9yaop/cnwtnfL bmXkMyfPl88X7nXBaWXwWPlKkiYsKVcG23a1M7KLlQb6yBYaA+1BoMg6SOTNXdKc3fpoNR spa97Rx7GYFIuHCpeF9cda+Yr6bDoXx75PydGzAF6CoLpNR3Wtj3wpET1uKcG7DO6oOqyM ADBIGGCxD+0ovWL+smIXa68MYTBypfhYnGr+xywMyaLg9FCftEdPztntMyD+ysrZJ8eTjS /UcqGdHh7ck3//qF1iyIPjltWyg5mYhmW7tHfp8pYUN1s939rN7CrxeoCj9EuQ== 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=315b002b530460b26f086ccdfb9b5f4205cd1808 commit 315b002b530460b26f086ccdfb9b5f4205cd1808 Author: Dmitry Chagin AuthorDate: 2021-07-29 09:55:02 +0000 Commit: Dmitry Chagin CommitDate: 2022-06-17 19:33:24 +0000 linux(4): Handle FUTEX_LOCK_PI2 oeration. FUTEX_LOCK_PI2 was added to support clock selection as FUTEX_LOCK_PI uses a CLOCK_REALTIME based absolute value since it was implemented, but it does not require that the FUTEX_CLOCK_REALTIME bit is set, because that was introduced later. MFC after: 2 weeks (cherry picked from commit a9bb1b1c188339ed7658103ff5843c161df08799) --- sys/compat/linux/linux_futex.c | 7 ++++++- sys/compat/linux/linux_futex.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/sys/compat/linux/linux_futex.c b/sys/compat/linux/linux_futex.c index cc3a685fb14e..fcac2eba4956 100644 --- a/sys/compat/linux/linux_futex.c +++ b/sys/compat/linux/linux_futex.c @@ -288,6 +288,9 @@ linux_futex(struct thread *td, struct linux_futex_args *args) case LINUX_FUTEX_LOCK_PI: args->clockrt = true; + /* FALLTHROUGH */ + + case LINUX_FUTEX_LOCK_PI2: LINUX_CTR2(sys_futex, "LOCKPI uaddr %p val 0x%x", args->uaddr, args->val); @@ -789,7 +792,7 @@ linux_umtx_abs_timeout_init(struct umtx_abs_timeout *timo, /* * The FUTEX_CLOCK_REALTIME option bit can be employed only with the - * FUTEX_WAIT_BITSET, FUTEX_WAIT_REQUEUE_PI. + * FUTEX_WAIT_BITSET, FUTEX_WAIT_REQUEUE_PI, FUTEX_LOCK_PI2. * For FUTEX_WAIT, timeout is interpreted as a relative value, for other * futex operations timeout is interpreted as an absolute value. * If FUTEX_CLOCK_REALTIME option bit is set, the Linux kernel measures @@ -820,6 +823,7 @@ linux_sys_futex(struct thread *td, struct linux_sys_futex_args *args) case LINUX_FUTEX_WAIT: case LINUX_FUTEX_WAIT_BITSET: case LINUX_FUTEX_LOCK_PI: + case LINUX_FUTEX_LOCK_PI2: if (args->timeout != NULL) { error = copyin(args->timeout, <s, sizeof(lts)); if (error != 0) @@ -857,6 +861,7 @@ linux_sys_futex_time64(struct thread *td, case LINUX_FUTEX_WAIT: case LINUX_FUTEX_WAIT_BITSET: case LINUX_FUTEX_LOCK_PI: + case LINUX_FUTEX_LOCK_PI2: if (args->timeout != NULL) { error = copyin(args->timeout, <s, sizeof(lts)); if (error != 0) diff --git a/sys/compat/linux/linux_futex.h b/sys/compat/linux/linux_futex.h index 4255cbdc7363..189db4e17c4f 100644 --- a/sys/compat/linux/linux_futex.h +++ b/sys/compat/linux/linux_futex.h @@ -51,6 +51,7 @@ #define LINUX_FUTEX_WAKE_BITSET 10 #define LINUX_FUTEX_WAIT_REQUEUE_PI 11 #define LINUX_FUTEX_CMP_REQUEUE_PI 12 +#define LINUX_FUTEX_LOCK_PI2 13 #define LINUX_FUTEX_PRIVATE_FLAG 128 #define LINUX_FUTEX_CLOCK_REALTIME 256