e500.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575
  1. /*
  2. * Copyright (C) 2008-2011 Freescale Semiconductor, Inc. All rights reserved.
  3. *
  4. * Author: Yu Liu, <yu.liu@freescale.com>
  5. *
  6. * Description:
  7. * This file is derived from arch/powerpc/kvm/44x.c,
  8. * by Hollis Blanchard <hollisb@us.ibm.com>.
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License, version 2, as
  12. * published by the Free Software Foundation.
  13. */
  14. #include <linux/kvm_host.h>
  15. #include <linux/slab.h>
  16. #include <linux/err.h>
  17. #include <linux/export.h>
  18. #include <linux/module.h>
  19. #include <linux/miscdevice.h>
  20. #include <asm/reg.h>
  21. #include <asm/cputable.h>
  22. #include <asm/kvm_ppc.h>
  23. #include "../mm/mmu_decl.h"
  24. #include "booke.h"
  25. #include "e500.h"
  26. struct id {
  27. unsigned long val;
  28. struct id **pentry;
  29. };
  30. #define NUM_TIDS 256
  31. /*
  32. * This table provide mappings from:
  33. * (guestAS,guestTID,guestPR) --> ID of physical cpu
  34. * guestAS [0..1]
  35. * guestTID [0..255]
  36. * guestPR [0..1]
  37. * ID [1..255]
  38. * Each vcpu keeps one vcpu_id_table.
  39. */
  40. struct vcpu_id_table {
  41. struct id id[2][NUM_TIDS][2];
  42. };
  43. /*
  44. * This table provide reversed mappings of vcpu_id_table:
  45. * ID --> address of vcpu_id_table item.
  46. * Each physical core has one pcpu_id_table.
  47. */
  48. struct pcpu_id_table {
  49. struct id *entry[NUM_TIDS];
  50. };
  51. static DEFINE_PER_CPU(struct pcpu_id_table, pcpu_sids);
  52. /* This variable keeps last used shadow ID on local core.
  53. * The valid range of shadow ID is [1..255] */
  54. static DEFINE_PER_CPU(unsigned long, pcpu_last_used_sid);
  55. /*
  56. * Allocate a free shadow id and setup a valid sid mapping in given entry.
  57. * A mapping is only valid when vcpu_id_table and pcpu_id_table are match.
  58. *
  59. * The caller must have preemption disabled, and keep it that way until
  60. * it has finished with the returned shadow id (either written into the
  61. * TLB or arch.shadow_pid, or discarded).
  62. */
  63. static inline int local_sid_setup_one(struct id *entry)
  64. {
  65. unsigned long sid;
  66. int ret = -1;
  67. sid = __this_cpu_inc_return(pcpu_last_used_sid);
  68. if (sid < NUM_TIDS) {
  69. __this_cpu_write(pcpu_sids.entry[sid], entry);
  70. entry->val = sid;
  71. entry->pentry = this_cpu_ptr(&pcpu_sids.entry[sid]);
  72. ret = sid;
  73. }
  74. /*
  75. * If sid == NUM_TIDS, we've run out of sids. We return -1, and
  76. * the caller will invalidate everything and start over.
  77. *
  78. * sid > NUM_TIDS indicates a race, which we disable preemption to
  79. * avoid.
  80. */
  81. WARN_ON(sid > NUM_TIDS);
  82. return ret;
  83. }
  84. /*
  85. * Check if given entry contain a valid shadow id mapping.
  86. * An ID mapping is considered valid only if
  87. * both vcpu and pcpu know this mapping.
  88. *
  89. * The caller must have preemption disabled, and keep it that way until
  90. * it has finished with the returned shadow id (either written into the
  91. * TLB or arch.shadow_pid, or discarded).
  92. */
  93. static inline int local_sid_lookup(struct id *entry)
  94. {
  95. if (entry && entry->val != 0 &&
  96. __this_cpu_read(pcpu_sids.entry[entry->val]) == entry &&
  97. entry->pentry == this_cpu_ptr(&pcpu_sids.entry[entry->val]))
  98. return entry->val;
  99. return -1;
  100. }
  101. /* Invalidate all id mappings on local core -- call with preempt disabled */
  102. static inline void local_sid_destroy_all(void)
  103. {
  104. __this_cpu_write(pcpu_last_used_sid, 0);
  105. memset(this_cpu_ptr(&pcpu_sids), 0, sizeof(pcpu_sids));
  106. }
  107. static void *kvmppc_e500_id_table_alloc(struct kvmppc_vcpu_e500 *vcpu_e500)
  108. {
  109. vcpu_e500->idt = kzalloc(sizeof(struct vcpu_id_table), GFP_KERNEL);
  110. return vcpu_e500->idt;
  111. }
  112. static void kvmppc_e500_id_table_free(struct kvmppc_vcpu_e500 *vcpu_e500)
  113. {
  114. kfree(vcpu_e500->idt);
  115. vcpu_e500->idt = NULL;
  116. }
  117. /* Map guest pid to shadow.
  118. * We use PID to keep shadow of current guest non-zero PID,
  119. * and use PID1 to keep shadow of guest zero PID.
  120. * So that guest tlbe with TID=0 can be accessed at any time */
  121. static void kvmppc_e500_recalc_shadow_pid(struct kvmppc_vcpu_e500 *vcpu_e500)
  122. {
  123. preempt_disable();
  124. vcpu_e500->vcpu.arch.shadow_pid = kvmppc_e500_get_sid(vcpu_e500,
  125. get_cur_as(&vcpu_e500->vcpu),
  126. get_cur_pid(&vcpu_e500->vcpu),
  127. get_cur_pr(&vcpu_e500->vcpu), 1);
  128. vcpu_e500->vcpu.arch.shadow_pid1 = kvmppc_e500_get_sid(vcpu_e500,
  129. get_cur_as(&vcpu_e500->vcpu), 0,
  130. get_cur_pr(&vcpu_e500->vcpu), 1);
  131. preempt_enable();
  132. }
  133. /* Invalidate all mappings on vcpu */
  134. static void kvmppc_e500_id_table_reset_all(struct kvmppc_vcpu_e500 *vcpu_e500)
  135. {
  136. memset(vcpu_e500->idt, 0, sizeof(struct vcpu_id_table));
  137. /* Update shadow pid when mappings are changed */
  138. kvmppc_e500_recalc_shadow_pid(vcpu_e500);
  139. }
  140. /* Invalidate one ID mapping on vcpu */
  141. static inline void kvmppc_e500_id_table_reset_one(
  142. struct kvmppc_vcpu_e500 *vcpu_e500,
  143. int as, int pid, int pr)
  144. {
  145. struct vcpu_id_table *idt = vcpu_e500->idt;
  146. BUG_ON(as >= 2);
  147. BUG_ON(pid >= NUM_TIDS);
  148. BUG_ON(pr >= 2);
  149. idt->id[as][pid][pr].val = 0;
  150. idt->id[as][pid][pr].pentry = NULL;
  151. /* Update shadow pid when mappings are changed */
  152. kvmppc_e500_recalc_shadow_pid(vcpu_e500);
  153. }
  154. /*
  155. * Map guest (vcpu,AS,ID,PR) to physical core shadow id.
  156. * This function first lookup if a valid mapping exists,
  157. * if not, then creates a new one.
  158. *
  159. * The caller must have preemption disabled, and keep it that way until
  160. * it has finished with the returned shadow id (either written into the
  161. * TLB or arch.shadow_pid, or discarded).
  162. */
  163. unsigned int kvmppc_e500_get_sid(struct kvmppc_vcpu_e500 *vcpu_e500,
  164. unsigned int as, unsigned int gid,
  165. unsigned int pr, int avoid_recursion)
  166. {
  167. struct vcpu_id_table *idt = vcpu_e500->idt;
  168. int sid;
  169. BUG_ON(as >= 2);
  170. BUG_ON(gid >= NUM_TIDS);
  171. BUG_ON(pr >= 2);
  172. sid = local_sid_lookup(&idt->id[as][gid][pr]);
  173. while (sid <= 0) {
  174. /* No mapping yet */
  175. sid = local_sid_setup_one(&idt->id[as][gid][pr]);
  176. if (sid <= 0) {
  177. _tlbil_all();
  178. local_sid_destroy_all();
  179. }
  180. /* Update shadow pid when mappings are changed */
  181. if (!avoid_recursion)
  182. kvmppc_e500_recalc_shadow_pid(vcpu_e500);
  183. }
  184. return sid;
  185. }
  186. unsigned int kvmppc_e500_get_tlb_stid(struct kvm_vcpu *vcpu,
  187. struct kvm_book3e_206_tlb_entry *gtlbe)
  188. {
  189. return kvmppc_e500_get_sid(to_e500(vcpu), get_tlb_ts(gtlbe),
  190. get_tlb_tid(gtlbe), get_cur_pr(vcpu), 0);
  191. }
  192. void kvmppc_set_pid(struct kvm_vcpu *vcpu, u32 pid)
  193. {
  194. struct kvmppc_vcpu_e500 *vcpu_e500 = to_e500(vcpu);
  195. if (vcpu->arch.pid != pid) {
  196. vcpu_e500->pid[0] = vcpu->arch.pid = pid;
  197. kvmppc_e500_recalc_shadow_pid(vcpu_e500);
  198. }
  199. }
  200. /* gtlbe must not be mapped by more than one host tlbe */
  201. void kvmppc_e500_tlbil_one(struct kvmppc_vcpu_e500 *vcpu_e500,
  202. struct kvm_book3e_206_tlb_entry *gtlbe)
  203. {
  204. struct vcpu_id_table *idt = vcpu_e500->idt;
  205. unsigned int pr, tid, ts;
  206. int pid;
  207. u32 val, eaddr;
  208. unsigned long flags;
  209. ts = get_tlb_ts(gtlbe);
  210. tid = get_tlb_tid(gtlbe);
  211. preempt_disable();
  212. /* One guest ID may be mapped to two shadow IDs */
  213. for (pr = 0; pr < 2; pr++) {
  214. /*
  215. * The shadow PID can have a valid mapping on at most one
  216. * host CPU. In the common case, it will be valid on this
  217. * CPU, in which case we do a local invalidation of the
  218. * specific address.
  219. *
  220. * If the shadow PID is not valid on the current host CPU,
  221. * we invalidate the entire shadow PID.
  222. */
  223. pid = local_sid_lookup(&idt->id[ts][tid][pr]);
  224. if (pid <= 0) {
  225. kvmppc_e500_id_table_reset_one(vcpu_e500, ts, tid, pr);
  226. continue;
  227. }
  228. /*
  229. * The guest is invalidating a 4K entry which is in a PID
  230. * that has a valid shadow mapping on this host CPU. We
  231. * search host TLB to invalidate it's shadow TLB entry,
  232. * similar to __tlbil_va except that we need to look in AS1.
  233. */
  234. val = (pid << MAS6_SPID_SHIFT) | MAS6_SAS;
  235. eaddr = get_tlb_eaddr(gtlbe);
  236. local_irq_save(flags);
  237. mtspr(SPRN_MAS6, val);
  238. asm volatile("tlbsx 0, %[eaddr]" : : [eaddr] "r" (eaddr));
  239. val = mfspr(SPRN_MAS1);
  240. if (val & MAS1_VALID) {
  241. mtspr(SPRN_MAS1, val & ~MAS1_VALID);
  242. asm volatile("tlbwe");
  243. }
  244. local_irq_restore(flags);
  245. }
  246. preempt_enable();
  247. }
  248. void kvmppc_e500_tlbil_all(struct kvmppc_vcpu_e500 *vcpu_e500)
  249. {
  250. kvmppc_e500_id_table_reset_all(vcpu_e500);
  251. }
  252. void kvmppc_mmu_msr_notify(struct kvm_vcpu *vcpu, u32 old_msr)
  253. {
  254. /* Recalc shadow pid since MSR changes */
  255. kvmppc_e500_recalc_shadow_pid(to_e500(vcpu));
  256. }
  257. static void kvmppc_core_vcpu_load_e500(struct kvm_vcpu *vcpu, int cpu)
  258. {
  259. kvmppc_booke_vcpu_load(vcpu, cpu);
  260. /* Shadow PID may be expired on local core */
  261. kvmppc_e500_recalc_shadow_pid(to_e500(vcpu));
  262. }
  263. static void kvmppc_core_vcpu_put_e500(struct kvm_vcpu *vcpu)
  264. {
  265. #ifdef CONFIG_SPE
  266. if (vcpu->arch.shadow_msr & MSR_SPE)
  267. kvmppc_vcpu_disable_spe(vcpu);
  268. #endif
  269. kvmppc_booke_vcpu_put(vcpu);
  270. }
  271. int kvmppc_core_check_processor_compat(void)
  272. {
  273. int r;
  274. if (strcmp(cur_cpu_spec->cpu_name, "e500v2") == 0)
  275. r = 0;
  276. else
  277. r = -ENOTSUPP;
  278. return r;
  279. }
  280. static void kvmppc_e500_tlb_setup(struct kvmppc_vcpu_e500 *vcpu_e500)
  281. {
  282. struct kvm_book3e_206_tlb_entry *tlbe;
  283. /* Insert large initial mapping for guest. */
  284. tlbe = get_entry(vcpu_e500, 1, 0);
  285. tlbe->mas1 = MAS1_VALID | MAS1_TSIZE(BOOK3E_PAGESZ_256M);
  286. tlbe->mas2 = 0;
  287. tlbe->mas7_3 = E500_TLB_SUPER_PERM_MASK;
  288. /* 4K map for serial output. Used by kernel wrapper. */
  289. tlbe = get_entry(vcpu_e500, 1, 1);
  290. tlbe->mas1 = MAS1_VALID | MAS1_TSIZE(BOOK3E_PAGESZ_4K);
  291. tlbe->mas2 = (0xe0004500 & 0xFFFFF000) | MAS2_I | MAS2_G;
  292. tlbe->mas7_3 = (0xe0004500 & 0xFFFFF000) | E500_TLB_SUPER_PERM_MASK;
  293. }
  294. int kvmppc_core_vcpu_setup(struct kvm_vcpu *vcpu)
  295. {
  296. struct kvmppc_vcpu_e500 *vcpu_e500 = to_e500(vcpu);
  297. kvmppc_e500_tlb_setup(vcpu_e500);
  298. /* Registers init */
  299. vcpu->arch.pvr = mfspr(SPRN_PVR);
  300. vcpu_e500->svr = mfspr(SPRN_SVR);
  301. vcpu->arch.cpu_type = KVM_CPU_E500V2;
  302. return 0;
  303. }
  304. static int kvmppc_core_get_sregs_e500(struct kvm_vcpu *vcpu,
  305. struct kvm_sregs *sregs)
  306. {
  307. struct kvmppc_vcpu_e500 *vcpu_e500 = to_e500(vcpu);
  308. sregs->u.e.features |= KVM_SREGS_E_ARCH206_MMU | KVM_SREGS_E_SPE |
  309. KVM_SREGS_E_PM;
  310. sregs->u.e.impl_id = KVM_SREGS_E_IMPL_FSL;
  311. sregs->u.e.impl.fsl.features = 0;
  312. sregs->u.e.impl.fsl.svr = vcpu_e500->svr;
  313. sregs->u.e.impl.fsl.hid0 = vcpu_e500->hid0;
  314. sregs->u.e.impl.fsl.mcar = vcpu_e500->mcar;
  315. sregs->u.e.ivor_high[0] = vcpu->arch.ivor[BOOKE_IRQPRIO_SPE_UNAVAIL];
  316. sregs->u.e.ivor_high[1] = vcpu->arch.ivor[BOOKE_IRQPRIO_SPE_FP_DATA];
  317. sregs->u.e.ivor_high[2] = vcpu->arch.ivor[BOOKE_IRQPRIO_SPE_FP_ROUND];
  318. sregs->u.e.ivor_high[3] =
  319. vcpu->arch.ivor[BOOKE_IRQPRIO_PERFORMANCE_MONITOR];
  320. kvmppc_get_sregs_ivor(vcpu, sregs);
  321. kvmppc_get_sregs_e500_tlb(vcpu, sregs);
  322. return 0;
  323. }
  324. static int kvmppc_core_set_sregs_e500(struct kvm_vcpu *vcpu,
  325. struct kvm_sregs *sregs)
  326. {
  327. struct kvmppc_vcpu_e500 *vcpu_e500 = to_e500(vcpu);
  328. int ret;
  329. if (sregs->u.e.impl_id == KVM_SREGS_E_IMPL_FSL) {
  330. vcpu_e500->svr = sregs->u.e.impl.fsl.svr;
  331. vcpu_e500->hid0 = sregs->u.e.impl.fsl.hid0;
  332. vcpu_e500->mcar = sregs->u.e.impl.fsl.mcar;
  333. }
  334. ret = kvmppc_set_sregs_e500_tlb(vcpu, sregs);
  335. if (ret < 0)
  336. return ret;
  337. if (!(sregs->u.e.features & KVM_SREGS_E_IVOR))
  338. return 0;
  339. if (sregs->u.e.features & KVM_SREGS_E_SPE) {
  340. vcpu->arch.ivor[BOOKE_IRQPRIO_SPE_UNAVAIL] =
  341. sregs->u.e.ivor_high[0];
  342. vcpu->arch.ivor[BOOKE_IRQPRIO_SPE_FP_DATA] =
  343. sregs->u.e.ivor_high[1];
  344. vcpu->arch.ivor[BOOKE_IRQPRIO_SPE_FP_ROUND] =
  345. sregs->u.e.ivor_high[2];
  346. }
  347. if (sregs->u.e.features & KVM_SREGS_E_PM) {
  348. vcpu->arch.ivor[BOOKE_IRQPRIO_PERFORMANCE_MONITOR] =
  349. sregs->u.e.ivor_high[3];
  350. }
  351. return kvmppc_set_sregs_ivor(vcpu, sregs);
  352. }
  353. static int kvmppc_get_one_reg_e500(struct kvm_vcpu *vcpu, u64 id,
  354. union kvmppc_one_reg *val)
  355. {
  356. int r = kvmppc_get_one_reg_e500_tlb(vcpu, id, val);
  357. return r;
  358. }
  359. static int kvmppc_set_one_reg_e500(struct kvm_vcpu *vcpu, u64 id,
  360. union kvmppc_one_reg *val)
  361. {
  362. int r = kvmppc_get_one_reg_e500_tlb(vcpu, id, val);
  363. return r;
  364. }
  365. static struct kvm_vcpu *kvmppc_core_vcpu_create_e500(struct kvm *kvm,
  366. unsigned int id)
  367. {
  368. struct kvmppc_vcpu_e500 *vcpu_e500;
  369. struct kvm_vcpu *vcpu;
  370. int err;
  371. vcpu_e500 = kmem_cache_zalloc(kvm_vcpu_cache, GFP_KERNEL);
  372. if (!vcpu_e500) {
  373. err = -ENOMEM;
  374. goto out;
  375. }
  376. vcpu = &vcpu_e500->vcpu;
  377. err = kvm_vcpu_init(vcpu, kvm, id);
  378. if (err)
  379. goto free_vcpu;
  380. if (kvmppc_e500_id_table_alloc(vcpu_e500) == NULL) {
  381. err = -ENOMEM;
  382. goto uninit_vcpu;
  383. }
  384. err = kvmppc_e500_tlb_init(vcpu_e500);
  385. if (err)
  386. goto uninit_id;
  387. vcpu->arch.shared = (void*)__get_free_page(GFP_KERNEL|__GFP_ZERO);
  388. if (!vcpu->arch.shared) {
  389. err = -ENOMEM;
  390. goto uninit_tlb;
  391. }
  392. return vcpu;
  393. uninit_tlb:
  394. kvmppc_e500_tlb_uninit(vcpu_e500);
  395. uninit_id:
  396. kvmppc_e500_id_table_free(vcpu_e500);
  397. uninit_vcpu:
  398. kvm_vcpu_uninit(vcpu);
  399. free_vcpu:
  400. kmem_cache_free(kvm_vcpu_cache, vcpu_e500);
  401. out:
  402. return ERR_PTR(err);
  403. }
  404. static void kvmppc_core_vcpu_free_e500(struct kvm_vcpu *vcpu)
  405. {
  406. struct kvmppc_vcpu_e500 *vcpu_e500 = to_e500(vcpu);
  407. free_page((unsigned long)vcpu->arch.shared);
  408. kvmppc_e500_tlb_uninit(vcpu_e500);
  409. kvmppc_e500_id_table_free(vcpu_e500);
  410. kvm_vcpu_uninit(vcpu);
  411. kmem_cache_free(kvm_vcpu_cache, vcpu_e500);
  412. }
  413. static int kvmppc_core_init_vm_e500(struct kvm *kvm)
  414. {
  415. return 0;
  416. }
  417. static void kvmppc_core_destroy_vm_e500(struct kvm *kvm)
  418. {
  419. }
  420. static struct kvmppc_ops kvm_ops_e500 = {
  421. .get_sregs = kvmppc_core_get_sregs_e500,
  422. .set_sregs = kvmppc_core_set_sregs_e500,
  423. .get_one_reg = kvmppc_get_one_reg_e500,
  424. .set_one_reg = kvmppc_set_one_reg_e500,
  425. .vcpu_load = kvmppc_core_vcpu_load_e500,
  426. .vcpu_put = kvmppc_core_vcpu_put_e500,
  427. .vcpu_create = kvmppc_core_vcpu_create_e500,
  428. .vcpu_free = kvmppc_core_vcpu_free_e500,
  429. .mmu_destroy = kvmppc_mmu_destroy_e500,
  430. .init_vm = kvmppc_core_init_vm_e500,
  431. .destroy_vm = kvmppc_core_destroy_vm_e500,
  432. .emulate_op = kvmppc_core_emulate_op_e500,
  433. .emulate_mtspr = kvmppc_core_emulate_mtspr_e500,
  434. .emulate_mfspr = kvmppc_core_emulate_mfspr_e500,
  435. };
  436. static int __init kvmppc_e500_init(void)
  437. {
  438. int r, i;
  439. unsigned long ivor[3];
  440. /* Process remaining handlers above the generic first 16 */
  441. unsigned long *handler = &kvmppc_booke_handler_addr[16];
  442. unsigned long handler_len;
  443. unsigned long max_ivor = 0;
  444. r = kvmppc_core_check_processor_compat();
  445. if (r)
  446. goto err_out;
  447. r = kvmppc_booke_init();
  448. if (r)
  449. goto err_out;
  450. /* copy extra E500 exception handlers */
  451. ivor[0] = mfspr(SPRN_IVOR32);
  452. ivor[1] = mfspr(SPRN_IVOR33);
  453. ivor[2] = mfspr(SPRN_IVOR34);
  454. for (i = 0; i < 3; i++) {
  455. if (ivor[i] > ivor[max_ivor])
  456. max_ivor = i;
  457. handler_len = handler[i + 1] - handler[i];
  458. memcpy((void *)kvmppc_booke_handlers + ivor[i],
  459. (void *)handler[i], handler_len);
  460. }
  461. handler_len = handler[max_ivor + 1] - handler[max_ivor];
  462. flush_icache_range(kvmppc_booke_handlers, kvmppc_booke_handlers +
  463. ivor[max_ivor] + handler_len);
  464. r = kvm_init(NULL, sizeof(struct kvmppc_vcpu_e500), 0, THIS_MODULE);
  465. if (r)
  466. goto err_out;
  467. kvm_ops_e500.owner = THIS_MODULE;
  468. kvmppc_pr_ops = &kvm_ops_e500;
  469. err_out:
  470. return r;
  471. }
  472. static void __exit kvmppc_e500_exit(void)
  473. {
  474. kvmppc_pr_ops = NULL;
  475. kvmppc_booke_exit();
  476. }
  477. module_init(kvmppc_e500_init);
  478. module_exit(kvmppc_e500_exit);
  479. MODULE_ALIAS_MISCDEV(KVM_MINOR);
  480. MODULE_ALIAS("devname:kvm");