diff options
| author | Sri Krishna chowdary <schowdary@nvidia.com> | 2016-03-26 05:47:37 -0400 |
|---|---|---|
| committer | Sri Krishna Chowdary <schowdary@nvidia.com> | 2016-05-26 01:37:48 -0400 |
| commit | dbbc7368c3cca4973fd629cb00a34c652c470c88 (patch) | |
| tree | 21953c8e2fa804d5c0abc07d7f613553004dc9de /include | |
| parent | a2ce20ccfa6c9aea5dd003ed42c642d0a3fbe7bf (diff) | |
video: tegra: nvmap: Replace zap with mprotect
Despite zap being costly, zap was used as nvmap wants to be able
to disallow access to handle on any cpu access. Now this is made
available through a fixup_prot handler so a less costly operation
like mprotect can be used.
During NVMAP_PAGES_RESERVE operation, use mprotect to set
permissions to __P000.
On NVMAP_PAGES_UNRESERVE, just modify the vm_flags to allow nvmap
know about the first cpu access using fixup_prot handler and do
necessary cache operations. If fixup_prot returns true, the pte
will be fixed up with proper protections.
NVMAP_PAGES_INSERT_ON_UNRESERVE fixes up the pte protections as well.
Rename NVMAP_PAGES_ZAP_AND_CLEAN as NVMAP_PAGES_PROT_AND_CLEAN,
this is same as doing a NVMAP_PAGES_RESERVE followed by
NVMAP_PAGES_UNRESERVE.
Bug 200174682
Change-Id: I0a30deead282873d61bab96742fa840d89a40910
Signed-off-by: Sri Krishna chowdary <schowdary@nvidia.com>
Reviewed-on: http://git-master/r/1131814
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/nvmap.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/nvmap.h b/include/linux/nvmap.h index 7d24a40e0..8524e7a71 100644 --- a/include/linux/nvmap.h +++ b/include/linux/nvmap.h | |||
| @@ -127,7 +127,7 @@ enum { | |||
| 127 | NVMAP_PAGES_UNRESERVE = 0, | 127 | NVMAP_PAGES_UNRESERVE = 0, |
| 128 | NVMAP_PAGES_RESERVE, | 128 | NVMAP_PAGES_RESERVE, |
| 129 | NVMAP_INSERT_PAGES_ON_UNRESERVE, | 129 | NVMAP_INSERT_PAGES_ON_UNRESERVE, |
| 130 | NVMAP_PAGES_ZAP_AND_CLEAN, | 130 | NVMAP_PAGES_PROT_AND_CLEAN, |
| 131 | }; | 131 | }; |
| 132 | 132 | ||
| 133 | struct nvmap_create_handle { | 133 | struct nvmap_create_handle { |
