1 From eb6174f6d1be16b19cfa43dac296bfed003ce1a6 Mon Sep 17 00:00:00 2001
2 From: Dan Williams <dan.j.williams@intel.com>
3 Date: Fri, 16 Feb 2018 13:20:54 -0800
4 Subject: nospec: Include <asm/barrier.h> dependency
6 From: Dan Williams <dan.j.williams@intel.com>
8 commit eb6174f6d1be16b19cfa43dac296bfed003ce1a6 upstream.
10 The nospec.h header expects the per-architecture header file
11 <asm/barrier.h> to optionally define array_index_mask_nospec(). Include
12 that dependency to prevent inadvertent fallback to the default
13 array_index_mask_nospec() implementation.
15 The default implementation may not provide a full mitigation
16 on architectures that perform data value speculation.
18 Reported-by: Christian Borntraeger <borntraeger@de.ibm.com>
19 Signed-off-by: Dan Williams <dan.j.williams@intel.com>
20 Cc: Andy Lutomirski <luto@kernel.org>
21 Cc: Arjan van de Ven <arjan@linux.intel.com>
22 Cc: Borislav Petkov <bp@alien8.de>
23 Cc: Dave Hansen <dave.hansen@linux.intel.com>
24 Cc: David Woodhouse <dwmw2@infradead.org>
25 Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
26 Cc: Josh Poimboeuf <jpoimboe@redhat.com>
27 Cc: Linus Torvalds <torvalds@linux-foundation.org>
28 Cc: Peter Zijlstra <peterz@infradead.org>
29 Cc: Thomas Gleixner <tglx@linutronix.de>
30 Cc: Will Deacon <will.deacon@arm.com>
31 Cc: linux-arch@vger.kernel.org
32 Link: http://lkml.kernel.org/r/151881605404.17395.1341935530792574707.stgit@dwillia2-desk3.amr.corp.intel.com
33 Signed-off-by: Ingo Molnar <mingo@kernel.org>
34 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
37 include/linux/nospec.h | 1 +
38 1 file changed, 1 insertion(+)
40 --- a/include/linux/nospec.h
41 +++ b/include/linux/nospec.h
44 #ifndef _LINUX_NOSPEC_H
45 #define _LINUX_NOSPEC_H
46 +#include <asm/barrier.h>
49 * array_index_mask_nospec() - generate a ~0 mask when index < size, 0 otherwise