kvm: qemu: separate TSC load from kvm_arch_load_regs
[kvm-userspace.git] / libkvm / libkvm.h
blobd068fb3160baafa3edf3bb83a2dc31fa54ada52e
1 /** \file libkvm.h
2 * libkvm API
3 */
5 #ifndef LIBKVM_H
6 #define LIBKVM_H
8 #if defined(__s390__)
9 #include <asm/ptrace.h>
10 #endif
12 #include <stdint.h>
14 #ifndef __user
15 #define __user /* temporary, until installed via make headers_install */
16 #endif
18 #include <linux/kvm.h>
20 #include <signal.h>
22 struct kvm_context;
24 typedef struct kvm_context *kvm_context_t;
26 #if defined(__x86_64__) || defined(__i386__)
27 struct kvm_msr_list *kvm_get_msr_list(kvm_context_t);
28 int kvm_get_msrs(kvm_context_t, int vcpu, struct kvm_msr_entry *msrs, int n);
29 int kvm_set_msrs(kvm_context_t, int vcpu, struct kvm_msr_entry *msrs, int n);
30 #endif
32 /*!
33 * \brief KVM callbacks structure
35 * This structure holds pointers to various functions that KVM will call
36 * when it encounters something that cannot be virtualized, such as
37 * accessing hardware devices via MMIO or regular IO.
39 struct kvm_callbacks {
40 /// For 8bit IO reads from the guest (Usually when executing 'inb')
41 int (*inb)(void *opaque, uint16_t addr, uint8_t *data);
42 /// For 16bit IO reads from the guest (Usually when executing 'inw')
43 int (*inw)(void *opaque, uint16_t addr, uint16_t *data);
44 /// For 32bit IO reads from the guest (Usually when executing 'inl')
45 int (*inl)(void *opaque, uint16_t addr, uint32_t *data);
46 /// For 8bit IO writes from the guest (Usually when executing 'outb')
47 int (*outb)(void *opaque, uint16_t addr, uint8_t data);
48 /// For 16bit IO writes from the guest (Usually when executing 'outw')
49 int (*outw)(void *opaque, uint16_t addr, uint16_t data);
50 /// For 32bit IO writes from the guest (Usually when executing 'outl')
51 int (*outl)(void *opaque, uint16_t addr, uint32_t data);
52 /// generic memory reads to unmapped memory (For MMIO devices)
53 int (*mmio_read)(void *opaque, uint64_t addr, uint8_t *data,
54 int len);
55 /// generic memory writes to unmapped memory (For MMIO devices)
56 int (*mmio_write)(void *opaque, uint64_t addr, uint8_t *data,
57 int len);
58 #ifdef KVM_CAP_SET_GUEST_DEBUG
59 int (*debug)(void *opaque, void *env,
60 struct kvm_debug_exit_arch *arch_info);
61 #endif
62 /*!
63 * \brief Called when the VCPU issues an 'hlt' instruction.
65 * Typically, you should yeild here to prevent 100% CPU utilization
66 * on the host CPU.
68 int (*halt)(void *opaque, int vcpu);
69 int (*shutdown)(void *opaque, void *env);
70 int (*io_window)(void *opaque);
71 int (*try_push_interrupts)(void *opaque);
72 #ifdef KVM_CAP_USER_NMI
73 void (*push_nmi)(void *opaque);
74 #endif
75 void (*post_kvm_run)(void *opaque, void *env);
76 int (*pre_kvm_run)(void *opaque, void *env);
77 int (*tpr_access)(void *opaque, int vcpu, uint64_t rip, int is_write);
78 #if defined(__powerpc__)
79 int (*powerpc_dcr_read)(int vcpu, uint32_t dcrn, uint32_t *data);
80 int (*powerpc_dcr_write)(int vcpu, uint32_t dcrn, uint32_t data);
81 #endif
82 #if defined(__s390__)
83 int (*s390_handle_intercept)(kvm_context_t context, int vcpu,
84 struct kvm_run *run);
85 int (*s390_handle_reset)(kvm_context_t context, int vcpu,
86 struct kvm_run *run);
87 #endif
90 /*!
91 * \brief Create new KVM context
93 * This creates a new kvm_context. A KVM context is a small area of data that
94 * holds information about the KVM instance that gets created by this call.\n
95 * This should always be your first call to KVM.
97 * \param callbacks Pointer to a valid kvm_callbacks structure
98 * \param opaque Not used
99 * \return NULL on failure
101 kvm_context_t kvm_init(struct kvm_callbacks *callbacks,
102 void *opaque);
105 * \brief Cleanup the KVM context
107 * Should always be called when closing down KVM.\n
108 * Exception: If kvm_init() fails, this function should not be called, as the
109 * context would be invalid
111 * \param kvm Pointer to the kvm_context that is to be freed
113 void kvm_finalize(kvm_context_t kvm);
116 * \brief Disable the in-kernel IRQCHIP creation
118 * In-kernel irqchip is enabled by default. If userspace irqchip is to be used,
119 * this should be called prior to kvm_create().
121 * \param kvm Pointer to the kvm_context
123 void kvm_disable_irqchip_creation(kvm_context_t kvm);
126 * \brief Disable the in-kernel PIT creation
128 * In-kernel pit is enabled by default. If userspace pit is to be used,
129 * this should be called prior to kvm_create().
131 * \param kvm Pointer to the kvm_context
133 void kvm_disable_pit_creation(kvm_context_t kvm);
136 * \brief Create new virtual machine
138 * This creates a new virtual machine, maps physical RAM to it, and creates a
139 * virtual CPU for it.\n
140 * \n
141 * Memory gets mapped for addresses 0->0xA0000, 0xC0000->phys_mem_bytes
143 * \param kvm Pointer to the current kvm_context
144 * \param phys_mem_bytes The amount of physical ram you want the VM to have
145 * \param phys_mem This pointer will be set to point to the memory that
146 * kvm_create allocates for physical RAM
147 * \return 0 on success
149 int kvm_create(kvm_context_t kvm,
150 unsigned long phys_mem_bytes,
151 void **phys_mem);
152 int kvm_create_vm(kvm_context_t kvm);
153 int kvm_check_extension(kvm_context_t kvm, int ext);
154 void kvm_create_irqchip(kvm_context_t kvm);
157 * \brief Create a new virtual cpu
159 * This creates a new virtual cpu (the first vcpu is created by kvm_create()).
160 * Should be called from a thread dedicated to the vcpu.
162 * \param kvm kvm context
163 * \param slot vcpu number (> 0)
164 * \return 0 on success, -errno on failure
166 int kvm_create_vcpu(kvm_context_t kvm, int slot);
169 * \brief Start the VCPU
171 * This starts the VCPU and virtualization is started.\n
172 * \n
173 * This function will not return until any of these conditions are met:
174 * - An IO/MMIO handler does not return "0"
175 * - An exception that neither the guest OS, nor KVM can handle occurs
177 * \note This function will call the callbacks registered in kvm_init()
178 * to emulate those functions
179 * \note If you at any point want to interrupt the VCPU, kvm_run() will
180 * listen to the EINTR signal. This allows you to simulate external interrupts
181 * and asyncronous IO.
183 * \param kvm Pointer to the current kvm_context
184 * \param vcpu Which virtual CPU should be started
185 * \return 0 on success, but you really shouldn't expect this function to
186 * return except for when an error has occured, or when you have sent it
187 * an EINTR signal.
189 int kvm_run(kvm_context_t kvm, int vcpu, void *env);
192 * \brief Get interrupt flag from on last exit to userspace
194 * This gets the CPU interrupt flag as it was on the last exit to userspace.
196 * \param kvm Pointer to the current kvm_context
197 * \param vcpu Which virtual CPU should get dumped
198 * \return interrupt flag value (0 or 1)
200 int kvm_get_interrupt_flag(kvm_context_t kvm, int vcpu);
203 * \brief Get the value of the APIC_BASE msr as of last exit to userspace
205 * This gets the APIC_BASE msr as it was on the last exit to userspace.
207 * \param kvm Pointer to the current kvm_context
208 * \param vcpu Which virtual CPU should get dumped
209 * \return APIC_BASE msr contents
211 uint64_t kvm_get_apic_base(kvm_context_t kvm, int vcpu);
214 * \brief Check if a vcpu is ready for interrupt injection
216 * This checks if vcpu interrupts are not masked by mov ss or sti.
218 * \param kvm Pointer to the current kvm_context
219 * \param vcpu Which virtual CPU should get dumped
220 * \return boolean indicating interrupt injection readiness
222 int kvm_is_ready_for_interrupt_injection(kvm_context_t kvm, int vcpu);
225 * \brief Read VCPU registers
227 * This gets the GP registers from the VCPU and outputs them
228 * into a kvm_regs structure
230 * \note This function returns a \b copy of the VCPUs registers.\n
231 * If you wish to modify the VCPUs GP registers, you should call kvm_set_regs()
233 * \param kvm Pointer to the current kvm_context
234 * \param vcpu Which virtual CPU should get dumped
235 * \param regs Pointer to a kvm_regs which will be populated with the VCPUs
236 * registers values
237 * \return 0 on success
239 int kvm_get_regs(kvm_context_t kvm, int vcpu, struct kvm_regs *regs);
242 * \brief Write VCPU registers
244 * This sets the GP registers on the VCPU from a kvm_regs structure
246 * \note When this function returns, the regs pointer and the data it points to
247 * can be discarded
248 * \param kvm Pointer to the current kvm_context
249 * \param vcpu Which virtual CPU should get dumped
250 * \param regs Pointer to a kvm_regs which will be populated with the VCPUs
251 * registers values
252 * \return 0 on success
254 int kvm_set_regs(kvm_context_t kvm, int vcpu, struct kvm_regs *regs);
256 * \brief Read VCPU fpu registers
258 * This gets the FPU registers from the VCPU and outputs them
259 * into a kvm_fpu structure
261 * \note This function returns a \b copy of the VCPUs registers.\n
262 * If you wish to modify the VCPU FPU registers, you should call kvm_set_fpu()
264 * \param kvm Pointer to the current kvm_context
265 * \param vcpu Which virtual CPU should get dumped
266 * \param fpu Pointer to a kvm_fpu which will be populated with the VCPUs
267 * fpu registers values
268 * \return 0 on success
270 int kvm_get_fpu(kvm_context_t kvm, int vcpu, struct kvm_fpu *fpu);
273 * \brief Write VCPU fpu registers
275 * This sets the FPU registers on the VCPU from a kvm_fpu structure
277 * \note When this function returns, the fpu pointer and the data it points to
278 * can be discarded
279 * \param kvm Pointer to the current kvm_context
280 * \param vcpu Which virtual CPU should get dumped
281 * \param fpu Pointer to a kvm_fpu which holds the new vcpu fpu state
282 * \return 0 on success
284 int kvm_set_fpu(kvm_context_t kvm, int vcpu, struct kvm_fpu *fpu);
287 * \brief Read VCPU system registers
289 * This gets the non-GP registers from the VCPU and outputs them
290 * into a kvm_sregs structure
292 * \note This function returns a \b copy of the VCPUs registers.\n
293 * If you wish to modify the VCPUs non-GP registers, you should call
294 * kvm_set_sregs()
296 * \param kvm Pointer to the current kvm_context
297 * \param vcpu Which virtual CPU should get dumped
298 * \param regs Pointer to a kvm_sregs which will be populated with the VCPUs
299 * registers values
300 * \return 0 on success
302 int kvm_get_sregs(kvm_context_t kvm, int vcpu, struct kvm_sregs *regs);
305 * \brief Write VCPU system registers
307 * This sets the non-GP registers on the VCPU from a kvm_sregs structure
309 * \note When this function returns, the regs pointer and the data it points to
310 * can be discarded
311 * \param kvm Pointer to the current kvm_context
312 * \param vcpu Which virtual CPU should get dumped
313 * \param regs Pointer to a kvm_sregs which will be populated with the VCPUs
314 * registers values
315 * \return 0 on success
317 int kvm_set_sregs(kvm_context_t kvm, int vcpu, struct kvm_sregs *regs);
319 #ifdef KVM_CAP_MP_STATE
321 * * \brief Read VCPU MP state
324 int kvm_get_mpstate(kvm_context_t kvm, int vcpu,
325 struct kvm_mp_state *mp_state);
328 * * \brief Write VCPU MP state
331 int kvm_set_mpstate(kvm_context_t kvm, int vcpu,
332 struct kvm_mp_state *mp_state);
334 * * \brief Reset VCPU MP state
337 static inline int kvm_reset_mpstate(kvm_context_t kvm, int vcpu)
339 struct kvm_mp_state mp_state = {.mp_state = KVM_MP_STATE_UNINITIALIZED};
340 return kvm_set_mpstate(kvm, vcpu, &mp_state);
342 #endif
345 * \brief Simulate an external vectored interrupt
347 * This allows you to simulate an external vectored interrupt.
349 * \param kvm Pointer to the current kvm_context
350 * \param vcpu Which virtual CPU should get dumped
351 * \param irq Vector number
352 * \return 0 on success
354 int kvm_inject_irq(kvm_context_t kvm, int vcpu, unsigned irq);
356 #ifdef KVM_CAP_SET_GUEST_DEBUG
357 int kvm_set_guest_debug(kvm_context_t, int vcpu, struct kvm_guest_debug *dbg);
358 #endif
360 #if defined(__i386__) || defined(__x86_64__)
362 * \brief Setup a vcpu's cpuid instruction emulation
364 * Set up a table of cpuid function to cpuid outputs.\n
366 * \param kvm Pointer to the current kvm_context
367 * \param vcpu Which virtual CPU should be initialized
368 * \param nent number of entries to be installed
369 * \param entries cpuid function entries table
370 * \return 0 on success, or -errno on error
372 int kvm_setup_cpuid(kvm_context_t kvm, int vcpu, int nent,
373 struct kvm_cpuid_entry *entries);
376 * \brief Setting the number of shadow pages to be allocated to the vm
378 * \param kvm pointer to kvm_context
379 * \param nrshadow_pages number of pages to be allocated
381 int kvm_set_shadow_pages(kvm_context_t kvm, unsigned int nrshadow_pages);
384 * \breif Getting the number of shadow pages that are allocated to the vm
386 * \param kvm pointer to kvm_context
387 * \param nrshadow_pages number of pages to be allocated
389 int kvm_get_shadow_pages(kvm_context_t kvm , unsigned int *nrshadow_pages);
392 * \brief Set up cr8 for next time the vcpu is executed
394 * This is a fast setter for cr8, which will be applied when the
395 * vcpu next enters guest mode.
397 * \param kvm Pointer to the current kvm_context
398 * \param vcpu Which virtual CPU should get dumped
399 * \param cr8 next cr8 value
401 void kvm_set_cr8(kvm_context_t kvm, int vcpu, uint64_t cr8);
404 * \brief Get cr8 for sync tpr in qemu apic emulation
406 * This is a getter for cr8, which used to sync with the tpr in qemu
407 * apic emualtion.
409 * \param kvm Pointer to the current kvm_context
410 * \param vcpu Which virtual CPU should get dumped
412 __u64 kvm_get_cr8(kvm_context_t kvm, int vcpu);
413 #endif
416 * \brief Set a vcpu's signal mask for guest mode
418 * A vcpu can have different signals blocked in guest mode and user mode.
419 * This allows guest execution to be interrupted on a signal, without requiring
420 * that the signal be delivered to a signal handler (the signal can be
421 * dequeued using sigwait(2).
423 * \param kvm Pointer to the current kvm_context
424 * \param vcpu Which virtual CPU should be initialized
425 * \param sigset signal mask for guest mode
426 * \return 0 on success, or -errno on error
428 int kvm_set_signal_mask(kvm_context_t kvm, int vcpu, const sigset_t *sigset);
431 * \brief Dump all VCPU information
433 * This dumps \b all the information that KVM has about a virtual CPU, namely:
434 * - GP Registers
435 * - System registers (selectors, descriptors, etc)
436 * - VMCS Data
437 * - MSRS
438 * - Pending interrupts
440 * \param kvm Pointer to the current kvm_context
441 * \param vcpu Which virtual CPU should get dumped
442 * \return 0 on success
444 int kvm_dump_vcpu(kvm_context_t kvm, int vcpu);
447 * \brief Dump VCPU registers
449 * This dumps some of the information that KVM has about a virtual CPU, namely:
450 * - GP Registers
452 * A much more verbose version of this is available as kvm_dump_vcpu()
454 * \param kvm Pointer to the current kvm_context
455 * \param vcpu Which virtual CPU should get dumped
456 * \return 0 on success
458 void kvm_show_regs(kvm_context_t kvm, int vcpu);
461 void *kvm_create_phys_mem(kvm_context_t, unsigned long phys_start,
462 unsigned long len, int log, int writable);
463 void kvm_destroy_phys_mem(kvm_context_t, unsigned long phys_start,
464 unsigned long len);
465 void kvm_unregister_memory_area(kvm_context_t, uint64_t phys_start,
466 unsigned long len);
468 int kvm_is_containing_region(kvm_context_t kvm, unsigned long phys_start, unsigned long size);
469 int kvm_register_phys_mem(kvm_context_t kvm,
470 unsigned long phys_start, void *userspace_addr,
471 unsigned long len, int log);
472 int kvm_get_dirty_pages(kvm_context_t, unsigned long phys_addr, void *buf);
473 int kvm_get_dirty_pages_range(kvm_context_t kvm, unsigned long phys_addr,
474 unsigned long end_addr, void *buf, void*opaque,
475 int (*cb)(unsigned long start, unsigned long len,
476 void*bitmap, void *opaque));
477 int kvm_register_coalesced_mmio(kvm_context_t kvm,
478 uint64_t addr, uint32_t size);
479 int kvm_unregister_coalesced_mmio(kvm_context_t kvm,
480 uint64_t addr, uint32_t size);
483 * \brief Create a memory alias
485 * Aliases a portion of physical memory to another portion. If the guest
486 * accesses the alias region, it will behave exactly as if it accessed
487 * the target memory.
489 int kvm_create_memory_alias(kvm_context_t,
490 uint64_t phys_start, uint64_t len,
491 uint64_t target_phys);
494 * \brief Destroy a memory alias
496 * Removes an alias created with kvm_create_memory_alias().
498 int kvm_destroy_memory_alias(kvm_context_t, uint64_t phys_start);
501 * \brief Get a bitmap of guest ram pages which are allocated to the guest.
503 * \param kvm Pointer to the current kvm_context
504 * \param phys_addr Memory slot phys addr
505 * \param bitmap Long aligned address of a big enough bitmap (one bit per page)
507 int kvm_get_mem_map(kvm_context_t kvm, unsigned long phys_addr, void *bitmap);
508 int kvm_get_mem_map_range(kvm_context_t kvm, unsigned long phys_addr,
509 unsigned long len, void *buf, void *opaque,
510 int (*cb)(unsigned long start,unsigned long len,
511 void* bitmap, void* opaque));
512 int kvm_set_irq_level(kvm_context_t kvm, int irq, int level);
514 int kvm_dirty_pages_log_enable_slot(kvm_context_t kvm,
515 uint64_t phys_start,
516 uint64_t len);
517 int kvm_dirty_pages_log_disable_slot(kvm_context_t kvm,
518 uint64_t phys_start,
519 uint64_t len);
521 * \brief Enable dirty-pages-logging for all memory regions
523 * \param kvm Pointer to the current kvm_context
525 int kvm_dirty_pages_log_enable_all(kvm_context_t kvm);
528 * \brief Disable dirty-page-logging for some memory regions
530 * Disable dirty-pages-logging for those memory regions that were
531 * created with dirty-page-logging disabled.
533 * \param kvm Pointer to the current kvm_context
535 int kvm_dirty_pages_log_reset(kvm_context_t kvm);
538 * \brief Query whether in kernel irqchip is used
540 * \param kvm Pointer to the current kvm_context
542 int kvm_irqchip_in_kernel(kvm_context_t kvm);
544 int kvm_has_sync_mmu(kvm_context_t kvm);
546 #ifdef KVM_CAP_IRQCHIP
548 * \brief Dump in kernel IRQCHIP contents
550 * Dump one of the in kernel irq chip devices, including PIC (master/slave)
551 * and IOAPIC into a kvm_irqchip structure
553 * \param kvm Pointer to the current kvm_context
554 * \param chip The irq chip device to be dumped
556 int kvm_get_irqchip(kvm_context_t kvm, struct kvm_irqchip *chip);
559 * \brief Set in kernel IRQCHIP contents
561 * Write one of the in kernel irq chip devices, including PIC (master/slave)
562 * and IOAPIC
565 * \param kvm Pointer to the current kvm_context
566 * \param chip THe irq chip device to be written
568 int kvm_set_irqchip(kvm_context_t kvm, struct kvm_irqchip *chip);
570 #if defined(__i386__) || defined(__x86_64__)
572 * \brief Get in kernel local APIC for vcpu
574 * Save the local apic state including the timer of a virtual CPU
576 * \param kvm Pointer to the current kvm_context
577 * \param vcpu Which virtual CPU should be accessed
578 * \param s Local apic state of the specific virtual CPU
580 int kvm_get_lapic(kvm_context_t kvm, int vcpu, struct kvm_lapic_state *s);
583 * \brief Set in kernel local APIC for vcpu
585 * Restore the local apic state including the timer of a virtual CPU
587 * \param kvm Pointer to the current kvm_context
588 * \param vcpu Which virtual CPU should be accessed
589 * \param s Local apic state of the specific virtual CPU
591 int kvm_set_lapic(kvm_context_t kvm, int vcpu, struct kvm_lapic_state *s);
593 #endif
596 * \brief Simulate an NMI
598 * This allows you to simulate a non-maskable interrupt.
600 * \param kvm Pointer to the current kvm_context
601 * \param vcpu Which virtual CPU should get dumped
602 * \return 0 on success
604 int kvm_inject_nmi(kvm_context_t kvm, int vcpu);
606 #endif
609 * \brief Query wheather in kernel pit is used
611 * \param kvm Pointer to the current kvm_context
613 int kvm_pit_in_kernel(kvm_context_t kvm);
616 * \brief Initialize coalesced MMIO
618 * Check for coalesced MMIO capability and store in context
620 * \param kvm Pointer to the current kvm_context
622 int kvm_init_coalesced_mmio(kvm_context_t kvm);
624 #ifdef KVM_CAP_PIT
626 #if defined(__i386__) || defined(__x86_64__)
628 * \brief Get in kernel PIT of the virtual domain
630 * Save the PIT state.
632 * \param kvm Pointer to the current kvm_context
633 * \param s PIT state of the virtual domain
635 int kvm_get_pit(kvm_context_t kvm, struct kvm_pit_state *s);
638 * \brief Set in kernel PIT of the virtual domain
640 * Restore the PIT state.
641 * Timer would be retriggerred after restored.
643 * \param kvm Pointer to the current kvm_context
644 * \param s PIT state of the virtual domain
646 int kvm_set_pit(kvm_context_t kvm, struct kvm_pit_state *s);
647 #endif
649 #endif
651 #ifdef KVM_CAP_VAPIC
654 * \brief Enable kernel tpr access reporting
656 * When tpr access reporting is enabled, the kernel will call the
657 * ->tpr_access() callback every time the guest vcpu accesses the tpr.
659 * \param kvm Pointer to the current kvm_context
660 * \param vcpu vcpu to enable tpr access reporting on
662 int kvm_enable_tpr_access_reporting(kvm_context_t kvm, int vcpu);
665 * \brief Disable kernel tpr access reporting
667 * Undoes the effect of kvm_enable_tpr_access_reporting().
669 * \param kvm Pointer to the current kvm_context
670 * \param vcpu vcpu to disable tpr access reporting on
672 int kvm_disable_tpr_access_reporting(kvm_context_t kvm, int vcpu);
674 int kvm_enable_vapic(kvm_context_t kvm, int vcpu, uint64_t vapic);
676 #endif
678 #if defined(__s390__)
679 int kvm_s390_initial_reset(kvm_context_t kvm, int slot);
680 int kvm_s390_interrupt(kvm_context_t kvm, int slot,
681 struct kvm_s390_interrupt *kvmint);
682 int kvm_s390_set_initial_psw(kvm_context_t kvm, int slot, psw_t psw);
683 int kvm_s390_store_status(kvm_context_t kvm, int slot, unsigned long addr);
684 #endif
686 #ifdef KVM_CAP_DEVICE_ASSIGNMENT
688 * \brief Notifies host kernel about a PCI device to be assigned to a guest
690 * Used for PCI device assignment, this function notifies the host
691 * kernel about the assigning of the physical PCI device to a guest.
693 * \param kvm Pointer to the current kvm_context
694 * \param assigned_dev Parameters, like bus, devfn number, etc
696 int kvm_assign_pci_device(kvm_context_t kvm,
697 struct kvm_assigned_pci_dev *assigned_dev);
700 * \brief Notifies host kernel about changes to IRQ for an assigned device
702 * Used for PCI device assignment, this function notifies the host
703 * kernel about the changes in IRQ number for an assigned physical
704 * PCI device.
706 * \param kvm Pointer to the current kvm_context
707 * \param assigned_irq Parameters, like dev id, host irq, guest irq, etc
709 int kvm_assign_irq(kvm_context_t kvm,
710 struct kvm_assigned_irq *assigned_irq);
713 * \brief Determines whether destroying memory regions is allowed
715 * KVM before 2.6.29 had a bug when destroying memory regions.
717 * \param kvm Pointer to the current kvm_context
719 int kvm_destroy_memory_region_works(kvm_context_t kvm);
720 #endif
721 #endif