kvm_asm.h 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*
  2. * Copyright (C) 2012 - Virtual Open Systems and Columbia University
  3. * Author: Christoffer Dall <c.dall@virtualopensystems.com>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License, version 2, as
  7. * published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  17. */
  18. #ifndef __ARM_KVM_ASM_H__
  19. #define __ARM_KVM_ASM_H__
  20. /* 0 is reserved as an invalid value. */
  21. #define c0_MPIDR 1 /* MultiProcessor ID Register */
  22. #define c0_CSSELR 2 /* Cache Size Selection Register */
  23. #define c1_SCTLR 3 /* System Control Register */
  24. #define c1_ACTLR 4 /* Auxilliary Control Register */
  25. #define c1_CPACR 5 /* Coprocessor Access Control */
  26. #define c2_TTBR0 6 /* Translation Table Base Register 0 */
  27. #define c2_TTBR0_high 7 /* TTBR0 top 32 bits */
  28. #define c2_TTBR1 8 /* Translation Table Base Register 1 */
  29. #define c2_TTBR1_high 9 /* TTBR1 top 32 bits */
  30. #define c2_TTBCR 10 /* Translation Table Base Control R. */
  31. #define c3_DACR 11 /* Domain Access Control Register */
  32. #define c5_DFSR 12 /* Data Fault Status Register */
  33. #define c5_IFSR 13 /* Instruction Fault Status Register */
  34. #define c5_ADFSR 14 /* Auxilary Data Fault Status R */
  35. #define c5_AIFSR 15 /* Auxilary Instrunction Fault Status R */
  36. #define c6_DFAR 16 /* Data Fault Address Register */
  37. #define c6_IFAR 17 /* Instruction Fault Address Register */
  38. #define c9_L2CTLR 18 /* Cortex A15 L2 Control Register */
  39. #define c10_PRRR 19 /* Primary Region Remap Register */
  40. #define c10_NMRR 20 /* Normal Memory Remap Register */
  41. #define c12_VBAR 21 /* Vector Base Address Register */
  42. #define c13_CID 22 /* Context ID Register */
  43. #define c13_TID_URW 23 /* Thread ID, User R/W */
  44. #define c13_TID_URO 24 /* Thread ID, User R/O */
  45. #define c13_TID_PRIV 25 /* Thread ID, Privileged */
  46. #define c14_CNTKCTL 26 /* Timer Control Register (PL1) */
  47. #define NR_CP15_REGS 27 /* Number of regs (incl. invalid) */
  48. #define ARM_EXCEPTION_RESET 0
  49. #define ARM_EXCEPTION_UNDEFINED 1
  50. #define ARM_EXCEPTION_SOFTWARE 2
  51. #define ARM_EXCEPTION_PREF_ABORT 3
  52. #define ARM_EXCEPTION_DATA_ABORT 4
  53. #define ARM_EXCEPTION_IRQ 5
  54. #define ARM_EXCEPTION_FIQ 6
  55. #define ARM_EXCEPTION_HVC 7
  56. #ifndef __ASSEMBLY__
  57. struct kvm;
  58. struct kvm_vcpu;
  59. extern char __kvm_hyp_init[];
  60. extern char __kvm_hyp_init_end[];
  61. extern char __kvm_hyp_exit[];
  62. extern char __kvm_hyp_exit_end[];
  63. extern char __kvm_hyp_vector[];
  64. extern char __kvm_hyp_code_start[];
  65. extern char __kvm_hyp_code_end[];
  66. extern void __kvm_tlb_flush_vmid(struct kvm *kvm);
  67. extern void __kvm_flush_vm_context(void);
  68. extern void __kvm_tlb_flush_vmid(struct kvm *kvm);
  69. extern int __kvm_vcpu_run(struct kvm_vcpu *vcpu);
  70. #endif
  71. #endif /* __ARM_KVM_ASM_H__ */