kvm.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * Copyright (C) 2012 MIPS Technologies, Inc. All rights reserved.
  7. * Copyright (C) 2013 Cavium, Inc.
  8. * Authors: Sanjay Lal <sanjayl@kymasys.com>
  9. */
  10. #ifndef __LINUX_KVM_MIPS_H
  11. #define __LINUX_KVM_MIPS_H
  12. #include <linux/types.h>
  13. /*
  14. * KVM MIPS specific structures and definitions.
  15. *
  16. * Some parts derived from the x86 version of this file.
  17. */
  18. /*
  19. * for KVM_GET_REGS and KVM_SET_REGS
  20. *
  21. * If Config[AT] is zero (32-bit CPU), the register contents are
  22. * stored in the lower 32-bits of the struct kvm_regs fields and sign
  23. * extended to 64-bits.
  24. */
  25. struct kvm_regs {
  26. /* out (KVM_GET_REGS) / in (KVM_SET_REGS) */
  27. __u64 gpr[32];
  28. __u64 hi;
  29. __u64 lo;
  30. __u64 pc;
  31. };
  32. /*
  33. * for KVM_GET_FPU and KVM_SET_FPU
  34. *
  35. * If Status[FR] is zero (32-bit FPU), the upper 32-bits of the FPRs
  36. * are zero filled.
  37. */
  38. struct kvm_fpu {
  39. __u64 fpr[32];
  40. __u32 fir;
  41. __u32 fccr;
  42. __u32 fexr;
  43. __u32 fenr;
  44. __u32 fcsr;
  45. __u32 pad;
  46. };
  47. /*
  48. * For MIPS, we use KVM_SET_ONE_REG and KVM_GET_ONE_REG to access CP0
  49. * registers. The id field is broken down as follows:
  50. *
  51. * bits[2..0] - Register 'sel' index.
  52. * bits[7..3] - Register 'rd' index.
  53. * bits[15..8] - Must be zero.
  54. * bits[63..16] - 1 -> CP0 registers.
  55. *
  56. * Other sets registers may be added in the future. Each set would
  57. * have its own identifier in bits[63..16].
  58. *
  59. * The addr field of struct kvm_one_reg must point to an aligned
  60. * 64-bit wide location. For registers that are narrower than
  61. * 64-bits, the value is stored in the low order bits of the location,
  62. * and sign extended to 64-bits.
  63. *
  64. * The registers defined in struct kvm_regs are also accessible, the
  65. * id values for these are below.
  66. */
  67. #define KVM_REG_MIPS_R0 0
  68. #define KVM_REG_MIPS_R1 1
  69. #define KVM_REG_MIPS_R2 2
  70. #define KVM_REG_MIPS_R3 3
  71. #define KVM_REG_MIPS_R4 4
  72. #define KVM_REG_MIPS_R5 5
  73. #define KVM_REG_MIPS_R6 6
  74. #define KVM_REG_MIPS_R7 7
  75. #define KVM_REG_MIPS_R8 8
  76. #define KVM_REG_MIPS_R9 9
  77. #define KVM_REG_MIPS_R10 10
  78. #define KVM_REG_MIPS_R11 11
  79. #define KVM_REG_MIPS_R12 12
  80. #define KVM_REG_MIPS_R13 13
  81. #define KVM_REG_MIPS_R14 14
  82. #define KVM_REG_MIPS_R15 15
  83. #define KVM_REG_MIPS_R16 16
  84. #define KVM_REG_MIPS_R17 17
  85. #define KVM_REG_MIPS_R18 18
  86. #define KVM_REG_MIPS_R19 19
  87. #define KVM_REG_MIPS_R20 20
  88. #define KVM_REG_MIPS_R21 21
  89. #define KVM_REG_MIPS_R22 22
  90. #define KVM_REG_MIPS_R23 23
  91. #define KVM_REG_MIPS_R24 24
  92. #define KVM_REG_MIPS_R25 25
  93. #define KVM_REG_MIPS_R26 26
  94. #define KVM_REG_MIPS_R27 27
  95. #define KVM_REG_MIPS_R28 28
  96. #define KVM_REG_MIPS_R29 29
  97. #define KVM_REG_MIPS_R30 30
  98. #define KVM_REG_MIPS_R31 31
  99. #define KVM_REG_MIPS_HI 32
  100. #define KVM_REG_MIPS_LO 33
  101. #define KVM_REG_MIPS_PC 34
  102. /*
  103. * KVM MIPS specific structures and definitions
  104. *
  105. */
  106. struct kvm_debug_exit_arch {
  107. __u64 epc;
  108. };
  109. /* for KVM_SET_GUEST_DEBUG */
  110. struct kvm_guest_debug_arch {
  111. };
  112. /* definition of registers in kvm_run */
  113. struct kvm_sync_regs {
  114. };
  115. /* dummy definition */
  116. struct kvm_sregs {
  117. };
  118. struct kvm_mips_interrupt {
  119. /* in */
  120. __u32 cpu;
  121. __u32 irq;
  122. };
  123. #endif /* __LINUX_KVM_MIPS_H */