1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
3 * Copyright IBM Corp. 2022
6 #ifndef __S390_ASM_UVDEVICE_H
7 #define __S390_ASM_UVDEVICE_H
9 #include <linux/types.h>
11 struct uvio_ioctl_cb {
13 __u16 uv_rc; /* UV header rc value */
14 __u16 uv_rrc; /* UV header rrc value */
15 __u64 argument_addr; /* Userspace address of uvio argument */
17 __u8 reserved14[0x40 - 0x14]; /* must be zero */
20 #define UVIO_ATT_USER_DATA_LEN 0x100
21 #define UVIO_ATT_UID_LEN 0x10
23 __u64 arcb_addr; /* 0x0000 */
24 __u64 meas_addr; /* 0x0008 */
25 __u64 add_data_addr; /* 0x0010 */
26 __u8 user_data[UVIO_ATT_USER_DATA_LEN]; /* 0x0018 */
27 __u8 config_uid[UVIO_ATT_UID_LEN]; /* 0x0118 */
28 __u32 arcb_len; /* 0x0128 */
29 __u32 meas_len; /* 0x012c */
30 __u32 add_data_len; /* 0x0130 */
31 __u16 user_data_len; /* 0x0134 */
32 __u16 reserved136; /* 0x0136 */
36 * The following max values define an upper length for the IOCTL in/out buffers.
37 * However, they do not represent the maximum the Ultravisor allows which is
38 * often way smaller. By allowing larger buffer sizes we hopefully do not need
39 * to update the code with every machine update. It is therefore possible for
40 * userspace to request more memory than actually used by kernel/UV.
42 #define UVIO_ATT_ARCB_MAX_LEN 0x100000
43 #define UVIO_ATT_MEASUREMENT_MAX_LEN 0x8000
44 #define UVIO_ATT_ADDITIONAL_MAX_LEN 0x8000
46 #define UVIO_DEVICE_NAME "uv"
47 #define UVIO_TYPE_UVC 'u'
49 #define UVIO_IOCTL_ATT _IOWR(UVIO_TYPE_UVC, 0x01, struct uvio_ioctl_cb)
51 #endif /* __S390_ASM_UVDEVICE_H */