booke.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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 IBM Corp. 2008
  16. *
  17. * Authors: Hollis Blanchard <hollisb@us.ibm.com>
  18. */
  19. #ifndef __KVM_BOOKE_H__
  20. #define __KVM_BOOKE_H__
  21. #include <linux/types.h>
  22. #include <linux/kvm_host.h>
  23. #include <asm/kvm_ppc.h>
  24. #include "timing.h"
  25. /* interrupt priortity ordering */
  26. #define BOOKE_IRQPRIO_DATA_STORAGE 0
  27. #define BOOKE_IRQPRIO_INST_STORAGE 1
  28. #define BOOKE_IRQPRIO_ALIGNMENT 2
  29. #define BOOKE_IRQPRIO_PROGRAM 3
  30. #define BOOKE_IRQPRIO_FP_UNAVAIL 4
  31. #define BOOKE_IRQPRIO_SPE_UNAVAIL 5
  32. #define BOOKE_IRQPRIO_SPE_FP_DATA 6
  33. #define BOOKE_IRQPRIO_SPE_FP_ROUND 7
  34. #define BOOKE_IRQPRIO_SYSCALL 8
  35. #define BOOKE_IRQPRIO_AP_UNAVAIL 9
  36. #define BOOKE_IRQPRIO_DTLB_MISS 10
  37. #define BOOKE_IRQPRIO_ITLB_MISS 11
  38. #define BOOKE_IRQPRIO_MACHINE_CHECK 12
  39. #define BOOKE_IRQPRIO_DEBUG 13
  40. #define BOOKE_IRQPRIO_CRITICAL 14
  41. #define BOOKE_IRQPRIO_WATCHDOG 15
  42. #define BOOKE_IRQPRIO_EXTERNAL 16
  43. #define BOOKE_IRQPRIO_FIT 17
  44. #define BOOKE_IRQPRIO_DECREMENTER 18
  45. #define BOOKE_IRQPRIO_PERFORMANCE_MONITOR 19
  46. /* Internal pseudo-irqprio for level triggered externals */
  47. #define BOOKE_IRQPRIO_EXTERNAL_LEVEL 20
  48. #define BOOKE_IRQPRIO_MAX 20
  49. extern unsigned long kvmppc_booke_handlers;
  50. void kvmppc_set_msr(struct kvm_vcpu *vcpu, u32 new_msr);
  51. void kvmppc_mmu_msr_notify(struct kvm_vcpu *vcpu, u32 old_msr);
  52. void kvmppc_set_tcr(struct kvm_vcpu *vcpu, u32 new_tcr);
  53. void kvmppc_set_tsr_bits(struct kvm_vcpu *vcpu, u32 tsr_bits);
  54. void kvmppc_clr_tsr_bits(struct kvm_vcpu *vcpu, u32 tsr_bits);
  55. int kvmppc_booke_emulate_op(struct kvm_run *run, struct kvm_vcpu *vcpu,
  56. unsigned int inst, int *advance);
  57. int kvmppc_booke_emulate_mfspr(struct kvm_vcpu *vcpu, int sprn, int rt);
  58. int kvmppc_booke_emulate_mtspr(struct kvm_vcpu *vcpu, int sprn, int rs);
  59. /* low-level asm code to transfer guest state */
  60. void kvmppc_load_guest_spe(struct kvm_vcpu *vcpu);
  61. void kvmppc_save_guest_spe(struct kvm_vcpu *vcpu);
  62. /* high-level function, manages flags, host state */
  63. void kvmppc_vcpu_disable_spe(struct kvm_vcpu *vcpu);
  64. #endif /* __KVM_BOOKE_H__ */