s390/kprobes: move insn_page to text segment
authorHeiko Carstens <hca@linux.ibm.com>
Fri, 18 Sep 2020 08:26:19 +0000 (10:26 +0200)
committerVasily Gorbik <gor@linux.ibm.com>
Fri, 9 Oct 2020 21:45:30 +0000 (23:45 +0200)
commitb61e1f3281c5a53f24f47849873463514f58c1b8
tree73623ca152797153f08cddc9bca78cb8f619869f
parenteefc69a09ca5b441ee136f9fb68ab5970cfc2d51
s390/kprobes: move insn_page to text segment

Move the in-kernel kprobes insn page to text segment. Rationale:
having that page in rw data segment is suboptimal, since as soon as a
kprobe is set, this will split the 1:1 kernel mapping for a single
page which get new permissions.

Note: there is always at least one kprobe present for the kretprobe
trampoline; so the mapping will always be split into smaller 4k
mappings because of this.

Moving the kprobes insn page into text segment makes sure that the
page is mapped RO/X in any case, and avoids that the 1:1 mapping is
split.

The kprobe insn_page is defined as a dummy function which is filled
with "br %r14" instructions.

Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/kernel/Makefile
arch/s390/kernel/entry.h
arch/s390/kernel/kprobes.c
arch/s390/kernel/kprobes_insn_page.S [new file with mode: 0644]