All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luca Fancellu <Luca.Fancellu@arm.com>
To: Bertrand Marquis <Bertrand.Marquis@arm.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
	Wei Chen <Wei.Chen@arm.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: Re: [PATCH v5 01/12] xen/arm: enable SVE extension for Xen
Date: Fri, 14 Apr 2023 13:28:42 +0000	[thread overview]
Message-ID: <8C042AAE-8256-488C-92C6-E4C0B5DEB3C1@arm.com> (raw)
In-Reply-To: <190AEC88-68BE-4DEA-84D5-9DDF0F63A365@arm.com>



> On 13 Apr 2023, at 13:47, Bertrand Marquis <Bertrand.Marquis@arm.com> wrote:
> 
> Hi Luca,
> 
>> On 12 Apr 2023, at 11:49, Luca Fancellu <Luca.Fancellu@arm.com> wrote:
>> 
>> Enable Xen to handle the SVE extension, add code in cpufeature module
>> to handle ZCR SVE register, disable trapping SVE feature on system
>> boot only when SVE resources are accessed.
>> While there, correct coding style for the comment on coprocessor
>> trapping.
>> 
>> Now cptr_el2 is part of the domain context and it will be restored
>> on context switch, this is a preparation for saving the SVE context
>> which will be part of VFP operations, so restore it before the call
>> to save VFP registers.
>> To save an additional isb barrier, restore cptr_el2 before an
>> existing isb barrier and move the call for saving VFP context after
>> that barrier.
>> 
>> Change the KConfig entry to make ARM64_SVE symbol selectable, by
>> default it will be not selected.
>> 
>> Create sve module and sve_asm.S that contains assembly routines for
>> the SVE feature, this code is inspired from linux and it uses
>> instruction encoding to be compatible with compilers that does not
>> support SVE.
>> 
>> Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
>> ---
>> Changes from v4:
>> - don't use fixed types in vl_to_zcr, forgot to address that in
>>  v3, by mistake I changed that in patch 2, fixing now (Jan)
>> Changes from v3:
>> - no changes
>> Changes from v2:
>> - renamed sve_asm.S in sve-asm.S, new files should not contain
>>  underscore in the name (Jan)
>> Changes from v1:
>> - Add assert to vl_to_zcr, it is never called with vl==0, but just
>>  to be sure it won't in the future.
>> Changes from RFC:
>> - Moved restoring of cptr before an existing barrier (Julien)
>> - Marked the feature as unsupported for now (Julien)
>> - Trap and un-trap only when using SVE resources in
>>  compute_max_zcr() (Julien)
>> ---
>> xen/arch/arm/Kconfig                     | 10 +++--
>> xen/arch/arm/arm64/Makefile              |  1 +
>> xen/arch/arm/arm64/cpufeature.c          |  7 ++--
>> xen/arch/arm/arm64/sve-asm.S             | 48 +++++++++++++++++++++++
>> xen/arch/arm/arm64/sve.c                 | 50 ++++++++++++++++++++++++
>> xen/arch/arm/cpufeature.c                |  6 ++-
>> xen/arch/arm/domain.c                    |  9 +++--
>> xen/arch/arm/include/asm/arm64/sve.h     | 43 ++++++++++++++++++++
>> xen/arch/arm/include/asm/arm64/sysregs.h |  1 +
>> xen/arch/arm/include/asm/cpufeature.h    | 14 +++++++
>> xen/arch/arm/include/asm/domain.h        |  1 +
>> xen/arch/arm/include/asm/processor.h     |  2 +
>> xen/arch/arm/setup.c                     |  5 ++-
>> xen/arch/arm/traps.c                     | 28 +++++++------
>> 14 files changed, 201 insertions(+), 24 deletions(-)
>> create mode 100644 xen/arch/arm/arm64/sve-asm.S
>> create mode 100644 xen/arch/arm/arm64/sve.c
>> create mode 100644 xen/arch/arm/include/asm/arm64/sve.h
>> 
>> diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
>> index 239d3aed3c7f..41f45d8d1203 100644
>> --- a/xen/arch/arm/Kconfig
>> +++ b/xen/arch/arm/Kconfig
>> @@ -112,11 +112,15 @@ config ARM64_PTR_AUTH
>> This feature is not supported in Xen.
>> 
>> config ARM64_SVE
>> - def_bool n
>> + bool "Enable Scalar Vector Extension support (UNSUPPORTED)" if UNSUPPORTED
>> depends on ARM_64
>> help
>> -  Scalar Vector Extension support.
>> -  This feature is not supported in Xen.
>> +  Scalar Vector Extension (SVE/SVE2) support for guests.
> 
> I would prevent to mention SVE2 here unless both versions of SVE are supported with this config.
> Is it the case ?

Hi Bertrand,

Yes both versions of SVE are supported with this config, SVE2 is a superset of SVE that includes new
instructions, but the work done in this serie for registers settings and context switch will apply to both
versions.

> 
> Cheers
> Bertrand



  reply	other threads:[~2023-04-14 13:29 UTC|newest]

Thread overview: 74+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-12  9:49 [PATCH v5 00/12] SVE feature for arm guests Luca Fancellu
2023-04-12  9:49 ` [PATCH v5 01/12] xen/arm: enable SVE extension for Xen Luca Fancellu
2023-04-13 12:47   ` Bertrand Marquis
2023-04-14 13:28     ` Luca Fancellu [this message]
2023-04-14 13:38       ` Bertrand Marquis
2023-04-12  9:49 ` [PATCH v5 02/12] xen/arm: add SVE vector length field to the domain Luca Fancellu
2023-04-13 12:47   ` Bertrand Marquis
2023-04-17  9:20     ` Jan Beulich
2023-04-13 12:57   ` Julien Grall
2023-04-13 13:24     ` Luca Fancellu
2023-04-13 13:30       ` Julien Grall
2023-04-13 14:05         ` Luca Fancellu
2023-04-13 16:10           ` Luca Fancellu
2023-04-13 19:53             ` Julien Grall
2023-04-13 19:52           ` Julien Grall
2023-04-14 11:07             ` Luca Fancellu
2023-04-14 17:16               ` Julien Grall
2023-04-12  9:49 ` [PATCH v5 03/12] xen/arm: Expose SVE feature to the guest Luca Fancellu
2023-04-13 12:47   ` Bertrand Marquis
2023-04-12  9:49 ` [PATCH v5 04/12] xen/arm: add SVE exception class handling Luca Fancellu
2023-04-13 13:02   ` Julien Grall
2023-04-13 13:27     ` Luca Fancellu
2023-04-14  8:40   ` Bertrand Marquis
2023-04-12  9:49 ` [PATCH v5 05/12] arm/sve: save/restore SVE context switch Luca Fancellu
2023-04-13 13:11   ` Julien Grall
2023-04-13 14:35     ` Luca Fancellu
2023-04-13 19:54       ` Julien Grall
2023-04-18 12:40   ` Bertrand Marquis
2023-04-19  7:09     ` Luca Fancellu
2023-04-19  7:13       ` Bertrand Marquis
2023-04-20  7:43         ` Luca Fancellu
2023-04-20  7:55           ` Bertrand Marquis
2023-04-20  7:58             ` Luca Fancellu
2023-04-20  8:33               ` Bertrand Marquis
2023-04-12  9:49 ` [PATCH v5 06/12] xen/common: add dom0 xen command line argument for Arm Luca Fancellu
2023-04-14  8:47   ` Bertrand Marquis
2023-04-12  9:49 ` [PATCH v5 07/12] xen: enable Dom0 to use SVE feature Luca Fancellu
2023-04-17  9:41   ` Jan Beulich
2023-04-20  6:25     ` Luca Fancellu
2023-04-20  7:56       ` Jan Beulich
2023-04-18 12:47   ` Bertrand Marquis
2023-04-19  6:34     ` Jan Beulich
2023-04-19  7:15     ` Luca Fancellu
2023-04-19  7:21       ` Bertrand Marquis
2023-04-19  7:41         ` Luca Fancellu
2023-04-20  8:46           ` Luca Fancellu
2023-04-20 12:00             ` Bertrand Marquis
2023-04-20 12:29             ` Julien Grall
2023-04-20 12:43               ` Luca Fancellu
2023-04-20 13:08                 ` Julien Grall
2023-04-20 13:18                   ` Luca Fancellu
2023-04-12  9:49 ` [PATCH v5 08/12] xen/physinfo: encode Arm SVE vector length in arch_capabilities Luca Fancellu
2023-04-18 12:49   ` Bertrand Marquis
2023-04-12  9:49 ` [PATCH v5 09/12] tools: add physinfo arch_capabilities handling for Arm Luca Fancellu
2023-04-12  9:49 ` [PATCH v5 10/12] xen/tools: add sve parameter in XL configuration Luca Fancellu
2023-04-12  9:49 ` [PATCH v5 11/12] xen/arm: add sve property for dom0less domUs Luca Fancellu
2023-04-18 12:55   ` Bertrand Marquis
2023-04-18 13:21     ` Bertrand Marquis
2023-04-12  9:49 ` [PATCH v5 12/12] xen/changelog: Add SVE and "dom0" options to the changelog for Arm Luca Fancellu
2023-04-12  9:53   ` Henry Wang
2023-04-18 12:56   ` Bertrand Marquis
2023-04-19  7:11     ` Luca Fancellu
2023-04-19  7:16       ` Bertrand Marquis
2023-04-18 13:13 ` [PATCH v5 00/12] SVE feature for arm guests Bertrand Marquis
2023-04-18 14:25   ` Julien Grall
2023-04-18 14:38     ` Bertrand Marquis
2023-04-18 14:41       ` Luca Fancellu
2023-04-18 15:00         ` Bertrand Marquis
2023-04-19  6:28     ` Jan Beulich
2023-04-19  7:31       ` Bertrand Marquis
2023-04-19  7:46         ` Julien Grall
2023-04-19  7:52         ` Jan Beulich
2023-04-19  8:20           ` Bertrand Marquis
2023-04-20 12:30             ` Julien Grall

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=8C042AAE-8256-488C-92C6-E4C0B5DEB3C1@arm.com \
    --to=luca.fancellu@arm.com \
    --cc=Bertrand.Marquis@arm.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=Wei.Chen@arm.com \
    --cc=julien@xen.org \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.