Commit Graph

59 Commits

Author SHA1 Message Date
Nicolas Benech
71244da672 gpu: nvgpu: unit: page_table unit test
This unit test covers the page_table map/unmap logic as well
as low level PDE/PTE handling.
This patch contains a first phase aiming to cover most
functionality and code coverage but it does not cover
most error handling cases nor formal requirements.

JIRA NVGPU-907

Change-Id: I3b63cfce6cee27d01e1ef54c763560a542992d33
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1950974
Reviewed-by: Philip Elcan <pelcan@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>
2018-11-21 19:37:29 -08:00
Alex Waterman
550e5b65cb gpu: nvgpu: unit: Add pd_cache unit test
Add a unit test to cover the pd_cache unit. This unit is
responsible for maintaining the page directory allocations.
It's effectively a DMA slab allocator since we want to be
able to pack multiple sub page sized page directories into
a single page.

JIRA NVGPU-1323

Change-Id: If65a803cf2ee5af9938668958b9353d50b2e98f9
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1942248
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-11-15 15:36:32 -08:00
Alex Waterman
bf51b0cdf7 gpu: nvgpu: Update license for some scripts
Update (or add) the MIT license for several scripts in the nvgpu
code.

Change-Id: I3724c3cf22358773cc7dcaa8a8bb8acba439d216
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1946911
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-11-12 15:46:49 -08:00
Nicolas Benech
5b5a1cb014 nvgpu: posix: Add support for backtrace
Add support for backtrace prints when BUG() is being called.
To support backtrace calls, the -rdynamic compiler flag is
now being used. On host, it fully works as expected, on
target only exported symbols (in libnvgpu-drv.export) are
visible.

JIRA NVGPU-1246

Change-Id: Ia075ac99228e8377bdb3142fef2e56c2fea2d967
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1943478
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
Reviewed-by: Philip Elcan <pelcan@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>
2018-11-09 18:47:13 -08:00
Philip Elcan
dccf97a2ca gpu: nvgpu: unit: add gp106 to fuse unit test
This adds testing for gp106 to the fuse unit test.

This provides 98% code coverage and 94% branch coverage for this
device/module. The missing coverage consists of 2 redundant case/default
statements that are checked previously in the same function.

JIRA NVGPU-938

Change-Id: I04872824204fe6a0e8fa0275726d372892fc78cf
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1943387
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-11-08 21:43:39 -08:00
Philip Elcan
eea6feec23 gpu: nvgpu: unit: add gm20b to fuse test
This adds unit testing for gm20b to the fuse unit test.

This provides 100% code and branch coverage for this module/device.

JIRA NVGPU-938

Change-Id: I766098bfe96044be18d0dbf74b277d1079d263f0
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1943386
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-11-08 21:43:35 -08:00
Philip Elcan
cef9b8ff9d gpu: nvgpu: unit: fuse unit test for gp10b
This adds the initial unit test for the fuse module and testing for
gp10b. It verifies the exposed APIs for this device in the fuse module.

To allow the hal_init to pass before the HAL for
read_gcplex_config_fuse() can be overridden, the default behavior of the
POSIX implementation for nvgpu_tegra_fuse_read_gcplex_config_fuse() is
changed.

This provides 100% code and branch coverage for this unit/device.

JIRA NVGPU-938

Change-Id: I9efa8080c12ace637581c77aa35aab3f86a94760
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1943385
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-11-08 21:43:26 -08:00
Alex Waterman
63da5366a6 gpu: nvgpu: unit: Shuffle the paths of tests around a bit
We will need to organize the unit tests in order to keep the
units/ directory managable.

The basic idea here is to mirror the common/ structure in
nvgpu proper under units/. There's one additrion at the
moment though: posix. This is for posix environment related
tests.

Also added a fix for the runlist unit test. Add it to the
tmake sources and move the nvgpu-runlist/ directory to just
runlist/.

Change-Id: I1f4163d0e33c3af70376cfeb3441d277d559e05a
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1935710
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-11-07 13:10:55 -08:00
Nicolas Benech
99384a67b5 gpu: nvgpu: unit: install-unit: Handle subfolders
Now that some unit modules are in subfolders, this script
needed an update as well. All module .so are now searched
and all copied to the nvgpu_unit/units/ folder on target.

JIRA NVGPU-1246

Change-Id: I1da639006a0012c8a2d1e19b8b2bddd0b6376b67
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1943578
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-11-06 21:57:40 -08:00
Alex Waterman
44b4b036e2 gpu: nvgpu: unit: Delete redundant enabled init
Now that the enabled flags init is taken care of in the
nvgpu_posix_probe() function tests need only init the specific
flags they care about.

JIRA NVGPU-1323

Change-Id: I9255dddcd3aad34881668d283f2cc8332b06e7ce
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1941538
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Scott Long <scottl@nvidia.com>
Reviewed-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-11-05 14:35:52 -08:00
Alex Waterman
e85368b4f3 gpu: nvgpu: unit: update .gitignore to hide .gcno/.gcda files
These files now get generated by the unit tests themselves, too, which
clutter the source directories foir the units. So hide them from git.

Change-Id: Id9e302581fa20979b14d5af09510023dd984d37f
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1941537
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
Reviewed-by: Scott Long <scottl@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-11-04 21:25:42 -08:00
Philip Elcan
e2c08f4f7b gpu: nvgpu: unit: install-unit: check for -next
Check for nvgpu-next before trying to copy it to the target. This avoids
an error message when the directory doesn't exist.

Change-Id: I0e195779c7bd53c19e3e5e2ce0aaa4ac4c5c653d
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1935594
Reviewed-by: Nicolas Benech <nbenech@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-30 15:36:20 -07:00
Nicolas Benech
78476a9bb6 gpu: nvgpu: unit: Add unit for list testing
This simple unit covers all the APIs of list.h

JIRA NVGPU-900

Change-Id: I74d4d33ad23c1f31ce76612e7afba167394a01b6
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1935612
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>
2018-10-29 15:55:03 -07:00
Nicolas Benech
ae9fe7c438 gpu: nvgpu: unit: Add gcov for units on host
The unit test source files must have gcov enabled to get
coverage information for inline function included from header
files.

JIRA NVGPU-1316

Change-Id: I46f973c321da93ef2b374f9310e6f0214ca70b09
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1935613
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>
2018-10-29 15:54:59 -07:00
Philip Elcan
aeadca8f43 gpu: nvgpu: unit: dma alloc fault inj test
This adds a unit test to verify the fault injection for the dma alloc
POSIX module used by the unit test framework.

JIRA NVGPU-1235

Change-Id: Ib24d5db008b43c91c19c2f2ffff619147b46fc23
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1930801
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>
2018-10-26 17:29:27 -07:00
Konsta Holtta
472f8d1352 gpu: nvgpu: unit: add runlist construction tests
Test that the runlist construction formats tsg items as expected and in
correct order, in particular when interleaving is enabled and tsgs of
different interleave levels exist.

Jira NVGPU-1174

Change-Id: I9c88a618ce8bf5b0555b39a876cda98f6d887a01
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1918227
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-26 11:14:23 -07:00
Alex Waterman
f96d229e70 gpu: nvgpu: unit: allocator unit test
This unit test covers the nvgpu allocator high level logic for
calling nvgpu allocator imlementation routines. The nvgpu_allocator
code is generally very simple.

This gets to >90% coverage of the module. Once the fault injection
code is merged the failure path after nvgpu_mutex_init() will also
be coverable.

JIRA NVGPU-903

Change-Id: I7e180da9cbc518b6568c240fd5e67a233b17edc6
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1927642
Reviewed-by: Philip Elcan <pelcan@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-25 12:04:08 -07:00
Konsta Holtta
520fe7c568 gpu: nvgpu: unit: free reg spaces in mockio test
Get rid of some simple memory leaks: free the two allocated register
spaces at the end of the register space test.

Change-Id: Ib6341c34e8b6830073d43afc9291e1ea1da7184e
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1934472
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Nicolas Benech <nbenech@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-24 17:02:43 -07:00
Philip Elcan
9aec9410d7 gpu: nvgpu: unit: update path for unit export file
The template tmake makefile for the unit test shared object interface
was using a relative path based on the component to find the common
export file. This uses a path relative to the project source path. This
allows multi-level directories for the unit tests (e.g.
../units/mm/nvgpu_allocator/).

Change-Id: Iff8d6419eec9fe8877f5ce8111a6045a10289dc9
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1930006
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-22 20:02:15 -07:00
Philip Elcan
8465fc9266 gpu: nvgpu: unit: kmem fault injection unit test
This adds a unit test to exercise the kmem alloc and cache routines.

JIRA NVGPU-1235

Change-Id: I1baaa4b807504cb93db7e91bc5fb443a07cdad52
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1919444
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>
2018-10-19 00:35:56 -07:00
Alex Waterman
eeff8bf356 gpu: nvgpu: unit: Fix test type for PRAMIN unit test
Fix the test type for the PRAMIN unit test from POSIX to nvgpu.
This affects the order in which the tests are run.

JIRA NVGPU-916

Change-Id: Ie946ea6db112437f0e7bf98a8a5d5d9e2d595283
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1929038
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-18 14:54:15 -07:00
Philip Elcan
45db303354 gpu: nvgpu: unit: update params for on target runs
When run on target, presumably as part of GVS, we need to run
multithreaded, without colors and with the nvtest output. This updates
unit.sh to apply those params on target.

Also use the long parameter names since they should be self documenting.

JIRA NVGPU-1042

Change-Id: I27f0d1371df9b553262e1ebe1e4b258202c322d2
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1924617
Reviewed-by: Automatic_Commit_Validation_User
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>
2018-10-18 13:44:32 -07:00
Philip Elcan
78eca5bdc3 gpu: nvgpu: unit: print nvtest info for whole test
The nvtest output required to run as part of the nvgpu_submit framework
was being printed per unit test. However, when we run each test in a
thread with -j, the nvtest output was mixed among the tests as they
finished and the results were not consistent.

This patch changes the unit test framework to only output the nvtest
start/pass/fail messages for the entire unit test framework run so that
the output is consistent. This will allow enabling of threaded runs in
GVS.

For the NVTEST output, we want to use the binary name, so save that from
argv[0] to use later.

JIRA NVGPU-1042

Change-Id: I71697e75d4a0bba8c5aa2425bc25de57322826d7
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1924616
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
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>
2018-10-18 13:44:28 -07:00
Philip Elcan
9bf47eff8a gpu: nvgpu: unit: fix typo in error msg
This fixes a typo in an error message in the unit test framework when
unable to parse command line arguments.

Change-Id: I8a8fe0dea9480db730b48bcf81671a5701fdd251
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1924615
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-18 13:44:25 -07:00
Philip Elcan
7ac7c061a1 gpu: nvgpu: unit: only load .so files
There was a situation where a .so.debug file was stored with the unit
.so files and was causing the unit test framework to abort with a "Bus
Error."

This update only loads files ending in .so to avoid loading invalid
files in the future.

Bug 2415403

Change-Id: I0c3cdd7a05942b746695f88f5b1f2324f309daba
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1924614
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-18 13:44:21 -07:00
Nicolas Benech
fdba70425d gpu: nvgpu: unit: PRAMIN unit test
This new unit test covers 100% of the PRAMIN lines and almost
all branches.

JIRA NVGPU-916

Change-Id: Ib58d72fcd3efc2d86d8b80e16e48b6efc9c947c4
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1919604
Reviewed-by: Philip Elcan <pelcan@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>
2018-10-16 23:40:57 -07:00
Philip Elcan
334f5869c9 gpu: nvgpu: unit: add output to make nvtest happy
This adds the correct output for the nvtest interpreter in GVS to track
the per-test pass/fails.

JIRA NVGPU-1042

Change-Id: I7f4a1a63c64988520db08029231f0db9deeaee7d
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1850293
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-12 17:35:10 +05:30
Philip Elcan
24a678ea81 gpu: nvgpu: unit: run test in right path
This make sure we're in the assumed path for running the unit fw.
This is done for GVS/nvgpu_submit.

JIRA NVGPU-1042

Change-Id: I7dfc874fdde2d97d543c25ac139db23f723985a1
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1848120
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-12 17:35:10 +05:30
Philip Elcan
bb1753d1be gpu: nvgpu: unit: common tmake for poxix-mockio
This updates the tmake Makefiles for posix-mockio to use the new common
makefiles.

Change-Id: I3aabb5b09533ab36584f5249b8489c41e9dc56f9
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1916823
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>
2018-10-12 17:35:09 +05:30
Philip Elcan
712d4c1fe1 gpu: nvgpu: unit: common tmake for poxix-env
This updates the tmake Makefiles for posix-env to use the new common
makefiles.

Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Change-Id: Ib9c2830fa58f0d960c998a5f184b7efb7c7d6fdc
Reviewed-on: https://git-master.nvidia.com/r/1916822
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>
2018-10-12 17:35:09 +05:30
Philip Elcan
a8dec2fdc3 gpu: nvgpu: unit: common tmake for posix-bitmap
This updates the tmake Makefiles for posix-bitmap to use the new common
makefiles.

Change-Id: I83f3c750e286c0211976b8d9143cdc05e78a9acb
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1916819
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>
2018-10-12 17:35:09 +05:30
Philip Elcan
19f45ae2d9 gpu: nvgpu: unit: add common tmake files
This creates common files for tmake that can be included by the unit
tests to simplify the makefiles and make the process common.

Change-Id: I46493b7fd7c5d5b1b2d592cb41a4bee770b5b9fa
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1916818
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>
2018-10-12 17:35:09 +05:30
Alex Waterman
1f1134544d gpu: nvgpu: unit: Add script to install unit tests
Add a script to install unit tests on a target jetson board.
The installation consists of copying all the binaries generated
by tmake over to that target board and building a source tree
that matches the nvgpu code.

The reason the systemimage out directory is not used is this
is created by the `image createfs' command during the build
process. This script will work after just a simple `tmm[p]'

Change-Id: I1f2650e666a42c12762ab444159b69ba8fc582f8
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1850545
Reviewed-by: Philip Elcan <pelcan@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-12 17:35:09 +05:30
Alex Waterman
e1da1cd2c2 gpu: nvgpu: unit: Delete unused Makefile
The nvgpu unit test binary and shim library are built
from nvgpu/userspace. The Makefile.tmk in nvgpu/userspace/src
was not being used for anything it seems.

This also updates the nvgpu/userspace makefile to specify the
dependence on libnvgpu-drv.so.

Change-Id: I24b6682c7ebf84c36ef38923eee96a6277a7083c
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1850544
Reviewed-by: Philip Elcan <pelcan@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-12 17:35:09 +05:30
Terje Bergstrom
3bda3a0678 Revert "Revert "gpu: nvgpu: add turing support""
This reverts commit 278842d6ff4e15467e0b8761c6e1b2a05f926f91.

Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Change-Id: I37f47c137c048ddc3a728e143b6f30be525de120
Reviewed-on: https://git-master.nvidia.com/r/1918622
2018-10-12 17:35:09 +05:30
David Gilhooley
b74a4dbd26 Revert "gpu: nvgpu: add turing support"
This reverts commit 27686d8b56316c7ad772dd91548e91516d59f3b1.

Change-Id: Iebda705858edbd58c10ca3024a4ad060401485b6
Signed-off-by: David Gilhooley <dgilhooley@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1918612
2018-10-12 17:35:09 +05:30
Deepak Nibade
51244d6112 gpu: nvgpu: add turing support
Add Turing specific common, unit, hardware header files

Make all the Makefile and Makefile.sources changes to compile
all Turing specific code

Bug 200454999

Change-Id: I62ebff5c078b4b8817fc83ea0e4ee3cfffe668dc
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1917983
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
2018-10-12 17:35:09 +05:30
Konsta Holtta
7138e01666 gpu: nvgpu: posix: fix reg space boundaries
The nvgpu_posix_io_get_reg_space was incorrectly checking the upper
boundary of the register space. Likewise, the mockIO test was passing
where it shouldn't have.

Change-Id: Ic45d99f0e1b27a87421f331b2f0ff4b4729f859f
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1852640
Reviewed-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
Reviewed-by: Konsta Holtta <kholtta@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>
2018-10-12 17:35:08 +05:30
Konsta Holtta
2cafb5fe74 gpu: nvgpu: unit: close the module dir
Call closedir on the opened load directory also on success; it was there
only for the error path.

Change-Id: I869c9e583fdf7453c752744b0af054d521717feb
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1916642
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-12 17:35:08 +05:30
Nicolas Benech
673da85d36 gpu: nvgpu: unit: Add mockio unit test to tmake
MockIO unit test went in before the tmake changes. Now
adding tmake files so that it builds for target.

Change-Id: I9f08076a46f8f6487342553999d43279fb74cabb
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1851219
Reviewed-by: Philip Elcan <pelcan@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>
2018-10-12 17:35:08 +05:30
Alex Waterman
bdf6176a34 gpu: nvgpu: unit: Add posix-env test to unit tests
Add the posix-env test to the unit test suite that gets built
by tmake. This test caught a legit bug in the posix impl on
the target platform which needed to be fixed first.

JIRA NVGPU-1234

Change-Id: Ic62eac0bb62741dd03883dcd24c57b49ff67fa0e
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1846180
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
Reviewed-by: Philip Elcan <pelcan@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-10-12 17:35:07 +05:30
Nicolas Benech
ac87a707b3 gpu: nvgpu: posix: Multithreading for unit tests
Add a -j argument to enable running unit tests on several
threads. Also adds signal handling to prevent a fatal
error in one thread from killing the whole unit test
framework.

JIRA NVGPU-1043

Change-Id: I891a547640cd005a50ffa5c06367ed46c54de012
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1847740
Reviewed-by: svc-misra-checker <svc-misra-checker@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>
2018-10-12 17:35:07 +05:30
Philip Elcan
bf99dfdaf2 gpu: nvgpu: unit: update unit.h for target
The directory structure is every so slightly different on target, so
this handles the differences.

JIRA NVGPU-1042

Change-Id: I5a0566c7d371fcb5cd541c71841e8acedfaac6e2
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1837443
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
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>
2018-09-24 15:54:55 -07:00
Philip Elcan
b3127c45fb gpu: nvgpu: unit: build posix-bitops in tmake
This builds the posix-bitops unit test shared library in the tmake build
system for target.  The systemimage output is in
nvgpu_unit/build/units/libunit-posix-bitops.so

JIRA NVGPU-1042

Change-Id: Id73a1f3e7d8de4e21e3a7f5c5bd036e0ce62ad3e
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1822288
Reviewed-by: svc-misra-checker <svc-misra-checker@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>
2018-09-24 15:54:18 -07:00
Philip Elcan
9ac1e34312 gpu: nvgpu: unit: build in tmake
This builds the nvgpu userspace in the tmake build system. The shared
library and the unit test binary are built for target. The output goes
to the systemimage in nvgpu_unit/build.

JIRA NVGPU-1042

Change-Id: I70a118bc02789caf838b2b8e9d6778e94239c56f
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1822287
Reviewed-by: svc-misra-checker <svc-misra-checker@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>
2018-09-24 15:54:13 -07:00
Nicolas Benech
5c7a740403 gpu: nvgpu: unit: Add mockio unit test
Add a unit test to make sure the posix IO mocking works
corretly.

JIRA NVGPU-1040

Change-Id: Iadec2f515c9dd74dc0723885b3a6560dc91ce052
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1741954
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-09-24 15:52:34 -07:00
Alex Waterman
ec067c5ed1 gpu: nvgpu: Add POSIX sanity unit test
Add a unit test to do sanity checks for the environment. These
checks currently include:

  - Size of types (f.e. u32 is really 4 bytes)
  - Signedness of types (u32 is really unsigned)
  - Endianness check
  - Pointers fit in u64s

Note: the endianness check does not fail for either detected
endianness. It just prints the determined endianness. The exception
to this is if the check itself is broken and does not successfully
determine what endianness the underlying machine is. In that case
the test fails. Unless the underlying architure is a so called
middle endian machine something is horribly wrong.

We will determine what to actually do about this endianness
check once we determine what we need to do with BIOS fields,
etc. We proabbly don't really care what the machine endianness is
but we do need to make sure that we access data that may not match
machine endianness correctly.

JIRA NVGPU-1039

Change-Id: I5be68cf4dcea87e9e746262fcc0372380ef57df4
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1816897
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-09-20 15:14:51 -07:00
Philip Elcan
fa7394037c gpu: nvgpu: unit: posix_bitops: fix fls() tests
The fls() test assumed fls(1)=0, but really fls(1)=1, etc.

Bug found as result of JIRA NVGPU-1042.

Change-Id: I8d0ffe53277f4923a970b46788165ef03b385703
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1828362
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svc-misra-checker <svc-misra-checker@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>
2018-09-20 12:58:54 -07:00
Konsta Holtta
1982d050cc gpu: nvgpu: unit: deref twice in qsort callback
The compare function for qsort takes pointers to compared elements, and
our elements are already pointers so the void pointer has to be cast to
a pointer pointer. Dereferencing only once would compare some data
that's in the array of module pointers (or past it), not the actual data
where the module pointers point to.

Change-Id: I65678863eddd6fc86d4ffceb621f8123944b058d
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1828164
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-09-17 23:42:05 -07:00
Konsta Holtta
cf394f82d4 gpu: nvgpu: include correct header in bitops test
The right one is nvgpu/bitops.h, not nvgpu/posix/bitops.h even though
this is a test for the posix layer. The latter is not meant to be
included directly and does not contain everything necessary.

Change-Id: I86a580abc6202064a3fbaa445bb1618b91e5ac4c
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1812230
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Scott Long <scottl@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Tested-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-09-04 09:44:27 -07:00