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/gk20a | |
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/gk20a')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index 989ee5c9..636d5714 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c | |||
@@ -3943,6 +3943,7 @@ int gr_gk20a_add_zbc(struct gk20a *g, struct gr_gk20a *gr, | |||
3943 | /* no endian swap ? */ | 3943 | /* no endian swap ? */ |
3944 | 3944 | ||
3945 | nvgpu_mutex_acquire(&gr->zbc_lock); | 3945 | nvgpu_mutex_acquire(&gr->zbc_lock); |
3946 | nvgpu_speculation_barrier(); | ||
3946 | switch (zbc_val->type) { | 3947 | switch (zbc_val->type) { |
3947 | case GK20A_ZBC_TYPE_COLOR: | 3948 | case GK20A_ZBC_TYPE_COLOR: |
3948 | /* search existing tables */ | 3949 | /* search existing tables */ |
@@ -4047,6 +4048,7 @@ int gr_gk20a_query_zbc(struct gk20a *g, struct gr_gk20a *gr, | |||
4047 | u32 index = query_params->index_size; | 4048 | u32 index = query_params->index_size; |
4048 | u32 i; | 4049 | u32 i; |
4049 | 4050 | ||
4051 | nvgpu_speculation_barrier(); | ||
4050 | switch (query_params->type) { | 4052 | switch (query_params->type) { |
4051 | case GK20A_ZBC_TYPE_INVALID: | 4053 | case GK20A_ZBC_TYPE_INVALID: |
4052 | query_params->index_size = GK20A_ZBC_TABLE_SIZE; | 4054 | query_params->index_size = GK20A_ZBC_TABLE_SIZE; |