2 * This header is for functions & variables that will ONLY be
5 * derived from libkvm.c
7 * Copyright (C) 2006 Qumranet, Inc.
10 * Avi Kivity <avi@qumranet.com>
11 * Yaniv Kamay <yaniv@qumranet.com>
13 * This work is licensed under the GNU LGPL license, version 2.
19 /* FIXME: share this number with kvm */
20 /* FIXME: or dynamically alloc/realloc regions */
22 #define KVM_MAX_NUM_MEM_REGIONS 1u
24 #define LIBKVM_S390_ORIGIN (0UL)
25 #elif defined(__ia64__)
26 #define KVM_MAX_NUM_MEM_REGIONS 32u
29 #define KVM_MAX_NUM_MEM_REGIONS 32u
34 /* kvm abi verison variable */
38 * \brief The KVM context
40 * The verbose KVM context
44 /// Filedescriptor to /dev/kvm
47 /// Callbacks that KVM uses to emulate various unvirtualizable functionality
48 struct kvm_callbacks
*callbacks
;
50 /// is dirty pages logging enabled for all regions or not
51 int dirty_pages_log_all
;
52 /// do not create in-kernel irqchip if set
53 int no_irqchip_creation
;
54 /// in-kernel irqchip status
55 int irqchip_in_kernel
;
56 /// ioctl to use to inject interrupts
57 int irqchip_inject_ioctl
;
58 /// do not create in-kernel pit if set
60 /// in-kernel pit status
62 /// in-kernel coalesced mmio
64 #ifdef KVM_CAP_IRQ_ROUTING
65 struct kvm_irq_routing
*irq_routes
;
66 int nr_allocated_irq_routes
;
68 void *used_gsi_bitmap
;
72 struct kvm_vcpu_context
76 struct kvm_context
*kvm
;
80 int kvm_alloc_kernel_memory(kvm_context_t kvm
, unsigned long memory
,
82 int kvm_alloc_userspace_memory(kvm_context_t kvm
, unsigned long memory
,
85 int kvm_arch_create(kvm_context_t kvm
, unsigned long phys_mem_bytes
,
87 int kvm_arch_run(kvm_vcpu_context_t vcpu
);
90 void kvm_show_code(kvm_vcpu_context_t vcpu
);
92 int handle_halt(kvm_vcpu_context_t vcpu
);
93 int handle_shutdown(kvm_context_t kvm
, void *env
);
94 void post_kvm_run(kvm_context_t kvm
, void *env
);
95 int pre_kvm_run(kvm_context_t kvm
, void *env
);
96 int handle_io_window(kvm_context_t kvm
);
97 int handle_debug(kvm_vcpu_context_t vcpu
, void *env
);
98 int try_push_interrupts(kvm_context_t kvm
);