diff options
Diffstat (limited to 'include/asm-powerpc')
-rw-r--r-- | include/asm-powerpc/hugetlb.h | 79 | ||||
-rw-r--r-- | include/asm-powerpc/kvm.h | 53 | ||||
-rw-r--r-- | include/asm-powerpc/kvm_asm.h | 55 | ||||
-rw-r--r-- | include/asm-powerpc/kvm_host.h | 152 | ||||
-rw-r--r-- | include/asm-powerpc/kvm_para.h | 37 | ||||
-rw-r--r-- | include/asm-powerpc/kvm_ppc.h | 88 | ||||
-rw-r--r-- | include/asm-powerpc/mmu-44x.h | 2 | ||||
-rw-r--r-- | include/asm-powerpc/page_64.h | 7 | ||||
-rw-r--r-- | include/asm-powerpc/pgtable-ppc32.h | 3 | ||||
-rw-r--r-- | include/asm-powerpc/pgtable-ppc64.h | 3 |
10 files changed, 470 insertions, 9 deletions
diff --git a/include/asm-powerpc/hugetlb.h b/include/asm-powerpc/hugetlb.h new file mode 100644 index 000000000000..649c6c3b87b3 --- /dev/null +++ b/include/asm-powerpc/hugetlb.h | |||
@@ -0,0 +1,79 @@ | |||
1 | #ifndef _ASM_POWERPC_HUGETLB_H | ||
2 | #define _ASM_POWERPC_HUGETLB_H | ||
3 | |||
4 | #include <asm/page.h> | ||
5 | |||
6 | |||
7 | int is_hugepage_only_range(struct mm_struct *mm, unsigned long addr, | ||
8 | unsigned long len); | ||
9 | |||
10 | void hugetlb_free_pgd_range(struct mmu_gather **tlb, unsigned long addr, | ||
11 | unsigned long end, unsigned long floor, | ||
12 | unsigned long ceiling); | ||
13 | |||
14 | void set_huge_pte_at(struct mm_struct *mm, unsigned long addr, | ||
15 | pte_t *ptep, pte_t pte); | ||
16 | |||
17 | pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, | ||
18 | pte_t *ptep); | ||
19 | |||
20 | /* | ||
21 | * If the arch doesn't supply something else, assume that hugepage | ||
22 | * size aligned regions are ok without further preparation. | ||
23 | */ | ||
24 | static inline int prepare_hugepage_range(unsigned long addr, unsigned long len) | ||
25 | { | ||
26 | if (len & ~HPAGE_MASK) | ||
27 | return -EINVAL; | ||
28 | if (addr & ~HPAGE_MASK) | ||
29 | return -EINVAL; | ||
30 | return 0; | ||
31 | } | ||
32 | |||
33 | static inline void hugetlb_prefault_arch_hook(struct mm_struct *mm) | ||
34 | { | ||
35 | } | ||
36 | |||
37 | static inline void huge_ptep_clear_flush(struct vm_area_struct *vma, | ||
38 | unsigned long addr, pte_t *ptep) | ||
39 | { | ||
40 | } | ||
41 | |||
42 | static inline int huge_pte_none(pte_t pte) | ||
43 | { | ||
44 | return pte_none(pte); | ||
45 | } | ||
46 | |||
47 | static inline pte_t huge_pte_wrprotect(pte_t pte) | ||
48 | { | ||
49 | return pte_wrprotect(pte); | ||
50 | } | ||
51 | |||
52 | static inline void huge_ptep_set_wrprotect(struct mm_struct *mm, | ||
53 | unsigned long addr, pte_t *ptep) | ||
54 | { | ||
55 | ptep_set_wrprotect(mm, addr, ptep); | ||
56 | } | ||
57 | |||
58 | static inline int huge_ptep_set_access_flags(struct vm_area_struct *vma, | ||
59 | unsigned long addr, pte_t *ptep, | ||
60 | pte_t pte, int dirty) | ||
61 | { | ||
62 | return ptep_set_access_flags(vma, addr, ptep, pte, dirty); | ||
63 | } | ||
64 | |||
65 | static inline pte_t huge_ptep_get(pte_t *ptep) | ||
66 | { | ||
67 | return *ptep; | ||
68 | } | ||
69 | |||
70 | static inline int arch_prepare_hugepage(struct page *page) | ||
71 | { | ||
72 | return 0; | ||
73 | } | ||
74 | |||
75 | static inline void arch_release_hugepage(struct page *page) | ||
76 | { | ||
77 | } | ||
78 | |||
79 | #endif /* _ASM_POWERPC_HUGETLB_H */ | ||
diff --git a/include/asm-powerpc/kvm.h b/include/asm-powerpc/kvm.h index d1b530fbf8dd..f993e4198d5c 100644 --- a/include/asm-powerpc/kvm.h +++ b/include/asm-powerpc/kvm.h | |||
@@ -1,6 +1,55 @@ | |||
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. 2007 | ||
16 | * | ||
17 | * Authors: Hollis Blanchard <hollisb@us.ibm.com> | ||
18 | */ | ||
19 | |||
1 | #ifndef __LINUX_KVM_POWERPC_H | 20 | #ifndef __LINUX_KVM_POWERPC_H |
2 | #define __LINUX_KVM_POWERPC_H | 21 | #define __LINUX_KVM_POWERPC_H |
3 | 22 | ||
4 | /* powerpc does not support KVM */ | 23 | #include <asm/types.h> |
24 | |||
25 | struct kvm_regs { | ||
26 | __u64 pc; | ||
27 | __u64 cr; | ||
28 | __u64 ctr; | ||
29 | __u64 lr; | ||
30 | __u64 xer; | ||
31 | __u64 msr; | ||
32 | __u64 srr0; | ||
33 | __u64 srr1; | ||
34 | __u64 pid; | ||
35 | |||
36 | __u64 sprg0; | ||
37 | __u64 sprg1; | ||
38 | __u64 sprg2; | ||
39 | __u64 sprg3; | ||
40 | __u64 sprg4; | ||
41 | __u64 sprg5; | ||
42 | __u64 sprg6; | ||
43 | __u64 sprg7; | ||
44 | |||
45 | __u64 gpr[32]; | ||
46 | }; | ||
47 | |||
48 | struct kvm_sregs { | ||
49 | }; | ||
50 | |||
51 | struct kvm_fpu { | ||
52 | __u64 fpr[32]; | ||
53 | }; | ||
5 | 54 | ||
6 | #endif | 55 | #endif /* __LINUX_KVM_POWERPC_H */ |
diff --git a/include/asm-powerpc/kvm_asm.h b/include/asm-powerpc/kvm_asm.h new file mode 100644 index 000000000000..2197764796d9 --- /dev/null +++ b/include/asm-powerpc/kvm_asm.h | |||
@@ -0,0 +1,55 @@ | |||
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 | |||
20 | #ifndef __POWERPC_KVM_ASM_H__ | ||
21 | #define __POWERPC_KVM_ASM_H__ | ||
22 | |||
23 | /* IVPR must be 64KiB-aligned. */ | ||
24 | #define VCPU_SIZE_ORDER 4 | ||
25 | #define VCPU_SIZE_LOG (VCPU_SIZE_ORDER + 12) | ||
26 | #define VCPU_TLB_PGSZ PPC44x_TLB_64K | ||
27 | #define VCPU_SIZE_BYTES (1<<VCPU_SIZE_LOG) | ||
28 | |||
29 | #define BOOKE_INTERRUPT_CRITICAL 0 | ||
30 | #define BOOKE_INTERRUPT_MACHINE_CHECK 1 | ||
31 | #define BOOKE_INTERRUPT_DATA_STORAGE 2 | ||
32 | #define BOOKE_INTERRUPT_INST_STORAGE 3 | ||
33 | #define BOOKE_INTERRUPT_EXTERNAL 4 | ||
34 | #define BOOKE_INTERRUPT_ALIGNMENT 5 | ||
35 | #define BOOKE_INTERRUPT_PROGRAM 6 | ||
36 | #define BOOKE_INTERRUPT_FP_UNAVAIL 7 | ||
37 | #define BOOKE_INTERRUPT_SYSCALL 8 | ||
38 | #define BOOKE_INTERRUPT_AP_UNAVAIL 9 | ||
39 | #define BOOKE_INTERRUPT_DECREMENTER 10 | ||
40 | #define BOOKE_INTERRUPT_FIT 11 | ||
41 | #define BOOKE_INTERRUPT_WATCHDOG 12 | ||
42 | #define BOOKE_INTERRUPT_DTLB_MISS 13 | ||
43 | #define BOOKE_INTERRUPT_ITLB_MISS 14 | ||
44 | #define BOOKE_INTERRUPT_DEBUG 15 | ||
45 | #define BOOKE_MAX_INTERRUPT 15 | ||
46 | |||
47 | #define RESUME_FLAG_NV (1<<0) /* Reload guest nonvolatile state? */ | ||
48 | #define RESUME_FLAG_HOST (1<<1) /* Resume host? */ | ||
49 | |||
50 | #define RESUME_GUEST 0 | ||
51 | #define RESUME_GUEST_NV RESUME_FLAG_NV | ||
52 | #define RESUME_HOST RESUME_FLAG_HOST | ||
53 | #define RESUME_HOST_NV (RESUME_FLAG_HOST|RESUME_FLAG_NV) | ||
54 | |||
55 | #endif /* __POWERPC_KVM_ASM_H__ */ | ||
diff --git a/include/asm-powerpc/kvm_host.h b/include/asm-powerpc/kvm_host.h new file mode 100644 index 000000000000..04ffbb8e0a35 --- /dev/null +++ b/include/asm-powerpc/kvm_host.h | |||
@@ -0,0 +1,152 @@ | |||
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. 2007 | ||
16 | * | ||
17 | * Authors: Hollis Blanchard <hollisb@us.ibm.com> | ||
18 | */ | ||
19 | |||
20 | #ifndef __POWERPC_KVM_HOST_H__ | ||
21 | #define __POWERPC_KVM_HOST_H__ | ||
22 | |||
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> | ||
28 | |||
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 | ||
33 | |||
34 | /* We don't currently support large pages. */ | ||
35 | #define KVM_PAGES_PER_HPAGE (1<<31) | ||
36 | |||
37 | struct kvm; | ||
38 | struct kvm_run; | ||
39 | struct kvm_vcpu; | ||
40 | |||
41 | struct kvm_vm_stat { | ||
42 | u32 remote_tlb_flush; | ||
43 | }; | ||
44 | |||
45 | struct kvm_vcpu_stat { | ||
46 | u32 sum_exits; | ||
47 | u32 mmio_exits; | ||
48 | u32 dcr_exits; | ||
49 | u32 signal_exits; | ||
50 | u32 light_exits; | ||
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; | ||
56 | u32 syscall_exits; | ||
57 | u32 isi_exits; | ||
58 | u32 dsi_exits; | ||
59 | u32 emulated_inst_exits; | ||
60 | u32 dec_exits; | ||
61 | u32 ext_intr_exits; | ||
62 | }; | ||
63 | |||
64 | struct tlbe { | ||
65 | u32 tid; /* Only the low 8 bits are used. */ | ||
66 | u32 word0; | ||
67 | u32 word1; | ||
68 | u32 word2; | ||
69 | }; | ||
70 | |||
71 | struct kvm_arch { | ||
72 | }; | ||
73 | |||
74 | struct kvm_vcpu_arch { | ||
75 | /* Unmodified copy of the guest's TLB. */ | ||
76 | struct tlbe guest_tlb[PPC44x_TLB_SIZE]; | ||
77 | /* TLB that's actually used when the guest is running. */ | ||
78 | struct tlbe shadow_tlb[PPC44x_TLB_SIZE]; | ||
79 | /* Pages which are referenced in the shadow TLB. */ | ||
80 | struct page *shadow_pages[PPC44x_TLB_SIZE]; | ||
81 | /* Copy of the host's TLB. */ | ||
82 | struct tlbe host_tlb[PPC44x_TLB_SIZE]; | ||
83 | |||
84 | u32 host_stack; | ||
85 | u32 host_pid; | ||
86 | |||
87 | u64 fpr[32]; | ||
88 | u32 gpr[32]; | ||
89 | |||
90 | u32 pc; | ||
91 | u32 cr; | ||
92 | u32 ctr; | ||
93 | u32 lr; | ||
94 | u32 xer; | ||
95 | |||
96 | u32 msr; | ||
97 | u32 mmucr; | ||
98 | u32 sprg0; | ||
99 | u32 sprg1; | ||
100 | u32 sprg2; | ||
101 | u32 sprg3; | ||
102 | u32 sprg4; | ||
103 | u32 sprg5; | ||
104 | u32 sprg6; | ||
105 | u32 sprg7; | ||
106 | u32 srr0; | ||
107 | u32 srr1; | ||
108 | u32 csrr0; | ||
109 | u32 csrr1; | ||
110 | u32 dsrr0; | ||
111 | u32 dsrr1; | ||
112 | u32 dear; | ||
113 | u32 esr; | ||
114 | u32 dec; | ||
115 | u32 decar; | ||
116 | u32 tbl; | ||
117 | u32 tbu; | ||
118 | u32 tcr; | ||
119 | u32 tsr; | ||
120 | u32 ivor[16]; | ||
121 | u32 ivpr; | ||
122 | u32 pir; | ||
123 | u32 pid; | ||
124 | u32 pvr; | ||
125 | u32 ccr0; | ||
126 | u32 ccr1; | ||
127 | u32 dbcr0; | ||
128 | u32 dbcr1; | ||
129 | |||
130 | u32 last_inst; | ||
131 | u32 fault_dear; | ||
132 | u32 fault_esr; | ||
133 | gpa_t paddr_accessed; | ||
134 | |||
135 | u8 io_gpr; /* GPR used as IO source/target */ | ||
136 | u8 mmio_is_bigendian; | ||
137 | u8 dcr_needed; | ||
138 | u8 dcr_is_write; | ||
139 | |||
140 | u32 cpr0_cfgaddr; /* holds the last set cpr0_cfgaddr */ | ||
141 | |||
142 | struct timer_list dec_timer; | ||
143 | unsigned long pending_exceptions; | ||
144 | }; | ||
145 | |||
146 | struct kvm_guest_debug { | ||
147 | int enabled; | ||
148 | unsigned long bp[4]; | ||
149 | int singlestep; | ||
150 | }; | ||
151 | |||
152 | #endif /* __POWERPC_KVM_HOST_H__ */ | ||
diff --git a/include/asm-powerpc/kvm_para.h b/include/asm-powerpc/kvm_para.h new file mode 100644 index 000000000000..2d48f6a63d0b --- /dev/null +++ b/include/asm-powerpc/kvm_para.h | |||
@@ -0,0 +1,37 @@ | |||
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 | |||
20 | #ifndef __POWERPC_KVM_PARA_H__ | ||
21 | #define __POWERPC_KVM_PARA_H__ | ||
22 | |||
23 | #ifdef __KERNEL__ | ||
24 | |||
25 | static inline int kvm_para_available(void) | ||
26 | { | ||
27 | return 0; | ||
28 | } | ||
29 | |||
30 | static inline unsigned int kvm_arch_para_features(void) | ||
31 | { | ||
32 | return 0; | ||
33 | } | ||
34 | |||
35 | #endif /* __KERNEL__ */ | ||
36 | |||
37 | #endif /* __POWERPC_KVM_PARA_H__ */ | ||
diff --git a/include/asm-powerpc/kvm_ppc.h b/include/asm-powerpc/kvm_ppc.h new file mode 100644 index 000000000000..7ac820308a7e --- /dev/null +++ b/include/asm-powerpc/kvm_ppc.h | |||
@@ -0,0 +1,88 @@ | |||
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 | |||
20 | #ifndef __POWERPC_KVM_PPC_H__ | ||
21 | #define __POWERPC_KVM_PPC_H__ | ||
22 | |||
23 | /* This file exists just so we can dereference kvm_vcpu, avoiding nested header | ||
24 | * dependencies. */ | ||
25 | |||
26 | #include <linux/mutex.h> | ||
27 | #include <linux/timer.h> | ||
28 | #include <linux/types.h> | ||
29 | #include <linux/kvm_types.h> | ||
30 | #include <linux/kvm_host.h> | ||
31 | |||
32 | struct kvm_tlb { | ||
33 | struct tlbe guest_tlb[PPC44x_TLB_SIZE]; | ||
34 | struct tlbe shadow_tlb[PPC44x_TLB_SIZE]; | ||
35 | }; | ||
36 | |||
37 | enum emulation_result { | ||
38 | EMULATE_DONE, /* no further processing */ | ||
39 | EMULATE_DO_MMIO, /* kvm_run filled with MMIO request */ | ||
40 | EMULATE_DO_DCR, /* kvm_run filled with DCR request */ | ||
41 | EMULATE_FAIL, /* can't emulate this instruction */ | ||
42 | }; | ||
43 | |||
44 | extern const unsigned char exception_priority[]; | ||
45 | extern const unsigned char priority_exception[]; | ||
46 | |||
47 | extern int __kvmppc_vcpu_run(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu); | ||
48 | extern char kvmppc_handlers_start[]; | ||
49 | extern unsigned long kvmppc_handler_len; | ||
50 | |||
51 | extern void kvmppc_dump_vcpu(struct kvm_vcpu *vcpu); | ||
52 | extern int kvmppc_handle_load(struct kvm_run *run, struct kvm_vcpu *vcpu, | ||
53 | unsigned int rt, unsigned int bytes, | ||
54 | int is_bigendian); | ||
55 | extern int kvmppc_handle_store(struct kvm_run *run, struct kvm_vcpu *vcpu, | ||
56 | u32 val, unsigned int bytes, int is_bigendian); | ||
57 | |||
58 | extern int kvmppc_emulate_instruction(struct kvm_run *run, | ||
59 | struct kvm_vcpu *vcpu); | ||
60 | |||
61 | extern void kvmppc_mmu_map(struct kvm_vcpu *vcpu, u64 gvaddr, gfn_t gfn, | ||
62 | u64 asid, u32 flags); | ||
63 | extern void kvmppc_mmu_invalidate(struct kvm_vcpu *vcpu, u64 eaddr, u64 asid); | ||
64 | extern void kvmppc_mmu_priv_switch(struct kvm_vcpu *vcpu, int usermode); | ||
65 | |||
66 | extern void kvmppc_check_and_deliver_interrupts(struct kvm_vcpu *vcpu); | ||
67 | |||
68 | static inline void kvmppc_queue_exception(struct kvm_vcpu *vcpu, int exception) | ||
69 | { | ||
70 | unsigned int priority = exception_priority[exception]; | ||
71 | set_bit(priority, &vcpu->arch.pending_exceptions); | ||
72 | } | ||
73 | |||
74 | static inline void kvmppc_clear_exception(struct kvm_vcpu *vcpu, int exception) | ||
75 | { | ||
76 | unsigned int priority = exception_priority[exception]; | ||
77 | clear_bit(priority, &vcpu->arch.pending_exceptions); | ||
78 | } | ||
79 | |||
80 | static inline void kvmppc_set_msr(struct kvm_vcpu *vcpu, u32 new_msr) | ||
81 | { | ||
82 | if ((new_msr & MSR_PR) != (vcpu->arch.msr & MSR_PR)) | ||
83 | kvmppc_mmu_priv_switch(vcpu, new_msr & MSR_PR); | ||
84 | |||
85 | vcpu->arch.msr = new_msr; | ||
86 | } | ||
87 | |||
88 | #endif /* __POWERPC_KVM_PPC_H__ */ | ||
diff --git a/include/asm-powerpc/mmu-44x.h b/include/asm-powerpc/mmu-44x.h index c8b02d97f753..a825524c981a 100644 --- a/include/asm-powerpc/mmu-44x.h +++ b/include/asm-powerpc/mmu-44x.h | |||
@@ -53,6 +53,8 @@ | |||
53 | 53 | ||
54 | #ifndef __ASSEMBLY__ | 54 | #ifndef __ASSEMBLY__ |
55 | 55 | ||
56 | extern unsigned int tlb_44x_hwater; | ||
57 | |||
56 | typedef struct { | 58 | typedef struct { |
57 | unsigned long id; | 59 | unsigned long id; |
58 | unsigned long vdso_base; | 60 | unsigned long vdso_base; |
diff --git a/include/asm-powerpc/page_64.h b/include/asm-powerpc/page_64.h index 67834eae5702..25af4fc8daf4 100644 --- a/include/asm-powerpc/page_64.h +++ b/include/asm-powerpc/page_64.h | |||
@@ -128,11 +128,6 @@ extern void slice_init_context(struct mm_struct *mm, unsigned int psize); | |||
128 | extern void slice_set_user_psize(struct mm_struct *mm, unsigned int psize); | 128 | extern void slice_set_user_psize(struct mm_struct *mm, unsigned int psize); |
129 | #define slice_mm_new_context(mm) ((mm)->context.id == 0) | 129 | #define slice_mm_new_context(mm) ((mm)->context.id == 0) |
130 | 130 | ||
131 | #define ARCH_HAS_HUGEPAGE_ONLY_RANGE | ||
132 | extern int is_hugepage_only_range(struct mm_struct *m, | ||
133 | unsigned long addr, | ||
134 | unsigned long len); | ||
135 | |||
136 | #endif /* __ASSEMBLY__ */ | 131 | #endif /* __ASSEMBLY__ */ |
137 | #else | 132 | #else |
138 | #define slice_init() | 133 | #define slice_init() |
@@ -146,8 +141,6 @@ do { \ | |||
146 | 141 | ||
147 | #ifdef CONFIG_HUGETLB_PAGE | 142 | #ifdef CONFIG_HUGETLB_PAGE |
148 | 143 | ||
149 | #define ARCH_HAS_HUGETLB_FREE_PGD_RANGE | ||
150 | #define ARCH_HAS_SETCLEAR_HUGE_PTE | ||
151 | #define HAVE_ARCH_HUGETLB_UNMAPPED_AREA | 144 | #define HAVE_ARCH_HUGETLB_UNMAPPED_AREA |
152 | 145 | ||
153 | #endif /* !CONFIG_HUGETLB_PAGE */ | 146 | #endif /* !CONFIG_HUGETLB_PAGE */ |
diff --git a/include/asm-powerpc/pgtable-ppc32.h b/include/asm-powerpc/pgtable-ppc32.h index daea7692d070..7c97b5a08d08 100644 --- a/include/asm-powerpc/pgtable-ppc32.h +++ b/include/asm-powerpc/pgtable-ppc32.h | |||
@@ -504,6 +504,7 @@ static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW; } | |||
504 | static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; } | 504 | static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; } |
505 | static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; } | 505 | static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; } |
506 | static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; } | 506 | static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; } |
507 | static inline int pte_special(pte_t pte) { return 0; } | ||
507 | 508 | ||
508 | static inline void pte_uncache(pte_t pte) { pte_val(pte) |= _PAGE_NO_CACHE; } | 509 | static inline void pte_uncache(pte_t pte) { pte_val(pte) |= _PAGE_NO_CACHE; } |
509 | static inline void pte_cache(pte_t pte) { pte_val(pte) &= ~_PAGE_NO_CACHE; } | 510 | static inline void pte_cache(pte_t pte) { pte_val(pte) &= ~_PAGE_NO_CACHE; } |
@@ -521,6 +522,8 @@ static inline pte_t pte_mkdirty(pte_t pte) { | |||
521 | pte_val(pte) |= _PAGE_DIRTY; return pte; } | 522 | pte_val(pte) |= _PAGE_DIRTY; return pte; } |
522 | static inline pte_t pte_mkyoung(pte_t pte) { | 523 | static inline pte_t pte_mkyoung(pte_t pte) { |
523 | pte_val(pte) |= _PAGE_ACCESSED; return pte; } | 524 | pte_val(pte) |= _PAGE_ACCESSED; return pte; } |
525 | static inline pte_t pte_mkspecial(pte_t pte) { | ||
526 | return pte; } | ||
524 | 527 | ||
525 | static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) | 528 | static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) |
526 | { | 529 | { |
diff --git a/include/asm-powerpc/pgtable-ppc64.h b/include/asm-powerpc/pgtable-ppc64.h index dd4c26dc57d2..27f18695f7d6 100644 --- a/include/asm-powerpc/pgtable-ppc64.h +++ b/include/asm-powerpc/pgtable-ppc64.h | |||
@@ -239,6 +239,7 @@ static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW;} | |||
239 | static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY;} | 239 | static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY;} |
240 | static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED;} | 240 | static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED;} |
241 | static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE;} | 241 | static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE;} |
242 | static inline int pte_special(pte_t pte) { return 0; } | ||
242 | 243 | ||
243 | static inline void pte_uncache(pte_t pte) { pte_val(pte) |= _PAGE_NO_CACHE; } | 244 | static inline void pte_uncache(pte_t pte) { pte_val(pte) |= _PAGE_NO_CACHE; } |
244 | static inline void pte_cache(pte_t pte) { pte_val(pte) &= ~_PAGE_NO_CACHE; } | 245 | static inline void pte_cache(pte_t pte) { pte_val(pte) &= ~_PAGE_NO_CACHE; } |
@@ -257,6 +258,8 @@ static inline pte_t pte_mkyoung(pte_t pte) { | |||
257 | pte_val(pte) |= _PAGE_ACCESSED; return pte; } | 258 | pte_val(pte) |= _PAGE_ACCESSED; return pte; } |
258 | static inline pte_t pte_mkhuge(pte_t pte) { | 259 | static inline pte_t pte_mkhuge(pte_t pte) { |
259 | return pte; } | 260 | return pte; } |
261 | static inline pte_t pte_mkspecial(pte_t pte) { | ||
262 | return pte; } | ||
260 | 263 | ||
261 | /* Atomic PTE updates */ | 264 | /* Atomic PTE updates */ |
262 | static inline unsigned long pte_update(struct mm_struct *mm, | 265 | static inline unsigned long pte_update(struct mm_struct *mm, |