2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-10-13 15:36:22 +09:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-04-17 14:56:44 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2008-02-26 21:55:17 +02:00
|
|
|
|
2021-11-26 22:35:45 +01:00
|
|
|
|
|
|
|
|
|
2013-06-29 13:31:24 +02:00
|
|
|
|
2018-05-28 20:27:35 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-05-30 22:48:38 +02:00
|
|
|
|
2017-08-20 10:52:22 +02:00
|
|
|
|
2007-10-18 13:54:51 -07:00
|
|
|
|
2017-08-20 10:52:22 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2020-03-26 23:31:43 +01:00
|
|
|
|
2021-06-10 11:03:31 +09:00
|
|
|
|
2020-03-26 23:31:43 +01:00
|
|
|
|
2021-06-10 11:03:31 +09:00
|
|
|
|
2020-03-26 23:31:43 +01:00
|
|
|
|
|
|
|
|
|
2021-06-10 11:03:31 +09:00
|
|
|
|
2020-03-26 23:31:43 +01:00
|
|
|
|
|
|
|
|
|
2017-08-20 10:52:22 +02:00
|
|
|
|
|
|
|
|
|
2021-12-08 11:06:52 +01:00
|
|
|
|
|
|
|
|
|
2022-03-21 22:02:01 +01:00
|
|
|
|
2021-12-08 11:06:52 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-05-02 02:24:36 +09:00
|
|
|
|
2024-02-02 10:31:42 +09:00
|
|
|
|
2022-03-21 22:02:01 +01:00
|
|
|
|
2013-05-11 19:04:09 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-02-02 10:31:42 +09:00
|
|
|
|
2007-10-18 13:54:51 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
parisc: add dynamic ftrace
This patch implements dynamic ftrace for PA-RISC. The required mcount
call sequences can get pretty long, so instead of patching the
whole call sequence out of the functions, we are using
-fpatchable-function-entry from gcc. This puts a configurable amount of
NOPS before/at the start of the function. Taking do_sys_open() as example,
which would look like this when the call is patched out:
1036b248: 08 00 02 40 nop
1036b24c: 08 00 02 40 nop
1036b250: 08 00 02 40 nop
1036b254: 08 00 02 40 nop
1036b258 <do_sys_open>:
1036b258: 08 00 02 40 nop
1036b25c: 08 03 02 41 copy r3,r1
1036b260: 6b c2 3f d9 stw rp,-14(sp)
1036b264: 08 1e 02 43 copy sp,r3
1036b268: 6f c1 01 00 stw,ma r1,80(sp)
When ftrace gets enabled for this function the kernel will patch these
NOPs to:
1036b248: 10 19 57 20 <address of ftrace>
1036b24c: 6f c1 00 80 stw,ma r1,40(sp)
1036b250: 48 21 3f d1 ldw -18(r1),r1
1036b254: e8 20 c0 02 bv,n r0(r1)
1036b258 <do_sys_open>:
1036b258: e8 3f 1f df b,l,n .-c,r1
1036b25c: 08 03 02 41 copy r3,r1
1036b260: 6b c2 3f d9 stw rp,-14(sp)
1036b264: 08 1e 02 43 copy sp,r3
1036b268: 6f c1 01 00 stw,ma r1,80(sp)
So the first NOP in do_sys_open() will be patched to jump backwards into
some minimal trampoline code which pushes a stackframe, saves r1 which
holds the return address, loads the address of the real ftrace function,
and branches to that location. For 64 Bit things are getting a bit more
complicated (and longer) because we must make sure that the address of
ftrace location is 8 byte aligned, and the offset passed to ldd for
fetching the address is 8 byte aligned as well.
Note that gcc has a bug which misplaces the function label, and needs a
patch to make dynamic ftrace work. See
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90751 for details.
Signed-off-by: Sven Schnelle <svens@stackframe.org>
Signed-off-by: Helge Deller <deller@gmx.de>
2019-06-05 22:32:22 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-09-22 20:54:50 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-10-21 22:48:34 -04:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2013-01-31 21:44:28 +00:00
|
|
|
|
2013-04-23 21:29:03 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-31 21:44:28 +00:00
|
|
|
|
2018-11-29 17:05:47 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2013-05-29 09:56:58 +00:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-10-14 22:21:35 +02:00
|
|
|
|
2020-05-10 22:43:33 +02:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2012-06-05 13:54:09 +09:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2024-03-29 21:32:10 +01:00
|
|
|
|
2023-04-17 14:56:45 +02:00
|
|
|
|
2017-08-20 10:52:22 +02:00
|
|
|
|
|
|
|
|
|
2008-12-08 09:43:08 +00:00
|
|
|
|
2007-10-18 15:09:59 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-07-06 12:07:11 +09:00
|
|
|
|
|
|
|
|
|
2007-10-20 09:31:33 -07:00
|
|
|
|
|
|
|
|
|
2013-10-18 21:18:46 +02:00
|
|
|
|
2007-10-20 09:31:33 -07:00
|
|
|
|
2007-10-18 15:09:59 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-10-20 09:31:33 -07:00
|
|
|
|
2019-07-06 12:07:11 +09:00
|
|
|
|
|
|
|
|
|
2007-10-18 15:09:59 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-10-20 09:31:33 -07:00
|
|
|
|
2007-10-18 15:09:59 -07:00
|
|
|
|
2013-10-18 21:18:46 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-04-18 07:49:19 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-08-20 10:52:22 +02:00
|
|
|
|
2013-06-29 13:31:24 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2017-08-20 10:52:22 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-29 13:31:24 +02:00
|
|
|
|
2021-12-08 11:06:52 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
kbuild: unify vdso_install rules
Currently, there is no standard implementation for vdso_install,
leading to various issues:
1. Code duplication
Many architectures duplicate similar code just for copying files
to the install destination.
Some architectures (arm, sparc, x86) create build-id symlinks,
introducing more code duplication.
2. Unintended updates of in-tree build artifacts
The vdso_install rule depends on the vdso files to install.
It may update in-tree build artifacts. This can be problematic,
as explained in commit 19514fc665ff ("arm, kbuild: make
"make install" not depend on vmlinux").
3. Broken code in some architectures
Makefile code is often copied from one architecture to another
without proper adaptation.
'make vdso_install' for parisc does not work.
'make vdso_install' for s390 installs vdso64, but not vdso32.
To address these problems, this commit introduces a generic vdso_install
rule.
Architectures that support vdso_install need to define vdso-install-y
in arch/*/Makefile. vdso-install-y lists the files to install.
For example, arch/x86/Makefile looks like this:
vdso-install-$(CONFIG_X86_64) += arch/x86/entry/vdso/vdso64.so.dbg
vdso-install-$(CONFIG_X86_X32_ABI) += arch/x86/entry/vdso/vdsox32.so.dbg
vdso-install-$(CONFIG_X86_32) += arch/x86/entry/vdso/vdso32.so.dbg
vdso-install-$(CONFIG_IA32_EMULATION) += arch/x86/entry/vdso/vdso32.so.dbg
These files will be installed to $(MODLIB)/vdso/ with the .dbg suffix,
if exists, stripped away.
vdso-install-y can optionally take the second field after the colon
separator. This is needed because some architectures install a vdso
file as a different base name.
The following is a snippet from arch/arm64/Makefile.
vdso-install-$(CONFIG_COMPAT_VDSO) += arch/arm64/kernel/vdso32/vdso.so.dbg:vdso32.so
This will rename vdso.so.dbg to vdso32.so during installation. If such
architectures change their implementation so that the base names match,
this workaround will go away.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Acked-by: Sven Schnelle <svens@linux.ibm.com> # s390
Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
Reviewed-by: Guo Ren <guoren@kernel.org>
Acked-by: Helge Deller <deller@gmx.de> # parisc
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2023-10-14 19:54:35 +09:00
|
|
|
|
|
|
|
|
|
2022-05-03 11:47:16 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2005-09-09 20:57:26 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-29 13:31:24 +02:00
|
|
|
|
2007-10-18 15:09:59 -07:00
|
|
|
|
2013-10-18 21:18:46 +02:00
|
|
|
|
2009-07-20 21:37:11 +02:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2013-10-18 21:18:46 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2018-11-19 12:04:36 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|