.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
---|
1 | 2 | /* |
---|
2 | 3 | * KVM Microsoft Hyper-V emulation |
---|
3 | 4 | * |
---|
.. | .. |
---|
15 | 16 | * Amit Shah <amit.shah@qumranet.com> |
---|
16 | 17 | * Ben-Ami Yassour <benami@il.ibm.com> |
---|
17 | 18 | * Andrey Smetanin <asmetanin@virtuozzo.com> |
---|
18 | | - * |
---|
19 | | - * This work is licensed under the terms of the GNU GPL, version 2. See |
---|
20 | | - * the COPYING file in the top-level directory. |
---|
21 | | - * |
---|
22 | 19 | */ |
---|
23 | 20 | |
---|
24 | 21 | #ifndef __ARCH_X86_KVM_HYPERV_H__ |
---|
25 | 22 | #define __ARCH_X86_KVM_HYPERV_H__ |
---|
| 23 | + |
---|
| 24 | +#include <linux/kvm_host.h> |
---|
| 25 | + |
---|
| 26 | +/* |
---|
| 27 | + * The #defines related to the synthetic debugger are required by KDNet, but |
---|
| 28 | + * they are not documented in the Hyper-V TLFS because the synthetic debugger |
---|
| 29 | + * functionality has been deprecated and is subject to removal in future |
---|
| 30 | + * versions of Windows. |
---|
| 31 | + */ |
---|
| 32 | +#define HYPERV_CPUID_SYNDBG_VENDOR_AND_MAX_FUNCTIONS 0x40000080 |
---|
| 33 | +#define HYPERV_CPUID_SYNDBG_INTERFACE 0x40000081 |
---|
| 34 | +#define HYPERV_CPUID_SYNDBG_PLATFORM_CAPABILITIES 0x40000082 |
---|
| 35 | + |
---|
| 36 | +/* |
---|
| 37 | + * Hyper-V synthetic debugger platform capabilities |
---|
| 38 | + * These are HYPERV_CPUID_SYNDBG_PLATFORM_CAPABILITIES.EAX bits. |
---|
| 39 | + */ |
---|
| 40 | +#define HV_X64_SYNDBG_CAP_ALLOW_KERNEL_DEBUGGING BIT(1) |
---|
| 41 | + |
---|
| 42 | +/* Hyper-V Synthetic debug options MSR */ |
---|
| 43 | +#define HV_X64_MSR_SYNDBG_CONTROL 0x400000F1 |
---|
| 44 | +#define HV_X64_MSR_SYNDBG_STATUS 0x400000F2 |
---|
| 45 | +#define HV_X64_MSR_SYNDBG_SEND_BUFFER 0x400000F3 |
---|
| 46 | +#define HV_X64_MSR_SYNDBG_RECV_BUFFER 0x400000F4 |
---|
| 47 | +#define HV_X64_MSR_SYNDBG_PENDING_BUFFER 0x400000F5 |
---|
| 48 | +#define HV_X64_MSR_SYNDBG_OPTIONS 0x400000FF |
---|
| 49 | + |
---|
| 50 | +/* Hyper-V HV_X64_MSR_SYNDBG_OPTIONS bits */ |
---|
| 51 | +#define HV_X64_SYNDBG_OPTION_USE_HCALLS BIT(2) |
---|
26 | 52 | |
---|
27 | 53 | static inline struct kvm_vcpu_hv *vcpu_to_hv_vcpu(struct kvm_vcpu *vcpu) |
---|
28 | 54 | { |
---|
.. | .. |
---|
45 | 71 | static inline struct kvm_vcpu *synic_to_vcpu(struct kvm_vcpu_hv_synic *synic) |
---|
46 | 72 | { |
---|
47 | 73 | return hv_vcpu_to_vcpu(container_of(synic, struct kvm_vcpu_hv, synic)); |
---|
| 74 | +} |
---|
| 75 | + |
---|
| 76 | +static inline struct kvm_hv_syndbg *vcpu_to_hv_syndbg(struct kvm_vcpu *vcpu) |
---|
| 77 | +{ |
---|
| 78 | + return &vcpu->kvm->arch.hyperv.hv_syndbg; |
---|
48 | 79 | } |
---|
49 | 80 | |
---|
50 | 81 | int kvm_hv_set_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 data, bool host); |
---|
.. | .. |
---|
95 | 126 | void kvm_hv_init_vm(struct kvm *kvm); |
---|
96 | 127 | void kvm_hv_destroy_vm(struct kvm *kvm); |
---|
97 | 128 | int kvm_vm_ioctl_hv_eventfd(struct kvm *kvm, struct kvm_hyperv_eventfd *args); |
---|
| 129 | +int kvm_vcpu_ioctl_get_hv_cpuid(struct kvm_vcpu *vcpu, struct kvm_cpuid2 *cpuid, |
---|
| 130 | + struct kvm_cpuid_entry2 __user *entries); |
---|
98 | 131 | |
---|
99 | 132 | #endif |
---|