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 #define KVM_COALESCED_MMIO_PAGE_OFFSET 1
36 /* We don't currently support large pages. */
37 #define KVM_PAGES_PER_HPAGE (1<<31)
47 struct kvm_vcpu_stat
{
53 /* Account for special types of light exits: */
54 u32 itlb_real_miss_exits
;
55 u32 itlb_virt_miss_exits
;
56 u32 dtlb_real_miss_exits
;
57 u32 dtlb_virt_miss_exits
;
61 u32 emulated_inst_exits
;
79 EMULATED_MTMSRWE_EXITS
,
95 __NUMBER_OF_KVM_EXIT_TYPES
98 /* allow access to big endian 32bit upper/lower parts and 64bit var */
99 struct kvmppc_exit_timing
{
111 struct kvm_vcpu_arch
{
163 #ifdef CONFIG_KVM_EXIT_TIMING
164 struct kvmppc_exit_timing timing_exit
;
165 struct kvmppc_exit_timing timing_last_enter
;
167 u32 timing_count_type
[__NUMBER_OF_KVM_EXIT_TYPES
];
168 u64 timing_sum_duration
[__NUMBER_OF_KVM_EXIT_TYPES
];
169 u64 timing_sum_quad_duration
[__NUMBER_OF_KVM_EXIT_TYPES
];
170 u64 timing_min_duration
[__NUMBER_OF_KVM_EXIT_TYPES
];
171 u64 timing_max_duration
[__NUMBER_OF_KVM_EXIT_TYPES
];
172 u64 timing_last_exit
;
173 struct dentry
*debugfs_exit_timing
;
179 gpa_t paddr_accessed
;
181 u8 io_gpr
; /* GPR used as IO source/target */
182 u8 mmio_is_bigendian
;
186 u32 cpr0_cfgaddr
; /* holds the last set cpr0_cfgaddr */
188 struct timer_list dec_timer
;
189 unsigned long pending_exceptions
;
192 #endif /* __POWERPC_KVM_HOST_H__ */