kvm_e500.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /*
  2. * Copyright (C) 2008-2011 Freescale Semiconductor, Inc. All rights reserved.
  3. *
  4. * Author: Yu Liu, <yu.liu@freescale.com>
  5. *
  6. * Description:
  7. * This file is derived from arch/powerpc/include/asm/kvm_44x.h,
  8. * by Hollis Blanchard <hollisb@us.ibm.com>.
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License, version 2, as
  12. * published by the Free Software Foundation.
  13. */
  14. #ifndef __ASM_KVM_E500_H__
  15. #define __ASM_KVM_E500_H__
  16. #include <linux/kvm_host.h>
  17. #define BOOKE_INTERRUPT_SIZE 36
  18. #define E500_PID_NUM 3
  19. #define E500_TLB_NUM 2
  20. struct tlbe{
  21. u32 mas1;
  22. u32 mas2;
  23. u32 mas3;
  24. u32 mas7;
  25. };
  26. #define E500_TLB_VALID 1
  27. #define E500_TLB_DIRTY 2
  28. struct tlbe_priv {
  29. pfn_t pfn;
  30. unsigned int flags; /* E500_TLB_* */
  31. };
  32. struct vcpu_id_table;
  33. struct kvmppc_vcpu_e500 {
  34. /* Unmodified copy of the guest's TLB. */
  35. struct tlbe *gtlb_arch[E500_TLB_NUM];
  36. /* KVM internal information associated with each guest TLB entry */
  37. struct tlbe_priv *gtlb_priv[E500_TLB_NUM];
  38. unsigned int gtlb_size[E500_TLB_NUM];
  39. unsigned int gtlb_nv[E500_TLB_NUM];
  40. u32 host_pid[E500_PID_NUM];
  41. u32 pid[E500_PID_NUM];
  42. u32 svr;
  43. u32 mas0;
  44. u32 mas1;
  45. u32 mas2;
  46. u32 mas3;
  47. u32 mas4;
  48. u32 mas5;
  49. u32 mas6;
  50. u32 mas7;
  51. /* vcpu id table */
  52. struct vcpu_id_table *idt;
  53. u32 l1csr0;
  54. u32 l1csr1;
  55. u32 hid0;
  56. u32 hid1;
  57. u32 tlb0cfg;
  58. u32 tlb1cfg;
  59. u64 mcar;
  60. struct kvm_vcpu vcpu;
  61. };
  62. static inline struct kvmppc_vcpu_e500 *to_e500(struct kvm_vcpu *vcpu)
  63. {
  64. return container_of(vcpu, struct kvmppc_vcpu_e500, vcpu);
  65. }
  66. #endif /* __ASM_KVM_E500_H__ */