This change modifies the user fault handler to
- allow read access on reserved page
- do not mark pages which are read by cpu as dirty
Bug
1444151
Bug
1444298
Change-Id: Ic0550503fe27ecd179e9d24f09cc344613249be5
Signed-off-by: Sri Krishna chowdary <schowdary@nvidia.com>
Reviewed-on: http://git-master/r/403969
(cherry picked from commit
d8c2a9f56bbfbb90d90719a8fcae58e1b6f0df3c)
Reviewed-on: http://git-master/r/405155
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
page = pfn_to_page(pfn);
} else {
offs >>= PAGE_SHIFT;
- if (nvmap_page_reserved(priv->handle->pgalloc.pages[offs]))
- return VM_FAULT_SIGBUS;
+ if (vmf->flags & (FAULT_FLAG_WRITE | FAULT_FLAG_MKWRITE)) {
+ if (nvmap_page_reserved(priv->handle->pgalloc.pages[offs]))
+ return VM_FAULT_SIGBUS;
+ nvmap_page_mkdirty(&priv->handle->pgalloc.pages[offs]);
+ }
page = nvmap_to_page(priv->handle->pgalloc.pages[offs]);
- nvmap_page_mkdirty(&priv->handle->pgalloc.pages[offs]);
}
if (page)