From: Shameerali Kolothum Thodi <shameerali.kolothum.thodi@huawei.com>
To: Oliver Upton <oliver.upton@linux.dev>
Cc: "kvmarm@lists.linux.dev" <kvmarm@lists.linux.dev>,
"maz@kernel.org" <maz@kernel.org>,
"catalin.marinas@arm.com" <catalin.marinas@arm.com>,
"will@kernel.org" <will@kernel.org>,
"mark.rutland@arm.com" <mark.rutland@arm.com>,
"cohuck@redhat.com" <cohuck@redhat.com>,
"eric.auger@redhat.com" <eric.auger@redhat.com>,
"sebott@redhat.com" <sebott@redhat.com>,
yuzenghui <yuzenghui@huawei.com>,
"Wangzhou (B)" <wangzhou1@hisilicon.com>,
jiangkunkun <jiangkunkun@huawei.com>,
"Jonathan Cameron" <jonathan.cameron@huawei.com>,
Anthony Jebson <anthony.jebson@huawei.com>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
Linuxarm <linuxarm@huawei.com>
Subject: RE: [PATCH v5 2/4] KVM: arm64: Introduce hypercall support for retrieving target implementations
Date: Tue, 28 Jan 2025 14:16:08 +0000 [thread overview]
Message-ID: <c10e377aa58c408599e06007052cff7a@huawei.com> (raw)
In-Reply-To: <Z5fBrFVIs0jOiR9W@linux.dev>
> -----Original Message-----
> From: Oliver Upton <oliver.upton@linux.dev>
> Sent: Monday, January 27, 2025 5:26 PM
> To: Shameerali Kolothum Thodi <shameerali.kolothum.thodi@huawei.com>
> Cc: kvmarm@lists.linux.dev; maz@kernel.org; catalin.marinas@arm.com;
> will@kernel.org; mark.rutland@arm.com; cohuck@redhat.com;
> eric.auger@redhat.com; sebott@redhat.com; yuzenghui
> <yuzenghui@huawei.com>; Wangzhou (B) <wangzhou1@hisilicon.com>;
> jiangkunkun <jiangkunkun@huawei.com>; Jonathan Cameron
> <jonathan.cameron@huawei.com>; Anthony Jebson
> <anthony.jebson@huawei.com>; linux-arm-kernel@lists.infradead.org;
> Linuxarm <linuxarm@huawei.com>
> Subject: Re: [PATCH v5 2/4] KVM: arm64: Introduce hypercall support for
> retrieving target implementations
>
> On Fri, Jan 24, 2025 at 03:17:30PM +0000, Shameer Kolothum wrote:
> > If the Guest requires migration to multiple targets, these hypercalls
> > will provide a way to retrieve the target CPU implementations from
> > the user space VMM.
> >
> > Subsequent patch will use this to enable the associated errata.
> >
> > Suggested-by: Oliver Upton <oliver.upton@linux.dev>
> > Suggested-by: Marc Zyngier <maz@kernel.org>
> > Signed-off-by: Shameer Kolothum
> <shameerali.kolothum.thodi@huawei.com>
> > ---
> > Documentation/virt/kvm/arm/hypercalls.rst | 59
> +++++++++++++++++++++++
> > include/linux/arm-smccc.h | 15 ++++++
> > 2 files changed, 74 insertions(+)
> >
> > diff --git a/Documentation/virt/kvm/arm/hypercalls.rst
> b/Documentation/virt/kvm/arm/hypercalls.rst
> > index af7bc2c2e0cb..718725cbf6c7 100644
> > --- a/Documentation/virt/kvm/arm/hypercalls.rst
> > +++ b/Documentation/virt/kvm/arm/hypercalls.rst
> > @@ -142,3 +142,62 @@ region is equal to the memory protection granule
> advertised by
> > | | | +---------------------------------------------+
> > | | | | ``INVALID_PARAMETER (-3)`` |
> > +---------------------+----------+----+---------------------------------------------+
> > +
> > +``ARM_SMCCC_VENDOR_HYP_KVM_DISCOVER_IMPL_VER_FUNC_ID``
> > +-------------------------------------------------------
> > +Request the target CPU implementation version information and the
> number of target
> > +implementations for the Guest VM.
> > +
> > ++---------------------+-------------------------------------------------------------+
> > +| Presence: | Optional; KVM/ARM64 Guests only |
> > ++---------------------+-------------------------------------------------------------+
> > +| Calling convention: | HVC64 |
> > ++---------------------+----------+--------------------------------------------------+
> > +| Function ID: | (uint32) | 0xC6000040 |
> > ++---------------------+----------+--------------------------------------------------+
> > +| Arguments: | None |
> > ++---------------------+----------+----+---------------------------------------------+
> > +| Return Values: | (int64) | R0 | ``SUCCESS (0)`` |
> > +| | | +---------------------------------------------+
> > +| | | | ``NOT_SUPPORTED (-1)`` |
> > +| +----------+----+---------------------------------------------+
> > +| | (uint64) | R1 | Bit[63] Must be zero |
> > +| | | +---------------------------------------------+
>
> Why? R0 is sufficient to determine if the hypercall was successful, and
> this is already defined as an unsigned quantity to the guest.
Hmm..I was trying to imitate(badly ofcourse) the SMCCC_VERSION where
bit 31 must be zero but again in that case it is Int32 so it makes sense there.
>
> > +| | | | Bits [62:32] Major version |
> > +| | | +---------------------------------------------+
> > +| | | | Bits [31:0] Minor version |
> > +| +----------+----+---------------------------------------------+
>
> Do we really need a full u64 of version information? If you collapse
> this down to a u32 it'd align with the versioning scheme for PSCI /
> SMCCC.
Ok. How about this,
Bits [63:32] Reserved/] Must be zero
Bits [31:16] Major Rev (Should we leave the bit 31 to zero here to match
SMCCC_VERSION?)
Bits [15:0] Minor Rev
Thanks,
Shameer
next prev parent reply other threads:[~2025-01-28 14:18 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-24 15:17 [PATCH v5 0/4] KVM: arm64: Errata management for VM Live migration Shameer Kolothum
2025-01-24 15:17 ` [PATCH v5 1/4] arm64: Modify _midr_range() functions to read MIDR/REVIDR internally Shameer Kolothum
2025-01-24 15:17 ` [PATCH v5 2/4] KVM: arm64: Introduce hypercall support for retrieving target implementations Shameer Kolothum
2025-01-27 12:50 ` Cornelia Huck
2025-01-27 17:26 ` Oliver Upton
2025-01-28 14:16 ` Shameerali Kolothum Thodi [this message]
2025-01-24 15:17 ` [PATCH v5 3/4] KVM: arm64: Report all the KVM/arm64-specific hypercalls Shameer Kolothum
2025-01-27 12:47 ` Cornelia Huck
2025-01-27 13:35 ` Shameerali Kolothum Thodi
2025-01-27 17:05 ` Oliver Upton
2025-01-27 17:24 ` Shameerali Kolothum Thodi
2025-01-24 15:17 ` [PATCH v5 4/4] arm64: paravirt: Enable errata based on implementation CPUs Shameer Kolothum
2025-01-27 12:53 ` Cornelia Huck
2025-01-27 17:37 ` Oliver Upton
2025-02-04 16:45 ` [PATCH v5 0/4] KVM: arm64: Errata management for VM Live migration Sebastian Ott
2025-02-04 17:11 ` Marc Zyngier
2025-02-04 17:42 ` Sebastian Ott
2025-02-04 18:15 ` Marc Zyngier
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=c10e377aa58c408599e06007052cff7a@huawei.com \
--to=shameerali.kolothum.thodi@huawei.com \
--cc=anthony.jebson@huawei.com \
--cc=catalin.marinas@arm.com \
--cc=cohuck@redhat.com \
--cc=eric.auger@redhat.com \
--cc=jiangkunkun@huawei.com \
--cc=jonathan.cameron@huawei.com \
--cc=kvmarm@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linuxarm@huawei.com \
--cc=mark.rutland@arm.com \
--cc=maz@kernel.org \
--cc=oliver.upton@linux.dev \
--cc=sebott@redhat.com \
--cc=wangzhou1@hisilicon.com \
--cc=will@kernel.org \
--cc=yuzenghui@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).