aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/arm-smccc.h
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 /include/linux/arm-smccc.h
parentclocksource: Add clocksource id for arm arch counter (diff)
downloadlinux-dev-3bf725699bf62494b3e179f1795f08c7d749f061.tar.xz
linux-dev-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 'include/linux/arm-smccc.h')
-rw-r--r--include/linux/arm-smccc.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/arm-smccc.h b/include/linux/arm-smccc.h
index 1a27bd9493fe..6861489a1890 100644
--- a/include/linux/arm-smccc.h
+++ b/include/linux/arm-smccc.h
@@ -103,6 +103,7 @@
/* KVM "vendor specific" services */
#define ARM_SMCCC_KVM_FUNC_FEATURES 0
+#define ARM_SMCCC_KVM_FUNC_PTP 1
#define ARM_SMCCC_KVM_FUNC_FEATURES_2 127
#define ARM_SMCCC_KVM_NUM_FUNCS 128
@@ -114,6 +115,21 @@
#define SMCCC_ARCH_WORKAROUND_RET_UNAFFECTED 1
+/*
+ * ptp_kvm is a feature used for time sync between vm and host.
+ * ptp_kvm module in guest kernel will get service from host using
+ * this hypercall ID.
+ */
+#define ARM_SMCCC_VENDOR_HYP_KVM_PTP_FUNC_ID \
+ ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, \
+ ARM_SMCCC_SMC_32, \
+ ARM_SMCCC_OWNER_VENDOR_HYP, \
+ ARM_SMCCC_KVM_FUNC_PTP)
+
+/* ptp_kvm counter type ID */
+#define KVM_PTP_VIRT_COUNTER 0
+#define KVM_PTP_PHYS_COUNTER 1
+
/* Paravirtualised time calls (defined by ARM DEN0057A) */
#define ARM_SMCCC_HV_PV_TIME_FEATURES \
ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, \