summaryrefslogtreecommitdiffstats
path: root/Documentation/virt/kvm/arm/ptp_kvm.rst
diff options
context:
space:
mode:
authorJianyong Wu <jianyong.wu@arm.com>2020-12-09 14:09:29 +0800
committerMarc Zyngier <maz@kernel.org>2021-04-07 16:33:20 +0100
commit3bf725699bf62494b3e179f1795f08c7d749f061 (patch)
treeb2f880f70fd927e430b06c2a8e5c3b35ad672fe9 /Documentation/virt/kvm/arm/ptp_kvm.rst
parent100148d0fc7dcf8672fe0ac83f44dc5749b4da5c (diff)
downloadlinux-stable-3bf725699bf62494b3e179f1795f08c7d749f061.tar.gz
linux-stable-3bf725699bf62494b3e179f1795f08c7d749f061.tar.bz2
linux-stable-3bf725699bf62494b3e179f1795f08c7d749f061.zip
KVM: arm64: Add support for the KVM PTP service
Implement the hypervisor side of the KVM PTP interface. The service offers wall time and cycle count from host to guest. The caller must specify whether they want the host's view of either the virtual or physical counter. Signed-off-by: Jianyong Wu <jianyong.wu@arm.com> Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20201209060932.212364-7-jianyong.wu@arm.com
Diffstat (limited to 'Documentation/virt/kvm/arm/ptp_kvm.rst')
-rw-r--r--Documentation/virt/kvm/arm/ptp_kvm.rst25
1 files changed, 25 insertions, 0 deletions
diff --git a/Documentation/virt/kvm/arm/ptp_kvm.rst b/Documentation/virt/kvm/arm/ptp_kvm.rst
new file mode 100644
index 000000000000..68cffb50d8bf
--- /dev/null
+++ b/Documentation/virt/kvm/arm/ptp_kvm.rst
@@ -0,0 +1,25 @@
+.. SPDX-License-Identifier: GPL-2.0
+
+PTP_KVM support for arm/arm64
+=============================
+
+PTP_KVM is used for high precision time sync between host and guests.
+It relies on transferring the wall clock and counter value from the
+host to the guest using a KVM-specific hypercall.
+
+* ARM_SMCCC_HYP_KVM_PTP_FUNC_ID: 0x86000001
+
+This hypercall uses the SMC32/HVC32 calling convention:
+
+ARM_SMCCC_HYP_KVM_PTP_FUNC_ID
+ ============= ========== ==========
+ Function ID: (uint32) 0x86000001
+ Arguments: (uint32) KVM_PTP_VIRT_COUNTER(0)
+ KVM_PTP_PHYS_COUNTER(1)
+ Return Values: (int32) NOT_SUPPORTED(-1) on error, or
+ (uint32) Upper 32 bits of wall clock time (r0)
+ (uint32) Lower 32 bits of wall clock time (r1)
+ (uint32) Upper 32 bits of counter (r2)
+ (uint32) Lower 32 bits of counter (r3)
+ Endianness: No Restrictions.
+ ============= ========== ==========