Path: blob/master/arch/s390/include/uapi/asm/uvdevice.h
26481 views
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */1/*2* Copyright IBM Corp. 2022, 20243* Author(s): Steffen Eiden <[email protected]>4*/5#ifndef __S390_ASM_UVDEVICE_H6#define __S390_ASM_UVDEVICE_H78#include <linux/types.h>910struct uvio_ioctl_cb {11__u32 flags;12__u16 uv_rc; /* UV header rc value */13__u16 uv_rrc; /* UV header rrc value */14__u64 argument_addr; /* Userspace address of uvio argument */15__u32 argument_len;16__u8 reserved14[0x40 - 0x14]; /* must be zero */17};1819#define UVIO_ATT_USER_DATA_LEN 0x10020#define UVIO_ATT_UID_LEN 0x1021struct uvio_attest {22__u64 arcb_addr; /* 0x0000 */23__u64 meas_addr; /* 0x0008 */24__u64 add_data_addr; /* 0x0010 */25__u8 user_data[UVIO_ATT_USER_DATA_LEN]; /* 0x0018 */26__u8 config_uid[UVIO_ATT_UID_LEN]; /* 0x0118 */27__u32 arcb_len; /* 0x0128 */28__u32 meas_len; /* 0x012c */29__u32 add_data_len; /* 0x0130 */30__u16 user_data_len; /* 0x0134 */31__u16 reserved136; /* 0x0136 */32};3334/**35* uvio_uvdev_info - Information of supported functions36* @supp_uvio_cmds - supported IOCTLs by this device37* @supp_uv_cmds - supported UVCs corresponding to the IOCTL38*39* UVIO request to get information about supported request types by this40* uvdevice and the Ultravisor. Everything is output. Bits are in LSB041* ordering. If the bit is set in both, @supp_uvio_cmds and @supp_uv_cmds, the42* uvdevice and the Ultravisor support that call.43*44* Note that bit 0 (UVIO_IOCTL_UVDEV_INFO_NR) is always zero for `supp_uv_cmds`45* as there is no corresponding UV-call.46*/47struct uvio_uvdev_info {48/*49* If bit `n` is set, this device supports the IOCTL with nr `n`.50*/51__u64 supp_uvio_cmds;52/*53* If bit `n` is set, the Ultravisor(UV) supports the UV-call54* corresponding to the IOCTL with nr `n` in the calling context (host55* or guest). The value is only valid if the corresponding bit in56* @supp_uvio_cmds is set as well.57*/58__u64 supp_uv_cmds;59};6061/*62* The following max values define an upper length for the IOCTL in/out buffers.63* However, they do not represent the maximum the Ultravisor allows which is64* often way smaller. By allowing larger buffer sizes we hopefully do not need65* to update the code with every machine update. It is therefore possible for66* userspace to request more memory than actually used by kernel/UV.67*/68#define UVIO_ATT_ARCB_MAX_LEN 0x10000069#define UVIO_ATT_MEASUREMENT_MAX_LEN 0x800070#define UVIO_ATT_ADDITIONAL_MAX_LEN 0x800071#define UVIO_ADD_SECRET_MAX_LEN 0x10000072#define UVIO_LIST_SECRETS_LEN 0x100073#define UVIO_RETR_SECRET_MAX_LEN 0x20007475#define UVIO_DEVICE_NAME "uv"76#define UVIO_TYPE_UVC 'u'7778enum UVIO_IOCTL_NR {79UVIO_IOCTL_UVDEV_INFO_NR = 0x00,80UVIO_IOCTL_ATT_NR,81UVIO_IOCTL_ADD_SECRET_NR,82UVIO_IOCTL_LIST_SECRETS_NR,83UVIO_IOCTL_LOCK_SECRETS_NR,84UVIO_IOCTL_RETR_SECRET_NR,85/* must be the last entry */86UVIO_IOCTL_NUM_IOCTLS87};8889#define UVIO_IOCTL(nr) _IOWR(UVIO_TYPE_UVC, nr, struct uvio_ioctl_cb)90#define UVIO_IOCTL_UVDEV_INFO UVIO_IOCTL(UVIO_IOCTL_UVDEV_INFO_NR)91#define UVIO_IOCTL_ATT UVIO_IOCTL(UVIO_IOCTL_ATT_NR)92#define UVIO_IOCTL_ADD_SECRET UVIO_IOCTL(UVIO_IOCTL_ADD_SECRET_NR)93#define UVIO_IOCTL_LIST_SECRETS UVIO_IOCTL(UVIO_IOCTL_LIST_SECRETS_NR)94#define UVIO_IOCTL_LOCK_SECRETS UVIO_IOCTL(UVIO_IOCTL_LOCK_SECRETS_NR)95#define UVIO_IOCTL_RETR_SECRET UVIO_IOCTL(UVIO_IOCTL_RETR_SECRET_NR)9697#define UVIO_SUPP_CALL(nr) (1ULL << (nr))98#define UVIO_SUPP_UDEV_INFO UVIO_SUPP_CALL(UVIO_IOCTL_UDEV_INFO_NR)99#define UVIO_SUPP_ATT UVIO_SUPP_CALL(UVIO_IOCTL_ATT_NR)100#define UVIO_SUPP_ADD_SECRET UVIO_SUPP_CALL(UVIO_IOCTL_ADD_SECRET_NR)101#define UVIO_SUPP_LIST_SECRETS UVIO_SUPP_CALL(UVIO_IOCTL_LIST_SECRETS_NR)102#define UVIO_SUPP_LOCK_SECRETS UVIO_SUPP_CALL(UVIO_IOCTL_LOCK_SECRETS_NR)103#define UVIO_SUPP_RETR_SECRET UVIO_SUPP_CALL(UVIO_IOCTL_RETR_SECRET_NR)104105#endif /* __S390_ASM_UVDEVICE_H */106107108