Skip to content

Commit 45fc24e

Browse files
hansendcdavehansenintel
authored andcommitted
x86/mpx: remove MPX from arch/x86
From: Dave Hansen <dave.hansen@linux.intel.com> MPX is being removed from the kernel due to a lack of support in the toolchain going forward (gcc). This removes all the remaining (dead at this point) MPX handling code remaining in the tree. The only remaining code is the XSAVE support for MPX state which is currently needd for KVM to handle VMs which might use MPX. Cc: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Andy Lutomirski <luto@kernel.org> Cc: x86@kernel.org Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
1 parent 42222ea commit 45fc24e

15 files changed

Lines changed: 1 addition & 1567 deletions

File tree

‎Documentation/x86/intel_mpx.rst‎

Lines changed: 0 additions & 252 deletions
This file was deleted.

‎arch/x86/include/asm/bugs.h‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@
66

77
extern void check_bugs(void);
88

9-
#if defined(CONFIG_CPU_SUP_INTEL)
10-
void check_mpx_erratum(struct cpuinfo_x86 *c);
11-
#else
12-
static inline void check_mpx_erratum(struct cpuinfo_x86 *c) {}
13-
#endif
14-
159
#if defined(CONFIG_CPU_SUP_INTEL) && defined(CONFIG_X86_32)
1610
int ppro_with_ram_bug(void);
1711
#else

‎arch/x86/include/asm/disabled-features.h‎

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,6 @@
1010
* cpu_feature_enabled().
1111
*/
1212

13-
#ifdef CONFIG_X86_INTEL_MPX
14-
# define DISABLE_MPX 0
15-
#else
16-
# define DISABLE_MPX (1<<(X86_FEATURE_MPX & 31))
17-
#endif
18-
1913
#ifdef CONFIG_X86_SMAP
2014
# define DISABLE_SMAP 0
2115
#else
@@ -74,7 +68,7 @@
7468
#define DISABLED_MASK6 0
7569
#define DISABLED_MASK7 (DISABLE_PTI)
7670
#define DISABLED_MASK8 0
77-
#define DISABLED_MASK9 (DISABLE_MPX|DISABLE_SMAP)
71+
#define DISABLED_MASK9 (DISABLE_SMAP)
7872
#define DISABLED_MASK10 0
7973
#define DISABLED_MASK11 0
8074
#define DISABLED_MASK12 0

‎arch/x86/include/asm/mmu.h‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,6 @@ typedef struct {
5050
u16 pkey_allocation_map;
5151
s16 execute_only_pkey;
5252
#endif
53-
#ifdef CONFIG_X86_INTEL_MPX
54-
/* address of the bounds directory */
55-
void __user *bd_addr;
56-
#endif
5753
} mm_context_t;
5854

5955
#define INIT_MM_CONTEXT(mm) \

‎arch/x86/include/asm/mmu_context.h‎

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include <asm/pgalloc.h>
1313
#include <asm/tlbflush.h>
1414
#include <asm/paravirt.h>
15-
#include <asm/mpx.h>
1615
#include <asm/debugreg.h>
1716

1817
extern atomic64_t last_mm_ctx_id;
@@ -275,25 +274,6 @@ static inline bool is_64bit_mm(struct mm_struct *mm)
275274
static inline void arch_unmap(struct mm_struct *mm, unsigned long start,
276275
unsigned long end)
277276
{
278-
/*
279-
* mpx_notify_unmap() goes and reads a rarely-hot
280-
* cacheline in the mm_struct. That can be expensive
281-
* enough to be seen in profiles.
282-
*
283-
* The mpx_notify_unmap() call and its contents have been
284-
* observed to affect munmap() performance on hardware
285-
* where MPX is not present.
286-
*
287-
* The unlikely() optimizes for the fast case: no MPX
288-
* in the CPU, or no MPX use in the process. Even if
289-
* we get this wrong (in the unlikely event that MPX
290-
* is widely enabled on some system) the overhead of
291-
* MPX itself (reading bounds tables) is expected to
292-
* overwhelm the overhead of getting this unlikely()
293-
* consistently wrong.
294-
*/
295-
if (unlikely(cpu_feature_enabled(X86_FEATURE_MPX)))
296-
mpx_notify_unmap(mm, start, end);
297277
}
298278

299279
/*

0 commit comments

Comments
 (0)