From d7196d41222a2b314d8634834f76fda4a0273fd6 Mon Sep 17 00:00:00 2001 From: Alexey Skidanov Date: Thu, 27 Nov 2014 16:21:53 +0200 Subject: [PATCH] IOCTL: Adding memory exception data Signed-off-by: Alexey Skidanov Reviewed-by: Oded Gabbay --- include/linux/kfd_ioctl.h | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/include/linux/kfd_ioctl.h b/include/linux/kfd_ioctl.h index da4668300d..693b3f64f9 100644 --- a/include/linux/kfd_ioctl.h +++ b/include/linux/kfd_ioctl.h @@ -194,8 +194,35 @@ struct kfd_ioctl_reset_event_args { uint32_t pad; }; + +struct kfd_memory_exception_failure { + bool NotPresent; /* Page not present or supervisor privilege */ + bool ReadOnly; /* Write access to a read-only page */ + bool NoExecute; /* Execute access to a page marked NX */ + bool pad; +}; + +/* memory exception data*/ +struct kfd_hsa_memory_exception_data { + uint64_t va; + uint32_t gpu_id; + struct kfd_memory_exception_failure failure; +}; + +/* Event data*/ +struct kfd_event_data { + union { + struct kfd_hsa_memory_exception_data memory_exception_data; + }; /* From KFD */ + uint64_t kfd_event_data_ext; /* pointer to an extension structure + for future exception types */ + uint32_t event_id; /* to KFD */ + uint32_t pad; +}; + struct kfd_ioctl_wait_events_args { - uint64_t events_ptr; /* to KFD */ + uint64_t events_ptr; /* pointed to struct + kfd_event_data array, to KFD */ uint32_t num_events; /* to KFD */ uint32_t wait_for_all; /* to KFD */ uint32_t timeout; /* to KFD */