e500.c 15 KB

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