Skip to content

Commit 33f65df

Browse files
committed
crypto: don't track xor test pages with kmemcheck
The xor tests are run on uninitialized data, because it is doesn't really matter what the underlying data is. Annotate this false- positive warning. Acked-by: Pekka Enberg <penberg@cs.helsinki.fi> Signed-off-by: Vegard Nossum <vegard.nossum@gmail.com>
1 parent c175eea commit 33f65df

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎crypto/xor.c‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,12 @@ calibrate_xor_blocks(void)
101101
void *b1, *b2;
102102
struct xor_block_template *f, *fastest;
103103

104-
b1 = (void *) __get_free_pages(GFP_KERNEL, 2);
104+
/*
105+
* Note: Since the memory is not actually used for _anything_ but to
106+
* test the XOR speed, we don't really want kmemcheck to warn about
107+
* reading uninitialized bytes here.
108+
*/
109+
b1 = (void *) __get_free_pages(GFP_KERNEL | __GFP_NOTRACK, 2);
105110
if (!b1) {
106111
printk(KERN_WARNING "xor: Yikes! No memory available.\n");
107112
return -ENOMEM;

0 commit comments

Comments
 (0)