From nobody Thu Jun 29 08:20:12 2023 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 4QsBG508DTz4knWT; Thu, 29 Jun 2023 08:20:13 +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 4QsBG441lhz3tQ7; Thu, 29 Jun 2023 08:20:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1688026812; 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=VPNNEWNLkQdjkA1j+GjQkY8Bjom6XTMMLxIKS9OfrFE=; b=cZHpzgrBYZXGaJe+W/fDNmiwusWDtbLFu7J2VUFgd2lfuBVDfd1ZvA7VseJvno1Kx1TCnn EveTrkvO28zna8xZeaej94RFFa0+yCqBVylXxSgbU9x/0T7eH3I/uXYNiK5r5zv5l8xqNP GJigTLc0+93Z7BE82wXdMLkD3fBjxUXb9LvuflN2ZJEPha9arW0HSoGum8rwGXv/LqXOjH 7veOEP1I87cDzYSqZeoVHbKJhnRlGKAH88TBGKIZgkWkuwXCjx4xh/36NEjlK3bcK6ylRp 3uaIRBO8oJTPgyrj1i5CqyN9NoXA4F8bav5vS5RNqWcfGhzbdHJpH6eQRko2Ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1688026812; 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=VPNNEWNLkQdjkA1j+GjQkY8Bjom6XTMMLxIKS9OfrFE=; b=EgtNfy+XF8d9aElOD9MJXmRdaltyGktPgvhFrkwlCB1uVZUYk9Q5rlOTiwjtEYE76V5dIn dan2Xufn/tqM1R3XebGPbGFEnWrlptk23ixWjI3Yz5mDdXUdM+/BW/2iMKYj9TxSP8rhA3 0h/xWhWlfuMmuleH90Lwk6kr/4wfdTx906vRr3GPv2JdnfmxscBE5ivrY+G+ruiTFFxaCI 6ni8W/LNFsuYZPQIwCF8uRxZZDwgan3kbrj5k13FEZIikBCJbEUFGxDoqCzPyCX6A+l3/A +Cwre4lBltLcpwZ6oW4bpB+jYAC020GLmiaTxrknweY3/7j6FVm5l8Jdz6xLRw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1688026812; a=rsa-sha256; cv=none; b=eEJv29cYSRB3yATxEgENmw4c8tDUCzIBCdtfyBPM6vQZ9TEHCCjKtnUkrI9NF/mCAj/4VD bzfLGHLGjltVkMbMKMqItdvTG1G6NPcrAoP88oH9xPOwvbH/OXoCNIRJ6ykIyBuIL7FCM3 TSgYGJ2lzgV12fySjzzqMk/o1yFEXqRf9wUDACwXOccslP2HupaPes6/fQA59I7rTzuwJn So1uvAx2dPrYWFYGdjbM3Z+/dfPdmgRUlMqKsImage7X2EdNO7o4lx4LYgiKsf+cLcVW6L bJadR1V0fKh2q4b0s+265YW8xS1U58uoOYV0w/YS1FUzKrmz5DYFiVhYBuh91w== 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 4QsBG437dFz17db; Thu, 29 Jun 2023 08:20:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 35T8KCjf080326; Thu, 29 Jun 2023 08:20:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 35T8KCjH080320; Thu, 29 Jun 2023 08:20:12 GMT (envelope-from git) Date: Thu, 29 Jun 2023 08:20:12 GMT Message-Id: <202306290820.35T8KCjH080320@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: 2c7aac44f5ab - stable/13 - linux(4): Use inlined LINUX_KERNVER for tests to improve readability 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: 2c7aac44f5abd751465d5bf854a9ef0f104c5ee0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=2c7aac44f5abd751465d5bf854a9ef0f104c5ee0 commit 2c7aac44f5abd751465d5bf854a9ef0f104c5ee0 Author: Dmitry Chagin AuthorDate: 2023-04-26 13:57:30 +0000 Commit: Dmitry Chagin CommitDate: 2023-06-29 08:15:28 +0000 linux(4): Use inlined LINUX_KERNVER for tests to improve readability MFC after: 1 month (cherry picked from commit e185d83fc48ba0f28896a986104c02203005b533) --- sys/compat/linux/linux_elf.c | 2 +- sys/compat/linux/linux_mib.h | 6 ------ sys/compat/linux/linux_misc.c | 4 ++-- sys/compat/linux/linux_signal.c | 2 +- 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/sys/compat/linux/linux_elf.c b/sys/compat/linux/linux_elf.c index 1af861122f81..06a384325d14 100644 --- a/sys/compat/linux/linux_elf.c +++ b/sys/compat/linux/linux_elf.c @@ -513,7 +513,7 @@ __linuxN(copyout_auxargs)(struct image_params *imgp, uintptr_t base) * is not present. * Also see linux_times() implementation. */ - if (linux_kernver(curthread) >= LINUX_KERNVER_2004000) + if (linux_kernver(td) >= LINUX_KERNVER(2,4,0)) AUXARGS_ENTRY(pos, LINUX_AT_CLKTCK, stclohz); AUXARGS_ENTRY(pos, AT_PAGESZ, args->pagesz); AUXARGS_ENTRY(pos, AT_PHDR, args->phdr); diff --git a/sys/compat/linux/linux_mib.h b/sys/compat/linux/linux_mib.h index 7022d811959b..5902f523dfee 100644 --- a/sys/compat/linux/linux_mib.h +++ b/sys/compat/linux/linux_mib.h @@ -57,12 +57,6 @@ int linux_kernver(struct thread *td); #define LINUX_XKERNVERSTR(x) LINUX_KERNVERSTR(x) #define LINUX_VERSION_STR LINUX_XKERNVERSTR(LINUX_KVERSION.LINUX_KPATCHLEVEL.LINUX_KSUBLEVEL) -#define LINUX_KERNVER_2004000 LINUX_KERNVER(2,4,0) -#define LINUX_KERNVER_2006039 LINUX_KERNVER(2,6,39) -#define LINUX_KERNVER_5004000 LINUX_KERNVER(5,4,0) - -#define linux_use54(t) (linux_kernver(t) >= LINUX_KERNVER_5004000) - extern int linux_debug; extern int linux_default_openfiles; extern int linux_default_stacksize; diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index bc62c6b24d2c..ba0ac190a946 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -384,7 +384,7 @@ struct l_times_argv { #define CONVOTCK(r) (r.tv_sec * CLK_TCK + r.tv_usec / (1000000 / CLK_TCK)) #define CONVNTCK(r) (r.tv_sec * stclohz + r.tv_usec / (1000000 / stclohz)) -#define CONVTCK(r) (linux_kernver(td) >= LINUX_KERNVER_2004000 ? \ +#define CONVTCK(r) (linux_kernver(td) >= LINUX_KERNVER(2,4,0) ? \ CONVNTCK(r) : CONVOTCK(r)) int @@ -850,7 +850,7 @@ linux_waitid(struct thread *td, struct linux_waitid_args *args) idtype = P_PID; break; case LINUX_P_PGID: - if (linux_use54(td) && args->id == 0) { + if (linux_kernver(td) >= LINUX_KERNVER(5,4,0) && args->id == 0) { p = td->td_proc; PROC_LOCK(p); id = p->p_pgid; diff --git a/sys/compat/linux/linux_signal.c b/sys/compat/linux/linux_signal.c index 5a3cb97c385f..89f0f38d7b6c 100644 --- a/sys/compat/linux/linux_signal.c +++ b/sys/compat/linux/linux_signal.c @@ -776,7 +776,7 @@ lsiginfo_to_siginfo(struct thread *td, const l_siginfo_t *lsi, switch (lsi->lsi_code) { case LINUX_SI_TKILL: - if (linux_kernver(td) >= LINUX_KERNVER_2006039) { + if (linux_kernver(td) >= LINUX_KERNVER(2,6,39)) { linux_msg(td, "SI_TKILL forbidden since 2.6.39"); return (EPERM); }