uvdevice.h 1.6 KB

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