diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-10-23 08:08:53 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-10-23 08:08:53 -0400 |
| commit | 0200fbdd431519d730b5d399a12840ec832b27cc (patch) | |
| tree | 2b58f9e24b61b00e0550f106c95bfabc3b52cfdd /arch/x86/include/asm/asm.h | |
| parent | de3fbb2aa802a267dee2213ae7d5a1e19eb4294a (diff) | |
| parent | 01a14bda11add9dcd4a59200f13834d634559935 (diff) | |
Merge branch 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull locking and misc x86 updates from Ingo Molnar:
"Lots of changes in this cycle - in part because locking/core attracted
a number of related x86 low level work which was easier to handle in a
single tree:
- Linux Kernel Memory Consistency Model updates (Alan Stern, Paul E.
McKenney, Andrea Parri)
- lockdep scalability improvements and micro-optimizations (Waiman
Long)
- rwsem improvements (Waiman Long)
- spinlock micro-optimization (Matthew Wilcox)
- qspinlocks: Provide a liveness guarantee (more fairness) on x86.
(Peter Zijlstra)
- Add support for relative references in jump tables on arm64, x86
and s390 to optimize jump labels (Ard Biesheuvel, Heiko Carstens)
- Be a lot less permissive on weird (kernel address) uaccess faults
on x86: BUG() when uaccess helpers fault on kernel addresses (Jann
Horn)
- macrofy x86 asm statements to un-confuse the GCC inliner. (Nadav
Amit)
- ... and a handful of other smaller changes as well"
* 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (57 commits)
locking/lockdep: Make global debug_locks* variables read-mostly
locking/lockdep: Fix debug_locks off performance problem
locking/pvqspinlock: Extend node size when pvqspinlock is configured
locking/qspinlock_stat: Count instances of nested lock slowpaths
locking/qspinlock, x86: Provide liveness guarantee
x86/asm: 'Simplify' GEN_*_RMWcc() macros
locking/qspinlock: Rework some comments
locking/qspinlock: Re-order code
locking/lockdep: Remove duplicated 'lock_class_ops' percpu array
x86/defconfig: Enable CONFIG_USB_XHCI_HCD=y
futex: Replace spin_is_locked() with lockdep
locking/lockdep: Make class->ops a percpu counter and move it under CONFIG_DEBUG_LOCKDEP=y
x86/jump-labels: Macrofy inline assembly code to work around GCC inlining bugs
x86/cpufeature: Macrofy inline assembly code to work around GCC inlining bugs
x86/extable: Macrofy inline assembly code to work around GCC inlining bugs
x86/paravirt: Work around GCC inlining bugs when compiling paravirt ops
x86/bug: Macrofy the BUG table section handling, to work around GCC inlining bugs
x86/alternatives: Macrofy lock prefixes to work around GCC inlining bugs
x86/refcount: Work around GCC inlining bug
x86/objtool: Use asm macros to work around GCC inlining bugs
...
Diffstat (limited to 'arch/x86/include/asm/asm.h')
| -rw-r--r-- | arch/x86/include/asm/asm.h | 57 |
1 files changed, 25 insertions, 32 deletions
diff --git a/arch/x86/include/asm/asm.h b/arch/x86/include/asm/asm.h index 990770f9e76b..21b086786404 100644 --- a/arch/x86/include/asm/asm.h +++ b/arch/x86/include/asm/asm.h | |||
| @@ -120,16 +120,32 @@ | |||
| 120 | /* Exception table entry */ | 120 | /* Exception table entry */ |
| 121 | #ifdef __ASSEMBLY__ | 121 | #ifdef __ASSEMBLY__ |
| 122 | # define _ASM_EXTABLE_HANDLE(from, to, handler) \ | 122 | # define _ASM_EXTABLE_HANDLE(from, to, handler) \ |
| 123 | .pushsection "__ex_table","a" ; \ | 123 | ASM_EXTABLE_HANDLE from to handler |
| 124 | .balign 4 ; \ | 124 | |
| 125 | .long (from) - . ; \ | 125 | .macro ASM_EXTABLE_HANDLE from:req to:req handler:req |
| 126 | .long (to) - . ; \ | 126 | .pushsection "__ex_table","a" |
| 127 | .long (handler) - . ; \ | 127 | .balign 4 |
| 128 | .long (\from) - . | ||
| 129 | .long (\to) - . | ||
| 130 | .long (\handler) - . | ||
| 128 | .popsection | 131 | .popsection |
| 132 | .endm | ||
| 133 | #else /* __ASSEMBLY__ */ | ||
| 134 | |||
| 135 | # define _ASM_EXTABLE_HANDLE(from, to, handler) \ | ||
| 136 | "ASM_EXTABLE_HANDLE from=" #from " to=" #to \ | ||
| 137 | " handler=\"" #handler "\"\n\t" | ||
| 138 | |||
| 139 | /* For C file, we already have NOKPROBE_SYMBOL macro */ | ||
| 140 | |||
| 141 | #endif /* __ASSEMBLY__ */ | ||
| 129 | 142 | ||
| 130 | # define _ASM_EXTABLE(from, to) \ | 143 | # define _ASM_EXTABLE(from, to) \ |
| 131 | _ASM_EXTABLE_HANDLE(from, to, ex_handler_default) | 144 | _ASM_EXTABLE_HANDLE(from, to, ex_handler_default) |
| 132 | 145 | ||
| 146 | # define _ASM_EXTABLE_UA(from, to) \ | ||
| 147 | _ASM_EXTABLE_HANDLE(from, to, ex_handler_uaccess) | ||
| 148 | |||
| 133 | # define _ASM_EXTABLE_FAULT(from, to) \ | 149 | # define _ASM_EXTABLE_FAULT(from, to) \ |
| 134 | _ASM_EXTABLE_HANDLE(from, to, ex_handler_fault) | 150 | _ASM_EXTABLE_HANDLE(from, to, ex_handler_fault) |
| 135 | 151 | ||
| @@ -145,6 +161,7 @@ | |||
| 145 | _ASM_PTR (entry); \ | 161 | _ASM_PTR (entry); \ |
| 146 | .popsection | 162 | .popsection |
| 147 | 163 | ||
| 164 | #ifdef __ASSEMBLY__ | ||
| 148 | .macro ALIGN_DESTINATION | 165 | .macro ALIGN_DESTINATION |
| 149 | /* check for bad alignment of destination */ | 166 | /* check for bad alignment of destination */ |
| 150 | movl %edi,%ecx | 167 | movl %edi,%ecx |
| @@ -165,34 +182,10 @@ | |||
| 165 | jmp copy_user_handle_tail | 182 | jmp copy_user_handle_tail |
| 166 | .previous | 183 | .previous |
| 167 | 184 | ||
| 168 | _ASM_EXTABLE(100b,103b) | 185 | _ASM_EXTABLE_UA(100b, 103b) |
| 169 | _ASM_EXTABLE(101b,103b) | 186 | _ASM_EXTABLE_UA(101b, 103b) |
| 170 | .endm | 187 | .endm |
| 171 | 188 | #endif /* __ASSEMBLY__ */ | |
| 172 | #else | ||
| 173 | # define _EXPAND_EXTABLE_HANDLE(x) #x | ||
| 174 | # define _ASM_EXTABLE_HANDLE(from, to, handler) \ | ||
| 175 | " .pushsection \"__ex_table\",\"a\"\n" \ | ||
| 176 | " .balign 4\n" \ | ||
| 177 | " .long (" #from ") - .\n" \ | ||
| 178 | " .long (" #to ") - .\n" \ | ||
| 179 | " .long (" _EXPAND_EXTABLE_HANDLE(handler) ") - .\n" \ | ||
| 180 | " .popsection\n" | ||
| 181 | |||
| 182 | # define _ASM_EXTABLE(from, to) \ | ||
| 183 | _ASM_EXTABLE_HANDLE(from, to, ex_handler_default) | ||
| 184 | |||
| 185 | # define _ASM_EXTABLE_FAULT(from, to) \ | ||
| 186 | _ASM_EXTABLE_HANDLE(from, to, ex_handler_fault) | ||
| 187 | |||
| 188 | # define _ASM_EXTABLE_EX(from, to) \ | ||
| 189 | _ASM_EXTABLE_HANDLE(from, to, ex_handler_ext) | ||
| 190 | |||
| 191 | # define _ASM_EXTABLE_REFCOUNT(from, to) \ | ||
| 192 | _ASM_EXTABLE_HANDLE(from, to, ex_handler_refcount) | ||
| 193 | |||
| 194 | /* For C file, we already have NOKPROBE_SYMBOL macro */ | ||
| 195 | #endif | ||
| 196 | 189 | ||
| 197 | #ifndef __ASSEMBLY__ | 190 | #ifndef __ASSEMBLY__ |
| 198 | /* | 191 | /* |
