blob: 905a934c1ef4691722dedfd3a4f4d77edd2e2d1e [file] [log] [blame]
Alexander Graf77419092010-06-30 15:18:45 +02001/*
2 * Copyright (C) 2010 SUSE Linux Products GmbH. All rights reserved.
3 *
4 * Authors:
5 * Alexander Graf <agraf@suse.de>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License, version 2, as
9 * published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 */
20
21#include <linux/kvm_host.h>
22#include <linux/hash.h>
23#include <linux/slab.h>
Ingo Molnarb2d09102017-02-04 01:27:20 +010024#include <linux/rculist.h>
Alexander Graf77419092010-06-30 15:18:45 +020025
26#include <asm/kvm_ppc.h>
27#include <asm/kvm_book3s.h>
28#include <asm/machdep.h>
29#include <asm/mmu_context.h>
30#include <asm/hw_irq.h>
31
Aneesh Kumar K.V72c12532013-10-07 22:17:57 +053032#include "trace_pr.h"
Paul Mackerrasc4befc52011-06-29 00:17:33 +000033
Alexander Graf77419092010-06-30 15:18:45 +020034#define PTE_SIZE 12
35
Alexander Graf77419092010-06-30 15:18:45 +020036static struct kmem_cache *hpte_cache;
37
38static inline u64 kvmppc_mmu_hash_pte(u64 eaddr)
39{
40 return hash_64(eaddr >> PTE_SIZE, HPTEG_HASH_BITS_PTE);
41}
42
Alexander Graf2d27fc52010-07-29 15:04:19 +020043static inline u64 kvmppc_mmu_hash_pte_long(u64 eaddr)
44{
45 return hash_64((eaddr & 0x0ffff000) >> PTE_SIZE,
46 HPTEG_HASH_BITS_PTE_LONG);
47}
48
Alexander Graf77419092010-06-30 15:18:45 +020049static inline u64 kvmppc_mmu_hash_vpte(u64 vpage)
50{
51 return hash_64(vpage & 0xfffffffffULL, HPTEG_HASH_BITS_VPTE);
52}
53
54static inline u64 kvmppc_mmu_hash_vpte_long(u64 vpage)
55{
56 return hash_64((vpage & 0xffffff000ULL) >> 12,
57 HPTEG_HASH_BITS_VPTE_LONG);
58}
59
Paul Mackerrasa4a0f252013-09-20 14:52:44 +100060#ifdef CONFIG_PPC_BOOK3S_64
61static inline u64 kvmppc_mmu_hash_vpte_64k(u64 vpage)
62{
63 return hash_64((vpage & 0xffffffff0ULL) >> 4,
64 HPTEG_HASH_BITS_VPTE_64K);
65}
66#endif
67
Alexander Graf77419092010-06-30 15:18:45 +020068void kvmppc_mmu_hpte_cache_map(struct kvm_vcpu *vcpu, struct hpte_cache *pte)
69{
70 u64 index;
Paul Mackerrasc4befc52011-06-29 00:17:33 +000071 struct kvmppc_vcpu_book3s *vcpu3s = to_book3s(vcpu);
Alexander Graf77419092010-06-30 15:18:45 +020072
Alexander Graf4c4eea72010-08-02 12:51:07 +020073 trace_kvm_book3s_mmu_map(pte);
74
Paul Mackerrasc4befc52011-06-29 00:17:33 +000075 spin_lock(&vcpu3s->mmu_lock);
Alexander Graf2e0908a2010-07-29 15:04:17 +020076
Alexander Graf77419092010-06-30 15:18:45 +020077 /* Add to ePTE list */
78 index = kvmppc_mmu_hash_pte(pte->pte.eaddr);
Paul Mackerrasc4befc52011-06-29 00:17:33 +000079 hlist_add_head_rcu(&pte->list_pte, &vcpu3s->hpte_hash_pte[index]);
Alexander Graf77419092010-06-30 15:18:45 +020080
Alexander Graf2d27fc52010-07-29 15:04:19 +020081 /* Add to ePTE_long list */
82 index = kvmppc_mmu_hash_pte_long(pte->pte.eaddr);
83 hlist_add_head_rcu(&pte->list_pte_long,
Paul Mackerrasc4befc52011-06-29 00:17:33 +000084 &vcpu3s->hpte_hash_pte_long[index]);
Alexander Graf2d27fc52010-07-29 15:04:19 +020085
Alexander Graf77419092010-06-30 15:18:45 +020086 /* Add to vPTE list */
87 index = kvmppc_mmu_hash_vpte(pte->pte.vpage);
Paul Mackerrasc4befc52011-06-29 00:17:33 +000088 hlist_add_head_rcu(&pte->list_vpte, &vcpu3s->hpte_hash_vpte[index]);
Alexander Graf77419092010-06-30 15:18:45 +020089
90 /* Add to vPTE_long list */
91 index = kvmppc_mmu_hash_vpte_long(pte->pte.vpage);
Alexander Graf2e0908a2010-07-29 15:04:17 +020092 hlist_add_head_rcu(&pte->list_vpte_long,
Paul Mackerrasc4befc52011-06-29 00:17:33 +000093 &vcpu3s->hpte_hash_vpte_long[index]);
Alexander Graf2e0908a2010-07-29 15:04:17 +020094
Paul Mackerrasa4a0f252013-09-20 14:52:44 +100095#ifdef CONFIG_PPC_BOOK3S_64
96 /* Add to vPTE_64k list */
97 index = kvmppc_mmu_hash_vpte_64k(pte->pte.vpage);
98 hlist_add_head_rcu(&pte->list_vpte_64k,
99 &vcpu3s->hpte_hash_vpte_64k[index]);
100#endif
101
Paul Mackerrasd78bca72013-09-20 14:52:52 +1000102 vcpu3s->hpte_cache_count++;
103
Paul Mackerrasc4befc52011-06-29 00:17:33 +0000104 spin_unlock(&vcpu3s->mmu_lock);
Alexander Graf2e0908a2010-07-29 15:04:17 +0200105}
106
107static void free_pte_rcu(struct rcu_head *head)
108{
109 struct hpte_cache *pte = container_of(head, struct hpte_cache, rcu_head);
110 kmem_cache_free(hpte_cache, pte);
Alexander Graf77419092010-06-30 15:18:45 +0200111}
112
113static void invalidate_pte(struct kvm_vcpu *vcpu, struct hpte_cache *pte)
114{
Paul Mackerrasc4befc52011-06-29 00:17:33 +0000115 struct kvmppc_vcpu_book3s *vcpu3s = to_book3s(vcpu);
116
Alexander Graf8696ee42010-08-02 12:55:19 +0200117 trace_kvm_book3s_mmu_invalidate(pte);
Alexander Graf77419092010-06-30 15:18:45 +0200118
119 /* Different for 32 and 64 bit */
120 kvmppc_mmu_invalidate_pte(vcpu, pte);
121
Paul Mackerrasc4befc52011-06-29 00:17:33 +0000122 spin_lock(&vcpu3s->mmu_lock);
Alexander Graf2e0908a2010-07-29 15:04:17 +0200123
Alexander Grafe7c1d142010-08-02 21:24:48 +0200124 /* pte already invalidated in between? */
125 if (hlist_unhashed(&pte->list_pte)) {
Paul Mackerrasc4befc52011-06-29 00:17:33 +0000126 spin_unlock(&vcpu3s->mmu_lock);
Alexander Grafe7c1d142010-08-02 21:24:48 +0200127 return;
128 }
129
Alexander Graf2e0908a2010-07-29 15:04:17 +0200130 hlist_del_init_rcu(&pte->list_pte);
Alexander Graf2d27fc52010-07-29 15:04:19 +0200131 hlist_del_init_rcu(&pte->list_pte_long);
Alexander Graf2e0908a2010-07-29 15:04:17 +0200132 hlist_del_init_rcu(&pte->list_vpte);
133 hlist_del_init_rcu(&pte->list_vpte_long);
Paul Mackerrasa4a0f252013-09-20 14:52:44 +1000134#ifdef CONFIG_PPC_BOOK3S_64
135 hlist_del_init_rcu(&pte->list_vpte_64k);
136#endif
Paul Mackerrasd78bca72013-09-20 14:52:52 +1000137 vcpu3s->hpte_cache_count--;
Alexander Graf2e0908a2010-07-29 15:04:17 +0200138
Paul Mackerrasc4befc52011-06-29 00:17:33 +0000139 spin_unlock(&vcpu3s->mmu_lock);
Alexander Grafe7c1d142010-08-02 21:24:48 +0200140
Alexander Graf2e0908a2010-07-29 15:04:17 +0200141 call_rcu(&pte->rcu_head, free_pte_rcu);
Alexander Graf77419092010-06-30 15:18:45 +0200142}
143
144static void kvmppc_mmu_pte_flush_all(struct kvm_vcpu *vcpu)
145{
Paul Mackerrasc4befc52011-06-29 00:17:33 +0000146 struct kvmppc_vcpu_book3s *vcpu3s = to_book3s(vcpu);
Alexander Graf77419092010-06-30 15:18:45 +0200147 struct hpte_cache *pte;
Alexander Graf77419092010-06-30 15:18:45 +0200148 int i;
149
Alexander Graf2e0908a2010-07-29 15:04:17 +0200150 rcu_read_lock();
151
Alexander Graf77419092010-06-30 15:18:45 +0200152 for (i = 0; i < HPTEG_HASH_NUM_VPTE_LONG; i++) {
Paul Mackerrasc4befc52011-06-29 00:17:33 +0000153 struct hlist_head *list = &vcpu3s->hpte_hash_vpte_long[i];
Alexander Graf77419092010-06-30 15:18:45 +0200154
Sasha Levinb67bfe02013-02-27 17:06:00 -0800155 hlist_for_each_entry_rcu(pte, list, list_vpte_long)
Alexander Graf77419092010-06-30 15:18:45 +0200156 invalidate_pte(vcpu, pte);
157 }
Alexander Graf2e0908a2010-07-29 15:04:17 +0200158
159 rcu_read_unlock();
Alexander Graf77419092010-06-30 15:18:45 +0200160}
161
162static void kvmppc_mmu_pte_flush_page(struct kvm_vcpu *vcpu, ulong guest_ea)
163{
Paul Mackerrasc4befc52011-06-29 00:17:33 +0000164 struct kvmppc_vcpu_book3s *vcpu3s = to_book3s(vcpu);
Alexander Graf77419092010-06-30 15:18:45 +0200165 struct hlist_head *list;
Alexander Graf77419092010-06-30 15:18:45 +0200166 struct hpte_cache *pte;
167
168 /* Find the list of entries in the map */
Paul Mackerrasc4befc52011-06-29 00:17:33 +0000169 list = &vcpu3s->hpte_hash_pte[kvmppc_mmu_hash_pte(guest_ea)];
Alexander Graf77419092010-06-30 15:18:45 +0200170
Alexander Graf2e0908a2010-07-29 15:04:17 +0200171 rcu_read_lock();
172
Alexander Graf77419092010-06-30 15:18:45 +0200173 /* Check the list for matching entries and invalidate */
Sasha Levinb67bfe02013-02-27 17:06:00 -0800174 hlist_for_each_entry_rcu(pte, list, list_pte)
Alexander Graf77419092010-06-30 15:18:45 +0200175 if ((pte->pte.eaddr & ~0xfffUL) == guest_ea)
176 invalidate_pte(vcpu, pte);
Alexander Graf2e0908a2010-07-29 15:04:17 +0200177
178 rcu_read_unlock();
Alexander Graf77419092010-06-30 15:18:45 +0200179}
180
Alexander Graf2d27fc52010-07-29 15:04:19 +0200181static void kvmppc_mmu_pte_flush_long(struct kvm_vcpu *vcpu, ulong guest_ea)
182{
Paul Mackerrasc4befc52011-06-29 00:17:33 +0000183 struct kvmppc_vcpu_book3s *vcpu3s = to_book3s(vcpu);
Alexander Graf2d27fc52010-07-29 15:04:19 +0200184 struct hlist_head *list;
Alexander Graf2d27fc52010-07-29 15:04:19 +0200185 struct hpte_cache *pte;
186
187 /* Find the list of entries in the map */
Paul Mackerrasc4befc52011-06-29 00:17:33 +0000188 list = &vcpu3s->hpte_hash_pte_long[
Alexander Graf2d27fc52010-07-29 15:04:19 +0200189 kvmppc_mmu_hash_pte_long(guest_ea)];
190
191 rcu_read_lock();
192
193 /* Check the list for matching entries and invalidate */
Sasha Levinb67bfe02013-02-27 17:06:00 -0800194 hlist_for_each_entry_rcu(pte, list, list_pte_long)
Alexander Graf2d27fc52010-07-29 15:04:19 +0200195 if ((pte->pte.eaddr & 0x0ffff000UL) == guest_ea)
196 invalidate_pte(vcpu, pte);
197
198 rcu_read_unlock();
199}
200
Alexander Graf77419092010-06-30 15:18:45 +0200201void kvmppc_mmu_pte_flush(struct kvm_vcpu *vcpu, ulong guest_ea, ulong ea_mask)
202{
Alexander Grafc60b4cf2010-08-02 13:40:30 +0200203 trace_kvm_book3s_mmu_flush("", vcpu, guest_ea, ea_mask);
Alexander Graf77419092010-06-30 15:18:45 +0200204 guest_ea &= ea_mask;
205
206 switch (ea_mask) {
207 case ~0xfffUL:
208 kvmppc_mmu_pte_flush_page(vcpu, guest_ea);
209 break;
210 case 0x0ffff000:
Alexander Graf2d27fc52010-07-29 15:04:19 +0200211 kvmppc_mmu_pte_flush_long(vcpu, guest_ea);
Alexander Graf77419092010-06-30 15:18:45 +0200212 break;
213 case 0:
214 /* Doing a complete flush -> start from scratch */
215 kvmppc_mmu_pte_flush_all(vcpu);
216 break;
217 default:
218 WARN_ON(1);
219 break;
220 }
221}
222
223/* Flush with mask 0xfffffffff */
224static void kvmppc_mmu_pte_vflush_short(struct kvm_vcpu *vcpu, u64 guest_vp)
225{
Paul Mackerrasc4befc52011-06-29 00:17:33 +0000226 struct kvmppc_vcpu_book3s *vcpu3s = to_book3s(vcpu);
Alexander Graf77419092010-06-30 15:18:45 +0200227 struct hlist_head *list;
Alexander Graf77419092010-06-30 15:18:45 +0200228 struct hpte_cache *pte;
229 u64 vp_mask = 0xfffffffffULL;
230
Paul Mackerrasc4befc52011-06-29 00:17:33 +0000231 list = &vcpu3s->hpte_hash_vpte[kvmppc_mmu_hash_vpte(guest_vp)];
Alexander Graf77419092010-06-30 15:18:45 +0200232
Alexander Graf2e0908a2010-07-29 15:04:17 +0200233 rcu_read_lock();
234
Alexander Graf77419092010-06-30 15:18:45 +0200235 /* Check the list for matching entries and invalidate */
Sasha Levinb67bfe02013-02-27 17:06:00 -0800236 hlist_for_each_entry_rcu(pte, list, list_vpte)
Alexander Graf77419092010-06-30 15:18:45 +0200237 if ((pte->pte.vpage & vp_mask) == guest_vp)
238 invalidate_pte(vcpu, pte);
Alexander Graf2e0908a2010-07-29 15:04:17 +0200239
240 rcu_read_unlock();
Alexander Graf77419092010-06-30 15:18:45 +0200241}
242
Paul Mackerrasa4a0f252013-09-20 14:52:44 +1000243#ifdef CONFIG_PPC_BOOK3S_64
244/* Flush with mask 0xffffffff0 */
245static void kvmppc_mmu_pte_vflush_64k(struct kvm_vcpu *vcpu, u64 guest_vp)
246{
247 struct kvmppc_vcpu_book3s *vcpu3s = to_book3s(vcpu);
248 struct hlist_head *list;
249 struct hpte_cache *pte;
250 u64 vp_mask = 0xffffffff0ULL;
251
252 list = &vcpu3s->hpte_hash_vpte_64k[
253 kvmppc_mmu_hash_vpte_64k(guest_vp)];
254
255 rcu_read_lock();
256
257 /* Check the list for matching entries and invalidate */
258 hlist_for_each_entry_rcu(pte, list, list_vpte_64k)
259 if ((pte->pte.vpage & vp_mask) == guest_vp)
260 invalidate_pte(vcpu, pte);
261
262 rcu_read_unlock();
263}
264#endif
265
Alexander Graf77419092010-06-30 15:18:45 +0200266/* Flush with mask 0xffffff000 */
267static void kvmppc_mmu_pte_vflush_long(struct kvm_vcpu *vcpu, u64 guest_vp)
268{
Paul Mackerrasc4befc52011-06-29 00:17:33 +0000269 struct kvmppc_vcpu_book3s *vcpu3s = to_book3s(vcpu);
Alexander Graf77419092010-06-30 15:18:45 +0200270 struct hlist_head *list;
Alexander Graf77419092010-06-30 15:18:45 +0200271 struct hpte_cache *pte;
272 u64 vp_mask = 0xffffff000ULL;
273
Paul Mackerrasc4befc52011-06-29 00:17:33 +0000274 list = &vcpu3s->hpte_hash_vpte_long[
Alexander Graf77419092010-06-30 15:18:45 +0200275 kvmppc_mmu_hash_vpte_long(guest_vp)];
276
Alexander Graf2e0908a2010-07-29 15:04:17 +0200277 rcu_read_lock();
278
Alexander Graf77419092010-06-30 15:18:45 +0200279 /* Check the list for matching entries and invalidate */
Sasha Levinb67bfe02013-02-27 17:06:00 -0800280 hlist_for_each_entry_rcu(pte, list, list_vpte_long)
Alexander Graf77419092010-06-30 15:18:45 +0200281 if ((pte->pte.vpage & vp_mask) == guest_vp)
282 invalidate_pte(vcpu, pte);
Alexander Graf2e0908a2010-07-29 15:04:17 +0200283
284 rcu_read_unlock();
Alexander Graf77419092010-06-30 15:18:45 +0200285}
286
287void kvmppc_mmu_pte_vflush(struct kvm_vcpu *vcpu, u64 guest_vp, u64 vp_mask)
288{
Alexander Grafc60b4cf2010-08-02 13:40:30 +0200289 trace_kvm_book3s_mmu_flush("v", vcpu, guest_vp, vp_mask);
Alexander Graf77419092010-06-30 15:18:45 +0200290 guest_vp &= vp_mask;
291
292 switch(vp_mask) {
293 case 0xfffffffffULL:
294 kvmppc_mmu_pte_vflush_short(vcpu, guest_vp);
295 break;
Paul Mackerrasa4a0f252013-09-20 14:52:44 +1000296#ifdef CONFIG_PPC_BOOK3S_64
297 case 0xffffffff0ULL:
298 kvmppc_mmu_pte_vflush_64k(vcpu, guest_vp);
299 break;
300#endif
Alexander Graf77419092010-06-30 15:18:45 +0200301 case 0xffffff000ULL:
302 kvmppc_mmu_pte_vflush_long(vcpu, guest_vp);
303 break;
304 default:
305 WARN_ON(1);
306 return;
307 }
308}
309
310void kvmppc_mmu_pte_pflush(struct kvm_vcpu *vcpu, ulong pa_start, ulong pa_end)
311{
Paul Mackerrasc4befc52011-06-29 00:17:33 +0000312 struct kvmppc_vcpu_book3s *vcpu3s = to_book3s(vcpu);
Alexander Graf77419092010-06-30 15:18:45 +0200313 struct hpte_cache *pte;
314 int i;
315
Alexander Grafc60b4cf2010-08-02 13:40:30 +0200316 trace_kvm_book3s_mmu_flush("p", vcpu, pa_start, pa_end);
Alexander Graf77419092010-06-30 15:18:45 +0200317
Alexander Graf2e0908a2010-07-29 15:04:17 +0200318 rcu_read_lock();
319
Alexander Graf77419092010-06-30 15:18:45 +0200320 for (i = 0; i < HPTEG_HASH_NUM_VPTE_LONG; i++) {
Paul Mackerrasc4befc52011-06-29 00:17:33 +0000321 struct hlist_head *list = &vcpu3s->hpte_hash_vpte_long[i];
Alexander Graf77419092010-06-30 15:18:45 +0200322
Sasha Levinb67bfe02013-02-27 17:06:00 -0800323 hlist_for_each_entry_rcu(pte, list, list_vpte_long)
Alexander Graf77419092010-06-30 15:18:45 +0200324 if ((pte->pte.raddr >= pa_start) &&
325 (pte->pte.raddr < pa_end))
326 invalidate_pte(vcpu, pte);
327 }
Alexander Graf2e0908a2010-07-29 15:04:17 +0200328
329 rcu_read_unlock();
Alexander Graf77419092010-06-30 15:18:45 +0200330}
331
332struct hpte_cache *kvmppc_mmu_hpte_cache_next(struct kvm_vcpu *vcpu)
333{
Paul Mackerrasc4befc52011-06-29 00:17:33 +0000334 struct kvmppc_vcpu_book3s *vcpu3s = to_book3s(vcpu);
Alexander Graf77419092010-06-30 15:18:45 +0200335 struct hpte_cache *pte;
336
Paul Mackerrasc4befc52011-06-29 00:17:33 +0000337 if (vcpu3s->hpte_cache_count == HPTEG_CACHE_NUM)
Alexander Graf77419092010-06-30 15:18:45 +0200338 kvmppc_mmu_pte_flush_all(vcpu);
339
Paul Mackerrasd78bca72013-09-20 14:52:52 +1000340 pte = kmem_cache_zalloc(hpte_cache, GFP_KERNEL);
341
Alexander Graf77419092010-06-30 15:18:45 +0200342 return pte;
343}
344
Paul Mackerrasd78bca72013-09-20 14:52:52 +1000345void kvmppc_mmu_hpte_cache_free(struct hpte_cache *pte)
346{
347 kmem_cache_free(hpte_cache, pte);
348}
349
Alexander Graf77419092010-06-30 15:18:45 +0200350void kvmppc_mmu_hpte_destroy(struct kvm_vcpu *vcpu)
351{
352 kvmppc_mmu_pte_flush(vcpu, 0, 0);
353}
354
355static void kvmppc_mmu_hpte_init_hash(struct hlist_head *hash_list, int len)
356{
357 int i;
358
359 for (i = 0; i < len; i++)
360 INIT_HLIST_HEAD(&hash_list[i]);
361}
362
363int kvmppc_mmu_hpte_init(struct kvm_vcpu *vcpu)
364{
Paul Mackerrasc4befc52011-06-29 00:17:33 +0000365 struct kvmppc_vcpu_book3s *vcpu3s = to_book3s(vcpu);
Alexander Graf77419092010-06-30 15:18:45 +0200366
Paul Mackerrasc4befc52011-06-29 00:17:33 +0000367 /* init hpte lookup hashes */
368 kvmppc_mmu_hpte_init_hash(vcpu3s->hpte_hash_pte,
369 ARRAY_SIZE(vcpu3s->hpte_hash_pte));
370 kvmppc_mmu_hpte_init_hash(vcpu3s->hpte_hash_pte_long,
371 ARRAY_SIZE(vcpu3s->hpte_hash_pte_long));
372 kvmppc_mmu_hpte_init_hash(vcpu3s->hpte_hash_vpte,
373 ARRAY_SIZE(vcpu3s->hpte_hash_vpte));
374 kvmppc_mmu_hpte_init_hash(vcpu3s->hpte_hash_vpte_long,
375 ARRAY_SIZE(vcpu3s->hpte_hash_vpte_long));
Paul Mackerrasa4a0f252013-09-20 14:52:44 +1000376#ifdef CONFIG_PPC_BOOK3S_64
377 kvmppc_mmu_hpte_init_hash(vcpu3s->hpte_hash_vpte_64k,
378 ARRAY_SIZE(vcpu3s->hpte_hash_vpte_64k));
379#endif
Paul Mackerrasc4befc52011-06-29 00:17:33 +0000380
381 spin_lock_init(&vcpu3s->mmu_lock);
Alexander Graf2e0908a2010-07-29 15:04:17 +0200382
Alexander Graf77419092010-06-30 15:18:45 +0200383 return 0;
384}
385
386int kvmppc_mmu_hpte_sysinit(void)
387{
388 /* init hpte slab cache */
389 hpte_cache = kmem_cache_create("kvm-spt", sizeof(struct hpte_cache),
390 sizeof(struct hpte_cache), 0, NULL);
391
392 return 0;
393}
394
395void kvmppc_mmu_hpte_sysexit(void)
396{
397 kmem_cache_destroy(hpte_cache);
398}