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.
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.
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.
15 * Copyright IBM Corp. 2007
17 * Authors: Hollis Blanchard <hollisb@us.ibm.com>
20 #ifndef __POWERPC_KVM_HOST_H__
21 #define __POWERPC_KVM_HOST_H__
23 #include <linux/mutex.h>
24 #include <linux/timer.h>
25 #include <linux/types.h>
26 #include <linux/kvm_types.h>
27 #include <asm/kvm_asm.h>
29 #define KVM_MAX_VCPUS 1
30 #define KVM_MEMORY_SLOTS 32
31 /* memory slots that does not exposed to userspace */
32 #define KVM_PRIVATE_MEM_SLOTS 4
34 /* We don't currently support large pages. */
35 #define KVM_PAGES_PER_HPAGE (1<<31)
45 struct kvm_vcpu_stat
{
51 /* Account for special types of light exits: */
52 u32 itlb_real_miss_exits
;
53 u32 itlb_virt_miss_exits
;
54 u32 dtlb_real_miss_exits
;
55 u32 dtlb_virt_miss_exits
;
59 u32 emulated_inst_exits
;
66 u32 tid
; /* Only the low 8 bits are used. */
75 struct kvm_vcpu_arch
{
76 /* Unmodified copy of the guest's TLB. */
77 struct tlbe guest_tlb
[PPC44x_TLB_SIZE
];
78 /* TLB that's actually used when the guest is running. */
79 struct tlbe shadow_tlb
[PPC44x_TLB_SIZE
];
80 /* Pages which are referenced in the shadow TLB. */
81 struct page
*shadow_pages
[PPC44x_TLB_SIZE
];
82 /* Copy of the host's TLB. */
83 struct tlbe host_tlb
[PPC44x_TLB_SIZE
];
134 gpa_t paddr_accessed
;
136 u8 io_gpr
; /* GPR used as IO source/target */
137 u8 mmio_is_bigendian
;
141 u32 cpr0_cfgaddr
; /* holds the last set cpr0_cfgaddr */
143 struct timer_list dec_timer
;
144 unsigned long pending_exceptions
;
147 struct kvm_guest_debug
{
153 #endif /* __POWERPC_KVM_HOST_H__ */