root / linux-headers / asm-x86 / kvm_para.h @ 7c6da3de
History | View | Annotate | Download (2.3 kB)
1 | 51b24e34 | Jan Kiszka | #ifndef _ASM_X86_KVM_PARA_H
|
---|---|---|---|
2 | 51b24e34 | Jan Kiszka | #define _ASM_X86_KVM_PARA_H
|
3 | 51b24e34 | Jan Kiszka | |
4 | 51b24e34 | Jan Kiszka | #include <linux/types.h> |
5 | 51b24e34 | Jan Kiszka | #include <asm/hyperv.h> |
6 | 51b24e34 | Jan Kiszka | |
7 | 51b24e34 | Jan Kiszka | /* This CPUID returns the signature 'KVMKVMKVM' in ebx, ecx, and edx. It
|
8 | 51b24e34 | Jan Kiszka | * should be used to determine that a VM is running under KVM.
|
9 | 51b24e34 | Jan Kiszka | */
|
10 | 51b24e34 | Jan Kiszka | #define KVM_CPUID_SIGNATURE 0x40000000 |
11 | 51b24e34 | Jan Kiszka | |
12 | 51b24e34 | Jan Kiszka | /* This CPUID returns a feature bitmap in eax. Before enabling a particular
|
13 | 51b24e34 | Jan Kiszka | * paravirtualization, the appropriate feature bit should be checked.
|
14 | 51b24e34 | Jan Kiszka | */
|
15 | 51b24e34 | Jan Kiszka | #define KVM_CPUID_FEATURES 0x40000001 |
16 | 51b24e34 | Jan Kiszka | #define KVM_FEATURE_CLOCKSOURCE 0 |
17 | 51b24e34 | Jan Kiszka | #define KVM_FEATURE_NOP_IO_DELAY 1 |
18 | 51b24e34 | Jan Kiszka | #define KVM_FEATURE_MMU_OP 2 |
19 | 51b24e34 | Jan Kiszka | /* This indicates that the new set of kvmclock msrs
|
20 | 51b24e34 | Jan Kiszka | * are available. The use of 0x11 and 0x12 is deprecated
|
21 | 51b24e34 | Jan Kiszka | */
|
22 | 51b24e34 | Jan Kiszka | #define KVM_FEATURE_CLOCKSOURCE2 3 |
23 | 51b24e34 | Jan Kiszka | #define KVM_FEATURE_ASYNC_PF 4 |
24 | 7c6da3de | Alexander Graf | #define KVM_FEATURE_STEAL_TIME 5 |
25 | 51b24e34 | Jan Kiszka | |
26 | 51b24e34 | Jan Kiszka | /* The last 8 bits are used to indicate how to interpret the flags field
|
27 | 51b24e34 | Jan Kiszka | * in pvclock structure. If no bits are set, all flags are ignored.
|
28 | 51b24e34 | Jan Kiszka | */
|
29 | 51b24e34 | Jan Kiszka | #define KVM_FEATURE_CLOCKSOURCE_STABLE_BIT 24 |
30 | 51b24e34 | Jan Kiszka | |
31 | 51b24e34 | Jan Kiszka | #define MSR_KVM_WALL_CLOCK 0x11 |
32 | 51b24e34 | Jan Kiszka | #define MSR_KVM_SYSTEM_TIME 0x12 |
33 | 51b24e34 | Jan Kiszka | |
34 | 7c6da3de | Alexander Graf | #define KVM_MSR_ENABLED 1 |
35 | 51b24e34 | Jan Kiszka | /* Custom MSRs falls in the range 0x4b564d00-0x4b564dff */
|
36 | 51b24e34 | Jan Kiszka | #define MSR_KVM_WALL_CLOCK_NEW 0x4b564d00 |
37 | 51b24e34 | Jan Kiszka | #define MSR_KVM_SYSTEM_TIME_NEW 0x4b564d01 |
38 | 51b24e34 | Jan Kiszka | #define MSR_KVM_ASYNC_PF_EN 0x4b564d02 |
39 | 7c6da3de | Alexander Graf | #define MSR_KVM_STEAL_TIME 0x4b564d03 |
40 | 7c6da3de | Alexander Graf | |
41 | 7c6da3de | Alexander Graf | struct kvm_steal_time {
|
42 | 7c6da3de | Alexander Graf | __u64 steal; |
43 | 7c6da3de | Alexander Graf | __u32 version; |
44 | 7c6da3de | Alexander Graf | __u32 flags; |
45 | 7c6da3de | Alexander Graf | __u32 pad[12];
|
46 | 7c6da3de | Alexander Graf | }; |
47 | 7c6da3de | Alexander Graf | |
48 | 7c6da3de | Alexander Graf | #define KVM_STEAL_ALIGNMENT_BITS 5 |
49 | 7c6da3de | Alexander Graf | #define KVM_STEAL_VALID_BITS ((-1ULL << (KVM_STEAL_ALIGNMENT_BITS + 1))) |
50 | 7c6da3de | Alexander Graf | #define KVM_STEAL_RESERVED_MASK (((1 << KVM_STEAL_ALIGNMENT_BITS) - 1 ) << 1) |
51 | 51b24e34 | Jan Kiszka | |
52 | 51b24e34 | Jan Kiszka | #define KVM_MAX_MMU_OP_BATCH 32 |
53 | 51b24e34 | Jan Kiszka | |
54 | 51b24e34 | Jan Kiszka | #define KVM_ASYNC_PF_ENABLED (1 << 0) |
55 | 51b24e34 | Jan Kiszka | #define KVM_ASYNC_PF_SEND_ALWAYS (1 << 1) |
56 | 51b24e34 | Jan Kiszka | |
57 | 51b24e34 | Jan Kiszka | /* Operations for KVM_HC_MMU_OP */
|
58 | 51b24e34 | Jan Kiszka | #define KVM_MMU_OP_WRITE_PTE 1 |
59 | 51b24e34 | Jan Kiszka | #define KVM_MMU_OP_FLUSH_TLB 2 |
60 | 51b24e34 | Jan Kiszka | #define KVM_MMU_OP_RELEASE_PT 3 |
61 | 51b24e34 | Jan Kiszka | |
62 | 51b24e34 | Jan Kiszka | /* Payload for KVM_HC_MMU_OP */
|
63 | 51b24e34 | Jan Kiszka | struct kvm_mmu_op_header {
|
64 | 51b24e34 | Jan Kiszka | __u32 op; |
65 | 51b24e34 | Jan Kiszka | __u32 pad; |
66 | 51b24e34 | Jan Kiszka | }; |
67 | 51b24e34 | Jan Kiszka | |
68 | 51b24e34 | Jan Kiszka | struct kvm_mmu_op_write_pte {
|
69 | 51b24e34 | Jan Kiszka | struct kvm_mmu_op_header header;
|
70 | 51b24e34 | Jan Kiszka | __u64 pte_phys; |
71 | 51b24e34 | Jan Kiszka | __u64 pte_val; |
72 | 51b24e34 | Jan Kiszka | }; |
73 | 51b24e34 | Jan Kiszka | |
74 | 51b24e34 | Jan Kiszka | struct kvm_mmu_op_flush_tlb {
|
75 | 51b24e34 | Jan Kiszka | struct kvm_mmu_op_header header;
|
76 | 51b24e34 | Jan Kiszka | }; |
77 | 51b24e34 | Jan Kiszka | |
78 | 51b24e34 | Jan Kiszka | struct kvm_mmu_op_release_pt {
|
79 | 51b24e34 | Jan Kiszka | struct kvm_mmu_op_header header;
|
80 | 51b24e34 | Jan Kiszka | __u64 pt_phys; |
81 | 51b24e34 | Jan Kiszka | }; |
82 | 51b24e34 | Jan Kiszka | |
83 | 51b24e34 | Jan Kiszka | #define KVM_PV_REASON_PAGE_NOT_PRESENT 1 |
84 | 51b24e34 | Jan Kiszka | #define KVM_PV_REASON_PAGE_READY 2 |
85 | 51b24e34 | Jan Kiszka | |
86 | 51b24e34 | Jan Kiszka | struct kvm_vcpu_pv_apf_data {
|
87 | 51b24e34 | Jan Kiszka | __u32 reason; |
88 | 51b24e34 | Jan Kiszka | __u8 pad[60];
|
89 | 51b24e34 | Jan Kiszka | __u32 enabled; |
90 | 51b24e34 | Jan Kiszka | }; |
91 | 51b24e34 | Jan Kiszka | |
92 | 51b24e34 | Jan Kiszka | |
93 | 51b24e34 | Jan Kiszka | #endif /* _ASM_X86_KVM_PARA_H */ |