1 #ifndef KVM__KVM_ARCH_H 2 #define KVM__KVM_ARCH_H 3 4 #include "kvm/interrupt.h" 5 6 #include <stdbool.h> 7 #include <linux/types.h> 8 #include <linux/sizes.h> 9 #include <time.h> 10 11 /* 12 * The hole includes VESA framebuffer and PCI memory. 13 */ 14 #define KVM_32BIT_MAX_MEM_SIZE (1ULL << 32) 15 #define KVM_32BIT_GAP_SIZE (768 << 20) 16 #define KVM_32BIT_GAP_START (KVM_32BIT_MAX_MEM_SIZE - KVM_32BIT_GAP_SIZE) 17 18 #define KVM_MMIO_START KVM_32BIT_GAP_START 19 20 /* This is the address that pci_get_io_port_block() starts allocating 21 * from. Note that this is a PCI bus address (though same on x86). 22 */ 23 #define KVM_IOPORT_AREA 0x0 24 #define KVM_PCI_CFG_AREA (KVM_MMIO_START + 0x1000000) 25 #define KVM_PCI_MMIO_AREA (KVM_MMIO_START + 0x2000000) 26 #define KVM_VIRTIO_MMIO_AREA (KVM_MMIO_START + 0x3000000) 27 28 #define KVM_IRQ_OFFSET 5 29 30 #define KVM_VM_TYPE 0 31 32 #define KVM_IOEVENTFD_HAS_PIO 1 33 34 #define MAX_PAGE_SIZE SZ_4K 35 36 struct kvm_arch { 37 u16 boot_selector; 38 u16 boot_ip; 39 u16 boot_sp; 40 41 struct interrupt_table interrupt_table; 42 }; 43 44 #endif /* KVM__KVM_ARCH_H */ 45