kvm_ppc.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487
  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. #ifndef __POWERPC_KVM_PPC_H__
  20. #define __POWERPC_KVM_PPC_H__
  21. /* This file exists just so we can dereference kvm_vcpu, avoiding nested header
  22. * dependencies. */
  23. #include <linux/mutex.h>
  24. #include <linux/timer.h>
  25. #include <linux/types.h>
  26. #include <linux/kvm_types.h>
  27. #include <linux/kvm_host.h>
  28. #include <linux/bug.h>
  29. #ifdef CONFIG_PPC_BOOK3S
  30. #include <asm/kvm_book3s.h>
  31. #else
  32. #include <asm/kvm_booke.h>
  33. #endif
  34. #ifdef CONFIG_KVM_BOOK3S_64_HANDLER
  35. #include <asm/paca.h>
  36. #endif
  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. EMULATE_AGAIN, /* something went wrong. go again */
  43. EMULATE_EXIT_USER, /* emulation requires exit to user-space */
  44. };
  45. extern int kvmppc_vcpu_run(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu);
  46. extern int __kvmppc_vcpu_run(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu);
  47. extern void kvmppc_handler_highmem(void);
  48. extern void kvmppc_dump_vcpu(struct kvm_vcpu *vcpu);
  49. extern int kvmppc_handle_load(struct kvm_run *run, struct kvm_vcpu *vcpu,
  50. unsigned int rt, unsigned int bytes,
  51. int is_bigendian);
  52. extern int kvmppc_handle_loads(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. u64 val, unsigned int bytes, int is_bigendian);
  57. extern int kvmppc_emulate_instruction(struct kvm_run *run,
  58. struct kvm_vcpu *vcpu);
  59. extern int kvmppc_emulate_mmio(struct kvm_run *run, struct kvm_vcpu *vcpu);
  60. extern void kvmppc_emulate_dec(struct kvm_vcpu *vcpu);
  61. extern u32 kvmppc_get_dec(struct kvm_vcpu *vcpu, u64 tb);
  62. extern void kvmppc_decrementer_func(unsigned long data);
  63. extern int kvmppc_sanity_check(struct kvm_vcpu *vcpu);
  64. extern int kvmppc_subarch_vcpu_init(struct kvm_vcpu *vcpu);
  65. extern void kvmppc_subarch_vcpu_uninit(struct kvm_vcpu *vcpu);
  66. /* Core-specific hooks */
  67. extern void kvmppc_mmu_map(struct kvm_vcpu *vcpu, u64 gvaddr, gpa_t gpaddr,
  68. unsigned int gtlb_idx);
  69. extern void kvmppc_mmu_priv_switch(struct kvm_vcpu *vcpu, int usermode);
  70. extern void kvmppc_mmu_switch_pid(struct kvm_vcpu *vcpu, u32 pid);
  71. extern void kvmppc_mmu_destroy(struct kvm_vcpu *vcpu);
  72. extern int kvmppc_mmu_init(struct kvm_vcpu *vcpu);
  73. extern int kvmppc_mmu_dtlb_index(struct kvm_vcpu *vcpu, gva_t eaddr);
  74. extern int kvmppc_mmu_itlb_index(struct kvm_vcpu *vcpu, gva_t eaddr);
  75. extern gpa_t kvmppc_mmu_xlate(struct kvm_vcpu *vcpu, unsigned int gtlb_index,
  76. gva_t eaddr);
  77. extern void kvmppc_mmu_dtlb_miss(struct kvm_vcpu *vcpu);
  78. extern void kvmppc_mmu_itlb_miss(struct kvm_vcpu *vcpu);
  79. extern struct kvm_vcpu *kvmppc_core_vcpu_create(struct kvm *kvm,
  80. unsigned int id);
  81. extern void kvmppc_core_vcpu_free(struct kvm_vcpu *vcpu);
  82. extern int kvmppc_core_vcpu_setup(struct kvm_vcpu *vcpu);
  83. extern int kvmppc_core_check_processor_compat(void);
  84. extern int kvmppc_core_vcpu_translate(struct kvm_vcpu *vcpu,
  85. struct kvm_translation *tr);
  86. extern void kvmppc_core_vcpu_load(struct kvm_vcpu *vcpu, int cpu);
  87. extern void kvmppc_core_vcpu_put(struct kvm_vcpu *vcpu);
  88. extern int kvmppc_core_prepare_to_enter(struct kvm_vcpu *vcpu);
  89. extern int kvmppc_core_pending_dec(struct kvm_vcpu *vcpu);
  90. extern void kvmppc_core_queue_program(struct kvm_vcpu *vcpu, ulong flags);
  91. extern void kvmppc_core_queue_dec(struct kvm_vcpu *vcpu);
  92. extern void kvmppc_core_dequeue_dec(struct kvm_vcpu *vcpu);
  93. extern void kvmppc_core_queue_external(struct kvm_vcpu *vcpu,
  94. struct kvm_interrupt *irq);
  95. extern void kvmppc_core_dequeue_external(struct kvm_vcpu *vcpu);
  96. extern void kvmppc_core_flush_tlb(struct kvm_vcpu *vcpu);
  97. extern int kvmppc_core_check_requests(struct kvm_vcpu *vcpu);
  98. extern int kvmppc_booke_init(void);
  99. extern void kvmppc_booke_exit(void);
  100. extern void kvmppc_core_destroy_mmu(struct kvm_vcpu *vcpu);
  101. extern int kvmppc_kvm_pv(struct kvm_vcpu *vcpu);
  102. extern void kvmppc_map_magic(struct kvm_vcpu *vcpu);
  103. extern long kvmppc_alloc_hpt(struct kvm *kvm, u32 *htab_orderp);
  104. extern long kvmppc_alloc_reset_hpt(struct kvm *kvm, u32 *htab_orderp);
  105. extern void kvmppc_free_hpt(struct kvm *kvm);
  106. extern long kvmppc_prepare_vrma(struct kvm *kvm,
  107. struct kvm_userspace_memory_region *mem);
  108. extern void kvmppc_map_vrma(struct kvm_vcpu *vcpu,
  109. struct kvm_memory_slot *memslot, unsigned long porder);
  110. extern int kvmppc_pseries_do_hcall(struct kvm_vcpu *vcpu);
  111. extern long kvm_vm_ioctl_create_spapr_tce(struct kvm *kvm,
  112. struct kvm_create_spapr_tce *args);
  113. extern long kvmppc_h_put_tce(struct kvm_vcpu *vcpu, unsigned long liobn,
  114. unsigned long ioba, unsigned long tce);
  115. extern struct kvm_rma_info *kvm_alloc_rma(void);
  116. extern void kvm_release_rma(struct kvm_rma_info *ri);
  117. extern struct page *kvm_alloc_hpt(unsigned long nr_pages);
  118. extern void kvm_release_hpt(struct page *page, unsigned long nr_pages);
  119. extern int kvmppc_core_init_vm(struct kvm *kvm);
  120. extern void kvmppc_core_destroy_vm(struct kvm *kvm);
  121. extern void kvmppc_core_free_memslot(struct kvm *kvm,
  122. struct kvm_memory_slot *free,
  123. struct kvm_memory_slot *dont);
  124. extern int kvmppc_core_create_memslot(struct kvm *kvm,
  125. struct kvm_memory_slot *slot,
  126. unsigned long npages);
  127. extern int kvmppc_core_prepare_memory_region(struct kvm *kvm,
  128. struct kvm_memory_slot *memslot,
  129. struct kvm_userspace_memory_region *mem);
  130. extern void kvmppc_core_commit_memory_region(struct kvm *kvm,
  131. struct kvm_userspace_memory_region *mem,
  132. const struct kvm_memory_slot *old);
  133. extern int kvm_vm_ioctl_get_smmu_info(struct kvm *kvm,
  134. struct kvm_ppc_smmu_info *info);
  135. extern void kvmppc_core_flush_memslot(struct kvm *kvm,
  136. struct kvm_memory_slot *memslot);
  137. extern int kvmppc_bookehv_init(void);
  138. extern void kvmppc_bookehv_exit(void);
  139. extern int kvmppc_prepare_to_enter(struct kvm_vcpu *vcpu);
  140. extern int kvm_vm_ioctl_get_htab_fd(struct kvm *kvm, struct kvm_get_htab_fd *);
  141. int kvm_vcpu_ioctl_interrupt(struct kvm_vcpu *vcpu, struct kvm_interrupt *irq);
  142. extern int kvm_vm_ioctl_rtas_define_token(struct kvm *kvm, void __user *argp);
  143. extern int kvmppc_rtas_hcall(struct kvm_vcpu *vcpu);
  144. extern void kvmppc_rtas_tokens_free(struct kvm *kvm);
  145. extern int kvmppc_xics_set_xive(struct kvm *kvm, u32 irq, u32 server,
  146. u32 priority);
  147. extern int kvmppc_xics_get_xive(struct kvm *kvm, u32 irq, u32 *server,
  148. u32 *priority);
  149. extern int kvmppc_xics_int_on(struct kvm *kvm, u32 irq);
  150. extern int kvmppc_xics_int_off(struct kvm *kvm, u32 irq);
  151. union kvmppc_one_reg {
  152. u32 wval;
  153. u64 dval;
  154. vector128 vval;
  155. u64 vsxval[2];
  156. struct {
  157. u64 addr;
  158. u64 length;
  159. } vpaval;
  160. };
  161. struct kvmppc_ops {
  162. struct module *owner;
  163. int (*get_sregs)(struct kvm_vcpu *vcpu, struct kvm_sregs *sregs);
  164. int (*set_sregs)(struct kvm_vcpu *vcpu, struct kvm_sregs *sregs);
  165. int (*get_one_reg)(struct kvm_vcpu *vcpu, u64 id,
  166. union kvmppc_one_reg *val);
  167. int (*set_one_reg)(struct kvm_vcpu *vcpu, u64 id,
  168. union kvmppc_one_reg *val);
  169. void (*vcpu_load)(struct kvm_vcpu *vcpu, int cpu);
  170. void (*vcpu_put)(struct kvm_vcpu *vcpu);
  171. void (*set_msr)(struct kvm_vcpu *vcpu, u64 msr);
  172. int (*vcpu_run)(struct kvm_run *run, struct kvm_vcpu *vcpu);
  173. struct kvm_vcpu *(*vcpu_create)(struct kvm *kvm, unsigned int id);
  174. void (*vcpu_free)(struct kvm_vcpu *vcpu);
  175. int (*check_requests)(struct kvm_vcpu *vcpu);
  176. int (*get_dirty_log)(struct kvm *kvm, struct kvm_dirty_log *log);
  177. void (*flush_memslot)(struct kvm *kvm, struct kvm_memory_slot *memslot);
  178. int (*prepare_memory_region)(struct kvm *kvm,
  179. struct kvm_memory_slot *memslot,
  180. struct kvm_userspace_memory_region *mem);
  181. void (*commit_memory_region)(struct kvm *kvm,
  182. struct kvm_userspace_memory_region *mem,
  183. const struct kvm_memory_slot *old);
  184. int (*unmap_hva)(struct kvm *kvm, unsigned long hva);
  185. int (*unmap_hva_range)(struct kvm *kvm, unsigned long start,
  186. unsigned long end);
  187. int (*age_hva)(struct kvm *kvm, unsigned long hva);
  188. int (*test_age_hva)(struct kvm *kvm, unsigned long hva);
  189. void (*set_spte_hva)(struct kvm *kvm, unsigned long hva, pte_t pte);
  190. void (*mmu_destroy)(struct kvm_vcpu *vcpu);
  191. void (*free_memslot)(struct kvm_memory_slot *free,
  192. struct kvm_memory_slot *dont);
  193. int (*create_memslot)(struct kvm_memory_slot *slot,
  194. unsigned long npages);
  195. int (*init_vm)(struct kvm *kvm);
  196. void (*destroy_vm)(struct kvm *kvm);
  197. int (*get_smmu_info)(struct kvm *kvm, struct kvm_ppc_smmu_info *info);
  198. int (*emulate_op)(struct kvm_run *run, struct kvm_vcpu *vcpu,
  199. unsigned int inst, int *advance);
  200. int (*emulate_mtspr)(struct kvm_vcpu *vcpu, int sprn, ulong spr_val);
  201. int (*emulate_mfspr)(struct kvm_vcpu *vcpu, int sprn, ulong *spr_val);
  202. void (*fast_vcpu_kick)(struct kvm_vcpu *vcpu);
  203. long (*arch_vm_ioctl)(struct file *filp, unsigned int ioctl,
  204. unsigned long arg);
  205. };
  206. extern struct kvmppc_ops *kvmppc_hv_ops;
  207. extern struct kvmppc_ops *kvmppc_pr_ops;
  208. static inline bool is_kvmppc_hv_enabled(struct kvm *kvm)
  209. {
  210. return kvm->arch.kvm_ops == kvmppc_hv_ops;
  211. }
  212. /*
  213. * Cuts out inst bits with ordering according to spec.
  214. * That means the leftmost bit is zero. All given bits are included.
  215. */
  216. static inline u32 kvmppc_get_field(u64 inst, int msb, int lsb)
  217. {
  218. u32 r;
  219. u32 mask;
  220. BUG_ON(msb > lsb);
  221. mask = (1 << (lsb - msb + 1)) - 1;
  222. r = (inst >> (63 - lsb)) & mask;
  223. return r;
  224. }
  225. /*
  226. * Replaces inst bits with ordering according to spec.
  227. */
  228. static inline u32 kvmppc_set_field(u64 inst, int msb, int lsb, int value)
  229. {
  230. u32 r;
  231. u32 mask;
  232. BUG_ON(msb > lsb);
  233. mask = ((1 << (lsb - msb + 1)) - 1) << (63 - lsb);
  234. r = (inst & ~mask) | ((value << (63 - lsb)) & mask);
  235. return r;
  236. }
  237. #define one_reg_size(id) \
  238. (1ul << (((id) & KVM_REG_SIZE_MASK) >> KVM_REG_SIZE_SHIFT))
  239. #define get_reg_val(id, reg) ({ \
  240. union kvmppc_one_reg __u; \
  241. switch (one_reg_size(id)) { \
  242. case 4: __u.wval = (reg); break; \
  243. case 8: __u.dval = (reg); break; \
  244. default: BUG(); \
  245. } \
  246. __u; \
  247. })
  248. #define set_reg_val(id, val) ({ \
  249. u64 __v; \
  250. switch (one_reg_size(id)) { \
  251. case 4: __v = (val).wval; break; \
  252. case 8: __v = (val).dval; break; \
  253. default: BUG(); \
  254. } \
  255. __v; \
  256. })
  257. int kvmppc_core_get_sregs(struct kvm_vcpu *vcpu, struct kvm_sregs *sregs);
  258. int kvmppc_core_set_sregs(struct kvm_vcpu *vcpu, struct kvm_sregs *sregs);
  259. int kvmppc_get_sregs_ivor(struct kvm_vcpu *vcpu, struct kvm_sregs *sregs);
  260. int kvmppc_set_sregs_ivor(struct kvm_vcpu *vcpu, struct kvm_sregs *sregs);
  261. int kvm_vcpu_ioctl_get_one_reg(struct kvm_vcpu *vcpu, struct kvm_one_reg *reg);
  262. int kvm_vcpu_ioctl_set_one_reg(struct kvm_vcpu *vcpu, struct kvm_one_reg *reg);
  263. int kvmppc_get_one_reg(struct kvm_vcpu *vcpu, u64 id, union kvmppc_one_reg *);
  264. int kvmppc_set_one_reg(struct kvm_vcpu *vcpu, u64 id, union kvmppc_one_reg *);
  265. void kvmppc_set_pid(struct kvm_vcpu *vcpu, u32 pid);
  266. struct openpic;
  267. #ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE
  268. extern void kvm_cma_reserve(void) __init;
  269. static inline void kvmppc_set_xics_phys(int cpu, unsigned long addr)
  270. {
  271. paca[cpu].kvm_hstate.xics_phys = addr;
  272. }
  273. static inline u32 kvmppc_get_xics_latch(void)
  274. {
  275. u32 xirr;
  276. xirr = get_paca()->kvm_hstate.saved_xirr;
  277. get_paca()->kvm_hstate.saved_xirr = 0;
  278. return xirr;
  279. }
  280. static inline void kvmppc_set_host_ipi(int cpu, u8 host_ipi)
  281. {
  282. paca[cpu].kvm_hstate.host_ipi = host_ipi;
  283. }
  284. static inline void kvmppc_fast_vcpu_kick(struct kvm_vcpu *vcpu)
  285. {
  286. vcpu->kvm->arch.kvm_ops->fast_vcpu_kick(vcpu);
  287. }
  288. #else
  289. static inline void __init kvm_cma_reserve(void)
  290. {}
  291. static inline void kvmppc_set_xics_phys(int cpu, unsigned long addr)
  292. {}
  293. static inline u32 kvmppc_get_xics_latch(void)
  294. {
  295. return 0;
  296. }
  297. static inline void kvmppc_set_host_ipi(int cpu, u8 host_ipi)
  298. {}
  299. static inline void kvmppc_fast_vcpu_kick(struct kvm_vcpu *vcpu)
  300. {
  301. kvm_vcpu_kick(vcpu);
  302. }
  303. #endif
  304. #ifdef CONFIG_KVM_XICS
  305. static inline int kvmppc_xics_enabled(struct kvm_vcpu *vcpu)
  306. {
  307. return vcpu->arch.irq_type == KVMPPC_IRQ_XICS;
  308. }
  309. extern void kvmppc_xics_free_icp(struct kvm_vcpu *vcpu);
  310. extern int kvmppc_xics_create_icp(struct kvm_vcpu *vcpu, unsigned long server);
  311. extern int kvm_vm_ioctl_xics_irq(struct kvm *kvm, struct kvm_irq_level *args);
  312. extern int kvmppc_xics_hcall(struct kvm_vcpu *vcpu, u32 cmd);
  313. extern u64 kvmppc_xics_get_icp(struct kvm_vcpu *vcpu);
  314. extern int kvmppc_xics_set_icp(struct kvm_vcpu *vcpu, u64 icpval);
  315. extern int kvmppc_xics_connect_vcpu(struct kvm_device *dev,
  316. struct kvm_vcpu *vcpu, u32 cpu);
  317. #else
  318. static inline int kvmppc_xics_enabled(struct kvm_vcpu *vcpu)
  319. { return 0; }
  320. static inline void kvmppc_xics_free_icp(struct kvm_vcpu *vcpu) { }
  321. static inline int kvmppc_xics_create_icp(struct kvm_vcpu *vcpu,
  322. unsigned long server)
  323. { return -EINVAL; }
  324. static inline int kvm_vm_ioctl_xics_irq(struct kvm *kvm,
  325. struct kvm_irq_level *args)
  326. { return -ENOTTY; }
  327. static inline int kvmppc_xics_hcall(struct kvm_vcpu *vcpu, u32 cmd)
  328. { return 0; }
  329. #endif
  330. static inline void kvmppc_set_epr(struct kvm_vcpu *vcpu, u32 epr)
  331. {
  332. #ifdef CONFIG_KVM_BOOKE_HV
  333. mtspr(SPRN_GEPR, epr);
  334. #elif defined(CONFIG_BOOKE)
  335. vcpu->arch.epr = epr;
  336. #endif
  337. }
  338. #ifdef CONFIG_KVM_MPIC
  339. void kvmppc_mpic_set_epr(struct kvm_vcpu *vcpu);
  340. int kvmppc_mpic_connect_vcpu(struct kvm_device *dev, struct kvm_vcpu *vcpu,
  341. u32 cpu);
  342. void kvmppc_mpic_disconnect_vcpu(struct openpic *opp, struct kvm_vcpu *vcpu);
  343. #else
  344. static inline void kvmppc_mpic_set_epr(struct kvm_vcpu *vcpu)
  345. {
  346. }
  347. static inline int kvmppc_mpic_connect_vcpu(struct kvm_device *dev,
  348. struct kvm_vcpu *vcpu, u32 cpu)
  349. {
  350. return -EINVAL;
  351. }
  352. static inline void kvmppc_mpic_disconnect_vcpu(struct openpic *opp,
  353. struct kvm_vcpu *vcpu)
  354. {
  355. }
  356. #endif /* CONFIG_KVM_MPIC */
  357. int kvm_vcpu_ioctl_config_tlb(struct kvm_vcpu *vcpu,
  358. struct kvm_config_tlb *cfg);
  359. int kvm_vcpu_ioctl_dirty_tlb(struct kvm_vcpu *vcpu,
  360. struct kvm_dirty_tlb *cfg);
  361. long kvmppc_alloc_lpid(void);
  362. void kvmppc_claim_lpid(long lpid);
  363. void kvmppc_free_lpid(long lpid);
  364. void kvmppc_init_lpid(unsigned long nr_lpids);
  365. static inline void kvmppc_mmu_flush_icache(pfn_t pfn)
  366. {
  367. struct page *page;
  368. /*
  369. * We can only access pages that the kernel maps
  370. * as memory. Bail out for unmapped ones.
  371. */
  372. if (!pfn_valid(pfn))
  373. return;
  374. /* Clear i-cache for new pages */
  375. page = pfn_to_page(pfn);
  376. if (!test_bit(PG_arch_1, &page->flags)) {
  377. flush_dcache_icache_page(page);
  378. set_bit(PG_arch_1, &page->flags);
  379. }
  380. }
  381. /*
  382. * Please call after prepare_to_enter. This function puts the lazy ee and irq
  383. * disabled tracking state back to normal mode, without actually enabling
  384. * interrupts.
  385. */
  386. static inline void kvmppc_fix_ee_before_entry(void)
  387. {
  388. trace_hardirqs_on();
  389. #ifdef CONFIG_PPC64
  390. /* Only need to enable IRQs by hard enabling them after this */
  391. local_paca->irq_happened = 0;
  392. local_paca->soft_enabled = 1;
  393. #endif
  394. }
  395. static inline ulong kvmppc_get_ea_indexed(struct kvm_vcpu *vcpu, int ra, int rb)
  396. {
  397. ulong ea;
  398. ulong msr_64bit = 0;
  399. ea = kvmppc_get_gpr(vcpu, rb);
  400. if (ra)
  401. ea += kvmppc_get_gpr(vcpu, ra);
  402. #if defined(CONFIG_PPC_BOOK3E_64)
  403. msr_64bit = MSR_CM;
  404. #elif defined(CONFIG_PPC_BOOK3S_64)
  405. msr_64bit = MSR_SF;
  406. #endif
  407. if (!(vcpu->arch.shared->msr & msr_64bit))
  408. ea = (uint32_t)ea;
  409. return ea;
  410. }
  411. extern void xics_wake_cpu(int cpu);
  412. #endif /* __POWERPC_KVM_PPC_H__ */