Lines Matching refs:uv_ioctl
74 static int uvio_uvdev_info(struct uvio_ioctl_cb *uv_ioctl) in uvio_uvdev_info() argument
76 void __user *user_buf_arg = (void __user *)uv_ioctl->argument_addr; in uvio_uvdev_info()
78 if (uv_ioctl->argument_len < sizeof(uvdev_info)) in uvio_uvdev_info()
83 uv_ioctl->uv_rc = UVC_RC_EXECUTED; in uvio_uvdev_info()
110 struct uvio_ioctl_cb *uv_ioctl, in uvio_copy_attest_result_to_user() argument
114 struct uvio_attest __user *user_uvio_attest = (void __user *)uv_ioctl->argument_addr; in uvio_copy_attest_result_to_user()
131 static int get_uvio_attest(struct uvio_ioctl_cb *uv_ioctl, struct uvio_attest *uvio_attest) in get_uvio_attest() argument
133 u8 __user *user_arg_buf = (u8 __user *)uv_ioctl->argument_addr; in get_uvio_attest()
185 static int uvio_attestation(struct uvio_ioctl_cb *uv_ioctl) in uvio_attestation() argument
195 if (uv_ioctl->argument_len != sizeof(*uvio_attest)) in uvio_attestation()
203 ret = get_uvio_attest(uv_ioctl, uvio_attest); in uvio_attestation()
229 uv_ioctl->uv_rc = uvcb_attest->header.rc; in uvio_attestation()
230 uv_ioctl->uv_rrc = uvcb_attest->header.rrc; in uvio_attestation()
232 ret = uvio_copy_attest_result_to_user(uvcb_attest, uv_ioctl, measurement, add_data, in uvio_attestation()
269 static int uvio_add_secret(struct uvio_ioctl_cb *uv_ioctl) in uvio_add_secret() argument
271 void __user *user_buf_arg = (void __user *)uv_ioctl->argument_addr; in uvio_add_secret()
279 if (uv_ioctl->argument_len > UVIO_ADD_SECRET_MAX_LEN) in uvio_add_secret()
281 if (uv_ioctl->argument_len == 0) in uvio_add_secret()
284 asrcb = kvzalloc(uv_ioctl->argument_len, GFP_KERNEL); in uvio_add_secret()
289 if (copy_from_user(asrcb, user_buf_arg, uv_ioctl->argument_len)) in uvio_add_secret()
295 uv_ioctl->uv_rc = uvcb.header.rc; in uvio_add_secret()
296 uv_ioctl->uv_rrc = uvcb.header.rrc; in uvio_add_secret()
307 static int uvio_get_list(void *zpage, struct uvio_ioctl_cb *uv_ioctl) in uvio_get_list() argument
310 u8 __user *user_buf = (u8 __user *)uv_ioctl->argument_addr; in uvio_get_list()
317 uv_list_secrets(list, list->next_secret_idx, &uv_ioctl->uv_rc, in uvio_get_list()
318 &uv_ioctl->uv_rrc); in uvio_get_list()
319 if (uv_ioctl->uv_rc != UVC_RC_EXECUTED && in uvio_get_list()
320 uv_ioctl->uv_rc != UVC_RC_MORE_DATA) in uvio_get_list()
329 } while (uv_ioctl->uv_rc == UVC_RC_MORE_DATA && in uvio_get_list()
330 user_off + sizeof(*list) <= uv_ioctl->argument_len); in uvio_get_list()
365 static int uvio_list_secrets(struct uvio_ioctl_cb *uv_ioctl) in uvio_list_secrets() argument
370 if (uv_ioctl->argument_len == 0 || in uvio_list_secrets()
371 uv_ioctl->argument_len % UVIO_LIST_SECRETS_LEN != 0) in uvio_list_secrets()
378 rc = uvio_get_list(zpage, uv_ioctl); in uvio_list_secrets()
436 static int uvio_retr_secret(struct uvio_ioctl_cb *uv_ioctl) in uvio_retr_secret() argument
438 u16 __user *user_index = (u16 __user *)uv_ioctl->argument_addr; in uvio_retr_secret()
443 u32 buf_len = uv_ioctl->argument_len; in uvio_retr_secret()
462 if (copy_to_user((__user void *)uv_ioctl->argument_addr, buf, buf_len)) in uvio_retr_secret()
466 uv_ioctl->uv_rc = uvcb.header.rc; in uvio_retr_secret()
467 uv_ioctl->uv_rrc = uvcb.header.rrc; in uvio_retr_secret()
503 struct uvio_ioctl_cb uv_ioctl = { }; in uvio_ioctl() local
507 nr = uvio_copy_and_check_ioctl(&uv_ioctl, argp, cmd); in uvio_ioctl()
513 ret = uvio_uvdev_info(&uv_ioctl); in uvio_ioctl()
516 ret = uvio_attestation(&uv_ioctl); in uvio_ioctl()
519 ret = uvio_add_secret(&uv_ioctl); in uvio_ioctl()
522 ret = uvio_list_secrets(&uv_ioctl); in uvio_ioctl()
525 ret = uvio_lock_secrets(&uv_ioctl); in uvio_ioctl()
528 ret = uvio_retr_secret(&uv_ioctl); in uvio_ioctl()
537 if (copy_to_user(argp, &uv_ioctl, sizeof(uv_ioctl))) in uvio_ioctl()