diff options
author | Ingo Molnar <mingo@elte.hu> | 2007-02-19 07:37:47 -0500 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2007-03-04 04:12:40 -0500 |
commit | 102d8325a1d2f266d3d0a03fdde948544e72c12d (patch) | |
tree | 21024c8b9b2b702c79200343e26f14f075da0479 /include/linux/kvm_para.h | |
parent | 5972e9535e94bf875eb8eab8a667ba04c7583874 (diff) |
KVM: add MSR based hypercall API
This adds a special MSR based hypercall API to KVM. This is to be
used by paravirtual kernels and virtual drivers.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'include/linux/kvm_para.h')
-rw-r--r-- | include/linux/kvm_para.h | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/include/linux/kvm_para.h b/include/linux/kvm_para.h new file mode 100644 index 00000000000..74be5c1002e --- /dev/null +++ b/include/linux/kvm_para.h | |||
@@ -0,0 +1,55 @@ | |||
1 | #ifndef __LINUX_KVM_PARA_H | ||
2 | #define __LINUX_KVM_PARA_H | ||
3 | |||
4 | /* | ||
5 | * Guest OS interface for KVM paravirtualization | ||
6 | * | ||
7 | * Note: this interface is totally experimental, and is certain to change | ||
8 | * as we make progress. | ||
9 | */ | ||
10 | |||
11 | /* | ||
12 | * Per-VCPU descriptor area shared between guest and host. Writable to | ||
13 | * both guest and host. Registered with the host by the guest when | ||
14 | * a guest acknowledges paravirtual mode. | ||
15 | * | ||
16 | * NOTE: all addresses are guest-physical addresses (gpa), to make it | ||
17 | * easier for the hypervisor to map between the various addresses. | ||
18 | */ | ||
19 | struct kvm_vcpu_para_state { | ||
20 | /* | ||
21 | * API version information for compatibility. If there's any support | ||
22 | * mismatch (too old host trying to execute too new guest) then | ||
23 | * the host will deny entry into paravirtual mode. Any other | ||
24 | * combination (new host + old guest and new host + new guest) | ||
25 | * is supposed to work - new host versions will support all old | ||
26 | * guest API versions. | ||
27 | */ | ||
28 | u32 guest_version; | ||
29 | u32 host_version; | ||
30 | u32 size; | ||
31 | u32 ret; | ||
32 | |||
33 | /* | ||
34 | * The address of the vm exit instruction (VMCALL or VMMCALL), | ||
35 | * which the host will patch according to the CPU model the | ||
36 | * VM runs on: | ||
37 | */ | ||
38 | u64 hypercall_gpa; | ||
39 | |||
40 | } __attribute__ ((aligned(PAGE_SIZE))); | ||
41 | |||
42 | #define KVM_PARA_API_VERSION 1 | ||
43 | |||
44 | /* | ||
45 | * This is used for an RDMSR's ECX parameter to probe for a KVM host. | ||
46 | * Hopefully no CPU vendor will use up this number. This is placed well | ||
47 | * out of way of the typical space occupied by CPU vendors' MSR indices, | ||
48 | * and we think (or at least hope) it wont be occupied in the future | ||
49 | * either. | ||
50 | */ | ||
51 | #define MSR_KVM_API_MAGIC 0x87655678 | ||
52 | |||
53 | #define KVM_EINVAL 1 | ||
54 | |||
55 | #endif | ||