| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * User-space Probes (UProbes) for x86 |
|---|
| 3 | | - * |
|---|
| 4 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 5 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 6 | | - * the Free Software Foundation; either version 2 of the License, or |
|---|
| 7 | | - * (at your option) any later version. |
|---|
| 8 | | - * |
|---|
| 9 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 10 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 11 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 12 | | - * GNU General Public License for more details. |
|---|
| 13 | | - * |
|---|
| 14 | | - * You should have received a copy of the GNU General Public License |
|---|
| 15 | | - * along with this program; if not, write to the Free Software |
|---|
| 16 | | - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|---|
| 17 | 4 | * |
|---|
| 18 | 5 | * Copyright (C) IBM Corporation, 2008-2011 |
|---|
| 19 | 6 | * Authors: |
|---|
| .. | .. |
|---|
| 735 | 722 | switch (opc1) { |
|---|
| 736 | 723 | case 0xeb: /* jmp 8 */ |
|---|
| 737 | 724 | case 0xe9: /* jmp 32 */ |
|---|
| 738 | | - case 0x90: /* prefix* + nop; same as jmp with .offs = 0 */ |
|---|
| 739 | 725 | break; |
|---|
| 726 | + case 0x90: /* prefix* + nop; same as jmp with .offs = 0 */ |
|---|
| 727 | + goto setup; |
|---|
| 740 | 728 | |
|---|
| 741 | 729 | case 0xe8: /* call relative */ |
|---|
| 742 | 730 | branch_clear_offset(auprobe, insn); |
|---|
| .. | .. |
|---|
| 750 | 738 | * OPCODE1() of the "short" jmp which checks the same condition. |
|---|
| 751 | 739 | */ |
|---|
| 752 | 740 | opc1 = OPCODE2(insn) - 0x10; |
|---|
| 741 | + fallthrough; |
|---|
| 753 | 742 | default: |
|---|
| 754 | 743 | if (!is_cond_jmp_opcode(opc1)) |
|---|
| 755 | 744 | return -ENOSYS; |
|---|
| .. | .. |
|---|
| 765 | 754 | return -ENOTSUPP; |
|---|
| 766 | 755 | } |
|---|
| 767 | 756 | |
|---|
| 757 | +setup: |
|---|
| 768 | 758 | auprobe->branch.opc1 = opc1; |
|---|
| 769 | 759 | auprobe->branch.ilen = insn->length; |
|---|
| 770 | 760 | auprobe->branch.offs = insn->immediate.value; |
|---|
| .. | .. |
|---|
| 856 | 846 | |
|---|
| 857 | 847 | /** |
|---|
| 858 | 848 | * arch_uprobe_analyze_insn - instruction analysis including validity and fixups. |
|---|
| 849 | + * @auprobe: the probepoint information. |
|---|
| 859 | 850 | * @mm: the probed address space. |
|---|
| 860 | | - * @arch_uprobe: the probepoint information. |
|---|
| 861 | 851 | * @addr: virtual address at which to install the probepoint |
|---|
| 862 | 852 | * Return 0 on success or a -ve number on error. |
|---|
| 863 | 853 | */ |
|---|
| .. | .. |
|---|
| 906 | 896 | fix_ip_or_call = 0; |
|---|
| 907 | 897 | break; |
|---|
| 908 | 898 | } |
|---|
| 909 | | - /* fall through */ |
|---|
| 899 | + fallthrough; |
|---|
| 910 | 900 | default: |
|---|
| 911 | 901 | riprel_analyze(auprobe, &insn); |
|---|
| 912 | 902 | } |
|---|
| .. | .. |
|---|
| 1091 | 1081 | pr_err("return address clobbered: pid=%d, %%sp=%#lx, %%ip=%#lx\n", |
|---|
| 1092 | 1082 | current->pid, regs->sp, regs->ip); |
|---|
| 1093 | 1083 | |
|---|
| 1094 | | - force_sig(SIGSEGV, current); |
|---|
| 1084 | + force_sig(SIGSEGV); |
|---|
| 1095 | 1085 | } |
|---|
| 1096 | 1086 | |
|---|
| 1097 | 1087 | return -1; |
|---|