aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/include')
-rw-r--r--arch/x86/include/asm/acpi.h1
-rw-r--r--arch/x86/include/asm/desc.h20
-rw-r--r--arch/x86/include/asm/mmu_context.h20
3 files changed, 34 insertions, 7 deletions
diff --git a/arch/x86/include/asm/acpi.h b/arch/x86/include/asm/acpi.h
index 0ab4f9fd2687..3a45668f6dc3 100644
--- a/arch/x86/include/asm/acpi.h
+++ b/arch/x86/include/asm/acpi.h
@@ -50,6 +50,7 @@ void acpi_pic_sci_set_trigger(unsigned int, u16);
50 50
51extern int (*__acpi_register_gsi)(struct device *dev, u32 gsi, 51extern int (*__acpi_register_gsi)(struct device *dev, u32 gsi,
52 int trigger, int polarity); 52 int trigger, int polarity);
53extern void (*__acpi_unregister_gsi)(u32 gsi);
53 54
54static inline void disable_acpi(void) 55static inline void disable_acpi(void)
55{ 56{
diff --git a/arch/x86/include/asm/desc.h b/arch/x86/include/asm/desc.h
index 50d033a8947d..a94b82e8f156 100644
--- a/arch/x86/include/asm/desc.h
+++ b/arch/x86/include/asm/desc.h
@@ -251,7 +251,8 @@ static inline void native_load_tls(struct thread_struct *t, unsigned int cpu)
251 gdt[GDT_ENTRY_TLS_MIN + i] = t->tls_array[i]; 251 gdt[GDT_ENTRY_TLS_MIN + i] = t->tls_array[i];
252} 252}
253 253
254#define _LDT_empty(info) \ 254/* This intentionally ignores lm, since 32-bit apps don't have that field. */
255#define LDT_empty(info) \
255 ((info)->base_addr == 0 && \ 256 ((info)->base_addr == 0 && \
256 (info)->limit == 0 && \ 257 (info)->limit == 0 && \
257 (info)->contents == 0 && \ 258 (info)->contents == 0 && \
@@ -261,11 +262,18 @@ static inline void native_load_tls(struct thread_struct *t, unsigned int cpu)
261 (info)->seg_not_present == 1 && \ 262 (info)->seg_not_present == 1 && \
262 (info)->useable == 0) 263 (info)->useable == 0)
263 264
264#ifdef CONFIG_X86_64 265/* Lots of programs expect an all-zero user_desc to mean "no segment at all". */
265#define LDT_empty(info) (_LDT_empty(info) && ((info)->lm == 0)) 266static inline bool LDT_zero(const struct user_desc *info)
266#else 267{
267#define LDT_empty(info) (_LDT_empty(info)) 268 return (info->base_addr == 0 &&
268#endif 269 info->limit == 0 &&
270 info->contents == 0 &&
271 info->read_exec_only == 0 &&
272 info->seg_32bit == 0 &&
273 info->limit_in_pages == 0 &&
274 info->seg_not_present == 0 &&
275 info->useable == 0);
276}
269 277
270static inline void clear_LDT(void) 278static inline void clear_LDT(void)
271{ 279{
diff --git a/arch/x86/include/asm/mmu_context.h b/arch/x86/include/asm/mmu_context.h
index 40269a2bf6f9..4b75d591eb5e 100644
--- a/arch/x86/include/asm/mmu_context.h
+++ b/arch/x86/include/asm/mmu_context.h
@@ -130,7 +130,25 @@ static inline void arch_bprm_mm_init(struct mm_struct *mm,
130static inline void arch_unmap(struct mm_struct *mm, struct vm_area_struct *vma, 130static inline void arch_unmap(struct mm_struct *mm, struct vm_area_struct *vma,
131 unsigned long start, unsigned long end) 131 unsigned long start, unsigned long end)
132{ 132{
133 mpx_notify_unmap(mm, vma, start, end); 133 /*
134 * mpx_notify_unmap() goes and reads a rarely-hot
135 * cacheline in the mm_struct. That can be expensive
136 * enough to be seen in profiles.
137 *
138 * The mpx_notify_unmap() call and its contents have been
139 * observed to affect munmap() performance on hardware
140 * where MPX is not present.
141 *
142 * The unlikely() optimizes for the fast case: no MPX
143 * in the CPU, or no MPX use in the process. Even if
144 * we get this wrong (in the unlikely event that MPX
145 * is widely enabled on some system) the overhead of
146 * MPX itself (reading bounds tables) is expected to
147 * overwhelm the overhead of getting this unlikely()
148 * consistently wrong.
149 */
150 if (unlikely(cpu_feature_enabled(X86_FEATURE_MPX)))
151 mpx_notify_unmap(mm, vma, start, end);
134} 152}
135 153
136#endif /* _ASM_X86_MMU_CONTEXT_H */ 154#endif /* _ASM_X86_MMU_CONTEXT_H */