From patchwork Mon Jan 29 16:05:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaldo Carvalho de Melo X-Patchwork-Id: 193560 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp665486dyb; Mon, 29 Jan 2024 08:05:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IGUG23oqc8P26znQ49JpeYfe4IuiivDJqsC2cjvENy9ZDX3yFaG0MSRLoEG9GFmEgQF5Gxp X-Received: by 2002:a05:6a00:1ac7:b0:6dd:86c7:cf8f with SMTP id f7-20020a056a001ac700b006dd86c7cf8fmr4432751pfv.13.1706544329948; Mon, 29 Jan 2024 08:05:29 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706544329; cv=pass; d=google.com; s=arc-20160816; b=tyNelqrrwgNxUzP4G0HHhL6O+4W/5LrHjrf8b9IGcmG8zKWpQGQUT/VRE/SLrCrpMI YsQWJN+vzCcdKLpmNkIbnJTHg4T6wX8Dq/x+6SPbpyaFJ7lP9LjQ4MmdoOa8UE5NpN1z Yv6TyIJxxfCdQO7Em7vyMKQ+LTP7H96Myfe+ypwxaVBPLpbpVck04ZHQzC324WifeNag 0jdkl/pSaajMXGnStJ88njxk2Uq3+ggxmEckvxTNWgNbHHekX5z8JkzKQAkMJ26Ce77L 6OIvHUOYkwSwmXCk2aodI4tltAamp9ldHSa9ML1Z/4eXQnJrGV7nKn6KfYLkzQGFmNWf i0ZA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:subject:cc:to:from:date :dkim-signature; bh=2BQEtp4dzAByYGCY4sW92L9JysAkCYAFcjic7eNLwcU=; fh=mZANWdE8Yb09zfFGk+QCC20IBx4xAlbdA2LJsRGl1ZI=; b=OahVNFiiI45423H94i2apvtNNnDEA2XF5fyvSFT0Es9fTtAt/ARF9MN+SB8hZe9+kb 32WkGsrsAvUSUXqWQihlUZzIBGnwNF9ZwZ4bwxLNExvXvf4i5E3unRpRukI/7dEagLeP 1dxGzLkYecllCTaVPMiMQPK6HFmsbci0gd7LTrqbKeHIXRMD2QPk1neXmuq1IZG7tNn3 Ibf9MhQKAuBq27YCMYVKVyHIHDn7SfppRlhn3Lnj8RLIt5JmzRzJEbuT7o4AUlvkpJW7 QzJNMoO1W4f288Zo5b1SA1GiRJHWYX9ShGG0/n7ltM75j24MXc+eXl05pTI0OBoGLrLJ 44jQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="K82rzX/p"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-43051-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-43051-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id y6-20020a62f246000000b006dbac558730si5924327pfl.103.2024.01.29.08.05.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 08:05:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-43051-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="K82rzX/p"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-43051-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-43051-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id B3B892836A2 for ; Mon, 29 Jan 2024 16:05:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A8DA1155A2D; Mon, 29 Jan 2024 16:05:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="K82rzX/p" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 082211552FE for ; Mon, 29 Jan 2024 16:05:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706544316; cv=none; b=GCgaUiUtHNVb9HwHw9+dfyom3OPSVAmelIhtgcaTq7j6yyGvde6NW+HFS+EVJG9QPSQQ6DQjfRm/VQrzCw/4JUO7ubzkknnDEtLjZGcnXZNp1YmnMQsoiw+lqGm9ZCRBzffZ9HpIg8WKtrvWUywb6mZ59zKc1EheGSxTmM6pRd4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706544316; c=relaxed/simple; bh=u3fDGUEBpCS6+m427D+VgxX1MSplev1LxWdiYDMvUFw=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=K8/G+Oni+119EDys4kn25n4eIe7wFmZgiQarBEYaXSSfW3qwc2tmKh887XW0RWPnLxMxH1yOf0oDkojIva9Lg31wY8C2AFRfE6ym83WOZtD2sLGDoZQtL0lOWmVVtHaTkzLf5PeC1NL0sqaFvNUWRnqFWFc6dyVrRZp4xFY466Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=K82rzX/p; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id A7043C433F1; Mon, 29 Jan 2024 16:05:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706544315; bh=u3fDGUEBpCS6+m427D+VgxX1MSplev1LxWdiYDMvUFw=; h=Date:From:To:Cc:Subject:From; b=K82rzX/pMmmPA29vpdB7mRKjdRYKhbue0D9hYq8NW8+rbjTBIVggb86JQdMe0PQ52 D5UJGF+szSFbYpzHur16zLYT4p1Kyqm/mCbL0QcYTTUGhMWexX+F/UClmKJrjHuzwX PzzHyDbSsbi8l8Z92JMnUvOYHJ/Kg1zMk0qwvoVEdNC/g/wgz3xYJSn3Q3sm+ZH3tT pPzlFGyEZJAIw6+MxoZLmP3cH26rBdq3UEQjmFCi2M2WNKCAqFzpDzRpOt6apPsTqC Y0Ch+eE4gYMtUyKLIeZ3zMAaeM9ksCBV6KY04d6I0JUkJjs62ZbHog73jdgGBEO1ve /GNnb9459ekIA== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id D548F40441; Mon, 29 Jan 2024 13:05:12 -0300 (-03) Date: Mon, 29 Jan 2024 13:05:12 -0300 From: Arnaldo Carvalho de Melo To: linux-kernel@vger.kernel.org Cc: Casey Schaufler , Christian Brauner , Miklos Szeredi , Paul Moore , Adrian Hunter , Ian Rogers , Jiri Olsa , Namhyung Kim Subject: [PATCH 1/1 fyi] tools headers UAPI: Sync unistd.h to pick {list,stat}mount, lsm_{[gs]et_self_attr,list_modules} syscall numbers Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789441427207244467 X-GMAIL-MSGID: 1789441427207244467 tldr; Just FYI, I'm carrying this on the perf tools tree. - Arnaldo Full explanation: There used to be no copies, with tools/ code using kernel headers directly. From time to time tools/perf/ broke due to legitimate kernel hacking. At some point Linus complained about such direct usage. Then we adopted the current model. The way these headers are used in perf are not restricted to just including them to compile something. There are sometimes used in scripts that convert defines into string tables, etc, so some change may break one of these scripts, or new MSRs may use some different #define pattern, etc. E.g.: $ ls -1 tools/perf/trace/beauty/*.sh | head -5 tools/perf/trace/beauty/arch_errno_names.sh tools/perf/trace/beauty/drm_ioctl.sh tools/perf/trace/beauty/fadvise.sh tools/perf/trace/beauty/fsconfig.sh tools/perf/trace/beauty/fsmount.sh $ $ tools/perf/trace/beauty/fadvise.sh static const char *fadvise_advices[] = { [0] = "NORMAL", [1] = "RANDOM", [2] = "SEQUENTIAL", [3] = "WILLNEED", [4] = "DONTNEED", [5] = "NOREUSE", }; $ The tools/perf/check-headers.sh script, part of the tools/ build process, points out changes in the original files. So its important not to touch the copies in tools/ when doing changes in the original kernel headers, that will be done later, when check-headers.sh inform about the change to the perf tools hackers. --- To pick the changes in these csets: d8b0f5465012538c ("wire up syscalls for statmount/listmount") 5f42375904b08890 ("LSM: wireup Linux Security Module syscalls") Used in some architectures to create syscall tables. This addresses this perf build warning: Warning: Kernel ABI header differences: diff -u tools/include/uapi/asm-generic/unistd.h include/uapi/asm-generic/unistd.h Cc: Casey Schaufler Cc: Christian Brauner Cc: Miklos Szeredi Cc: Paul Moore Cc: Adrian Hunter Cc: Ian Rogers Cc: Jiri Olsa Cc: Namhyung Kim Link: https://lore.kernel.org/lkml/ Signed-off-by: Arnaldo Carvalho de Melo --- tools/include/uapi/asm-generic/unistd.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tools/include/uapi/asm-generic/unistd.h b/tools/include/uapi/asm-generic/unistd.h index 756b013fb8324bd7..75f00965ab1586cd 100644 --- a/tools/include/uapi/asm-generic/unistd.h +++ b/tools/include/uapi/asm-generic/unistd.h @@ -829,8 +829,21 @@ __SYSCALL(__NR_futex_wait, sys_futex_wait) #define __NR_futex_requeue 456 __SYSCALL(__NR_futex_requeue, sys_futex_requeue) +#define __NR_statmount 457 +__SYSCALL(__NR_statmount, sys_statmount) + +#define __NR_listmount 458 +__SYSCALL(__NR_listmount, sys_listmount) + +#define __NR_lsm_get_self_attr 459 +__SYSCALL(__NR_lsm_get_self_attr, sys_lsm_get_self_attr) +#define __NR_lsm_set_self_attr 460 +__SYSCALL(__NR_lsm_set_self_attr, sys_lsm_set_self_attr) +#define __NR_lsm_list_modules 461 +__SYSCALL(__NR_lsm_list_modules, sys_lsm_list_modules) + #undef __NR_syscalls -#define __NR_syscalls 457 +#define __NR_syscalls 462 /* * 32 bit systems traditionally used different