From: Punit Agrawal <punit.agrawal@bytedance.com>
To: Usama Arif <usama.arif@bytedance.com>
Cc: linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org,
linux-doc@vger.kernel.org,
virtualization@lists.linux-foundation.org, linux@armlinux.org.uk,
yezengruan@huawei.com, catalin.marinas@arm.com, will@kernel.org,
maz@kernel.org, steven.price@arm.com, mark.rutland@arm.com,
bagasdotme@gmail.com, fam.zheng@bytedance.com,
liangma@liangbit.com, punit.agrawal@bytedance.com
Subject: Re: [v2 1/6] KVM: arm64: Document PV-lock interface
Date: Mon, 07 Nov 2022 17:56:49 +0000 [thread overview]
Message-ID: <87k0463axq.fsf@stealth> (raw)
In-Reply-To: 20221104062105.4119003-2-usama.arif@bytedance.com
Hi Usama,
Usama Arif <usama.arif@bytedance.com> writes:
> Introduce a paravirtualization interface for KVM/arm64 to obtain whether
> the VCPU is currently running or not.
>
> The PV lock structure of the guest is allocated by user space.
>
> A hypercall interface is provided for the guest to interrogate the
> location of the shared memory structures.
>
> Signed-off-by: Zengruan Ye <yezengruan@huawei.com>
> Signed-off-by: Usama Arif <usama.arif@bytedance.com>
> ---
> Documentation/virt/kvm/arm/index.rst | 1 +
> Documentation/virt/kvm/arm/pvlock.rst | 52 +++++++++++++++++++++++++
> Documentation/virt/kvm/devices/vcpu.rst | 25 ++++++++++++
> 3 files changed, 78 insertions(+)
> create mode 100644 Documentation/virt/kvm/arm/pvlock.rst
>
> diff --git a/Documentation/virt/kvm/arm/index.rst b/Documentation/virt/kvm/arm/index.rst
> index e84848432158..b8499dc00a6a 100644
> --- a/Documentation/virt/kvm/arm/index.rst
> +++ b/Documentation/virt/kvm/arm/index.rst
> @@ -10,4 +10,5 @@ ARM
> hyp-abi
> hypercalls
> pvtime
> + pvlock
> ptp_kvm
> diff --git a/Documentation/virt/kvm/arm/pvlock.rst b/Documentation/virt/kvm/arm/pvlock.rst
> new file mode 100644
> index 000000000000..d3c391b16d36
> --- /dev/null
> +++ b/Documentation/virt/kvm/arm/pvlock.rst
> @@ -0,0 +1,52 @@
> +.. SPDX-License-Identifier: GPL-2.0
> +
> +Paravirtualized lock support for arm64
> +======================================
> +
> +KVM/arm64 provides a hypervisor service call for paravirtualized guests to
> +determine whether a VCPU is currently running or not.
> +
> +A new SMCCC compatible hypercall is defined:
> +
> +* ARM_SMCCC_VENDOR_HYP_KVM_PV_LOCK_FUNC_ID: 0xC6000002
> +
> +ARM_SMCCC_VENDOR_HYP_KVM_PV_LOCK_FUNC_ID
> +
> + ============= ======== ==========================================
> + Function ID: (uint32) 0xC6000002
> + Return value: (int64) IPA of the pv lock data structure for this
> + VCPU. On failure:
> + NOT_SUPPORTED (-1)
> + ============= ======== ==========================================
> +
> +The IPA returned by PV_LOCK_PREEMPTED should be mapped by the guest as normal
> +memory with inner and outer write back caching attributes, in the inner
> +shareable domain.
> +
> +PV_LOCK_PREEMPTED returns the structure for the calling VCPU.
> +
> +PV lock state
> +-------------
> +
> +The structure pointed to by the PV_LOCK_PREEMPTED hypercall is as follows:
> +
> ++-----------+-------------+-------------+---------------------------------+
> +| Field | Byte Length | Byte Offset | Description |
> ++===========+=============+=============+=================================+
> +| preempted | 8 | 0 | Indicate if the VCPU that owns |
> +| | | | this struct is running or not. |
> +| | | | Non-zero values mean the VCPU |
> +| | | | has been preempted. Zero means |
> +| | | | the VCPU is not preempted. |
> ++-----------+-------------+-------------+---------------------------------+
> +
> +The preempted field will be updated to 1 by the hypervisor prior to scheduling
> +a VCPU. When the VCPU is scheduled out, the preempted field will be updated
> +to 0 by the hypervisor.
The text above doesn't match the description in the table. Please update
the texts to align them with the code.
[...]
next prev parent reply other threads:[~2022-11-07 18:01 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-04 6:20 [v2 0/6] KVM: arm64: implement vcpu_is_preempted check Usama Arif
2022-11-04 6:21 ` [v2 1/6] KVM: arm64: Document PV-lock interface Usama Arif
2022-11-07 17:56 ` Punit Agrawal [this message]
2022-11-07 18:05 ` Usama Arif
2022-11-04 6:21 ` [v2 2/6] KVM: arm64: Add SMCCC paravirtualised lock calls Usama Arif
2022-11-07 17:58 ` Punit Agrawal
2022-11-07 18:08 ` Usama Arif
2022-11-04 6:21 ` [v2 3/6] KVM: arm64: Support pvlock preempted via shared structure Usama Arif
2022-11-07 18:02 ` Punit Agrawal
2022-11-07 18:09 ` Usama Arif
2022-11-04 6:21 ` [v2 4/6] KVM: arm64: Provide VCPU attributes for PV lock Usama Arif
2022-11-04 6:21 ` [v2 5/6] KVM: arm64: Support the VCPU preemption check Usama Arif
2022-11-04 6:21 ` [v2 6/6] KVM: selftests: add tests for PV time specific hypercall Usama Arif
2022-11-04 9:02 ` [v2 0/6] KVM: arm64: implement vcpu_is_preempted check Marc Zyngier
2022-11-06 16:35 ` Marc Zyngier
2022-11-07 12:00 ` [External] " Usama Arif
2022-11-18 0:20 ` Marc Zyngier
2022-11-24 13:55 ` Usama Arif
2022-12-05 13:43 ` Usama Arif
2023-01-17 10:50 ` Usama Arif
2022-11-07 18:24 ` Punit Agrawal
2022-11-09 19:38 ` Usama Arif
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=87k0463axq.fsf@stealth \
--to=punit.agrawal@bytedance.com \
--cc=bagasdotme@gmail.com \
--cc=catalin.marinas@arm.com \
--cc=fam.zheng@bytedance.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=liangma@liangbit.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=mark.rutland@arm.com \
--cc=maz@kernel.org \
--cc=steven.price@arm.com \
--cc=usama.arif@bytedance.com \
--cc=virtualization@lists.linux-foundation.org \
--cc=will@kernel.org \
--cc=yezengruan@huawei.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).