kvm_host.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591
  1. /*
  2. * kvm_host.h: used for kvm module, and hold ia64-specific sections.
  3. *
  4. * Copyright (C) 2007, Intel Corporation.
  5. *
  6. * Xiantao Zhang <xiantao.zhang@intel.com>
  7. *
  8. * This program is free software; you can redistribute it and/or modify it
  9. * under the terms and conditions of the GNU General Public License,
  10. * version 2, as published by the Free Software Foundation.
  11. *
  12. * This program is distributed in the hope it will be useful, but WITHOUT
  13. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  14. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  15. * more details.
  16. *
  17. * You should have received a copy of the GNU General Public License along with
  18. * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
  19. * Place - Suite 330, Boston, MA 02111-1307 USA.
  20. *
  21. */
  22. #ifndef __ASM_KVM_HOST_H
  23. #define __ASM_KVM_HOST_H
  24. #define KVM_MEMORY_SLOTS 32
  25. /* memory slots that does not exposed to userspace */
  26. #define KVM_PRIVATE_MEM_SLOTS 4
  27. #define KVM_COALESCED_MMIO_PAGE_OFFSET 1
  28. /* define exit reasons from vmm to kvm*/
  29. #define EXIT_REASON_VM_PANIC 0
  30. #define EXIT_REASON_MMIO_INSTRUCTION 1
  31. #define EXIT_REASON_PAL_CALL 2
  32. #define EXIT_REASON_SAL_CALL 3
  33. #define EXIT_REASON_SWITCH_RR6 4
  34. #define EXIT_REASON_VM_DESTROY 5
  35. #define EXIT_REASON_EXTERNAL_INTERRUPT 6
  36. #define EXIT_REASON_IPI 7
  37. #define EXIT_REASON_PTC_G 8
  38. #define EXIT_REASON_DEBUG 20
  39. /*Define vmm address space and vm data space.*/
  40. #define KVM_VMM_SIZE (__IA64_UL_CONST(16)<<20)
  41. #define KVM_VMM_SHIFT 24
  42. #define KVM_VMM_BASE 0xD000000000000000
  43. #define VMM_SIZE (__IA64_UL_CONST(8)<<20)
  44. /*
  45. * Define vm_buffer, used by PAL Services, base address.
  46. * Note: vm_buffer is in the VMM-BLOCK, the size must be < 8M
  47. */
  48. #define KVM_VM_BUFFER_BASE (KVM_VMM_BASE + VMM_SIZE)
  49. #define KVM_VM_BUFFER_SIZE (__IA64_UL_CONST(8)<<20)
  50. /*
  51. * kvm guest's data area looks as follow:
  52. *
  53. * +----------------------+ ------- KVM_VM_DATA_SIZE
  54. * | vcpu[n]'s data | | ___________________KVM_STK_OFFSET
  55. * | | | / |
  56. * | .......... | | /vcpu's struct&stack |
  57. * | .......... | | /---------------------|---- 0
  58. * | vcpu[5]'s data | | / vpd |
  59. * | vcpu[4]'s data | |/-----------------------|
  60. * | vcpu[3]'s data | / vtlb |
  61. * | vcpu[2]'s data | /|------------------------|
  62. * | vcpu[1]'s data |/ | vhpt |
  63. * | vcpu[0]'s data |____________________________|
  64. * +----------------------+ |
  65. * | memory dirty log | |
  66. * +----------------------+ |
  67. * | vm's data struct | |
  68. * +----------------------+ |
  69. * | | |
  70. * | | |
  71. * | | |
  72. * | | |
  73. * | | |
  74. * | | |
  75. * | | |
  76. * | vm's p2m table | |
  77. * | | |
  78. * | | |
  79. * | | | |
  80. * vm's data->| | | |
  81. * +----------------------+ ------- 0
  82. * To support large memory, needs to increase the size of p2m.
  83. * To support more vcpus, needs to ensure it has enough space to
  84. * hold vcpus' data.
  85. */
  86. #define KVM_VM_DATA_SHIFT 26
  87. #define KVM_VM_DATA_SIZE (__IA64_UL_CONST(1) << KVM_VM_DATA_SHIFT)
  88. #define KVM_VM_DATA_BASE (KVM_VMM_BASE + KVM_VM_DATA_SIZE)
  89. #define KVM_P2M_BASE KVM_VM_DATA_BASE
  90. #define KVM_P2M_SIZE (__IA64_UL_CONST(24) << 20)
  91. #define VHPT_SHIFT 16
  92. #define VHPT_SIZE (__IA64_UL_CONST(1) << VHPT_SHIFT)
  93. #define VHPT_NUM_ENTRIES (__IA64_UL_CONST(1) << (VHPT_SHIFT-5))
  94. #define VTLB_SHIFT 16
  95. #define VTLB_SIZE (__IA64_UL_CONST(1) << VTLB_SHIFT)
  96. #define VTLB_NUM_ENTRIES (1UL << (VHPT_SHIFT-5))
  97. #define VPD_SHIFT 16
  98. #define VPD_SIZE (__IA64_UL_CONST(1) << VPD_SHIFT)
  99. #define VCPU_STRUCT_SHIFT 16
  100. #define VCPU_STRUCT_SIZE (__IA64_UL_CONST(1) << VCPU_STRUCT_SHIFT)
  101. /*
  102. * This must match KVM_IA64_VCPU_STACK_{SHIFT,SIZE} arch/ia64/include/asm/kvm.h
  103. */
  104. #define KVM_STK_SHIFT 16
  105. #define KVM_STK_OFFSET (__IA64_UL_CONST(1)<< KVM_STK_SHIFT)
  106. #define KVM_VM_STRUCT_SHIFT 19
  107. #define KVM_VM_STRUCT_SIZE (__IA64_UL_CONST(1) << KVM_VM_STRUCT_SHIFT)
  108. #define KVM_MEM_DIRY_LOG_SHIFT 19
  109. #define KVM_MEM_DIRTY_LOG_SIZE (__IA64_UL_CONST(1) << KVM_MEM_DIRY_LOG_SHIFT)
  110. #ifndef __ASSEMBLY__
  111. /*Define the max vcpus and memory for Guests.*/
  112. #define KVM_MAX_VCPUS (KVM_VM_DATA_SIZE - KVM_P2M_SIZE - KVM_VM_STRUCT_SIZE -\
  113. KVM_MEM_DIRTY_LOG_SIZE) / sizeof(struct kvm_vcpu_data)
  114. #define KVM_MAX_MEM_SIZE (KVM_P2M_SIZE >> 3 << PAGE_SHIFT)
  115. #define VMM_LOG_LEN 256
  116. #include <linux/types.h>
  117. #include <linux/mm.h>
  118. #include <linux/kvm.h>
  119. #include <linux/kvm_para.h>
  120. #include <linux/kvm_types.h>
  121. #include <asm/pal.h>
  122. #include <asm/sal.h>
  123. #include <asm/page.h>
  124. struct kvm_vcpu_data {
  125. char vcpu_vhpt[VHPT_SIZE];
  126. char vcpu_vtlb[VTLB_SIZE];
  127. char vcpu_vpd[VPD_SIZE];
  128. char vcpu_struct[VCPU_STRUCT_SIZE];
  129. };
  130. struct kvm_vm_data {
  131. char kvm_p2m[KVM_P2M_SIZE];
  132. char kvm_vm_struct[KVM_VM_STRUCT_SIZE];
  133. char kvm_mem_dirty_log[KVM_MEM_DIRTY_LOG_SIZE];
  134. struct kvm_vcpu_data vcpu_data[KVM_MAX_VCPUS];
  135. };
  136. #define VCPU_BASE(n) (KVM_VM_DATA_BASE + \
  137. offsetof(struct kvm_vm_data, vcpu_data[n]))
  138. #define KVM_VM_BASE (KVM_VM_DATA_BASE + \
  139. offsetof(struct kvm_vm_data, kvm_vm_struct))
  140. #define KVM_MEM_DIRTY_LOG_BASE KVM_VM_DATA_BASE + \
  141. offsetof(struct kvm_vm_data, kvm_mem_dirty_log)
  142. #define VHPT_BASE(n) (VCPU_BASE(n) + offsetof(struct kvm_vcpu_data, vcpu_vhpt))
  143. #define VTLB_BASE(n) (VCPU_BASE(n) + offsetof(struct kvm_vcpu_data, vcpu_vtlb))
  144. #define VPD_BASE(n) (VCPU_BASE(n) + offsetof(struct kvm_vcpu_data, vcpu_vpd))
  145. #define VCPU_STRUCT_BASE(n) (VCPU_BASE(n) + \
  146. offsetof(struct kvm_vcpu_data, vcpu_struct))
  147. /*IO section definitions*/
  148. #define IOREQ_READ 1
  149. #define IOREQ_WRITE 0
  150. #define STATE_IOREQ_NONE 0
  151. #define STATE_IOREQ_READY 1
  152. #define STATE_IOREQ_INPROCESS 2
  153. #define STATE_IORESP_READY 3
  154. /*Guest Physical address layout.*/
  155. #define GPFN_MEM (0UL << 60) /* Guest pfn is normal mem */
  156. #define GPFN_FRAME_BUFFER (1UL << 60) /* VGA framebuffer */
  157. #define GPFN_LOW_MMIO (2UL << 60) /* Low MMIO range */
  158. #define GPFN_PIB (3UL << 60) /* PIB base */
  159. #define GPFN_IOSAPIC (4UL << 60) /* IOSAPIC base */
  160. #define GPFN_LEGACY_IO (5UL << 60) /* Legacy I/O base */
  161. #define GPFN_GFW (6UL << 60) /* Guest Firmware */
  162. #define GPFN_PHYS_MMIO (7UL << 60) /* Directed MMIO Range */
  163. #define GPFN_IO_MASK (7UL << 60) /* Guest pfn is I/O type */
  164. #define GPFN_INV_MASK (1UL << 63) /* Guest pfn is invalid */
  165. #define INVALID_MFN (~0UL)
  166. #define MEM_G (1UL << 30)
  167. #define MEM_M (1UL << 20)
  168. #define MMIO_START (3 * MEM_G)
  169. #define MMIO_SIZE (512 * MEM_M)
  170. #define VGA_IO_START 0xA0000UL
  171. #define VGA_IO_SIZE 0x20000
  172. #define LEGACY_IO_START (MMIO_START + MMIO_SIZE)
  173. #define LEGACY_IO_SIZE (64 * MEM_M)
  174. #define IO_SAPIC_START 0xfec00000UL
  175. #define IO_SAPIC_SIZE 0x100000
  176. #define PIB_START 0xfee00000UL
  177. #define PIB_SIZE 0x200000
  178. #define GFW_START (4 * MEM_G - 16 * MEM_M)
  179. #define GFW_SIZE (16 * MEM_M)
  180. /*Deliver mode, defined for ioapic.c*/
  181. #define dest_Fixed IOSAPIC_FIXED
  182. #define dest_LowestPrio IOSAPIC_LOWEST_PRIORITY
  183. #define NMI_VECTOR 2
  184. #define ExtINT_VECTOR 0
  185. #define NULL_VECTOR (-1)
  186. #define IA64_SPURIOUS_INT_VECTOR 0x0f
  187. #define VCPU_LID(v) (((u64)(v)->vcpu_id) << 24)
  188. /*
  189. *Delivery mode
  190. */
  191. #define SAPIC_DELIV_SHIFT 8
  192. #define SAPIC_FIXED 0x0
  193. #define SAPIC_LOWEST_PRIORITY 0x1
  194. #define SAPIC_PMI 0x2
  195. #define SAPIC_NMI 0x4
  196. #define SAPIC_INIT 0x5
  197. #define SAPIC_EXTINT 0x7
  198. /*
  199. * vcpu->requests bit members for arch
  200. */
  201. #define KVM_REQ_PTC_G 32
  202. #define KVM_REQ_RESUME 33
  203. #define KVM_PAGES_PER_HPAGE 1
  204. struct kvm;
  205. struct kvm_vcpu;
  206. struct kvm_mmio_req {
  207. uint64_t addr; /* physical address */
  208. uint64_t size; /* size in bytes */
  209. uint64_t data; /* data (or paddr of data) */
  210. uint8_t state:4;
  211. uint8_t dir:1; /* 1=read, 0=write */
  212. };
  213. /*Pal data struct */
  214. struct kvm_pal_call{
  215. /*In area*/
  216. uint64_t gr28;
  217. uint64_t gr29;
  218. uint64_t gr30;
  219. uint64_t gr31;
  220. /*Out area*/
  221. struct ia64_pal_retval ret;
  222. };
  223. /* Sal data structure */
  224. struct kvm_sal_call{
  225. /*In area*/
  226. uint64_t in0;
  227. uint64_t in1;
  228. uint64_t in2;
  229. uint64_t in3;
  230. uint64_t in4;
  231. uint64_t in5;
  232. uint64_t in6;
  233. uint64_t in7;
  234. struct sal_ret_values ret;
  235. };
  236. /*Guest change rr6*/
  237. struct kvm_switch_rr6 {
  238. uint64_t old_rr;
  239. uint64_t new_rr;
  240. };
  241. union ia64_ipi_a{
  242. unsigned long val;
  243. struct {
  244. unsigned long rv : 3;
  245. unsigned long ir : 1;
  246. unsigned long eid : 8;
  247. unsigned long id : 8;
  248. unsigned long ib_base : 44;
  249. };
  250. };
  251. union ia64_ipi_d {
  252. unsigned long val;
  253. struct {
  254. unsigned long vector : 8;
  255. unsigned long dm : 3;
  256. unsigned long ig : 53;
  257. };
  258. };
  259. /*ipi check exit data*/
  260. struct kvm_ipi_data{
  261. union ia64_ipi_a addr;
  262. union ia64_ipi_d data;
  263. };
  264. /*global purge data*/
  265. struct kvm_ptc_g {
  266. unsigned long vaddr;
  267. unsigned long rr;
  268. unsigned long ps;
  269. struct kvm_vcpu *vcpu;
  270. };
  271. /*Exit control data */
  272. struct exit_ctl_data{
  273. uint32_t exit_reason;
  274. uint32_t vm_status;
  275. union {
  276. struct kvm_mmio_req ioreq;
  277. struct kvm_pal_call pal_data;
  278. struct kvm_sal_call sal_data;
  279. struct kvm_switch_rr6 rr_data;
  280. struct kvm_ipi_data ipi_data;
  281. struct kvm_ptc_g ptc_g_data;
  282. } u;
  283. };
  284. union pte_flags {
  285. unsigned long val;
  286. struct {
  287. unsigned long p : 1; /*0 */
  288. unsigned long : 1; /* 1 */
  289. unsigned long ma : 3; /* 2-4 */
  290. unsigned long a : 1; /* 5 */
  291. unsigned long d : 1; /* 6 */
  292. unsigned long pl : 2; /* 7-8 */
  293. unsigned long ar : 3; /* 9-11 */
  294. unsigned long ppn : 38; /* 12-49 */
  295. unsigned long : 2; /* 50-51 */
  296. unsigned long ed : 1; /* 52 */
  297. };
  298. };
  299. union ia64_pta {
  300. unsigned long val;
  301. struct {
  302. unsigned long ve : 1;
  303. unsigned long reserved0 : 1;
  304. unsigned long size : 6;
  305. unsigned long vf : 1;
  306. unsigned long reserved1 : 6;
  307. unsigned long base : 49;
  308. };
  309. };
  310. struct thash_cb {
  311. /* THASH base information */
  312. struct thash_data *hash; /* hash table pointer */
  313. union ia64_pta pta;
  314. int num;
  315. };
  316. struct kvm_vcpu_stat {
  317. };
  318. struct kvm_vcpu_arch {
  319. int launched;
  320. int last_exit;
  321. int last_run_cpu;
  322. int vmm_tr_slot;
  323. int vm_tr_slot;
  324. #define KVM_MP_STATE_RUNNABLE 0
  325. #define KVM_MP_STATE_UNINITIALIZED 1
  326. #define KVM_MP_STATE_INIT_RECEIVED 2
  327. #define KVM_MP_STATE_HALTED 3
  328. int mp_state;
  329. #define MAX_PTC_G_NUM 3
  330. int ptc_g_count;
  331. struct kvm_ptc_g ptc_g_data[MAX_PTC_G_NUM];
  332. /*halt timer to wake up sleepy vcpus*/
  333. struct hrtimer hlt_timer;
  334. long ht_active;
  335. struct kvm_lapic *apic; /* kernel irqchip context */
  336. struct vpd *vpd;
  337. /* Exit data for vmm_transition*/
  338. struct exit_ctl_data exit_data;
  339. cpumask_t cache_coherent_map;
  340. unsigned long vmm_rr;
  341. unsigned long host_rr6;
  342. unsigned long psbits[8];
  343. unsigned long cr_iipa;
  344. unsigned long cr_isr;
  345. unsigned long vsa_base;
  346. unsigned long dirty_log_lock_pa;
  347. unsigned long __gp;
  348. /* TR and TC. */
  349. struct thash_data itrs[NITRS];
  350. struct thash_data dtrs[NDTRS];
  351. /* Bit is set if there is a tr/tc for the region. */
  352. unsigned char itr_regions;
  353. unsigned char dtr_regions;
  354. unsigned char tc_regions;
  355. /* purge all */
  356. unsigned long ptce_base;
  357. unsigned long ptce_count[2];
  358. unsigned long ptce_stride[2];
  359. /* itc/itm */
  360. unsigned long last_itc;
  361. long itc_offset;
  362. unsigned long itc_check;
  363. unsigned long timer_check;
  364. unsigned int timer_pending;
  365. unsigned int timer_fired;
  366. unsigned long vrr[8];
  367. unsigned long ibr[8];
  368. unsigned long dbr[8];
  369. unsigned long insvc[4]; /* Interrupt in service. */
  370. unsigned long xtp;
  371. unsigned long metaphysical_rr0; /* from kvm_arch (so is pinned) */
  372. unsigned long metaphysical_rr4; /* from kvm_arch (so is pinned) */
  373. unsigned long metaphysical_saved_rr0; /* from kvm_arch */
  374. unsigned long metaphysical_saved_rr4; /* from kvm_arch */
  375. unsigned long fp_psr; /*used for lazy float register */
  376. unsigned long saved_gp;
  377. /*for phycial emulation */
  378. int mode_flags;
  379. struct thash_cb vtlb;
  380. struct thash_cb vhpt;
  381. char irq_check;
  382. char irq_new_pending;
  383. unsigned long opcode;
  384. unsigned long cause;
  385. char log_buf[VMM_LOG_LEN];
  386. union context host;
  387. union context guest;
  388. };
  389. struct kvm_vm_stat {
  390. u64 remote_tlb_flush;
  391. };
  392. struct kvm_sal_data {
  393. unsigned long boot_ip;
  394. unsigned long boot_gp;
  395. };
  396. struct kvm_arch {
  397. spinlock_t dirty_log_lock;
  398. unsigned long vm_base;
  399. unsigned long metaphysical_rr0;
  400. unsigned long metaphysical_rr4;
  401. unsigned long vmm_init_rr;
  402. int online_vcpus;
  403. struct kvm_ioapic *vioapic;
  404. struct kvm_vm_stat stat;
  405. struct kvm_sal_data rdv_sal_data;
  406. struct list_head assigned_dev_head;
  407. struct iommu_domain *iommu_domain;
  408. struct hlist_head irq_ack_notifier_list;
  409. unsigned long irq_sources_bitmap;
  410. unsigned long irq_states[KVM_IOAPIC_NUM_PINS];
  411. };
  412. union cpuid3_t {
  413. u64 value;
  414. struct {
  415. u64 number : 8;
  416. u64 revision : 8;
  417. u64 model : 8;
  418. u64 family : 8;
  419. u64 archrev : 8;
  420. u64 rv : 24;
  421. };
  422. };
  423. struct kvm_pt_regs {
  424. /* The following registers are saved by SAVE_MIN: */
  425. unsigned long b6; /* scratch */
  426. unsigned long b7; /* scratch */
  427. unsigned long ar_csd; /* used by cmp8xchg16 (scratch) */
  428. unsigned long ar_ssd; /* reserved for future use (scratch) */
  429. unsigned long r8; /* scratch (return value register 0) */
  430. unsigned long r9; /* scratch (return value register 1) */
  431. unsigned long r10; /* scratch (return value register 2) */
  432. unsigned long r11; /* scratch (return value register 3) */
  433. unsigned long cr_ipsr; /* interrupted task's psr */
  434. unsigned long cr_iip; /* interrupted task's instruction pointer */
  435. unsigned long cr_ifs; /* interrupted task's function state */
  436. unsigned long ar_unat; /* interrupted task's NaT register (preserved) */
  437. unsigned long ar_pfs; /* prev function state */
  438. unsigned long ar_rsc; /* RSE configuration */
  439. /* The following two are valid only if cr_ipsr.cpl > 0: */
  440. unsigned long ar_rnat; /* RSE NaT */
  441. unsigned long ar_bspstore; /* RSE bspstore */
  442. unsigned long pr; /* 64 predicate registers (1 bit each) */
  443. unsigned long b0; /* return pointer (bp) */
  444. unsigned long loadrs; /* size of dirty partition << 16 */
  445. unsigned long r1; /* the gp pointer */
  446. unsigned long r12; /* interrupted task's memory stack pointer */
  447. unsigned long r13; /* thread pointer */
  448. unsigned long ar_fpsr; /* floating point status (preserved) */
  449. unsigned long r15; /* scratch */
  450. /* The remaining registers are NOT saved for system calls. */
  451. unsigned long r14; /* scratch */
  452. unsigned long r2; /* scratch */
  453. unsigned long r3; /* scratch */
  454. unsigned long r16; /* scratch */
  455. unsigned long r17; /* scratch */
  456. unsigned long r18; /* scratch */
  457. unsigned long r19; /* scratch */
  458. unsigned long r20; /* scratch */
  459. unsigned long r21; /* scratch */
  460. unsigned long r22; /* scratch */
  461. unsigned long r23; /* scratch */
  462. unsigned long r24; /* scratch */
  463. unsigned long r25; /* scratch */
  464. unsigned long r26; /* scratch */
  465. unsigned long r27; /* scratch */
  466. unsigned long r28; /* scratch */
  467. unsigned long r29; /* scratch */
  468. unsigned long r30; /* scratch */
  469. unsigned long r31; /* scratch */
  470. unsigned long ar_ccv; /* compare/exchange value (scratch) */
  471. /*
  472. * Floating point registers that the kernel considers scratch:
  473. */
  474. struct ia64_fpreg f6; /* scratch */
  475. struct ia64_fpreg f7; /* scratch */
  476. struct ia64_fpreg f8; /* scratch */
  477. struct ia64_fpreg f9; /* scratch */
  478. struct ia64_fpreg f10; /* scratch */
  479. struct ia64_fpreg f11; /* scratch */
  480. unsigned long r4; /* preserved */
  481. unsigned long r5; /* preserved */
  482. unsigned long r6; /* preserved */
  483. unsigned long r7; /* preserved */
  484. unsigned long eml_unat; /* used for emulating instruction */
  485. unsigned long pad0; /* alignment pad */
  486. };
  487. static inline struct kvm_pt_regs *vcpu_regs(struct kvm_vcpu *v)
  488. {
  489. return (struct kvm_pt_regs *) ((unsigned long) v + KVM_STK_OFFSET) - 1;
  490. }
  491. typedef int kvm_vmm_entry(void);
  492. typedef void kvm_tramp_entry(union context *host, union context *guest);
  493. struct kvm_vmm_info{
  494. struct module *module;
  495. kvm_vmm_entry *vmm_entry;
  496. kvm_tramp_entry *tramp_entry;
  497. unsigned long vmm_ivt;
  498. };
  499. int kvm_highest_pending_irq(struct kvm_vcpu *vcpu);
  500. int kvm_emulate_halt(struct kvm_vcpu *vcpu);
  501. int kvm_pal_emul(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run);
  502. void kvm_sal_emul(struct kvm_vcpu *vcpu);
  503. static inline void kvm_inject_nmi(struct kvm_vcpu *vcpu) {}
  504. #endif /* __ASSEMBLY__*/
  505. #endif