kvm_book3s_asm.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /*
  2. * This program is free software; you can redistribute it and/or modify
  3. * it under the terms of the GNU General Public License, version 2, as
  4. * published by the Free Software Foundation.
  5. *
  6. * This program is distributed in the hope that it will be useful,
  7. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  9. * GNU General Public License for more details.
  10. *
  11. * You should have received a copy of the GNU General Public License
  12. * along with this program; if not, write to the Free Software
  13. * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  14. *
  15. * Copyright SUSE Linux Products GmbH 2009
  16. *
  17. * Authors: Alexander Graf <agraf@suse.de>
  18. */
  19. #ifndef __ASM_KVM_BOOK3S_ASM_H__
  20. #define __ASM_KVM_BOOK3S_ASM_H__
  21. #ifdef __ASSEMBLY__
  22. #ifdef CONFIG_KVM_BOOK3S_HANDLER
  23. #include <asm/kvm_asm.h>
  24. .macro DO_KVM intno
  25. .if (\intno == BOOK3S_INTERRUPT_SYSTEM_RESET) || \
  26. (\intno == BOOK3S_INTERRUPT_MACHINE_CHECK) || \
  27. (\intno == BOOK3S_INTERRUPT_DATA_STORAGE) || \
  28. (\intno == BOOK3S_INTERRUPT_INST_STORAGE) || \
  29. (\intno == BOOK3S_INTERRUPT_DATA_SEGMENT) || \
  30. (\intno == BOOK3S_INTERRUPT_INST_SEGMENT) || \
  31. (\intno == BOOK3S_INTERRUPT_EXTERNAL) || \
  32. (\intno == BOOK3S_INTERRUPT_ALIGNMENT) || \
  33. (\intno == BOOK3S_INTERRUPT_PROGRAM) || \
  34. (\intno == BOOK3S_INTERRUPT_FP_UNAVAIL) || \
  35. (\intno == BOOK3S_INTERRUPT_DECREMENTER) || \
  36. (\intno == BOOK3S_INTERRUPT_SYSCALL) || \
  37. (\intno == BOOK3S_INTERRUPT_TRACE) || \
  38. (\intno == BOOK3S_INTERRUPT_PERFMON) || \
  39. (\intno == BOOK3S_INTERRUPT_ALTIVEC) || \
  40. (\intno == BOOK3S_INTERRUPT_VSX)
  41. b kvmppc_trampoline_\intno
  42. kvmppc_resume_\intno:
  43. .endif
  44. .endm
  45. #else
  46. .macro DO_KVM intno
  47. .endm
  48. #endif /* CONFIG_KVM_BOOK3S_HANDLER */
  49. #else /*__ASSEMBLY__ */
  50. struct kvmppc_book3s_shadow_vcpu {
  51. ulong gpr[14];
  52. u32 cr;
  53. u32 xer;
  54. u32 fault_dsisr;
  55. u32 last_inst;
  56. ulong ctr;
  57. ulong lr;
  58. ulong pc;
  59. ulong shadow_srr1;
  60. ulong fault_dar;
  61. ulong host_r1;
  62. ulong host_r2;
  63. ulong handler;
  64. ulong scratch0;
  65. ulong scratch1;
  66. ulong vmhandler;
  67. u8 in_guest;
  68. #ifdef CONFIG_PPC_BOOK3S_32
  69. u32 sr[16]; /* Guest SRs */
  70. #endif
  71. #ifdef CONFIG_PPC_BOOK3S_64
  72. u8 slb_max; /* highest used guest slb entry */
  73. struct {
  74. u64 esid;
  75. u64 vsid;
  76. } slb[64]; /* guest SLB */
  77. #endif
  78. };
  79. #endif /*__ASSEMBLY__ */
  80. #endif /* __ASM_KVM_BOOK3S_ASM_H__ */