diff --git a/include/linux/smcinvoke.h b/include/linux/smcinvoke.h index 19d5577b7d..f71acf5745 100644 --- a/include/linux/smcinvoke.h +++ b/include/linux/smcinvoke.h @@ -20,8 +20,8 @@ struct smcinvoke_buf { struct smcinvoke_obj { __s64 fd; - __s32 cb_server_fd; - __s32 reserved; + __s64 cb_server_fd; + __s64 reserved; }; union smcinvoke_arg { @@ -36,6 +36,7 @@ union smcinvoke_arg { * @result - result of invoke operation * @argsize - size of each of arguments * @args - args is pointer to buffer having all arguments + * @reserved: IN/OUT: Usage is not defined but should be set to 0 */ struct smcinvoke_cmd_req { __u32 op; @@ -43,42 +44,45 @@ struct smcinvoke_cmd_req { __s32 result; __u32 argsize; __u64 args; + __s64 reserved; }; /* * struct smcinvoke_accept: structure to process CB req from TEE * @has_resp: IN: Whether IOCTL is carrying response data - * @txn_id: OUT: An id that should be passed as it is for response * @result: IN: Outcome of operation op - * @cbobj_id: OUT: Callback object which is target of operation op * @op: OUT: Operation to be performed on target object * @counts: OUT: Number of arguments, embedded in buffer pointed by * buf_addr, to complete operation * @reserved: IN/OUT: Usage is not defined but should be set to 0. * @argsize: IN: Size of any argument, all of equal size, embedded * in buffer pointed by buf_addr + * @txn_id: OUT: An id that should be passed as it is for response + * @cbobj_id: OUT: Callback object which is target of operation op * @buf_len: IN: Len of buffer pointed by buf_addr * @buf_addr: IN: Buffer containing all arguments which are needed * to complete operation op */ struct smcinvoke_accept { __u32 has_resp; - __u32 txn_id; __s32 result; - __s32 cbobj_id; __u32 op; __u32 counts; __s32 reserved; __u32 argsize; + __u64 txn_id; + __s64 cbobj_id; __u64 buf_len; __u64 buf_addr; }; /* * @cb_buf_size: IN: Max buffer size for any callback obj implemented by client + * @reserved: IN/OUT: Usage is not defined but should be set to 0 */ struct smcinvoke_server { - __u32 cb_buf_size; + __u64 cb_buf_size; + __s64 reserved; }; #define SMCINVOKE_IOC_MAGIC 0x98 @@ -93,7 +97,7 @@ struct smcinvoke_server { _IOWR(SMCINVOKE_IOC_MAGIC, 3, struct smcinvoke_server) #define SMCINVOKE_IOCTL_ACK_LOCAL_OBJ \ - _IOWR(SMCINVOKE_IOC_MAGIC, 4, __s32) + _IOWR(SMCINVOKE_IOC_MAGIC, 4, __s64) /* * smcinvoke logging buffer is for communicating with the smcinvoke driver additional diff --git a/include/uapi/linux/smcinvoke.h b/include/uapi/linux/smcinvoke.h index 2dff051b0a..53d9c41246 100644 --- a/include/uapi/linux/smcinvoke.h +++ b/include/uapi/linux/smcinvoke.h @@ -20,8 +20,8 @@ struct smcinvoke_buf { struct smcinvoke_obj { __s64 fd; - __s32 cb_server_fd; - __s32 reserved; + __s64 cb_server_fd; + __s64 reserved; }; union smcinvoke_arg { @@ -36,6 +36,7 @@ union smcinvoke_arg { * @result - result of invoke operation * @argsize - size of each of arguments * @args - args is pointer to buffer having all arguments + * @reserved: IN/OUT: Usage is not defined but should be set to 0 */ struct smcinvoke_cmd_req { __u32 op; @@ -43,42 +44,45 @@ struct smcinvoke_cmd_req { __s32 result; __u32 argsize; __u64 args; + __s64 reserved; }; /* * struct smcinvoke_accept: structure to process CB req from TEE * @has_resp: IN: Whether IOCTL is carrying response data - * @txn_id: OUT: An id that should be passed as it is for response * @result: IN: Outcome of operation op - * @cbobj_id: OUT: Callback object which is target of operation op * @op: OUT: Operation to be performed on target object * @counts: OUT: Number of arguments, embedded in buffer pointed by * buf_addr, to complete operation * @reserved: IN/OUT: Usage is not defined but should be set to 0. * @argsize: IN: Size of any argument, all of equal size, embedded * in buffer pointed by buf_addr + * @txn_id: OUT: An id that should be passed as it is for response + * @cbobj_id: OUT: Callback object which is target of operation op * @buf_len: IN: Len of buffer pointed by buf_addr * @buf_addr: IN: Buffer containing all arguments which are needed * to complete operation op */ struct smcinvoke_accept { __u32 has_resp; - __u32 txn_id; __s32 result; - __s32 cbobj_id; __u32 op; __u32 counts; __s32 reserved; __u32 argsize; + __u64 txn_id; + __s64 cbobj_id; __u64 buf_len; __u64 buf_addr; }; /* * @cb_buf_size: IN: Max buffer size for any callback obj implemented by client + * @reserved: IN/OUT: Usage is not defined but should be set to 0 */ struct smcinvoke_server { - __u32 cb_buf_size; + __u64 cb_buf_size; + __s64 reserved; }; #define SMCINVOKE_IOC_MAGIC 0x98 @@ -93,7 +97,7 @@ struct smcinvoke_server { _IOWR(SMCINVOKE_IOC_MAGIC, 3, struct smcinvoke_server) #define SMCINVOKE_IOCTL_ACK_LOCAL_OBJ \ - _IOWR(SMCINVOKE_IOC_MAGIC, 4, __s32) + _IOWR(SMCINVOKE_IOC_MAGIC, 4, __s64) /* * smcinvoke logging buffer is for communicating with the smcinvoke driver additional diff --git a/smcinvoke/smcinvoke.c b/smcinvoke/smcinvoke.c index f5894cb16b..acace7c1a2 100644 --- a/smcinvoke/smcinvoke.c +++ b/smcinvoke/smcinvoke.c @@ -2085,7 +2085,7 @@ static int marshal_in_tzcb_req(const struct smcinvoke_cb_txn *cb_txn, user_req->txn_id = cb_txn->txn_id; if (get_uhandle_from_tzhandle(tzcb_req->hdr.tzhandle, srvr_id, - &user_req->cbobj_id, TAKE_LOCK, + (int32_t*)(&user_req->cbobj_id), TAKE_LOCK, SMCINVOKE_OBJ_TYPE_TZ_OBJ)) { ret = -EINVAL; goto out;