Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
0002 /*
0003  *  Copyright IBM Corp. 2022
0004  *  Author(s): Steffen Eiden <seiden@linux.ibm.com>
0005  */
0006 #ifndef __S390_ASM_UVDEVICE_H
0007 #define __S390_ASM_UVDEVICE_H
0008 
0009 #include <linux/types.h>
0010 
0011 struct uvio_ioctl_cb {
0012     __u32 flags;
0013     __u16 uv_rc;            /* UV header rc value */
0014     __u16 uv_rrc;           /* UV header rrc value */
0015     __u64 argument_addr;        /* Userspace address of uvio argument */
0016     __u32 argument_len;
0017     __u8  reserved14[0x40 - 0x14];  /* must be zero */
0018 };
0019 
0020 #define UVIO_ATT_USER_DATA_LEN      0x100
0021 #define UVIO_ATT_UID_LEN        0x10
0022 struct uvio_attest {
0023     __u64 arcb_addr;                /* 0x0000 */
0024     __u64 meas_addr;                /* 0x0008 */
0025     __u64 add_data_addr;                /* 0x0010 */
0026     __u8  user_data[UVIO_ATT_USER_DATA_LEN];    /* 0x0018 */
0027     __u8  config_uid[UVIO_ATT_UID_LEN];     /* 0x0118 */
0028     __u32 arcb_len;                 /* 0x0128 */
0029     __u32 meas_len;                 /* 0x012c */
0030     __u32 add_data_len;             /* 0x0130 */
0031     __u16 user_data_len;                /* 0x0134 */
0032     __u16 reserved136;              /* 0x0136 */
0033 };
0034 
0035 /*
0036  * The following max values define an upper length for the IOCTL in/out buffers.
0037  * However, they do not represent the maximum the Ultravisor allows which is
0038  * often way smaller. By allowing larger buffer sizes we hopefully do not need
0039  * to update the code with every machine update. It is therefore possible for
0040  * userspace to request more memory than actually used by kernel/UV.
0041  */
0042 #define UVIO_ATT_ARCB_MAX_LEN       0x100000
0043 #define UVIO_ATT_MEASUREMENT_MAX_LEN    0x8000
0044 #define UVIO_ATT_ADDITIONAL_MAX_LEN 0x8000
0045 
0046 #define UVIO_DEVICE_NAME "uv"
0047 #define UVIO_TYPE_UVC 'u'
0048 
0049 #define UVIO_IOCTL_ATT _IOWR(UVIO_TYPE_UVC, 0x01, struct uvio_ioctl_cb)
0050 
0051 #endif /* __S390_ASM_UVDEVICE_H */