Skip to content

Commit 4675ff0

Browse files
Levin, Alexander (Sasha Levin)torvalds
authored andcommitted
kmemcheck: rip it out
Fix up makefiles, remove references, and git rm kmemcheck. Link: http://lkml.kernel.org/r/20171007030159.22241-4-alexander.levin@verizon.com Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Vegard Nossum <vegardno@ifi.uio.no> Cc: Pekka Enberg <penberg@kernel.org> Cc: Michal Hocko <mhocko@kernel.org> Cc: Eric W. Biederman <ebiederm@xmission.com> Cc: Alexander Potapenko <glider@google.com> Cc: Tim Hansen <devtimhansen@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent d8be756 commit 4675ff0

35 files changed

+7
-2592
lines changed

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1864,13 +1864,6 @@
18641864
Built with CONFIG_DEBUG_KMEMLEAK_DEFAULT_OFF=y,
18651865
the default is off.
18661866

1867-
kmemcheck= [X86] Boot-time kmemcheck enable/disable/one-shot mode
1868-
Valid arguments: 0, 1, 2
1869-
kmemcheck=0 (disabled)
1870-
kmemcheck=1 (enabled)
1871-
kmemcheck=2 (one-shot mode)
1872-
Default: 2 (one-shot mode)
1873-
18741867
kvm.ignore_msrs=[KVM] Ignore guest accesses to unhandled MSRs.
18751868
Default is 0 (don't ignore, but inject #GP)
18761869

Documentation/dev-tools/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ whole; patches welcome!
2121
kasan
2222
ubsan
2323
kmemleak
24-
kmemcheck
2524
gdb-kernel-debugging
2625
kgdb
2726
kselftest

Documentation/dev-tools/kmemcheck.rst

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

MAINTAINERS

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7688,16 +7688,6 @@ F: include/linux/kdb.h
76887688
F: include/linux/kgdb.h
76897689
F: kernel/debug/
76907690

7691-
KMEMCHECK
7692-
M: Vegard Nossum <vegardno@ifi.uio.no>
7693-
M: Pekka Enberg <penberg@kernel.org>
7694-
S: Maintained
7695-
F: Documentation/dev-tools/kmemcheck.rst
7696-
F: arch/x86/include/asm/kmemcheck.h
7697-
F: arch/x86/mm/kmemcheck/
7698-
F: include/linux/kmemcheck.h
7699-
F: mm/kmemcheck.c
7700-
77017691
KMEMLEAK
77027692
M: Catalin Marinas <catalin.marinas@arm.com>
77037693
S: Maintained

arch/x86/Kconfig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ config X86
112112
select HAVE_ARCH_JUMP_LABEL
113113
select HAVE_ARCH_KASAN if X86_64 && SPARSEMEM_VMEMMAP
114114
select HAVE_ARCH_KGDB
115-
select HAVE_ARCH_KMEMCHECK
116115
select HAVE_ARCH_MMAP_RND_BITS if MMU
117116
select HAVE_ARCH_MMAP_RND_COMPAT_BITS if MMU && COMPAT
118117
select HAVE_ARCH_COMPAT_MMAP_BASES if MMU && COMPAT
@@ -1430,7 +1429,7 @@ config ARCH_DMA_ADDR_T_64BIT
14301429

14311430
config X86_DIRECT_GBPAGES
14321431
def_bool y
1433-
depends on X86_64 && !DEBUG_PAGEALLOC && !KMEMCHECK
1432+
depends on X86_64 && !DEBUG_PAGEALLOC
14341433
---help---
14351434
Certain kernel features effectively disable kernel
14361435
linear 1 GB mappings (even if the CPU otherwise

arch/x86/include/asm/kmemcheck.h

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1 @@
11
/* SPDX-License-Identifier: GPL-2.0 */
2-
#ifndef ASM_X86_KMEMCHECK_H
3-
#define ASM_X86_KMEMCHECK_H
4-
5-
#include <linux/types.h>
6-
#include <asm/ptrace.h>
7-
8-
#ifdef CONFIG_KMEMCHECK
9-
bool kmemcheck_active(struct pt_regs *regs);
10-
11-
void kmemcheck_show(struct pt_regs *regs);
12-
void kmemcheck_hide(struct pt_regs *regs);
13-
14-
bool kmemcheck_fault(struct pt_regs *regs,
15-
unsigned long address, unsigned long error_code);
16-
bool kmemcheck_trap(struct pt_regs *regs);
17-
#else
18-
static inline bool kmemcheck_active(struct pt_regs *regs)
19-
{
20-
return false;
21-
}
22-
23-
static inline void kmemcheck_show(struct pt_regs *regs)
24-
{
25-
}
26-
27-
static inline void kmemcheck_hide(struct pt_regs *regs)
28-
{
29-
}
30-
31-
static inline bool kmemcheck_fault(struct pt_regs *regs,
32-
unsigned long address, unsigned long error_code)
33-
{
34-
return false;
35-
}
36-
37-
static inline bool kmemcheck_trap(struct pt_regs *regs)
38-
{
39-
return false;
40-
}
41-
#endif /* CONFIG_KMEMCHECK */
42-
43-
#endif

arch/x86/include/asm/string_32.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,6 @@ static inline void *__memcpy3d(void *to, const void *from, size_t len)
179179
* No 3D Now!
180180
*/
181181

182-
#ifndef CONFIG_KMEMCHECK
183-
184182
#if (__GNUC__ >= 4)
185183
#define memcpy(t, f, n) __builtin_memcpy(t, f, n)
186184
#else
@@ -189,13 +187,6 @@ static inline void *__memcpy3d(void *to, const void *from, size_t len)
189187
? __constant_memcpy((t), (f), (n)) \
190188
: __memcpy((t), (f), (n)))
191189
#endif
192-
#else
193-
/*
194-
* kmemcheck becomes very happy if we use the REP instructions unconditionally,
195-
* because it means that we know both memory operands in advance.
196-
*/
197-
#define memcpy(t, f, n) __memcpy((t), (f), (n))
198-
#endif
199190

200191
#endif
201192
#endif /* !CONFIG_FORTIFY_SOURCE */

arch/x86/include/asm/string_64.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ extern void *memcpy(void *to, const void *from, size_t len);
3333
extern void *__memcpy(void *to, const void *from, size_t len);
3434

3535
#ifndef CONFIG_FORTIFY_SOURCE
36-
#ifndef CONFIG_KMEMCHECK
3736
#if (__GNUC__ == 4 && __GNUC_MINOR__ < 3) || __GNUC__ < 4
3837
#define memcpy(dst, src, len) \
3938
({ \
@@ -46,13 +45,6 @@ extern void *__memcpy(void *to, const void *from, size_t len);
4645
__ret; \
4746
})
4847
#endif
49-
#else
50-
/*
51-
* kmemcheck becomes very happy if we use the REP instructions unconditionally,
52-
* because it means that we know both memory operands in advance.
53-
*/
54-
#define memcpy(dst, src, len) __inline_memcpy((dst), (src), (len))
55-
#endif
5648
#endif /* !CONFIG_FORTIFY_SOURCE */
5749

5850
#define __HAVE_ARCH_MEMSET

arch/x86/kernel/cpu/intel.c

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -187,21 +187,6 @@ static void early_init_intel(struct cpuinfo_x86 *c)
187187
if (c->x86 == 6 && c->x86_model < 15)
188188
clear_cpu_cap(c, X86_FEATURE_PAT);
189189

190-
#ifdef CONFIG_KMEMCHECK
191-
/*
192-
* P4s have a "fast strings" feature which causes single-
193-
* stepping REP instructions to only generate a #DB on
194-
* cache-line boundaries.
195-
*
196-
* Ingo Molnar reported a Pentium D (model 6) and a Xeon
197-
* (model 2) with the same problem.
198-
*/
199-
if (c->x86 == 15)
200-
if (msr_clear_bit(MSR_IA32_MISC_ENABLE,
201-
MSR_IA32_MISC_ENABLE_FAST_STRING_BIT) > 0)
202-
pr_info("kmemcheck: Disabling fast string operations\n");
203-
#endif
204-
205190
/*
206191
* If fast string is not enabled in IA32_MISC_ENABLE for any reason,
207192
* clear the fast string and enhanced fast string CPU capabilities.

arch/x86/mm/Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ obj-$(CONFIG_X86_PTDUMP) += debug_pagetables.o
2929

3030
obj-$(CONFIG_HIGHMEM) += highmem_32.o
3131

32-
obj-$(CONFIG_KMEMCHECK) += kmemcheck/
33-
3432
KASAN_SANITIZE_kasan_init_$(BITS).o := n
3533
obj-$(CONFIG_KASAN) += kasan_init_$(BITS).o
3634

arch/x86/mm/init.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,11 @@ static int page_size_mask;
163163
static void __init probe_page_size_mask(void)
164164
{
165165
/*
166-
* For CONFIG_KMEMCHECK or pagealloc debugging, identity mapping will
167-
* use small pages.
166+
* For pagealloc debugging, identity mapping will use small pages.
168167
* This will simplify cpa(), which otherwise needs to support splitting
169168
* large pages into small in interrupt context, etc.
170169
*/
171-
if (boot_cpu_has(X86_FEATURE_PSE) && !debug_pagealloc_enabled() && !IS_ENABLED(CONFIG_KMEMCHECK))
170+
if (boot_cpu_has(X86_FEATURE_PSE) && !debug_pagealloc_enabled())
172171
page_size_mask |= 1 << PG_LEVEL_2M;
173172
else
174173
direct_gbpages = 0;

arch/x86/mm/kmemcheck/Makefile

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)