3 * Copyright (c) 2015 Samsung Electronics Co., Ltd.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 #include <linux/linkage.h>
22 #include <asm/assembler.h>
24 .section .hyperdrive, "ax"
25 .global _start_hyperdrive
27 # Need a nop otherwise GCC keeps _start_hyperdrive label but NOT
28 # jopp_springboard_bl label.
37 #ifdef CONFIG_RKP_CFP_JOPP
40 * Load the word just before the function instructions.
41 * Halt execution if the word doesn't match the magic number placed at function
44 .macro springboard_blr, reg
45 jopp_springboard_blr_\reg:
47 ldr RRX_32, [\reg, #-4]
48 subs RRX_32, RRX_32, #0xbe7, lsl #12
53 mov RRX, #0xffffff80ffffffff
54 movk RRX, 0xf9ff, lsl #16
57 movk RRX, #0xfa5f, lsl #16
61 .inst 0xdeadc0de //crash for sure
66 //.inst 0xdeadc0de //crash for sure
69 // Only add springboards for a register rX if there exists a "BLR rX" instruction in vmlinux to instrument
101 // Don't need springboards for x31 (not allowed in RET by assembler)
104 .global _end_hyperdrive