mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-25 11:04:51 +03:00
nvgpu: gpu: Add speculation barrier macro
Provide a macro for preventing CPU speculation. bug 2039126 CVE-2017-5753 Change-Id: Ifa936c079d9f2a0231d0cf35c4d8bdd18d54b238 Signed-off-by: Alex Waterman <alexw@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1640497 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
b46045f3fe
commit
43dbbaaad7
@@ -14,6 +14,9 @@ ifeq ($(VERSION),4)
|
||||
ccflags-y += -Wextra -Wno-unused-parameter -Wno-missing-field-initializers
|
||||
endif
|
||||
|
||||
# Turn off when this is fixed upstream, if ever.
|
||||
ccflags-y += -D__NVGPU_PREVENT_UNTRUSTED_SPECULATION
|
||||
|
||||
obj-$(CONFIG_GK20A) := nvgpu.o
|
||||
|
||||
nvgpu-y := \
|
||||
|
||||
@@ -47,4 +47,13 @@
|
||||
|
||||
#define NV_ACCESS_ONCE(x) __NV_ACCESS_ONCE(x)
|
||||
|
||||
/*
|
||||
* Sometimes we want to prevent speculation.
|
||||
*/
|
||||
#ifdef __NVGPU_PREVENT_UNTRUSTED_SPECULATION
|
||||
#define nvgpu_speculation_barrier() __nvgpu_speculation_barrier()
|
||||
#else
|
||||
#define nvgpu_speculation_barrier()
|
||||
#endif
|
||||
|
||||
#endif /* __NVGPU_BARRIER_H__ */
|
||||
|
||||
@@ -32,4 +32,6 @@
|
||||
|
||||
#define __NV_ACCESS_ONCE(x) ACCESS_ONCE(x)
|
||||
|
||||
#define __nvgpu_speculation_barrier() speculation_barrier()
|
||||
|
||||
#endif /* __NVGPU_BARRIER_LINUX_H__ */
|
||||
|
||||
Reference in New Issue
Block a user