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)
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 int vcpu_fd
[MAX_VCPUS
];
48 struct kvm_run
*run
[MAX_VCPUS
];
49 /// Callbacks that KVM uses to emulate various unvirtualizable functionality
50 struct kvm_callbacks
*callbacks
;
52 /// is dirty pages logging enabled for all regions or not
53 int dirty_pages_log_all
;
54 /// do not create in-kernel irqchip if set
55 int no_irqchip_creation
;
56 /// in-kernel irqchip status
57 int irqchip_in_kernel
;
58 /// ioctl to use to inject interrupts
59 int irqchip_inject_ioctl
;
60 /// do not create in-kernel pit if set
62 /// in-kernel pit status
64 /// in-kernel coalesced mmio
66 #ifdef KVM_CAP_IRQ_ROUTING
67 struct kvm_irq_routing
*irq_routes
;
68 int nr_allocated_irq_routes
;
73 int kvm_alloc_kernel_memory(kvm_context_t kvm
, unsigned long memory
,
75 int kvm_alloc_userspace_memory(kvm_context_t kvm
, unsigned long memory
,
78 int kvm_arch_create(kvm_context_t kvm
, unsigned long phys_mem_bytes
,
80 int kvm_arch_run(struct kvm_run
*run
, kvm_context_t kvm
, int vcpu
);
83 void kvm_show_code(kvm_context_t kvm
, int vcpu
);
85 int handle_halt(kvm_context_t kvm
, int vcpu
);
86 int handle_shutdown(kvm_context_t kvm
, void *env
);
87 void post_kvm_run(kvm_context_t kvm
, void *env
);
88 int pre_kvm_run(kvm_context_t kvm
, void *env
);
89 int handle_io_window(kvm_context_t kvm
);
90 int handle_debug(kvm_context_t kvm
, int vcpu
, void *env
);
91 int try_push_interrupts(kvm_context_t kvm
);