[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v5 01/12] xen/arm: enable SVE extension for Xen


  • To: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Fri, 14 Apr 2023 13:38:11 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ogctp1zZxuHa8uxipGyJGj0grO+wa7ak43rkcB7fDYo=; b=JYQLZjiwRgNgsk33n/zkRHoFkoVhpoirOcFsusmD5NLJzIpbZB0g8x/ZYanL6oEIWt4HBLpm0ZfgV28hpeNABUPGho6camYN93hEEr3atOv1gvFkk/vPAlGqLwyGK9LiqQ/8OvumaJ5lw5U61MOmuIrDO9DkIwJdYeH+DCpbhkadDYR+t2pzWNoGG4zbpcDETlFOitkWwA+U6SJDTt4pCDeoBT8dGEf+eFwekjTAqiNqmgJqNR5lDKqal06hTxRPSym5KFy0EGJkySoVjJgxJIm0o4vIodsGtmmRParnFpFtfhPle/Fa8Tv+3f9ZZCyNa073zzwYbKGJp7Ut0MdAAw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Jyay1o0h0OidO6TELjBmi/U7fLiWNdWda92Y7hqdiB3Tw23cFlCLbovy0g2P29+Enriv8OVHUgHEnSPDKHaJUQ7VMjGkvYhbkchoN7sRY5oDtND4ZxUTLYXQJgkJps4rEyXd1GQt/HDX4WJgvLxgfD3NfgFLIFmMAoVVI2OU/jf6aOrlSjjXIOch7hWhR6zcb2BTuzgq/ioJ1o5TvZja481uFtY/we2PegC/1KLwKg8jJKTGNwjVKeP2opPw+XvLLWur2x1TUhS9ogVF2q+NQ1FBsazwdixnyjF6wuDdgnuemyf7R0yc9ka5Cd/OjtE2CCOCDKUbUn3Y23E/fGP3mA==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Wei Chen <Wei.Chen@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Fri, 14 Apr 2023 13:38:46 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHZbSQnZHhi12xjyUK0b5ypet9SdK8pMcIAgAGeBQCAAAKagA==
  • Thread-topic: [PATCH v5 01/12] xen/arm: enable SVE extension for Xen

Hi Luca,

> On 14 Apr 2023, at 15:28, Luca Fancellu <Luca.Fancellu@xxxxxxx> wrote:
> 
> 
> 
>> On 13 Apr 2023, at 13:47, Bertrand Marquis <Bertrand.Marquis@xxxxxxx> wrote:
>> 
>> Hi Luca,
>> 
>>> On 12 Apr 2023, at 11:49, Luca Fancellu <Luca.Fancellu@xxxxxxx> 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@xxxxxxx>
>>> ---
>>> 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.

Good so this is ok then.

You can add my:
Reviewed-by: Bertrand Marquis <bertrand.marquis@xxxxxxx>

Cheers
Bertrand


> 
>> 
>> Cheers
>> Bertrand





 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.