kvm_e500.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * Copyright (C) 2008 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. struct kvmppc_vcpu_e500 {
  27. /* Unmodified copy of the guest's TLB. */
  28. struct tlbe *guest_tlb[E500_TLB_NUM];
  29. /* TLB that's actually used when the guest is running. */
  30. struct tlbe *shadow_tlb[E500_TLB_NUM];
  31. /* Pages which are referenced in the shadow TLB. */
  32. struct page **shadow_pages[E500_TLB_NUM];
  33. unsigned int guest_tlb_size[E500_TLB_NUM];
  34. unsigned int shadow_tlb_size[E500_TLB_NUM];
  35. unsigned int guest_tlb_nv[E500_TLB_NUM];
  36. u32 host_pid[E500_PID_NUM];
  37. u32 pid[E500_PID_NUM];
  38. u32 mas0;
  39. u32 mas1;
  40. u32 mas2;
  41. u32 mas3;
  42. u32 mas4;
  43. u32 mas5;
  44. u32 mas6;
  45. u32 mas7;
  46. u32 l1csr1;
  47. u32 hid0;
  48. u32 hid1;
  49. struct kvm_vcpu vcpu;
  50. };
  51. static inline struct kvmppc_vcpu_e500 *to_e500(struct kvm_vcpu *vcpu)
  52. {
  53. return container_of(vcpu, struct kvmppc_vcpu_e500, vcpu);
  54. }
  55. #endif /* __ASM_KVM_E500_H__ */