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

TOMOYO Linux Cross Reference
Linux/Documentation/arch/x86/buslock.rst

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ 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.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /Documentation/arch/x86/buslock.rst (Architecture alpha) and /Documentation/arch/i386/buslock.rst (Architecture i386)


  1 .. SPDX-License-Identifier: GPL-2.0               
  2                                                   
  3 .. include:: <isonum.txt>                         
  4                                                   
  5 ===============================                   
  6 Bus lock detection and handling                   
  7 ===============================                   
  8                                                   
  9 :Copyright: |copy| 2021 Intel Corporation         
 10 :Authors: - Fenghua Yu <fenghua.yu@intel.com>      
 11           - Tony Luck <tony.luck@intel.com>        
 12                                                   
 13 Problem                                           
 14 =======                                           
 15                                                   
 16 A split lock is any atomic operation whose ope    
 17 Since the operand spans two cache lines and th    
 18 the system locks the bus while the CPU accesse    
 19                                                   
 20 A bus lock is acquired through either split lo    
 21 memory or any locked access to non-WB memory.     
 22 cycles slower than an atomic operation within     
 23 performance on other cores and brings the whol    
 24                                                   
 25 Detection                                         
 26 =========                                         
 27                                                   
 28 Intel processors may support either or both of    
 29 mechanisms to detect split locks and bus locks    
 30                                                   
 31 #AC exception for split lock detection            
 32 --------------------------------------            
 33                                                   
 34 Beginning with the Tremont Atom CPU split lock    
 35 Alignment Check (#AC) exception when a split l    
 36                                                   
 37 #DB exception for bus lock detection              
 38 ------------------------------------              
 39                                                   
 40 Some CPUs have the ability to notify the kerne    
 41 instruction acquires a bus lock and is execute    
 42 terminate the application or to enforce thrott    
 43                                                   
 44 Software handling                                 
 45 =================                                 
 46                                                   
 47 The kernel #AC and #DB handlers handle bus loc    
 48 parameter "split_lock_detect". Here is a summa    
 49                                                   
 50 +------------------+--------------------------    
 51 |split_lock_detect=|#AC for split lock            
 52 +------------------+--------------------------    
 53 |off               |Do nothing                    
 54 +------------------+--------------------------    
 55 |warn              |Kernel OOPs                   
 56 |(default)         |Warn once per task, add a     
 57 |                  |delay, add synchronization    
 58 |                  |to prevent more than one      
 59 |                  |core from executing a         
 60 |                  |split lock in parallel.       
 61 |                  |sysctl split_lock_mitigate    
 62 |                  |can be used to avoid the      
 63 |                  |delay and synchronization     
 64 |                  |When both features are        
 65 |                  |supported, warn in #AC        
 66 +------------------+--------------------------    
 67 |fatal             |Kernel OOPs                   
 68 |                  |Send SIGBUS to user           
 69 |                  |When both features are        
 70 |                  |supported, fatal in #AC       
 71 +------------------+--------------------------    
 72 |ratelimit:N       |Do nothing                    
 73 |(0 < N <= 1000)   |                              
 74 |                  |                              
 75 |                  |                              
 76 +------------------+--------------------------    
 77                                                   
 78 Usages                                            
 79 ======                                            
 80                                                   
 81 Detecting and handling bus lock may find usage    
 82                                                   
 83 It is critical for real time system designers     
 84 time systems. These systems run hard real time    
 85 "untrusted" user processes on other cores. The    
 86 to have any bus lock from the untrusted proces    
 87 performance. To date the designers have been u    
 88 solutions as they have no way to prevent the "    
 89 generating split lock and bus lock to block th    
 90 access memory during bus locking.                 
 91                                                   
 92 It's also useful for general computing to prev    
 93 applications from slowing down the overall sys    
 94 with bus lock.                                    
 95                                                   
 96                                                   
 97 Guidance                                          
 98 ========                                          
 99 off                                               
100 ---                                               
101                                                   
102 Disable checking for split lock and bus lock.     
103 there are legacy applications that trigger the    
104 that mitigation is not needed.                    
105                                                   
106 warn                                              
107 ----                                              
108                                                   
109 A warning is emitted when a bus lock is detect    
110 the offending application. This is the default    
111                                                   
112 fatal                                             
113 -----                                             
114                                                   
115 In this case, the bus lock is not tolerated an    
116                                                   
117 ratelimit                                         
118 ---------                                         
119                                                   
120 A system wide bus lock rate limit N is specifi    
121 allows a bus lock rate up to N bus locks per s    
122 is exceeded then any task which is caught via     
123 throttled by enforced sleeps until the rate go    
124                                                   
125 This is an effective mitigation in cases where    
126 tolerated, but an eventual Denial of Service a    
127 allows to identify the offending processes and    
128 malicious or just badly written.                  
129                                                   
130 Selecting a rate limit of 1000 allows the bus     
131 seven million cycles each second (assuming 700    
132 lock). On a 2 GHz processor that would be abou    
                                                      

~ [ 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