blob: e770ea2bbb1c16a38fff64036227d07273ab3f0e [file] [log] [blame]
Hollis Blancharddb93f572008-11-05 09:36:18 -06001/*
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
20#ifndef __ASM_44X_H__
21#define __ASM_44X_H__
22
23#include <linux/kvm_host.h>
24
Hollis Blancharddb93f572008-11-05 09:36:18 -060025#define PPC44x_TLB_SIZE 64
26
Hollis Blanchard7924bd42008-12-02 15:51:55 -060027/* If the guest is expecting it, this can be as large as we like; we'd just
28 * need to find some way of advertising it. */
29#define KVM44x_GUEST_TLB_SIZE 64
30
31struct kvmppc_44x_shadow_ref {
32 struct page *page;
33 u16 gtlb_index;
34 u8 writeable;
35 u8 tid;
36};
37
Hollis Blancharddb93f572008-11-05 09:36:18 -060038struct kvmppc_vcpu_44x {
39 /* Unmodified copy of the guest's TLB. */
Hollis Blanchard7924bd42008-12-02 15:51:55 -060040 struct kvmppc_44x_tlbe guest_tlb[KVM44x_GUEST_TLB_SIZE];
Hollis Blancharddb93f572008-11-05 09:36:18 -060041
Hollis Blanchard7924bd42008-12-02 15:51:55 -060042 /* References to guest pages in the hardware TLB. */
43 struct kvmppc_44x_shadow_ref shadow_refs[PPC44x_TLB_SIZE];
Hollis Blancharddb93f572008-11-05 09:36:18 -060044
45 struct kvm_vcpu vcpu;
46};
47
48static inline struct kvmppc_vcpu_44x *to_44x(struct kvm_vcpu *vcpu)
49{
50 return container_of(vcpu, struct kvmppc_vcpu_44x, vcpu);
51}
52
Hollis Blanchardfe4e7712008-11-10 14:57:36 -060053void kvmppc_set_pid(struct kvm_vcpu *vcpu, u32 new_pid);
54
Hollis Blancharddb93f572008-11-05 09:36:18 -060055#endif /* __ASM_44X_H__ */