* + compiler-attributes-introduce-the-__preserve_most-function-attribute.patch added to mm-nonmm-unstable branch
@ 2023-08-02 18:04 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2023-08-02 18:04 UTC (permalink / raw)
To: mm-commits, yuzenghui, will, trix, suzuki.poulose, oliver.upton,
ojeda, ndesaulniers, nathan, maz, linux, keescook, james.morse,
glider, dvyukov, catalin.marinas, elver, akpm
The patch titled
Subject: Compiler attributes: introduce the LLVM __preserve_most function attribute
has been added to the -mm mm-nonmm-unstable branch. Its filename is
compiler-attributes-introduce-the-__preserve_most-function-attribute.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/compiler-attributes-introduce-the-__preserve_most-function-attribute.patch
This patch will later appear in the mm-nonmm-unstable branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days
------------------------------------------------------
From: Marco Elver <elver@google.com>
Subject: Compiler attributes: introduce the LLVM __preserve_most function attribute
Date: Wed, 2 Aug 2023 17:06:37 +0200
[1]: "On X86-64 and AArch64 targets, this attribute changes the calling
convention of a function. The preserve_most calling convention attempts
to make the code in the caller as unintrusive as possible. This
convention behaves identically to the C calling convention on how
arguments and return values are passed, but it uses a different set of
caller/callee-saved registers. This alleviates the burden of saving and
recovering a large register set before and after the call in the
caller."
[1] https://clang.llvm.org/docs/AttributeReference.html#preserve-most
Use of this attribute results in better code generation for calls to
very rarely called functions, such as error-reporting functions, or
rarely executed slow paths.
Introduce the attribute to compiler_attributes.h.
Link: https://lkml.kernel.org/r/20230802150712.3583252-1-elver@google.com
Signed-off-by: Marco Elver <elver@google.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: James Morse <james.morse@arm.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Marc Zyngier <maz@kernel.org>
Cc: Miguel Ojeda <ojeda@kernel.org>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Oliver Upton <oliver.upton@linux.dev>
Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
Cc: Tom Rix <trix@redhat.com>
Cc: Will Deacon <will@kernel.org>
Cc: Zenghui Yu <yuzenghui@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
include/linux/compiler_attributes.h | 11 +++++++++++
1 file changed, 11 insertions(+)
--- a/include/linux/compiler_attributes.h~compiler-attributes-introduce-the-__preserve_most-function-attribute
+++ a/include/linux/compiler_attributes.h
@@ -322,6 +322,17 @@
#endif
/*
+ * Optional: not supported by gcc.
+ *
+ * clang: https://clang.llvm.org/docs/AttributeReference.html#preserve-most
+ */
+#if __has_attribute(__preserve_most__)
+# define __preserve_most __attribute__((__preserve_most__))
+#else
+# define __preserve_most
+#endif
+
+/*
* gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-pure-function-attribute
*/
#define __pure __attribute__((__pure__))
_
Patches currently in -mm which might be from elver@google.com are
compiler-attributes-introduce-the-__preserve_most-function-attribute.patch
list_debug-introduce-inline-wrappers-for-debug-checks.patch
list_debug-introduce-config_debug_list_minimal.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-08-02 18:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-02 18:04 + compiler-attributes-introduce-the-__preserve_most-function-attribute.patch added to mm-nonmm-unstable branch Andrew Morton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.