~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/arm/probes/kprobes/checkers-thumb.c

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /arch/arm/probes/kprobes/checkers-thumb.c (Architecture ppc) and /arch/m68k/probes/kprobes/checkers-thumb.c (Architecture m68k)


  1 // SPDX-License-Identifier: GPL-2.0-only            1 
  2 /*                                                
  3  * arch/arm/probes/kprobes/checkers-thumb.c       
  4  *                                                
  5  * Copyright (C) 2014 Huawei Inc.                 
  6  */                                               
  7                                                   
  8 #include <linux/kernel.h>                         
  9 #include "../decode.h"                            
 10 #include "../decode-thumb.h"                      
 11 #include "checkers.h"                             
 12                                                   
 13 static enum probes_insn __kprobes t32_check_st    
 14                 struct arch_probes_insn *asi,     
 15                 const struct decode_header *h)    
 16 {                                                 
 17         /*                                        
 18          * PROBES_T32_LDMSTM, PROBES_T32_LDRDS    
 19          * may get here. Simply mark all norma    
 20          */                                       
 21         static const union decode_item table[]    
 22                                                   
 23                 /*                                
 24                  * First, filter out all ldr i    
 25                  * Following load insns may co    
 26                  * LDM, LDRD, LDR.                
 27                  * In T32 encoding, bit 20 is     
 28                  * load and store. All load in    
 29                  * all store insns have this b    
 30                  */                               
 31                 DECODE_CUSTOM   (0x00100000, 0    
 32                                                   
 33                 /*                                
 34                  * Mark all 'STR{,B,H}, Rt, [R    
 35                  * if Rn or Rm is SP. T32 does    
 36                  */                               
 37                 /*                                
 38                 /* STR (register)       1111 1    
 39                 /* STRB (register)      1111 1    
 40                 /* STRH (register)      1111 1    
 41                 /* INVALID INSN         1111 1    
 42                 /* By Introducing INVALID INSN    
 43                 DECODE_OR       (0xff9f0fc0, 0    
 44                 DECODE_CUSTOM   (0xff900fcf, 0    
 45                                                   
 46                                                   
 47                 /*                                
 48                 /* STR (imm 8)          1111 1    
 49                 /* STRB (imm 8)         1111 1    
 50                 /* STRH (imm 8)         1111 1    
 51                 /* INVALID INSN         1111 1    
 52                 /* Only consider U == 0 and P     
 53                 DECODE_CUSTOM   (0xff9f0e00, 0    
 54                                                   
 55                 /* For STR{,B,H} (imm 12), off    
 56                                                   
 57                 /*                                
 58                 /* STRD (immediate)     1110 1    
 59                 /*                                
 60                  * Only consider U == 0 and P     
 61                  * Also note that STRD in T32     
 62                  * imm = ZeroExtend(imm8:'00',    
 63                  */                               
 64                 DECODE_CUSTOM   (0xffdf0000, 0    
 65                                                   
 66                 /*                                
 67                 /* STMDB                1110 1    
 68                 DECODE_CUSTOM   (0xffdf0000, 0    
 69                                                   
 70                 /* fall through */                
 71                 DECODE_CUSTOM   (0, 0, STACK_U    
 72                 DECODE_END                        
 73         };                                        
 74                                                   
 75         return probes_decode_insn(insn, asi, t    
 76 }                                                 
 77                                                   
 78 const struct decode_checker t32_stack_checker[    
 79         [PROBES_T32_LDMSTM] = {.checker = t32_    
 80         [PROBES_T32_LDRDSTRD] = {.checker = t3    
 81         [PROBES_T32_LDRSTR] = {.checker = t32_    
 82 };                                                
 83                                                   
 84 /*                                                
 85  * See following comments. This insn must be '    
 86  */                                               
 87 static enum probes_insn __kprobes t16_check_st    
 88                 struct arch_probes_insn *asi,     
 89                 const struct decode_header *h)    
 90 {                                                 
 91         unsigned int reglist = insn & 0x1ff;      
 92         asi->stack_space = hweight32(reglist)     
 93         return INSN_GOOD;                         
 94 }                                                 
 95                                                   
 96 /*                                                
 97  * T16 encoding is simple: only the 'push' ins    
 98  * Other insns, like str, can only use r0-r7 a    
 99  */                                               
100 const struct decode_checker t16_stack_checker[    
101         [PROBES_T16_PUSH] = {.checker = t16_ch    
102 };                                                
103                                                   

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php