Skip to content

Commit

Permalink
hsa/radeon: Clear allocated page to UNSIGNALED_EVENT_SLOT
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Lewycky <Andrew.Lewycky@amd.com>
Signed-off-by: Oded Gabbay <oded.gabbay@amd.com>
  • Loading branch information
Andrew Lewycky authored and Oded Gabbay committed Jul 2, 2014
1 parent 0fb34ab commit c9a5ff5
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/hsa/radeon/kfd_events.c
Original file line number Diff line number Diff line change
@@ -140,7 +140,7 @@ bool allocate_signal_page(struct file *devkfd, struct kfd_process *p)
if (!backing_store)
goto fail_alloc_signal_store;

memset(backing_store, 0, PAGE_SIZE); /* prevent user-mode info leaks */
memset(backing_store, (uint8_t)UNSIGNALED_EVENT_SLOT, PAGE_SIZE); /* prevent user-mode info leaks */
page->kernel_address = backing_store;

if (list_empty(&p->signal_event_pages))
1 change: 1 addition & 0 deletions drivers/gpu/hsa/radeon/kfd_events.h
Original file line number Diff line number Diff line change
@@ -36,6 +36,7 @@
/* Written into kfd_signal_slot_t to indicate that the event is not signaled.
* Since the event protocol may need to write the event ID into memory, this
* must not be a valid event ID.
* For the sake of easy memset-ing, this must be a byte pattern.
*/
#define UNSIGNALED_EVENT_SLOT ((uint64_t)-1)

0 comments on commit c9a5ff5

Please sign in to comment.