From nobody Fri Jun 17 19:39:34 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 442E185C2EE; Fri, 17 Jun 2022 19:39:35 +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 4LPq9y60NCz3R3n; Fri, 17 Jun 2022 19:39:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655494775; 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=p9vmPaY19tOjhCehLoji+pkidR+K+7WZpZegGYJxxjM=; b=EIlWpnWY8zTg0iJw1FaQVMRElIrSJeM6X+dySlOAYZoCn9CwSCfx1CS2G+DODscCF3unJl 6bqgE3xBNYA8BZIJVe8PGNDmMo/CgfHyhEE7oroWBGoIT6sm4aBvWJ0OcqSNMFyIWs0zKm xii0rGd7cBnCxggXOUboJ9tkKEWv26YoNX9w79ugWzc4C7a7CQDjIfqbV1rpQSM1CIMP04 9ztMPV2sgzc20svcAmGbDYAAHiXmawPDZkugrCN7y80V916/SyfWfrMSsDcN0TKL4leRyz E0vd92216IZICBf12iyl1sTgKSB897mA4fFWQdI+wMC1yZGbV+pHUFox7QxbMw== 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 8586F25ADE; Fri, 17 Jun 2022 19:39:34 +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 25HJdY4d016190; Fri, 17 Jun 2022 19:39:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25HJdYgn016189; Fri, 17 Jun 2022 19:39:34 GMT (envelope-from git) Date: Fri, 17 Jun 2022 19:39:34 GMT Message-Id: <202206171939.25HJdYgn016189@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: b2f336bb7395 - stable/13 - linux(4): Implement sched_rr_get_interval_time64 syscall. 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: b2f336bb7395106e65e15957cab1aa7cceb40c02 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655494775; 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=p9vmPaY19tOjhCehLoji+pkidR+K+7WZpZegGYJxxjM=; b=DBR50v+SVnVo6zppI7dY4R4jmJqmTDdikODdis6XjW1VwQ7IKXK8aN7Fsvw/U2Rm133/Pn 6g5uYr/048GEhXmqf/4z0PTeAM4cb9vyxqMeTq8S4PDe2fA4eC7rjxDk1+grBtp1Dj6eew WLfVYAjv5i62wUuo+PASDykVcTN78SqKz4uewrv8BZKpj+zhehJSmzaktYpt6GCBSuUqHc lsksuzuFT11Ro2+QoU8rXmI+W3lEpaa1hG8yGrEu4q2F4x3zUypfbdoyqQSsc1lNwdWeSG CShdoDinixw1qEK6X9naYEFI/C1JqgYSKDp8pbTlXK2/GCBdNakp/y58qZm83w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1655494775; a=rsa-sha256; cv=none; b=Awdx+Am1/i18yOnDmOQEjkqhfdsWQ15nETnVIE2aLruJWIlJ4DZgse00W9Sk3o7a2WhrU3 iALOxgk909V9txEUSa6QxpdQtO15CjCT/W7Qai/+cko79kN1oBTB5BaVW+rXR6GTHLpJrl 9/awCP/vkCBmNbrR4UcycaZYbfpU7lwoJUD3AwjSv9uS498XlUTpjetLtomN9Aj88NkNjv u9rPsXLTq1VDtddS+CQKOzUSIEoEN43jhh6Ct1E6TKnN+U7XgY0CPBgnx4f4FxvEYyZ4hh k55mYwk1P8CnZV9jmiMbIvSK+4jTfyL2YkNa9GFRg2dg2DO2+ZG6zPyNdebdDg== 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=b2f336bb7395106e65e15957cab1aa7cceb40c02 commit b2f336bb7395106e65e15957cab1aa7cceb40c02 Author: Dmitry Chagin AuthorDate: 2022-05-04 10:06:47 +0000 Commit: Dmitry Chagin CommitDate: 2022-06-17 19:34:15 +0000 linux(4): Implement sched_rr_get_interval_time64 syscall. MFC after: 2 weeks (cherry picked from commit 8c84ca657bb343b73f315520ac3cabc43c5a67ec) --- sys/amd64/linux32/linux32_dummy_machdep.c | 1 - sys/compat/linux/linux_misc.c | 45 +++++++++++++++++++++++++------ sys/i386/linux/linux_dummy_machdep.c | 1 - 3 files changed, 37 insertions(+), 10 deletions(-) diff --git a/sys/amd64/linux32/linux32_dummy_machdep.c b/sys/amd64/linux32/linux32_dummy_machdep.c index fb7c88629af7..e14da5b74733 100644 --- a/sys/amd64/linux32/linux32_dummy_machdep.c +++ b/sys/amd64/linux32/linux32_dummy_machdep.c @@ -77,4 +77,3 @@ DUMMY(recvmmsg_time64); DUMMY(mq_timedsend_time64); DUMMY(mq_timedreceive_time64); DUMMY(semtimedop_time64); -DUMMY(sched_rr_get_interval_time64); diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index ff8c1b26d1d8..cdc68d64fc5b 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -2665,12 +2665,10 @@ linux_pollout(struct thread *td, struct pollfd *fds, struct pollfd *ufds, u_int return (0); } -int -linux_sched_rr_get_interval(struct thread *td, - struct linux_sched_rr_get_interval_args *uap) +static int +linux_sched_rr_get_interval_common(struct thread *td, pid_t pid, + struct timespec *ts) { - struct timespec ts; - struct l_timespec lts; struct thread *tdt; int error; @@ -2678,15 +2676,27 @@ linux_sched_rr_get_interval(struct thread *td, * According to man in case the invalid pid specified * EINVAL should be returned. */ - if (uap->pid < 0) + if (pid < 0) return (EINVAL); - tdt = linux_tdfind(td, uap->pid, -1); + tdt = linux_tdfind(td, pid, -1); if (tdt == NULL) return (ESRCH); - error = kern_sched_rr_get_interval_td(td, tdt, &ts); + error = kern_sched_rr_get_interval_td(td, tdt, ts); PROC_UNLOCK(tdt->td_proc); + return (error); +} + +int +linux_sched_rr_get_interval(struct thread *td, + struct linux_sched_rr_get_interval_args *uap) +{ + struct timespec ts; + struct l_timespec lts; + int error; + + error = linux_sched_rr_get_interval_common(td, uap->pid, &ts); if (error != 0) return (error); error = native_to_linux_timespec(<s, &ts); @@ -2695,6 +2705,25 @@ linux_sched_rr_get_interval(struct thread *td, return (copyout(<s, uap->interval, sizeof(lts))); } +#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) +int +linux_sched_rr_get_interval_time64(struct thread *td, + struct linux_sched_rr_get_interval_time64_args *uap) +{ + struct timespec ts; + struct l_timespec64 lts; + int error; + + error = linux_sched_rr_get_interval_common(td, uap->pid, &ts); + if (error != 0) + return (error); + error = native_to_linux_timespec64(<s, &ts); + if (error != 0) + return (error); + return (copyout(<s, uap->interval, sizeof(lts))); +} +#endif + /* * In case when the Linux thread is the initial thread in * the thread group thread id is equal to the process id. diff --git a/sys/i386/linux/linux_dummy_machdep.c b/sys/i386/linux/linux_dummy_machdep.c index 071f5fff6f47..cbe945e00635 100644 --- a/sys/i386/linux/linux_dummy_machdep.c +++ b/sys/i386/linux/linux_dummy_machdep.c @@ -79,4 +79,3 @@ DUMMY(recvmmsg_time64); DUMMY(mq_timedsend_time64); DUMMY(mq_timedreceive_time64); DUMMY(semtimedop_time64); -DUMMY(sched_rr_get_interval_time64);