linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Jianyong Wu <jianyong.wu@arm.com>
Cc: Mark.Rutland@arm.com, justin.he@arm.com, kvm@vger.kernel.org,
	suzuki.poulose@arm.com, netdev@vger.kernel.org,
	richardcochran@gmail.com, Steve.Capper@arm.com,
	linux-kernel@vger.kernel.org, sean.j.christopherson@intel.com,
	steven.price@arm.com, Andre.Przywara@arm.com,
	john.stultz@linaro.org, yangbo.lu@nxp.com, pbonzini@redhat.com,
	tglx@linutronix.de, nd@arm.com, will@kernel.org,
	kvmarm@lists.cs.columbia.edu,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v15 8/9] doc: add ptp_kvm introduction for arm64 support
Date: Mon, 23 Nov 2020 10:58:07 +0000	[thread overview]
Message-ID: <38fad448a3a465e4c35994ce61f4d8dd@kernel.org> (raw)
In-Reply-To: <20201111062211.33144-9-jianyong.wu@arm.com>

On 2020-11-11 06:22, Jianyong Wu wrote:
> PTP_KVM implementation depends on hypercall using SMCCC. So we
> introduce a new SMCCC service ID. This doc explains how does the
> ID define and how does PTP_KVM works on arm/arm64.
> 
> Signed-off-by: Jianyong Wu <jianyong.wu@arm.com>
> ---
>  Documentation/virt/kvm/api.rst         |  9 +++++++
>  Documentation/virt/kvm/arm/index.rst   |  1 +
>  Documentation/virt/kvm/arm/ptp_kvm.rst | 29 +++++++++++++++++++++
>  Documentation/virt/kvm/timekeeping.rst | 35 ++++++++++++++++++++++++++
>  4 files changed, 74 insertions(+)
>  create mode 100644 Documentation/virt/kvm/arm/ptp_kvm.rst
> 
> diff --git a/Documentation/virt/kvm/api.rst 
> b/Documentation/virt/kvm/api.rst
> index 36d5f1f3c6dd..9843dbcbf770 100644
> --- a/Documentation/virt/kvm/api.rst
> +++ b/Documentation/virt/kvm/api.rst
> @@ -6391,3 +6391,12 @@ When enabled, KVM will disable paravirtual
> features provided to the
>  guest according to the bits in the KVM_CPUID_FEATURES CPUID leaf
>  (0x40000001). Otherwise, a guest may use the paravirtual features
>  regardless of what has actually been exposed through the CPUID leaf.
> +
> +8.27 KVM_CAP_PTP_KVM
> +--------------------
> +
> +:Architectures: arm64
> +
> +This capability indicates that KVM virtual PTP service is supported in 
> host.
> +It must company with the implementation of KVM virtual PTP service in 
> host
> +so VMM can probe if there is the service in host by checking this 
> capability.
> diff --git a/Documentation/virt/kvm/arm/index.rst
> b/Documentation/virt/kvm/arm/index.rst
> index 3e2b2aba90fc..78a9b670aafe 100644
> --- a/Documentation/virt/kvm/arm/index.rst
> +++ b/Documentation/virt/kvm/arm/index.rst
> @@ -10,3 +10,4 @@ ARM
>     hyp-abi
>     psci
>     pvtime
> +   ptp_kvm
> diff --git a/Documentation/virt/kvm/arm/ptp_kvm.rst
> b/Documentation/virt/kvm/arm/ptp_kvm.rst
> new file mode 100644
> index 000000000000..bb1e6cfefe44
> --- /dev/null
> +++ b/Documentation/virt/kvm/arm/ptp_kvm.rst
> @@ -0,0 +1,29 @@
> +.. SPDX-License-Identifier: GPL-2.0
> +
> +PTP_KVM support for arm/arm64
> +=============================
> +
> +PTP_KVM is used for time sync between guest and host in a high 
> precision.
> +It needs to get the wall time and counter value from the host and
> transfer these
> +to guest via hypercall service. So one more hypercall service has been 
> added.
> +
> +This new SMCCC hypercall is defined as:
> +
> +* ARM_SMCCC_HYP_KVM_PTP_FUNC_ID: 0x86000001
> +
> +As both 32 and 64-bits ptp_kvm client should be supported, we choose
> SMC32/HVC32
> +calling convention.
> +
> +ARM_SMCCC_HYP_KVM_PTP_FUNC_ID:
> +
> +    =============    ==========    ==========
> +    Function ID:     (uint32)      0x86000001
> +    Arguments:	     (uint32)      ARM_PTP_PHY_COUNTER(1) or
> ARM_PTP_VIRT_COUNTER(0)
> +                                   which indicate acquiring physical 
> counter or
> +                                   virtual counter respectively.
> +    return value:    (uint32)      NOT_SUPPORTED(-1) or val0 and val1 
> represent
> +                                   wall clock time and val2 and val3 
> represent
> +                                   counter cycle.

This needs a lot more description:

- Which word contains what part of the data (upper/lower part of the 
64bit data)
- The endianness of the data returned

         M.
-- 
Jazz is not dead. It just smells funny...

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-11-23 10:58 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-11  6:22 [PATCH v15 0/9] Enable ptp_kvm for arm/arm64 Jianyong Wu
2020-11-11  6:22 ` [PATCH v15 1/9] arm64: Probe for the presence of KVM hypervisor Jianyong Wu
2020-11-11  6:22 ` [PATCH v15 2/9] arm/arm64: KVM: Advertise KVM UID to guests via SMCCC Jianyong Wu
2020-11-11  6:22 ` [PATCH v15 3/9] ptp: Reorganize ptp_kvm module to make it arch-independent Jianyong Wu
2020-11-11  6:22 ` [PATCH v15 4/9] time: Add mechanism to recognize clocksource in time_get_snapshot Jianyong Wu
2020-11-11  6:22 ` [PATCH v15 5/9] clocksource: Add clocksource id for arm arch counter Jianyong Wu
2020-11-11  6:22 ` [PATCH v15 6/9] arm64/kvm: Add hypercall service for kvm ptp Jianyong Wu
2020-11-23 10:44   ` Marc Zyngier
2020-11-23 11:59     ` Marc Zyngier
2020-11-24  5:11       ` Jianyong Wu
2020-11-24  5:20     ` Jianyong Wu
2020-11-24  9:07       ` Marc Zyngier
2020-11-24 10:14         ` Jianyong Wu
2020-11-11  6:22 ` [PATCH v15 7/9] ptp: arm/arm64: Enable ptp_kvm for arm/arm64 Jianyong Wu
2020-11-23 10:49   ` Marc Zyngier
2020-11-24  5:37     ` Jianyong Wu
2020-11-24  9:04       ` Marc Zyngier
2020-11-24 10:18         ` Jianyong Wu
2020-11-11  6:22 ` [PATCH v15 8/9] doc: add ptp_kvm introduction for arm64 support Jianyong Wu
2020-11-23 10:58   ` Marc Zyngier [this message]
2020-11-24  5:21     ` Jianyong Wu
2020-11-11  6:22 ` [PATCH v15 9/9] arm64: Add kvm capability check extension for ptp_kvm Jianyong Wu
2020-11-23  9:26 ` [PATCH v15 0/9] Enable ptp_kvm for arm/arm64 Jianyong Wu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=38fad448a3a465e4c35994ce61f4d8dd@kernel.org \
    --to=maz@kernel.org \
    --cc=Andre.Przywara@arm.com \
    --cc=Mark.Rutland@arm.com \
    --cc=Steve.Capper@arm.com \
    --cc=jianyong.wu@arm.com \
    --cc=john.stultz@linaro.org \
    --cc=justin.he@arm.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nd@arm.com \
    --cc=netdev@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=richardcochran@gmail.com \
    --cc=sean.j.christopherson@intel.com \
    --cc=steven.price@arm.com \
    --cc=suzuki.poulose@arm.com \
    --cc=tglx@linutronix.de \
    --cc=will@kernel.org \
    --cc=yangbo.lu@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).