blob: 9346fd92e93bf9ee7d6be8134424a7b52e3229aa [file] [log] [blame]
Justin Terry (VM)29b22c72018-01-22 13:07:47 -08001/*
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)29b22c72018-01-22 13:07:47 -080016#ifdef CONFIG_WHPX
17
Sunil Muthuswamyfaf20792020-10-28 02:23:19 +000018#include "whp-dispatch.h"
19
20struct 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
28struct whpx_lapic_state {
29 struct {
30 uint32_t data;
31 uint32_t padding[3];
32 } fields[256];
33};
34
35extern struct whpx_state whpx_global;
Justin Terry (VM)29b22c72018-01-22 13:07:47 -080036int whpx_enabled(void);
37
Sunil Muthuswamyfaf20792020-10-28 02:23:19 +000038void whpx_apic_get(DeviceState *s);
39#define whpx_apic_in_platform() (whpx_global.apic_in_platform)
40
Justin Terry (VM)29b22c72018-01-22 13:07:47 -080041#else /* CONFIG_WHPX */
42
43#define whpx_enabled() (0)
Sunil Muthuswamyfaf20792020-10-28 02:23:19 +000044#define whpx_apic_in_platform() (0)
Justin Terry (VM)29b22c72018-01-22 13:07:47 -080045
46#endif /* CONFIG_WHPX */
47
Justin Terry (VM)29b22c72018-01-22 13:07:47 -080048#endif /* QEMU_WHPX_H */