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

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


  • To: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Tue, 18 Apr 2023 12:55:28 +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=HtQr+Y5ziVpwrOZc/shJYPPr8VuAC0TAvdtDs9X7vZY=; b=kGaHykQc+CuEhobnwnDrYdzzsVuTEoywjqVYALvNC2JNlpkwBG7P03AIzd0kk6x9MXzqlJmvpW+RWYTJgCnLsTJX8f0f6S0OCYvOFOvL+yjmmfz02eXuJF5rRWhWbEFYVLQVPf4wmkcORpPmHUzKIThbjLlXia18bdXbCbq7wok5zcPKu0tDC5o72qhS4a+CWOg+Ir08zr1AhvhJyhhmD9Panlh819S4nNCOXmKDHLEYgHHDd/GJn3D+qXxI2gA6X4CiRNGN/1+okIcIZfl1+CzpDC7ah6XGJ7rkyhvslGj7kz9XZaEuBy0K1MJwDf1O6mEPcjiQpGQWGzjw/VPWRw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZttQ7XtY3+bEUlfYlYE/rtxq3mGzulWkdH8VvRLuu+EjHfdM9+X4mVNyrvY5rjgGMlGLI8YJny80w6D8/udz4m0d25aGf4ywjFm3l9tfCa7RukIjV+hktNKQz214Nj4Xl0ZdUP5FEJUL3MtK1f9mBXUdUYqqkZH6YebTtOFO4gAihSF5jq0TNpRnbWdnF1S6ftfewiIA46v9xyJluRX7VSbQ21HhuCkDIMn1iY6YsxB2xCKgI92JGIOYQLDLuvYWcVRpdg5SqQgNfVNItmnOYFO+Rpogq/3DBu4C12WuESNPTM/hUjBx2tUBfmjSUSp+iosg80aClg3qlsChi8d68w==
  • 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: Tue, 18 Apr 2023 12:55:57 +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: AQHZbSQwrRQ9/UblkkiINOEljpHZc68xD8SA
  • Thread-topic: [PATCH v5 11/12] xen/arm: add sve property for dom0less domUs

Hi Luca,

> On 12 Apr 2023, at 11:49, 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 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 | 11 +++++++++++
> xen/arch/arm/domain_build.c           | 24 ++++++++++++++++++++++++
> 2 files changed, 35 insertions(+)
> 
> diff --git a/docs/misc/arm/device-tree/booting.txt 
> b/docs/misc/arm/device-tree/booting.txt
> index 3879340b5e0a..f9d2ecdda48a 100644
> --- a/docs/misc/arm/device-tree/booting.txt
> +++ b/docs/misc/arm/device-tree/booting.txt
> @@ -193,6 +193,17 @@ 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. A number that, when above 0, enables SVE for this guest and 
> sets
> +    its maximum SVE vector length. The default value is 0, that means this
> +    guest is not allowed to use SVE, the maximum value allowed is 2048, any
> +    other value must be multiple of 128.
> +    Please note that if the platform supports a lower value of bits, then the
> +    domain creation will fail.
> +    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.
> +
> - 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 3f30ef5c37b6..c1f0d1d78431 100644
> --- a/xen/arch/arm/domain_build.c
> +++ b/xen/arch/arm/domain_build.c
> @@ -4004,6 +4004,30 @@ void __init create_domUs(void)
>             d_cfg.max_maptrack_frames = val;
>         }
> 
> +        if ( dt_get_property(node, "sve", &val) )
> +        {
> +            unsigned int sve_vl_bits;
> +
> +            if ( !val )
> +            {
> +                /* Property found with no value, means max HW VL supported */
> +                rc = sve_sanitize_vl_param(-1, &sve_vl_bits);
> +            }
> +            else
> +            {
> +                if ( dt_property_read_u32(node, "sve", &val) )
> +                    rc = sve_sanitize_vl_param(val, &sve_vl_bits);
> +                else
> +                    panic("Error reading 'sve' property");
> +            }
> +
> +            if ( !rc )
> +                d_cfg.arch.sve_vl = sve_encode_vl(sve_vl_bits);
> +            else
> +                printk(XENLOG_WARNING
> +                       "SVE vector length error, disable feature for 
> Dom0less DomU\n");
> +        }
> +
>         /*
>          * 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®.