From cf29b8cc9f71202944dc7937d3ddac998f1144bc Mon Sep 17 00:00:00 2001 From: Jordan Crouse Date: Tue, 9 Dec 2014 10:22:42 -0700 Subject: 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 --- drivers/staging/android/ion/msm/secure_buffer.c | 11 +++++++++++ 1 file changed, 11 insertions(+) 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); } -- cgit v1.2.3