@@ -1048,6 +1048,18 @@ static int scm_ioctl_event_check(struct scm_data *scm_data, u64 __user *uarg)
return rc;
}
+/**
+ * scm_req_controller_health_perf() - Request controller health & performance data
+ * @scm_data: the SCM metadata
+ * Return: 0 on success, negative on failure
+ */
+int scm_req_controller_health_perf(struct scm_data *scm_data)
+{
+ return ocxl_global_mmio_set64(scm_data->ocxl_afu, GLOBAL_MMIO_HCI,
+ OCXL_LITTLE_ENDIAN,
+ GLOBAL_MMIO_HCI_REQ_HEALTH_PERF);
+}
+
static long scm_file_ioctl(struct file *file, unsigned int cmd,
unsigned long args)
{
@@ -1086,6 +1098,10 @@ static long scm_file_ioctl(struct file *file, unsigned int cmd,
case SCM_IOCTL_EVENT_CHECK:
rc = scm_ioctl_event_check(scm_data, (u64 __user *)args);
break;
+
+ case SCM_IOCTL_REQUEST_HEALTH:
+ rc = scm_req_controller_health_perf(scm_data);
+ break;
}
return rc;
@@ -90,5 +90,6 @@ struct scm_ioctl_eventfd {
#define SCM_IOCTL_CONTROLLER_STATS _IO(SCM_MAGIC, 0x05)
#define SCM_IOCTL_EVENTFD _IOW(SCM_MAGIC, 0x06, struct scm_ioctl_eventfd)
#define SCM_IOCTL_EVENT_CHECK _IOR(SCM_MAGIC, 0x07, __u64)
+#define SCM_IOCTL_REQUEST_HEALTH _IO(SCM_MAGIC, 0x08)
#endif /* _UAPI_OCXL_SCM_H */