<feed xmlns='http://www.w3.org/2005/Atom'>
<title>nvidia-tegra-modules.git/drivers/video/tegra/nvmap/nvmap_alloc.c, branch gpu-paging</title>
<subtitle>NVIDIA's kernel modules to support tegra chips (used in Jetson boards)</subtitle>
<link rel='alternate' type='text/html' href='http://rtsrv.cs.unc.edu/cgit/cgit.cgi/nvidia-tegra-modules.git/'/>
<entry>
<title>gpu-paging: Functions to support initial working version</title>
<updated>2022-05-25T01:16:30+00:00</updated>
<author>
<name>Joshua Bakita</name>
<email>jbakita@cs.unc.edu</email>
</author>
<published>2022-05-25T01:16:30+00:00</published>
<link rel='alternate' type='text/html' href='http://rtsrv.cs.unc.edu/cgit/cgit.cgi/nvidia-tegra-modules.git/commit/?id=2c076a01e5bd0949032ef81cd0e2d37bdecafba5'/>
<id>2c076a01e5bd0949032ef81cd0e2d37bdecafba5</id>
<content type='text'>
- Buffer deallocation (+IOCTL)
- Buffer reallocation
- Private dmabuf user list and accessor
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- Buffer deallocation (+IOCTL)
- Buffer reallocation
- Private dmabuf user list and accessor
</pre>
</div>
</content>
</entry>
<entry>
<title>tegra: nvmap: Address few inappropriate mixes of integer types</title>
<updated>2021-07-09T23:54:44+00:00</updated>
<author>
<name>Martin Radev</name>
<email>mradev@nvidia.com</email>
</author>
<published>2021-06-01T12:16:44+00:00</published>
<link rel='alternate' type='text/html' href='http://rtsrv.cs.unc.edu/cgit/cgit.cgi/nvidia-tegra-modules.git/commit/?id=1b1628709790f71ebb4bcf024164f5ff3da54201'/>
<id>1b1628709790f71ebb4bcf024164f5ff3da54201</id>
<content type='text'>
There are possible value truncations when mixing types of different
width, e.g. s32 (int), u32, u64. This patch attempts to address
such issues in two ways:
1) Manually find and fix error-prone mixing.
2) Prevent creating a handle from an exuberantly large size.

The maximum selected size is set to maximum of system memory. This
is expected to be small enough that the number of pages fits even
in s32. This should offer some future protection in case nvmap starts
mixing int and u64 again.

Bug 3315168

Change-Id: Icb83d745a7b1955ec473bec46f12a3ae25ad73af
Signed-off-by: Martin Radev &lt;mradev@nvidia.com&gt;
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2537851
(cherry picked from commit 5fa42e9d5f73a937995f87ba28b99d3b891d8f3a)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2547360
Tested-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
Reviewed-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There are possible value truncations when mixing types of different
width, e.g. s32 (int), u32, u64. This patch attempts to address
such issues in two ways:
1) Manually find and fix error-prone mixing.
2) Prevent creating a handle from an exuberantly large size.

The maximum selected size is set to maximum of system memory. This
is expected to be small enough that the number of pages fits even
in s32. This should offer some future protection in case nvmap starts
mixing int and u64 again.

Bug 3315168

Change-Id: Icb83d745a7b1955ec473bec46f12a3ae25ad73af
Signed-off-by: Martin Radev &lt;mradev@nvidia.com&gt;
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2537851
(cherry picked from commit 5fa42e9d5f73a937995f87ba28b99d3b891d8f3a)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2547360
Tested-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
Reviewed-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>video: tegra: nvmap: add support to create RO handle from user VA</title>
<updated>2021-05-11T03:40:05+00:00</updated>
<author>
<name>Puneet Saxena</name>
<email>puneets@nvidia.com</email>
</author>
<published>2020-07-07T16:06:40+00:00</published>
<link rel='alternate' type='text/html' href='http://rtsrv.cs.unc.edu/cgit/cgit.cgi/nvidia-tegra-modules.git/commit/?id=a3c08fdbdb3508ac4895fd159aaabff576fdcd14'/>
<id>a3c08fdbdb3508ac4895fd159aaabff576fdcd14</id>
<content type='text'>
User malloc + mprotect/mmap a buffer as RO and
as part of alloc_from_va, user pass
the ACCESS_FLAGS as RO and expects  NvMap to give dma_buf_fd with
RO access.

Below are the conditions result in NvRmMemHandle creation -

1) VA: RO and Attr: RW
	- Don't create NvMap Handle
2) VA: RO and Attr: RO
	- Create NvMap Handle and set dma_buf_fd as RO
3) VA: RW and Attr: RO
	- Create NvMap Handle and set dma_buf_fd as RO
4) Mixed VA: RO + RW and Attr: RO
	- Create NvMap Handle with dma_buf_fd as RO for the whole
	  buffer
5) Mixed VA: RO + RW and Attr: RW
	- Don't Create NvMap Handle

If few pages of the buffer is set as RO and rest as RW,
multiple vma are created and vma-&gt;end and vma-&gt;start doesn't
differ by the buffer size, passed to create handle from VA.
Hence remove the check. Anyway the check is done in get_user_pages.

The change sets dma_buf_fd as RW/RO so that other process
should fetch the access permission just by reading f_mode
of dma_buf_fd.

Bug 200621238
Bug 200634660

Change-Id: I9c50c6f28664f0ff9f70dc08b15d93389e7d7201
Signed-off-by: Puneet Saxena &lt;puneets@nvidia.com&gt;
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2515023
(cherry picked from commit 0514e68ce8948428b417c55057a4dd2f57acd9c2)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2521313
Reviewed-by: svc-mobile-coverity &lt;svc-mobile-coverity@nvidia.com&gt;
Reviewed-by: Bibek Basu &lt;bbasu@nvidia.com&gt;
Reviewed-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
Tested-by: Amulya Yarlagadda &lt;ayarlagadda@nvidia.com&gt;
Tested-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
GVS: Gerrit_Virtual_Submit
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
User malloc + mprotect/mmap a buffer as RO and
as part of alloc_from_va, user pass
the ACCESS_FLAGS as RO and expects  NvMap to give dma_buf_fd with
RO access.

Below are the conditions result in NvRmMemHandle creation -

1) VA: RO and Attr: RW
	- Don't create NvMap Handle
2) VA: RO and Attr: RO
	- Create NvMap Handle and set dma_buf_fd as RO
3) VA: RW and Attr: RO
	- Create NvMap Handle and set dma_buf_fd as RO
4) Mixed VA: RO + RW and Attr: RO
	- Create NvMap Handle with dma_buf_fd as RO for the whole
	  buffer
5) Mixed VA: RO + RW and Attr: RW
	- Don't Create NvMap Handle

If few pages of the buffer is set as RO and rest as RW,
multiple vma are created and vma-&gt;end and vma-&gt;start doesn't
differ by the buffer size, passed to create handle from VA.
Hence remove the check. Anyway the check is done in get_user_pages.

The change sets dma_buf_fd as RW/RO so that other process
should fetch the access permission just by reading f_mode
of dma_buf_fd.

Bug 200621238
Bug 200634660

Change-Id: I9c50c6f28664f0ff9f70dc08b15d93389e7d7201
Signed-off-by: Puneet Saxena &lt;puneets@nvidia.com&gt;
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2515023
(cherry picked from commit 0514e68ce8948428b417c55057a4dd2f57acd9c2)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2521313
Reviewed-by: svc-mobile-coverity &lt;svc-mobile-coverity@nvidia.com&gt;
Reviewed-by: Bibek Basu &lt;bbasu@nvidia.com&gt;
Reviewed-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
Tested-by: Amulya Yarlagadda &lt;ayarlagadda@nvidia.com&gt;
Tested-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
GVS: Gerrit_Virtual_Submit
</pre>
</div>
</content>
</entry>
<entry>
<title>video: tegra: nvmap: add support for page coloring</title>
<updated>2018-06-14T21:29:17+00:00</updated>
<author>
<name>Krishna Reddy</name>
<email>vdumpa@nvidia.com</email>
</author>
<published>2018-06-13T01:45:46+00:00</published>
<link rel='alternate' type='text/html' href='http://rtsrv.cs.unc.edu/cgit/cgit.cgi/nvidia-tegra-modules.git/commit/?id=518191e7718d8141b1136a1fc994d4ace0293895'/>
<id>518191e7718d8141b1136a1fc994d4ace0293895</id>
<content type='text'>
Add support for coloring pages on T194.
Page coloring can improve the memory access perf.

Bug 1924977

Change-Id: I586c99a41d93c68ee324158d7ebf4a98d0d2640f
Signed-off-by: Alex Van Brunt &lt;avanbrunt@nvidia.com&gt;
Signed-off-by: Krishna Reddy &lt;vdumpa@nvidia.com&gt;
Reviewed-on: https://git-master.nvidia.com/r/1747942
Reviewed-by: svc-mobile-coverity &lt;svc-mobile-coverity@nvidia.com&gt;
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
Tested-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add support for coloring pages on T194.
Page coloring can improve the memory access perf.

Bug 1924977

Change-Id: I586c99a41d93c68ee324158d7ebf4a98d0d2640f
Signed-off-by: Alex Van Brunt &lt;avanbrunt@nvidia.com&gt;
Signed-off-by: Krishna Reddy &lt;vdumpa@nvidia.com&gt;
Reviewed-on: https://git-master.nvidia.com/r/1747942
Reviewed-by: svc-mobile-coverity &lt;svc-mobile-coverity@nvidia.com&gt;
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
Tested-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>video: tegra: nvmap: support bigger page allocations</title>
<updated>2018-05-18T21:05:21+00:00</updated>
<author>
<name>Krishna Reddy</name>
<email>vdumpa@nvidia.com</email>
</author>
<published>2018-05-15T00:07:42+00:00</published>
<link rel='alternate' type='text/html' href='http://rtsrv.cs.unc.edu/cgit/cgit.cgi/nvidia-tegra-modules.git/commit/?id=d5181587851e8e0c842942685e9214876f33e73a'/>
<id>d5181587851e8e0c842942685e9214876f33e73a</id>
<content type='text'>
Support bigger page size allocations as possible for
NvMap allocations.
The big page is configurable and is set to 64K as a default.
NvMap would try to allcoate 64KB pages before fallback to 4KB
page size allocations.

Bug 2109966

Change-Id: I2abee7e33417d2a0ece944c4766378946f035b77
Signed-off-by: Krishna Reddy &lt;vdumpa@nvidia.com&gt;
Reviewed-on: https://git-master.nvidia.com/r/1718880
Reviewed-by: Navneet Kumar &lt;navneetk@nvidia.com&gt;
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
Tested-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Support bigger page size allocations as possible for
NvMap allocations.
The big page is configurable and is set to 64K as a default.
NvMap would try to allcoate 64KB pages before fallback to 4KB
page size allocations.

Bug 2109966

Change-Id: I2abee7e33417d2a0ece944c4766378946f035b77
Signed-off-by: Krishna Reddy &lt;vdumpa@nvidia.com&gt;
Reviewed-on: https://git-master.nvidia.com/r/1718880
Reviewed-by: Navneet Kumar &lt;navneetk@nvidia.com&gt;
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
Tested-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>video: tegra: nvmap: cleanup obsolete NvMap config options</title>
<updated>2018-05-08T21:48:38+00:00</updated>
<author>
<name>Krishna Reddy</name>
<email>vdumpa@nvidia.com</email>
</author>
<published>2018-04-30T21:23:44+00:00</published>
<link rel='alternate' type='text/html' href='http://rtsrv.cs.unc.edu/cgit/cgit.cgi/nvidia-tegra-modules.git/commit/?id=404d439045316bbe6025b3ca796e460e0cd064f6'/>
<id>404d439045316bbe6025b3ca796e460e0cd064f6</id>
<content type='text'>
Cleanup the following obsolete config otpions:
NVMAP_HIGHMEM_ONLY
NVMAP_PAGE_POOLS_INIT_FILLUP
NVMAP_PAGE_POOLS_INIT_FILLUP_SIZE

Bug 2110982

Change-Id: I37505366c4026883bb04d20f698b013f998ca0c1
Signed-off-by: Krishna Reddy &lt;vdumpa@nvidia.com&gt;
Reviewed-on: https://git-master.nvidia.com/r/1705733
Reviewed-by: svc-mobile-coverity &lt;svc-mobile-coverity@nvidia.com&gt;
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
Tested-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Cleanup the following obsolete config otpions:
NVMAP_HIGHMEM_ONLY
NVMAP_PAGE_POOLS_INIT_FILLUP
NVMAP_PAGE_POOLS_INIT_FILLUP_SIZE

Bug 2110982

Change-Id: I37505366c4026883bb04d20f698b013f998ca0c1
Signed-off-by: Krishna Reddy &lt;vdumpa@nvidia.com&gt;
Reviewed-on: https://git-master.nvidia.com/r/1705733
Reviewed-by: svc-mobile-coverity &lt;svc-mobile-coverity@nvidia.com&gt;
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
Tested-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>video: tegra: nvmap: cleanup unnecessary PAGE_ALIGN usage</title>
<updated>2018-05-01T23:33:29+00:00</updated>
<author>
<name>Krishna Reddy</name>
<email>vdumpa@nvidia.com</email>
</author>
<published>2018-04-30T23:03:36+00:00</published>
<link rel='alternate' type='text/html' href='http://rtsrv.cs.unc.edu/cgit/cgit.cgi/nvidia-tegra-modules.git/commit/?id=6c14e176ecdf77c83b641053271bc21d65e51a1f'/>
<id>6c14e176ecdf77c83b641053271bc21d65e51a1f</id>
<content type='text'>
Bug 2110982

Change-Id: I026c5b0be606d5e9d98b048a4f160ef591efcecb
Signed-off-by: Krishna Reddy &lt;vdumpa@nvidia.com&gt;
Reviewed-on: https://git-master.nvidia.com/r/1705783
Reviewed-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
Tested-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Bug 2110982

Change-Id: I026c5b0be606d5e9d98b048a4f160ef591efcecb
Signed-off-by: Krishna Reddy &lt;vdumpa@nvidia.com&gt;
Reviewed-on: https://git-master.nvidia.com/r/1705783
Reviewed-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
Tested-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>video: tegra: nvmap: report gup error correctly</title>
<updated>2018-05-01T19:23:02+00:00</updated>
<author>
<name>Navneet Kumar</name>
<email>navneetk@nvidia.com</email>
</author>
<published>2018-04-24T18:30:06+00:00</published>
<link rel='alternate' type='text/html' href='http://rtsrv.cs.unc.edu/cgit/cgit.cgi/nvidia-tegra-modules.git/commit/?id=382a091d34140d0c53b21737bebef9bcda90fa57'/>
<id>382a091d34140d0c53b21737bebef9bcda90fa57</id>
<content type='text'>
Report the error reported by get_user_pages (gup) correctly. While at it,
simplify the cleanup code associated with it.

Bug 1784061

Change-Id: Iead6bc4701e11dfb7c30fb2fe1d6dd2c3e2789f8
Signed-off-by: Navneet Kumar &lt;navneetk@nvidia.com&gt;
Reviewed-on: https://git-master.nvidia.com/r/1701725
Reviewed-by: svc-mobile-coverity &lt;svc-mobile-coverity@nvidia.com&gt;
Reviewed-by: Pritesh Raithatha &lt;praithatha@nvidia.com&gt;
Reviewed-by: Krishna Reddy &lt;vdumpa@nvidia.com&gt;
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
Tested-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Report the error reported by get_user_pages (gup) correctly. While at it,
simplify the cleanup code associated with it.

Bug 1784061

Change-Id: Iead6bc4701e11dfb7c30fb2fe1d6dd2c3e2789f8
Signed-off-by: Navneet Kumar &lt;navneetk@nvidia.com&gt;
Reviewed-on: https://git-master.nvidia.com/r/1701725
Reviewed-by: svc-mobile-coverity &lt;svc-mobile-coverity@nvidia.com&gt;
Reviewed-by: Pritesh Raithatha &lt;praithatha@nvidia.com&gt;
Reviewed-by: Krishna Reddy &lt;vdumpa@nvidia.com&gt;
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
Tested-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>video: tegra: nvmap: Remove runtime capability of forcing zero pages</title>
<updated>2018-03-01T20:54:14+00:00</updated>
<author>
<name>Ashish Mhetre</name>
<email>amhetre@nvidia.com</email>
</author>
<published>2018-02-28T10:36:10+00:00</published>
<link rel='alternate' type='text/html' href='http://rtsrv.cs.unc.edu/cgit/cgit.cgi/nvidia-tegra-modules.git/commit/?id=1c00147d53fcb679b6534d5e6bd0cbd6c8e094f8'/>
<id>1c00147d53fcb679b6534d5e6bd0cbd6c8e094f8</id>
<content type='text'>
zero_memory_set() API in nvmap_alloc is not getting used anywhere.
Hence removing it. This will improve code coverage.

Bug 200386771

Change-Id: I4750c5d3984c45c46d4b0fb72348b831944deecc
Signed-off-by: Ashish Mhetre &lt;amhetre@nvidia.com&gt;
Reviewed-on: https://git-master.nvidia.com/r/1665746
Reviewed-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
Tested-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
zero_memory_set() API in nvmap_alloc is not getting used anywhere.
Hence removing it. This will improve code coverage.

Bug 200386771

Change-Id: I4750c5d3984c45c46d4b0fb72348b831944deecc
Signed-off-by: Ashish Mhetre &lt;amhetre@nvidia.com&gt;
Reviewed-on: https://git-master.nvidia.com/r/1665746
Reviewed-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
Tested-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>video: tegra: nvmap: Fix carveout free leak</title>
<updated>2018-01-26T01:39:44+00:00</updated>
<author>
<name>David Gilhooley</name>
<email>dgilhooley@nvidia.com</email>
</author>
<published>2018-01-18T22:51:42+00:00</published>
<link rel='alternate' type='text/html' href='http://rtsrv.cs.unc.edu/cgit/cgit.cgi/nvidia-tegra-modules.git/commit/?id=fad27104fc54ba8a138b86576b17ac7476922a59'/>
<id>fad27104fc54ba8a138b86576b17ac7476922a59</id>
<content type='text'>
Fix a bug causing carveout Virtual Addresses to
not be freed when the handle was lazily unmapped

Change-Id: I5f2442b7e2cccacfaf7721eed6c7e630bc1f30a4
Signed-off-by: David Gilhooley &lt;dgilhooley@nvidia.com&gt;
Reviewed-on: https://git-master.nvidia.com/r/1641681
Reviewed-by: svc-mobile-coverity &lt;svc-mobile-coverity@nvidia.com&gt;
GVS: Gerrit_Virtual_Submit
Reviewed-by: Krishna Reddy &lt;vdumpa@nvidia.com&gt;
Reviewed-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
Tested-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix a bug causing carveout Virtual Addresses to
not be freed when the handle was lazily unmapped

Change-Id: I5f2442b7e2cccacfaf7721eed6c7e630bc1f30a4
Signed-off-by: David Gilhooley &lt;dgilhooley@nvidia.com&gt;
Reviewed-on: https://git-master.nvidia.com/r/1641681
Reviewed-by: svc-mobile-coverity &lt;svc-mobile-coverity@nvidia.com&gt;
GVS: Gerrit_Virtual_Submit
Reviewed-by: Krishna Reddy &lt;vdumpa@nvidia.com&gt;
Reviewed-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
Tested-by: mobile promotions &lt;svcmobile_promotions@nvidia.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
