runtime_instr.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. #ifndef _S390_UAPI_RUNTIME_INSTR_H
  3. #define _S390_UAPI_RUNTIME_INSTR_H
  4. #include <linux/types.h>
  5. #define S390_RUNTIME_INSTR_START 0x1
  6. #define S390_RUNTIME_INSTR_STOP 0x2
  7. struct runtime_instr_cb {
  8. __u64 rca;
  9. __u64 roa;
  10. __u64 rla;
  11. __u32 v : 1;
  12. __u32 s : 1;
  13. __u32 k : 1;
  14. __u32 h : 1;
  15. __u32 a : 1;
  16. __u32 reserved1 : 3;
  17. __u32 ps : 1;
  18. __u32 qs : 1;
  19. __u32 pc : 1;
  20. __u32 qc : 1;
  21. __u32 reserved2 : 1;
  22. __u32 g : 1;
  23. __u32 u : 1;
  24. __u32 l : 1;
  25. __u32 key : 4;
  26. __u32 reserved3 : 8;
  27. __u32 t : 1;
  28. __u32 rgs : 3;
  29. __u32 m : 4;
  30. __u32 n : 1;
  31. __u32 mae : 1;
  32. __u32 reserved4 : 2;
  33. __u32 c : 1;
  34. __u32 r : 1;
  35. __u32 b : 1;
  36. __u32 j : 1;
  37. __u32 e : 1;
  38. __u32 x : 1;
  39. __u32 reserved5 : 2;
  40. __u32 bpxn : 1;
  41. __u32 bpxt : 1;
  42. __u32 bpti : 1;
  43. __u32 bpni : 1;
  44. __u32 reserved6 : 2;
  45. __u32 d : 1;
  46. __u32 f : 1;
  47. __u32 ic : 4;
  48. __u32 dc : 4;
  49. __u64 reserved7;
  50. __u64 sf;
  51. __u64 rsic;
  52. __u64 reserved8;
  53. } __packed __aligned(8);
  54. static inline void load_runtime_instr_cb(struct runtime_instr_cb *cb)
  55. {
  56. asm volatile(".insn rsy,0xeb0000000060,0,0,%0" /* LRIC */
  57. : : "Q" (*cb));
  58. }
  59. static inline void store_runtime_instr_cb(struct runtime_instr_cb *cb)
  60. {
  61. asm volatile(".insn rsy,0xeb0000000061,0,0,%0" /* STRIC */
  62. : "=Q" (*cb) : : "cc");
  63. }
  64. #endif /* _S390_UAPI_RUNTIME_INSTR_H */