Justin Terry (VM) | 29b22c7 | 2018-01-22 13:07:47 -0800 | [diff] [blame] | 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 | |
Justin Terry (VM) | 29b22c7 | 2018-01-22 13:07:47 -0800 | [diff] [blame] | 16 | #ifdef CONFIG_WHPX |
| 17 | |
Sunil Muthuswamy | faf2079 | 2020-10-28 02:23:19 +0000 | [diff] [blame] | 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; |
Justin Terry (VM) | 29b22c7 | 2018-01-22 13:07:47 -0800 | [diff] [blame] | 36 | int whpx_enabled(void); |
| 37 | |
Sunil Muthuswamy | faf2079 | 2020-10-28 02:23:19 +0000 | [diff] [blame] | 38 | void whpx_apic_get(DeviceState *s); |
| 39 | #define whpx_apic_in_platform() (whpx_global.apic_in_platform) |
| 40 | |
Justin Terry (VM) | 29b22c7 | 2018-01-22 13:07:47 -0800 | [diff] [blame] | 41 | #else /* CONFIG_WHPX */ |
| 42 | |
| 43 | #define whpx_enabled() (0) |
Sunil Muthuswamy | faf2079 | 2020-10-28 02:23:19 +0000 | [diff] [blame] | 44 | #define whpx_apic_in_platform() (0) |
Justin Terry (VM) | 29b22c7 | 2018-01-22 13:07:47 -0800 | [diff] [blame] | 45 | |
| 46 | #endif /* CONFIG_WHPX */ |
| 47 | |
Justin Terry (VM) | 29b22c7 | 2018-01-22 13:07:47 -0800 | [diff] [blame] | 48 | #endif /* QEMU_WHPX_H */ |