Commit Graph

4 Commits

Author SHA1 Message Date
Seshendra Gadagottu
43324f7b1b gpu: nvgpu: Reconcile sim escape paths between RM and nvgpu
SIM models are getting updated to have same escape read path
for RM and nvgpu. Updated nvgpu driver code to have same escape
read mechanism as RM.

This is required for igpu to pass on NET21.

Bug 2539889

Change-Id: I5d37ceb799cafb7fc7dec611fda5f5caac7d7f17
Signed-off-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2130414
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: Lakshmanan M <lm@nvidia.com>
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: Lakshmanan M <lm@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
2020-12-15 14:13:28 -06:00
Scott Long
ae44d384f3 gpu: nvgpu: MISRA 4.5 fixes to round_up()
MISRA Advisory Directive 4.5 states that identifiers in the same
name space with overlapping visibility should be typographically
unambiguous.

The presence of both the roundup(x,y) and round_up(x,y) macros in
the posix utils.h header incurs a violation of this rule.

These macros were added to keep in sync with the linux kernel variants.

However, there is a key distinction between how these two macros
work in the linux kernel; roundup(x,y) can handle any y alignment while
round_up(x,y) is intended to work only when y is a power-of-two.

Passing a non-power-of-two alignment to round_up(x,y) results in an
incorrect value being returned (silently).

Because all current uses of roundup(x,y) and round_up(x,y) in
nvgpu specify a y value that is a power-of-two and the underlying
posix macro implementations assume as much, it is best to remove
roundup(x,y) from nvgpu altogether to avoid any confusion.

So this change converts all uses of roundup(x,y) to round_up(x,y).

Jira NVGPU-3178

Change-Id: I0ee974d3e088fa704e251a38f6b7ada5a7600aec
Signed-off-by: Scott Long <scottl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2271385
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2020-12-15 14:10:29 -06:00
Nitin Kumbhar
e0061b8daa gpu: nvgpu: fix sim STR30 CERT C violations
Make path a pointer to const char to avoid attempt to
modify string literal.

Error: CERT STR30-C:
drivers/gpu/nvgpu/common/sim/sim_netlist.c:363:
cert_violation: Assigning or casting string literal
 ""GRCTX_GEN_CTX_REGS_BASE_INDEX"" to a pointer to non-const.

Jira NVGPU-3560

Change-Id: I22dacbbd210a43c41aef2532c5ddb1429d5c9153
Signed-off-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2122101
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-06-06 16:26:48 -07:00
Seshendra Gadagottu
b716286e0f gpu: nvgpu: create common sim unit
Move all simulation related code to common sim unit.
Moved common/sim.c -> common/sim/sim.c
      common/sim_pci.c -> common/sim/sim_pci.c

Also moved sim netlist related functionality also here. Because, sim
related code is not part of safety build and it will work as single
place-holder for all sim related code.
common/netlist/netlist_sim.c -> common/sim/sim_netlist.c

Changed function name for initializing sim netlist context vars and
moved it to sim.h from netlist.h
nvgpu_netlist_init_ctx_vars_sim -> nvgpu_init_sim_netlist_ctx_vars

JIRA NVGPU-2078

Change-Id: Ibe3452d1595ebd8cc08ce7bd186fdf4291e40ca6
Signed-off-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2100605
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-04-19 15:35:12 -07:00