From nobody Fri Dec 17 02:56:46 2021 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 569B018F4A65; Fri, 17 Dec 2021 02:56:47 +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 4JFYXv0QYQz4TWY; Fri, 17 Dec 2021 02:56:47 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 E3C6513D5C; Fri, 17 Dec 2021 02:56:46 +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 1BH2uk7Y074483; Fri, 17 Dec 2021 02:56:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BH2ukFv074482; Fri, 17 Dec 2021 02:56:46 GMT (envelope-from git) Date: Fri, 17 Dec 2021 02:56:46 GMT Message-Id: <202112170256.1BH2ukFv074482@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 849466665811 - main - sysent: move away from allowing all compat options for other ABIs 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: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 849466665811981d2e55201f6901d576d947a745 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1639709807; 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=l3YHjc+4D9RqKpKKjoSixT71q1hwyjHrgOIvicXLhME=; b=cDsrwN6dyvRe4ThGnHoqscyTVREg68xm3bp4/5LEPxwch/tKQCMXmNwvkFlWVex66kmIXS eC5lV/quAmnURsaOQC/mb5wmNQ1AGXWNxenUBSfgre8MYync5V1/T5n6mJgd6PVdfivhgx nXYeTsdiOvgafkOkr0FF6xunzhFRI/GnPuULDzFcc+e/Fv875LuV7KJ7JAiH64ELFbTEmD NnjT1V0ZGKsTUiE824YdzogMmbcZMavQr/ggeN33vv6Z6as3Ojsyrb+WIWUM5Un/+ofb7j rrqEk5tsqSwPvtB+iRXPjz72uv9ATTuB8wyC3htoJfurUdlKCG2GoLfPObWUlw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1639709807; a=rsa-sha256; cv=none; b=D5uh7J4NB2h8Nykly42wGNTnVqwYVnmTr0G5JVWr0GSJSBCqY09K6Z3CwlnvPClUPlxqZU ebyP1stPZX1M460PKzJ301crzMjKo50AECc7/dxpJ+MWrMVQQrBm9/PC5sH0T8eswrFNLx c2TvWQCbnqR0iamoWdyuvGDEXtfjp6dF1oRvXmxKW1v8VcuC+g0Whit7NWfXPo2eyFUbc7 EdN5eUe2+m7XEnIaXDP90RybQnvIb6bJLxW+Oej+41VNoiT728ErPOKhfq79qOqMGvKd0j HIHRERTsDrq9tOTEPwhNBlHPFayQESq0Pxz5eWkNDzKLax3HJYhu4NDEhuEpzw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=849466665811981d2e55201f6901d576d947a745 commit 849466665811981d2e55201f6901d576d947a745 Author: Kyle Evans AuthorDate: 2021-12-09 04:37:28 +0000 Commit: Kyle Evans CommitDate: 2021-12-17 02:56:28 +0000 sysent: move away from allowing all compat options for other ABIs Notably, the current compat_options only makes sense for native and freebsd32 ABIs. For the others, it just adds cruft. Switch to having sets of compat options, and default to the native set. Setup the other ABIs where it doesn't make sense to opt-out of the native set. This removes some redundant COMPAT_FREEBSD* stuff from Linuxolator bits. line_expr in makesyscalls.lua is fixed to allow empty strings to be specified, since they're harmless. Reviewed by: brooks, kib (both earlier version) Differential Revision: https://reviews.freebsd.org/D33356 --- sys/amd64/linux/syscalls.conf | 1 + sys/amd64/linux32/syscalls.conf | 1 + sys/arm64/linux/syscalls.conf | 1 + sys/i386/linux/syscalls.conf | 1 + sys/tools/makesyscalls.lua | 49 +++++++++++++++++++++++++++-------------- 5 files changed, 37 insertions(+), 16 deletions(-) diff --git a/sys/amd64/linux/syscalls.conf b/sys/amd64/linux/syscalls.conf index 29f37920bba6..a47f80444c2a 100644 --- a/sys/amd64/linux/syscalls.conf +++ b/sys/amd64/linux/syscalls.conf @@ -9,3 +9,4 @@ syscallprefix="LINUX_SYS_" switchname="linux_sysent" namesname="linux_syscallnames" systrace="linux_systrace_args.c" +compat_set="" diff --git a/sys/amd64/linux32/syscalls.conf b/sys/amd64/linux32/syscalls.conf index 7d096b5a9c64..ce9a437e82e3 100644 --- a/sys/amd64/linux32/syscalls.conf +++ b/sys/amd64/linux32/syscalls.conf @@ -9,3 +9,4 @@ syscallprefix="LINUX32_SYS_" switchname="linux32_sysent" namesname="linux32_syscallnames" systrace="linux32_systrace_args.c" +compat_set="" diff --git a/sys/arm64/linux/syscalls.conf b/sys/arm64/linux/syscalls.conf index 29f37920bba6..a47f80444c2a 100644 --- a/sys/arm64/linux/syscalls.conf +++ b/sys/arm64/linux/syscalls.conf @@ -9,3 +9,4 @@ syscallprefix="LINUX_SYS_" switchname="linux_sysent" namesname="linux_syscallnames" systrace="linux_systrace_args.c" +compat_set="" diff --git a/sys/i386/linux/syscalls.conf b/sys/i386/linux/syscalls.conf index 29f37920bba6..a47f80444c2a 100644 --- a/sys/i386/linux/syscalls.conf +++ b/sys/i386/linux/syscalls.conf @@ -9,3 +9,4 @@ syscallprefix="LINUX_SYS_" switchname="linux_sysent" namesname="linux_syscallnames" systrace="linux_systrace_args.c" +compat_set="" diff --git a/sys/tools/makesyscalls.lua b/sys/tools/makesyscalls.lua index 452924f1eb21..178869d03b0e 100644 --- a/sys/tools/makesyscalls.lua +++ b/sys/tools/makesyscalls.lua @@ -56,6 +56,7 @@ local config = { systrace = "systrace_args.c", capabilities_conf = "capabilities.conf", capenabled = {}, + compat_set = "native", mincompat = 0, abi_type_suffix = "", abi_flags = "", @@ -201,7 +202,7 @@ local known_flags = { -- Compat flags start from here. We have plenty of space. } --- All compat_options entries should have five entries: +-- All compat option entries should have five entries: -- definition: The preprocessor macro that will be set for this -- compatlevel: The level this compatibility should be included at. This -- generally represents the version of FreeBSD that it is compatible @@ -212,23 +213,28 @@ local known_flags = { -- used as-is, without "_" or any other character appended. -- descr: The description of this compat option in init_sysent.c comments. -- The special "stdcompat" entry will cause the other five to be autogenerated. -local compat_options = { - { - definition = "COMPAT_43", - compatlevel = 3, - flag = "COMPAT", - prefix = "o", - descr = "old", +local compat_option_sets = { + native = { + { + definition = "COMPAT_43", + compatlevel = 3, + flag = "COMPAT", + prefix = "o", + descr = "old", + }, + { stdcompat = "FREEBSD4" }, + { stdcompat = "FREEBSD6" }, + { stdcompat = "FREEBSD7" }, + { stdcompat = "FREEBSD10" }, + { stdcompat = "FREEBSD11" }, + { stdcompat = "FREEBSD12" }, + { stdcompat = "FREEBSD13" }, }, - { stdcompat = "FREEBSD4" }, - { stdcompat = "FREEBSD6" }, - { stdcompat = "FREEBSD7" }, - { stdcompat = "FREEBSD10" }, - { stdcompat = "FREEBSD11" }, - { stdcompat = "FREEBSD12" }, - { stdcompat = "FREEBSD13" }, } +-- compat_options will be resolved to a set from the configuration. +local compat_options + local function trim(s, char) if s == nil then return nil @@ -250,7 +256,7 @@ local function process_config(file) -- Alternatively, we could drop the whitespace and instead try to -- use a pattern to strip out the meaty part of the line, but then we -- would need to sanitize the line for potentially special characters. - local line_expr = "^([%w%p]+%s*)=(%s*[`\"]?[^\"`]+[`\"]?)" + local line_expr = "^([%w%p]+%s*)=(%s*[`\"]?[^\"`]*[`\"]?)" if not file then return nil, "No file given" @@ -1336,6 +1342,17 @@ if configfile ~= nil then end end +local compat_set = config['compat_set'] +if compat_set ~= "" then + if not compat_option_sets[compat_set] then + abort(1, "Undefined compat set: " .. compat_set) + end + + compat_options = compat_option_sets[compat_set] +else + compat_options = {} +end + -- We ignore errors here if we're relying on the default configuration. if not config_modified["capenabled"] then config["capenabled"] = grab_capenabled(config['capabilities_conf'],