nbd/client: Support qemu-img convert from unaligned size
[qemu/kevin.git] / target / i386 / kvm_i386.h
blob3057ba4f7d1927b8828ee263069198b0ca078f44
1 /*
2 * QEMU KVM support -- x86 specific functions.
4 * Copyright (c) 2012 Linaro Limited
6 * This work is licensed under the terms of the GNU GPL, version 2 or later.
7 * See the COPYING file in the top-level directory.
9 */
11 #ifndef QEMU_KVM_I386_H
12 #define QEMU_KVM_I386_H
14 #include "sysemu/kvm.h"
16 #define kvm_apic_in_kernel() (kvm_irqchip_in_kernel())
18 #ifdef CONFIG_KVM
20 #define kvm_pit_in_kernel() \
21 (kvm_irqchip_in_kernel() && !kvm_irqchip_is_split())
22 #define kvm_pic_in_kernel() \
23 (kvm_irqchip_in_kernel() && !kvm_irqchip_is_split())
24 #define kvm_ioapic_in_kernel() \
25 (kvm_irqchip_in_kernel() && !kvm_irqchip_is_split())
27 #else
29 #define kvm_pit_in_kernel() 0
30 #define kvm_pic_in_kernel() 0
31 #define kvm_ioapic_in_kernel() 0
33 #endif /* CONFIG_KVM */
35 bool kvm_allows_irq0_override(void);
36 bool kvm_has_smm(void);
37 bool kvm_has_adjust_clock_stable(void);
38 void kvm_synchronize_all_tsc(void);
39 void kvm_arch_reset_vcpu(X86CPU *cs);
40 void kvm_arch_do_init_vcpu(X86CPU *cs);
42 int kvm_device_pci_assign(KVMState *s, PCIHostDeviceAddress *dev_addr,
43 uint32_t flags, uint32_t *dev_id);
44 int kvm_device_pci_deassign(KVMState *s, uint32_t dev_id);
46 int kvm_device_intx_assign(KVMState *s, uint32_t dev_id,
47 bool use_host_msi, uint32_t guest_irq);
48 int kvm_device_intx_set_mask(KVMState *s, uint32_t dev_id, bool masked);
49 int kvm_device_intx_deassign(KVMState *s, uint32_t dev_id, bool use_host_msi);
51 int kvm_device_msi_assign(KVMState *s, uint32_t dev_id, int virq);
52 int kvm_device_msi_deassign(KVMState *s, uint32_t dev_id);
54 bool kvm_device_msix_supported(KVMState *s);
55 int kvm_device_msix_init_vectors(KVMState *s, uint32_t dev_id,
56 uint32_t nr_vectors);
57 int kvm_device_msix_set_vector(KVMState *s, uint32_t dev_id, uint32_t vector,
58 int virq);
59 int kvm_device_msix_assign(KVMState *s, uint32_t dev_id);
60 int kvm_device_msix_deassign(KVMState *s, uint32_t dev_id);
62 void kvm_put_apicbase(X86CPU *cpu, uint64_t value);
64 bool kvm_enable_x2apic(void);
65 bool kvm_has_x2apic_api(void);
67 bool kvm_hv_vpindex_settable(void);
68 #endif