diff options
author | Steven Price <steven.price@arm.com> | 2019-10-21 16:28:18 +0100 |
---|---|---|
committer | Marc Zyngier <maz@kernel.org> | 2019-10-21 19:20:28 +0100 |
commit | 8564d6372a7d8a6d440441b8ed8020f97f744450 (patch) | |
tree | 1ec19f1184aafb3ccfe9574f760115e170b5cb16 /include | |
parent | cac0f1b7285eaaf9a186c618c3a7304d82ed5493 (diff) | |
download | lwn-8564d6372a7d8a6d440441b8ed8020f97f744450.tar.gz lwn-8564d6372a7d8a6d440441b8ed8020f97f744450.zip |
KVM: arm64: Support stolen time reporting via shared structure
Implement the service call for configuring a shared structure between a
VCPU and the hypervisor in which the hypervisor can write the time
stolen from the VCPU's execution time by other tasks on the host.
User space allocates memory which is placed at an IPA also chosen by user
space. The hypervisor then updates the shared structure using
kvm_put_guest() to ensure single copy atomicity of the 64-bit value
reporting the stolen time in nanoseconds.
Whenever stolen time is enabled by the guest, the stolen time counter is
reset.
The stolen time itself is retrieved from the sched_info structure
maintained by the Linux scheduler code. We enable SCHEDSTATS when
selecting KVM Kconfig to ensure this value is meaningful.
Signed-off-by: Steven Price <steven.price@arm.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/kvm_types.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/kvm_types.h b/include/linux/kvm_types.h index bde5374ae021..1c88e69db3d9 100644 --- a/include/linux/kvm_types.h +++ b/include/linux/kvm_types.h @@ -35,6 +35,8 @@ typedef unsigned long gva_t; typedef u64 gpa_t; typedef u64 gfn_t; +#define GPA_INVALID (~(gpa_t)0) + typedef unsigned long hva_t; typedef u64 hpa_t; typedef u64 hfn_t; |