summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan Crouse <jcrouse@codeaurora.org>2014-12-09 10:22:42 -0700
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-22 11:04:20 -0700
commitcf29b8cc9f71202944dc7937d3ddac998f1144bc (patch)
treeaa7eb94de5cd2617d906243954c85b25679795c0
parentfae73f3a16f8c02ff5ff74089475a5bf34d88da3 (diff)
ion: Set the private page flag on secure chunks
Set the private page flag on secure chunks to give other entities a clue that the memory is special. Change-Id: Ic0dedbad4b41a874a3f80dec75d0721d30307094 Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
-rw-r--r--drivers/staging/android/ion/msm/secure_buffer.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/staging/android/ion/msm/secure_buffer.c b/drivers/staging/android/ion/msm/secure_buffer.c
index d605de5e19f0..ee583220c60a 100644
--- a/drivers/staging/android/ion/msm/secure_buffer.c
+++ b/drivers/staging/android/ion/msm/secure_buffer.c
@@ -145,6 +145,17 @@ static int secure_buffer_change_table(struct sg_table *table, int lock)
ret = secure_buffer_change_chunk(virt_to_phys(chunk_list),
nchunks, V2_CHUNK_SIZE, lock);
+ if (!ret) {
+ /*
+ * Set or clear the private page flag to communicate the
+ * status of the chunk to other entities
+ */
+ if (lock)
+ SetPagePrivate(sg_page(sg));
+ else
+ ClearPagePrivate(sg_page(sg));
+ }
+
kfree(chunk_list);
}