1 /* 2 * QEMU Windows Hypervisor Platform accelerator (WHPX) support 3 * 4 * Copyright Microsoft, Corp. 2017 5 * 6 * Authors: 7 * 8 * This work is licensed under the terms of the GNU GPL, version 2 or later. 9 * See the COPYING file in the top-level directory. 10 * 11 */ 12 13 #ifndef QEMU_WHPX_H 14 #define QEMU_WHPX_H 15 16 #ifdef CONFIG_WHPX 17 18 #include "whp-dispatch.h" 19 20 struct whpx_state { 21 uint64_t mem_quota; 22 WHV_PARTITION_HANDLE partition; 23 bool kernel_irqchip_allowed; 24 bool kernel_irqchip_required; 25 bool apic_in_platform; 26 }; 27 28 struct whpx_lapic_state { 29 struct { 30 uint32_t data; 31 uint32_t padding[3]; 32 } fields[256]; 33 }; 34 35 extern struct whpx_state whpx_global; 36 int whpx_enabled(void); 37 38 void whpx_apic_get(DeviceState *s); 39 #define whpx_apic_in_platform() (whpx_global.apic_in_platform) 40 41 #else /* CONFIG_WHPX */ 42 43 #define whpx_enabled() (0) 44 #define whpx_apic_in_platform() (0) 45 46 #endif /* CONFIG_WHPX */ 47 48 #endif /* QEMU_WHPX_H */ 49