[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: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • Date: Fri, 14 Apr 2023 13:28:42 +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=snhBR0/mjQ5oUipLv/cbHjCeqCM07eecgS70/ZHYkqA=; b=PR4kRNhorLgBA0TL6UW2HCSTaw5XDCb4HGnvy0QScV4gRlM0Cu7HUbuW40F25mcu51785sHBWG2XA6sOQbL3ahvjIS/+p5kaiEfiZY6sn07QMOuO7S3RhC8aj9PwyLUaWmuHKe5YXHBLjcHZlTbfKor3229HfS3uCBj18x4FTyuo37k0PNjwFfThnxlnEFdp6sWvkVfx136wIdu7Rc/wUg8UhhCh4eiftpD2C2dmq6Ce60UVlljDC4GW0uowWoQ1F8/yRkKt2VHQOwU+gOpcLHPJkXdayBfKq78fsZhSS5Xg694UU5qW7Dn9DkbXc6AXuVGeCYWc38OT+l8EBjE2nQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=O3o23tdmV2j6qcD/+sg5XY85DhZ3bYZyLFuLkkp6kY/p9BUa54t5HBoZIMZM/29p3OhMEARayQ0u9+B08lmhA3bdp9S18LZ+6/6YjMbDHOvbOSQHet4HizmPBXq1zD9xuqNS9+zke6Irb+LdVKY7Yb6OxalMF4a87L1wNA7LefwN0G6l1lfahg1qqqVvWN4tPp9zp/TO7aFjsHSdBgInfUJenmu6Cf+QLgoYzV2rMKU0RgYiaywAF0dEpHGr2zfGEUTqs/1gleXNmSLzaePw1DxV5/Gk23XJpbQvh/6hyA8S52XqSJwPRcTs6Y/4HEq7U3MjWRHXevBIk3JX26Au1A==
  • 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:29:06 +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: AQHZbSQxNKEijLDBi06LhQ6zHwegOK8pMc0AgAGd7gA=
  • Thread-topic: [PATCH v5 01/12] xen/arm: enable SVE extension for Xen


> 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.

> 
> Cheers
> Bertrand




 


Rackspace

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