@@ -1639,7 +1639,7 @@ TIMER_ACPI_DECLARE(arch_timer, ACPI_SIG_GTDT, arch_timer_acpi_init);
#if IS_ENABLED(CONFIG_PTP_1588_CLOCK_KVM)
#include <linux/arm-smccc.h>
-int kvm_arch_ptp_get_clock_fn(unsigned long *cycle, struct timespec64 *ts,
+int kvm_arch_ptp_get_crosststamp(unsigned long *cycle, struct timespec64 *ts,
struct clocksource **cs)
{
struct arm_smccc_res hvc_res;
@@ -1656,5 +1656,5 @@ int kvm_arch_ptp_get_clock_fn(unsigned long *cycle, struct timespec64 *ts,
return 0;
}
-EXPORT_SYMBOL_GPL(kvm_arch_ptp_get_clock_fn);
+EXPORT_SYMBOL_GPL(kvm_arch_ptp_get_crosststamp);
#endif
@@ -30,7 +30,6 @@ int kvm_arch_ptp_init(void)
int kvm_arch_ptp_get_clock_generic(struct timespec64 *ts,
struct arm_smccc_res *hvc_res)
{
- u64 ns;
ktime_t ktime_overall;
arm_smccc_1_1_invoke(ARM_SMCCC_VENDOR_HYP_KVM_PTP_FUNC_ID,
@@ -993,6 +993,7 @@ struct kvm_ppc_resize_hpt {
#define KVM_CAP_ARM_SVE 170
#define KVM_CAP_ARM_PTRAUTH_ADDRESS 171
#define KVM_CAP_ARM_PTRAUTH_GENERIC 172
+#define KVM_CAP_ARM_KVM_PTP 173
#ifdef KVM_CAP_IRQ_ROUTING
@@ -201,6 +201,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
case KVM_CAP_MP_STATE:
case KVM_CAP_IMMEDIATE_EXIT:
case KVM_CAP_VCPU_EVENTS:
+ case KVM_CAP_ARM_KVM_PTP:
r = 1;
break;
case KVM_CAP_ARM_SET_DEVICE_ADDR:
Let userspace check if there is kvm ptp service in host. before VMs migrate to a another host, VMM may check if this cap is available to determine the migration behaviour. Signed-off-by: Jianyong Wu <jianyong.wu@arm.com> Suggested-by: Marc Zyngier <maz@kernel.org> --- drivers/clocksource/arm_arch_timer.c | 4 ++-- drivers/ptp/ptp_kvm_arm64.c | 1 - include/uapi/linux/kvm.h | 1 + virt/kvm/arm/arm.c | 1 + 4 files changed, 4 insertions(+), 3 deletions(-)