ptp_kvm.rst 2.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. .. SPDX-License-Identifier: GPL-2.0
  2. PTP_KVM support for arm/arm64
  3. =============================
  4. PTP_KVM is used for high precision time sync between host and guests.
  5. It relies on transferring the wall clock and counter value from the
  6. host to the guest using a KVM-specific hypercall.
  7. ``ARM_SMCCC_KVM_FUNC_PTP``
  8. ----------------------------------------
  9. Retrieve current time information for the specific counter. There are no
  10. endianness restrictions.
  11. +---------------------+-------------------------------------------------------+
  12. | Presence: | Optional |
  13. +---------------------+-------------------------------------------------------+
  14. | Calling convention: | HVC32 |
  15. +---------------------+----------+--------------------------------------------+
  16. | Function ID: | (uint32) | 0x86000001 |
  17. +---------------------+----------+----+---------------------------------------+
  18. | Arguments: | (uint32) | R1 | ``KVM_PTP_VIRT_COUNTER (0)`` |
  19. | | | +---------------------------------------+
  20. | | | | ``KVM_PTP_PHYS_COUNTER (1)`` |
  21. +---------------------+----------+----+---------------------------------------+
  22. | Return Values: | (int32) | R0 | ``NOT_SUPPORTED (-1)`` on error, else |
  23. | | | | upper 32 bits of wall clock time |
  24. | +----------+----+---------------------------------------+
  25. | | (uint32) | R1 | Lower 32 bits of wall clock time |
  26. | +----------+----+---------------------------------------+
  27. | | (uint32) | R2 | Upper 32 bits of counter |
  28. | +----------+----+---------------------------------------+
  29. | | (uint32) | R3 | Lower 32 bits of counter |
  30. +---------------------+----------+----+---------------------------------------+