diff options
author | Alex Waterman <alexw@nvidia.com> | 2017-12-13 19:25:46 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-01-25 17:25:18 -0500 |
commit | 43dbbaaad7b49036a507b7e04af67b766adc41be (patch) | |
tree | 1a52626d5d4a3d80736b0e33f1ac58532f768fab /drivers/gpu/nvgpu/include | |
parent | b46045f3fe71fad703ee7d689657af16925d78ca (diff) |
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>
Diffstat (limited to 'drivers/gpu/nvgpu/include')
-rw-r--r-- | drivers/gpu/nvgpu/include/nvgpu/barrier.h | 9 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/include/nvgpu/linux/barrier.h | 2 |
2 files changed, 11 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/include/nvgpu/barrier.h b/drivers/gpu/nvgpu/include/nvgpu/barrier.h index 01bd3023..03a14a99 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/barrier.h +++ b/drivers/gpu/nvgpu/include/nvgpu/barrier.h | |||
@@ -47,4 +47,13 @@ | |||
47 | 47 | ||
48 | #define NV_ACCESS_ONCE(x) __NV_ACCESS_ONCE(x) | 48 | #define NV_ACCESS_ONCE(x) __NV_ACCESS_ONCE(x) |
49 | 49 | ||
50 | /* | ||
51 | * Sometimes we want to prevent speculation. | ||
52 | */ | ||
53 | #ifdef __NVGPU_PREVENT_UNTRUSTED_SPECULATION | ||
54 | #define nvgpu_speculation_barrier() __nvgpu_speculation_barrier() | ||
55 | #else | ||
56 | #define nvgpu_speculation_barrier() | ||
57 | #endif | ||
58 | |||
50 | #endif /* __NVGPU_BARRIER_H__ */ | 59 | #endif /* __NVGPU_BARRIER_H__ */ |
diff --git a/drivers/gpu/nvgpu/include/nvgpu/linux/barrier.h b/drivers/gpu/nvgpu/include/nvgpu/linux/barrier.h index b20f9462..ef867c44 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/linux/barrier.h +++ b/drivers/gpu/nvgpu/include/nvgpu/linux/barrier.h | |||
@@ -32,4 +32,6 @@ | |||
32 | 32 | ||
33 | #define __NV_ACCESS_ONCE(x) ACCESS_ONCE(x) | 33 | #define __NV_ACCESS_ONCE(x) ACCESS_ONCE(x) |
34 | 34 | ||
35 | #define __nvgpu_speculation_barrier() speculation_barrier() | ||
36 | |||
35 | #endif /* __NVGPU_BARRIER_LINUX_H__ */ | 37 | #endif /* __NVGPU_BARRIER_LINUX_H__ */ |