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

Re: [PATCH v7 11/12] xen/arm: add sve property for dom0less domUs


  • To: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Wed, 24 May 2023 15:20:12 +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=TGQSEYXYzTOUrspQIYqCBfKVX8KDk+ogujSOEgH2T5s=; b=SKY+jNRX8v4dl9oDA0J1DbnybWgOh/D4ggUH/d3cD8RK11lscde6SHlIZ1doXrIne6IrgeAPfzrletHaekNNvdNCt0BAIEDoXy2HYle6zXbawqo/GbVxe5G3GsrZDAzpUtVpV6VDwlLUkaxDXKulFA9dcNoIf9AkRCGFvH7EUWu9toP9elFvhYg8SkCd2UfQEoinb4VSMmJ3cHpNw055nLxPMxaUUvNuW2Yna1WRc8NyTV/PHzqR8FZLy1VdUsSgSojawk2MgfZgHl6rvtFyhL2XX5uGHrqgazfxC8RrgG5KRC6dzR//9TzCUdmi7ZGq+SCIk4KAA5PrA3OSnysgKg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EM64cbDnBi3LGi1ctV/BIm2URjodvf/1v1c5e6MXcEnTd/zBXEKUtrtH78RlZ/jkW6eSPwINdAlClO7DGzQIT04ZlJXrMM2s/WbU/iVx4U50Il0s6VDeWWIfMH57WRirDk4HucU7a5EeSiiw7HiEnvc+uk3Zkst65fV/xFnlQJkJyrSBrO0RZA0ecCcnhXoMeiqB1hvxp4fgBXXE9oQBtQyy6RnIpfKAaasZ9hlvz4L9YZlGYX3tJUXPAH426ljK1HAVmi1v83JZxUdRfkGyYFOWBgWnFWzdyIiDaFGDm/1Z3yS1fNTK3sUiDLkZAJKZJCgt6Fp7BkNGMayslKS6LA==
  • 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: Wed, 24 May 2023 15:20:42 +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: AQHZjUpY6xFVIVbG80+SN4dEj9SmF69pi9WA
  • Thread-topic: [PATCH v7 11/12] xen/arm: add sve property for dom0less domUs

Hi Luca,

> On 23 May 2023, at 09:43, Luca Fancellu <Luca.Fancellu@xxxxxxx> wrote:
> 
> Add a device tree property in the dom0less domU configuration
> to enable the guest to use SVE.
> 
> Update documentation.
> 
> Signed-off-by: Luca Fancellu <luca.fancellu@xxxxxxx>

Reviewed-by: Bertrand Marquis <bertrand.marquis@xxxxxxx>

Cheers
Bertrand

> ---
> Changes from v6:
> - Use ifdef in create_domUs and fail if 'sve' is used on systems
>   with CONFIG_ARM64_SVE not selected (Bertrand, Julien, Jan)
> Changes from v5:
> - Stop the domain creation if SVE not supported or SVE VL
>   errors (Julien, Bertrand)
> - now sve_sanitize_vl_param is renamed to sve_domctl_vl_param
>   and returns a boolean, change the affected code.
> - Reworded documentation.
> Changes from v4:
> - Now it is possible to specify the property "sve" for dom0less
>   device tree node without any value, that means the platform
>   supported VL will be used.
> Changes from v3:
> - Now domainconfig_encode_vl is named sve_encode_vl
> Changes from v2:
> - xen_domctl_createdomain field name has changed into sve_vl
>   and its value is the VL/128, use domainconfig_encode_vl
>   to encode a plain VL in bits.
> Changes from v1:
> - No changes
> Changes from RFC:
> - Changed documentation
> ---
> docs/misc/arm/device-tree/booting.txt | 16 +++++++++++++++
> xen/arch/arm/domain_build.c           | 28 +++++++++++++++++++++++++++
> 2 files changed, 44 insertions(+)
> 
> diff --git a/docs/misc/arm/device-tree/booting.txt 
> b/docs/misc/arm/device-tree/booting.txt
> index 3879340b5e0a..32a0e508c471 100644
> --- a/docs/misc/arm/device-tree/booting.txt
> +++ b/docs/misc/arm/device-tree/booting.txt
> @@ -193,6 +193,22 @@ with the following properties:
>     Optional. Handle to a xen,cpupool device tree node that identifies the
>     cpupool where the guest will be started at boot.
> 
> +- sve
> +
> +    Optional. The `sve` property enables Arm SVE usage for the domain and 
> sets
> +    the maximum SVE vector length, the option is applicable only to AArch64
> +    guests.
> +    A value equal to 0 disables the feature, this is the default value.
> +    Specifying this property with no value, means that the SVE vector length
> +    will be set equal to the maximum vector length supported by the platform.
> +    Values above 0 explicitly set the maximum SVE vector length for the 
> domain,
> +    allowed values are from 128 to maximum 2048, being multiple of 128.
> +    Please note that when the user explicitly specifies the value, if that 
> value
> +    is above the hardware supported maximum SVE vector length, the domain
> +    creation will fail and the system will stop, the same will occur if the
> +    option is provided with a non zero value, but the platform doesn't 
> support
> +    SVE.
> +
> - xen,enhanced
> 
>     A string property. Possible property values are:
> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
> index 9202a96d9c28..ba4fe9e165ee 100644
> --- a/xen/arch/arm/domain_build.c
> +++ b/xen/arch/arm/domain_build.c
> @@ -4008,6 +4008,34 @@ void __init create_domUs(void)
>             d_cfg.max_maptrack_frames = val;
>         }
> 
> +        if ( dt_get_property(node, "sve", &val) )
> +        {
> +#ifdef CONFIG_ARM64_SVE
> +            unsigned int sve_vl_bits;
> +            bool ret = false;
> +
> +            if ( !val )
> +            {
> +                /* Property found with no value, means max HW VL supported */
> +                ret = sve_domctl_vl_param(-1, &sve_vl_bits);
> +            }
> +            else
> +            {
> +                if ( dt_property_read_u32(node, "sve", &val) )
> +                    ret = sve_domctl_vl_param(val, &sve_vl_bits);
> +                else
> +                    panic("Error reading 'sve' property");
> +            }
> +
> +            if ( ret )
> +                d_cfg.arch.sve_vl = sve_encode_vl(sve_vl_bits);
> +            else
> +                panic("SVE vector length error\n");
> +#else
> +            panic("'sve' property found, but CONFIG_ARM64_SVE not selected");
> +#endif
> +        }
> +
>         /*
>          * The variable max_init_domid is initialized with zero, so here it's
>          * very important to use the pre-increment operator to call
> -- 
> 2.34.1
> 




 


Rackspace

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