diff options
author | Ranjanikar Nikhil Prabhakarrao <rprabhakarra@nvidia.com> | 2018-12-13 06:59:20 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2020-06-30 13:07:26 -0400 |
commit | f56874aec2ec61f2c341b813cc76de5acc51ea12 (patch) | |
tree | efd3d6a3921c930a76bf0cb7011ca6b9809ed5f3 /drivers/gpu/nvgpu/common/fifo | |
parent | bbef4c6927a13a24821c43cb2b6af72f859f7deb (diff) |
gpu: nvgpu: add speculative barrier
Data can be speculativerly stored and
code flow can be hijacked.
To mitigate this problem insert a
speculation barrier.
Bug 200447167
Change-Id: Ia865ff2add8b30de49aa970715625b13e8f71c08
Signed-off-by: Ranjanikar Nikhil Prabhakarrao <rprabhakarra@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1972221
(cherry picked from commit f0762ed4831b3fe6cc953a4a4ec26c2537dcb69f)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/1996052
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: Deepak Nibade <dnibade@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/fifo')
-rw-r--r-- | drivers/gpu/nvgpu/common/fifo/submit.c | 1 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/common/fifo/tsg.c | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/common/fifo/submit.c b/drivers/gpu/nvgpu/common/fifo/submit.c index d518fbfb..b0f38ff1 100644 --- a/drivers/gpu/nvgpu/common/fifo/submit.c +++ b/drivers/gpu/nvgpu/common/fifo/submit.c | |||
@@ -212,6 +212,7 @@ static int nvgpu_submit_append_gpfifo_user_direct(struct channel_gk20a *c, | |||
212 | u32 end = start + len; /* exclusive */ | 212 | u32 end = start + len; /* exclusive */ |
213 | int err; | 213 | int err; |
214 | 214 | ||
215 | nvgpu_speculation_barrier(); | ||
215 | if (end > gpfifo_size) { | 216 | if (end > gpfifo_size) { |
216 | /* wrap-around */ | 217 | /* wrap-around */ |
217 | int length0 = gpfifo_size - start; | 218 | int length0 = gpfifo_size - start; |
diff --git a/drivers/gpu/nvgpu/common/fifo/tsg.c b/drivers/gpu/nvgpu/common/fifo/tsg.c index f6c718f0..841dd465 100644 --- a/drivers/gpu/nvgpu/common/fifo/tsg.c +++ b/drivers/gpu/nvgpu/common/fifo/tsg.c | |||
@@ -219,6 +219,7 @@ int gk20a_tsg_set_runlist_interleave(struct tsg_gk20a *tsg, u32 level) | |||
219 | 219 | ||
220 | nvgpu_log(g, gpu_dbg_sched, "tsgid=%u interleave=%u", tsg->tsgid, level); | 220 | nvgpu_log(g, gpu_dbg_sched, "tsgid=%u interleave=%u", tsg->tsgid, level); |
221 | 221 | ||
222 | nvgpu_speculation_barrier(); | ||
222 | switch (level) { | 223 | switch (level) { |
223 | case NVGPU_FIFO_RUNLIST_INTERLEAVE_LEVEL_LOW: | 224 | case NVGPU_FIFO_RUNLIST_INTERLEAVE_LEVEL_LOW: |
224 | case NVGPU_FIFO_RUNLIST_INTERLEAVE_LEVEL_MEDIUM: | 225 | case NVGPU_FIFO_RUNLIST_INTERLEAVE_LEVEL_MEDIUM: |