interrupts.S 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. #include <linux/linkage.h>
  19. #include <linux/const.h>
  20. #include <asm/unified.h>
  21. #include <asm/page.h>
  22. #include <asm/asm-offsets.h>
  23. #include <asm/kvm_asm.h>
  24. #include <asm/kvm_arm.h>
  25. .text
  26. __kvm_hyp_code_start:
  27. .globl __kvm_hyp_code_start
  28. /********************************************************************
  29. * Flush per-VMID TLBs
  30. */
  31. ENTRY(__kvm_flush_vm_context)
  32. bx lr
  33. ENDPROC(__kvm_flush_vm_context)
  34. /********************************************************************
  35. * Hypervisor world-switch code
  36. */
  37. ENTRY(__kvm_vcpu_run)
  38. bx lr
  39. /********************************************************************
  40. * Call function in Hyp mode
  41. *
  42. *
  43. * u64 kvm_call_hyp(void *hypfn, ...);
  44. *
  45. * This is not really a variadic function in the classic C-way and care must
  46. * be taken when calling this to ensure parameters are passed in registers
  47. * only, since the stack will change between the caller and the callee.
  48. *
  49. * Call the function with the first argument containing a pointer to the
  50. * function you wish to call in Hyp mode, and subsequent arguments will be
  51. * passed as r0, r1, and r2 (a maximum of 3 arguments in addition to the
  52. * function pointer can be passed). The function being called must be mapped
  53. * in Hyp mode (see init_hyp_mode in arch/arm/kvm/arm.c). Return values are
  54. * passed in r0 and r1.
  55. *
  56. * The calling convention follows the standard AAPCS:
  57. * r0 - r3: caller save
  58. * r12: caller save
  59. * rest: callee save
  60. */
  61. ENTRY(kvm_call_hyp)
  62. hvc #0
  63. bx lr
  64. /********************************************************************
  65. * Hypervisor exception vector and handlers
  66. */
  67. .align 5
  68. __kvm_hyp_vector:
  69. .globl __kvm_hyp_vector
  70. nop
  71. __kvm_hyp_code_end:
  72. .globl __kvm_hyp_code_end