kvm_44x.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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 __ASM_44X_H__
  20. #define __ASM_44X_H__
  21. #include <linux/kvm_host.h>
  22. /* XXX Can't include mmu-44x.h because it redefines struct mm_context. */
  23. #define PPC44x_TLB_SIZE 64
  24. struct kvmppc_vcpu_44x {
  25. /* Unmodified copy of the guest's TLB. */
  26. struct kvmppc_44x_tlbe guest_tlb[PPC44x_TLB_SIZE];
  27. /* TLB that's actually used when the guest is running. */
  28. struct kvmppc_44x_tlbe shadow_tlb[PPC44x_TLB_SIZE];
  29. /* Pages which are referenced in the shadow TLB. */
  30. struct page *shadow_pages[PPC44x_TLB_SIZE];
  31. /* Track which TLB entries we've modified in the current exit. */
  32. u8 shadow_tlb_mod[PPC44x_TLB_SIZE];
  33. struct kvm_vcpu vcpu;
  34. };
  35. static inline struct kvmppc_vcpu_44x *to_44x(struct kvm_vcpu *vcpu)
  36. {
  37. return container_of(vcpu, struct kvmppc_vcpu_44x, vcpu);
  38. }
  39. void kvmppc_set_pid(struct kvm_vcpu *vcpu, u32 new_pid);
  40. #endif /* __ASM_44X_H__ */