Documentation/virt/kvm/arm/ptp_kvm.rst GitHub 원문 ↗

Linux 6.18.37 · 가상화 / KVM / ARM

arm·arm64 PTP_KVM 지원

Host wall clock과 virtual·physical counter를 함께 전달해 host와 guest를 정밀 동기화하는 HVC32 ABI입니다.

Source pathDocumentation/virt/kvm/arm/ptp_kvm.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설, 영어 원문, 전체 번역을 구분해 실었습니다. API 이름, 코드 심벌, 소스 경로는 원문 표기를 유지합니다.

1. 요약·해설

원문의 핵심 내용을 정리하고 커널 프로그래밍에 필요한 설명을 덧붙였습니다. 아래의 전체 번역과는 별도로 작성한 해설입니다.

요약·해설

ptp_kvm.rst:1-35

Host wall clock과 virtual·physical counter를 함께 전달해 host와 guest를 정밀 동기화하는 HVC32 ABI입니다.

API 이름, register, function ID, source path와 error code는 원문 표기를 유지했습니다.

2. 영어 원문 전체

번역에 사용한 Linux v6.18.37 원문입니다. 줄 번호는 해당 버전의 소스 파일을 기준으로 합니다.

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

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미에 맞춰 전체 내용을 번역했습니다. 코드, 함수명, 코드 심벌, URL은 원문 표기를 유지합니다.

KVM PTP hypercall ABI

1-35

PTP_KVM은 KVM-specific hypercall로 host의 wall clock과 counter 값을 guest에 함께 전달해 host와 guest 사이의 고정밀 time synchronization을 제공합니다. 반환값에는 endianness 제한이 없습니다.

`ARM_SMCCC_VENDOR_HYP_KVM_PTP_FUNC_ID`
항목값
PresenceOptional
Function ID`0x86000001`
R1 argument`KVM_PTP_VIRT_COUNTER (0)` 또는 `KVM_PTP_PHYS_COUNTER (1)`
R0오류 시 `NOT_SUPPORTED (-1)`, 성공 시 wall-clock 상위 32 bit
R1Wall-clock 하위 32 bit
R2Counter 상위 32 bit
R3Counter 하위 32 bit

선택한 counter에 대응하는 현재 wall-clock과 counter 값을 HVC32로 읽습니다.

Guest는 R0:R1을 조합해 64-bit wall-clock 값을, R2:R3을 조합해 같은 시점의 64-bit counter 값을 구성합니다. 요청할 counter 종류는 virtual 또는 physical 중 하나여야 합니다.

.. 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_VENDOR_HYP_KVM_PTP_FUNC_ID``
----------------------------------------

Retrieve current time information for the specific counter. There are no
endianness restrictions.

+---------------------+-------------------------------------------------------+
| Presence:           | Optional                                              |
+---------------------+-------------------------------------------------------+
| Calling convention: | HVC32                                                 |
+---------------------+----------+--------------------------------------------+
| Function ID:        | (uint32) | 0x86000001                                 |
+---------------------+----------+----+---------------------------------------+
| Arguments:          | (uint32) | R1 | ``KVM_PTP_VIRT_COUNTER (0)``          |
|                     |          |    +---------------------------------------+
|                     |          |    | ``KVM_PTP_PHYS_COUNTER (1)``          |
+---------------------+----------+----+---------------------------------------+
| Return Values:      | (int32)  | R0 | ``NOT_SUPPORTED (-1)`` on error, else |
|                     |          |    | upper 32 bits of wall clock time      |
|                     +----------+----+---------------------------------------+
|                     | (uint32) | R1 | Lower 32 bits of wall clock time      |
|                     +----------+----+---------------------------------------+
|                     | (uint32) | R2 | Upper 32 bits of counter              |
|                     +----------+----+---------------------------------------+
|                     | (uint32) | R3 | Lower 32 bits of counter              |
+---------------------+----------+----+---------------------------------------+