diff options
author | Glauber Costa <glommer@redhat.com> | 2011-07-11 15:28:13 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-07-12 06:17:03 -0400 |
commit | 9ddabbe72e41ca6794cb4947c70929c9410e6752 (patch) | |
tree | c1b4b5dc3f326fcac560211283a65bb626277e7c /arch/x86 | |
parent | 4b6b35f55ca81d3bfdec63b0adb61798702ceb2e (diff) |
KVM: KVM Steal time guest/host interface
To implement steal time, we need the hypervisor to pass the guest information
about how much time was spent running other processes outside the VM.
This is per-vcpu, and using the kvmclock structure for that is an abuse
we decided not to make.
In this patchset, I am introducing a new msr, KVM_MSR_STEAL_TIME, that
holds the memory area address containing information about steal time
This patch contains the headers for it. I am keeping it separate to facilitate
backports to people who wants to backport the kernel part but not the
hypervisor, or the other way around.
Signed-off-by: Glauber Costa <glommer@redhat.com>
Acked-by: Rik van Riel <riel@redhat.com>
Tested-by: Eric B Munson <emunson@mgebm.net>
CC: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
CC: Peter Zijlstra <peterz@infradead.org>
CC: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/include/asm/kvm_para.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/x86/include/asm/kvm_para.h b/arch/x86/include/asm/kvm_para.h index d6cd79b34aab..65f8bb9279e0 100644 --- a/arch/x86/include/asm/kvm_para.h +++ b/arch/x86/include/asm/kvm_para.h | |||
@@ -21,6 +21,7 @@ | |||
21 | */ | 21 | */ |
22 | #define KVM_FEATURE_CLOCKSOURCE2 3 | 22 | #define KVM_FEATURE_CLOCKSOURCE2 3 |
23 | #define KVM_FEATURE_ASYNC_PF 4 | 23 | #define KVM_FEATURE_ASYNC_PF 4 |
24 | #define KVM_FEATURE_STEAL_TIME 5 | ||
24 | 25 | ||
25 | /* The last 8 bits are used to indicate how to interpret the flags field | 26 | /* The last 8 bits are used to indicate how to interpret the flags field |
26 | * in pvclock structure. If no bits are set, all flags are ignored. | 27 | * in pvclock structure. If no bits are set, all flags are ignored. |
@@ -35,6 +36,14 @@ | |||
35 | #define MSR_KVM_WALL_CLOCK_NEW 0x4b564d00 | 36 | #define MSR_KVM_WALL_CLOCK_NEW 0x4b564d00 |
36 | #define MSR_KVM_SYSTEM_TIME_NEW 0x4b564d01 | 37 | #define MSR_KVM_SYSTEM_TIME_NEW 0x4b564d01 |
37 | #define MSR_KVM_ASYNC_PF_EN 0x4b564d02 | 38 | #define MSR_KVM_ASYNC_PF_EN 0x4b564d02 |
39 | #define MSR_KVM_STEAL_TIME 0x4b564d03 | ||
40 | |||
41 | struct kvm_steal_time { | ||
42 | __u64 steal; | ||
43 | __u32 version; | ||
44 | __u32 flags; | ||
45 | __u32 pad[12]; | ||
46 | }; | ||
38 | 47 | ||
39 | #define KVM_MAX_MMU_OP_BATCH 32 | 48 | #define KVM_MAX_MMU_OP_BATCH 32 |
40 | 49 | ||