All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luca Fancellu <luca.fancellu@arm.com>
To: xen-devel@lists.xenproject.org
Cc: bertrand.marquis@arm.com, wei.chen@arm.com,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: [PATCH 10/10] xen/arm: add sve property for dom0less domUs
Date: Thu,  2 Feb 2023 11:08:16 +0000	[thread overview]
Message-ID: <20230202110816.1252419-11-luca.fancellu@arm.com> (raw)
In-Reply-To: <20230202110816.1252419-1-luca.fancellu@arm.com>

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@arm.com>
---
Changes from RFC:
 - Changed documentation
---
 docs/misc/arm/device-tree/booting.txt | 9 +++++++++
 xen/arch/arm/domain_build.c           | 7 +++++++
 2 files changed, 16 insertions(+)

diff --git a/docs/misc/arm/device-tree/booting.txt b/docs/misc/arm/device-tree/booting.txt
index 3879340b5e0a..d74bf9ab1c8b 100644
--- a/docs/misc/arm/device-tree/booting.txt
+++ b/docs/misc/arm/device-tree/booting.txt
@@ -193,6 +193,15 @@ 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.
+
 - 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 fbfdf3417cef..3752e2c7dc16 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -3960,6 +3960,13 @@ void __init create_domUs(void)
             d_cfg.max_maptrack_frames = val;
         }
 
+        if ( dt_property_read_u32(node, "sve", &val) )
+        {
+            if ( val > UINT16_MAX )
+                panic("sve property value (%"PRIu32") overflow\n", val);
+            d_cfg.arch.sve_vl_bits = val;
+        }
+
         /*
          * The variable max_init_domid is initialized with zero, so here it's
          * very important to use the pre-increment operator to call
-- 
2.25.1



      parent reply	other threads:[~2023-02-02 11:08 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-02 11:08 [PATCH 00/10] SVE feature for arm guests Luca Fancellu
2023-02-02 11:08 ` [PATCH 01/10] xen/arm: enable SVE extension for Xen Luca Fancellu
2023-02-02 11:08 ` [PATCH 02/10] xen/arm: add sve_vl_bits field to domain Luca Fancellu
2023-02-02 11:08 ` [PATCH 03/10] xen/arm: Expose SVE feature to the guest Luca Fancellu
2023-02-02 11:08 ` [PATCH 04/10] xen/arm: add SVE exception class handling Luca Fancellu
2023-02-02 11:08 ` [PATCH 05/10] arm/sve: save/restore SVE context switch Luca Fancellu
2023-02-02 11:08 ` [PATCH 06/10] xen/arm: enable Dom0 to use SVE feature Luca Fancellu
2023-02-02 11:08 ` [PATCH 07/10] xen/physinfo: add arm SVE arch capability and vector length Luca Fancellu
2023-02-02 12:05   ` Jan Beulich
2023-02-10 15:54     ` Luca Fancellu
2023-02-13  8:36       ` Jan Beulich
2023-02-23 14:00         ` Bertrand Marquis
2023-03-02  2:57           ` Stefano Stabellini
2023-02-02 11:08 ` [PATCH 08/10] tools: add SVE capability and SVE vector length for physinfo Luca Fancellu
2023-02-02 12:38   ` Marek Marczykowski-Górecki
2023-02-02 14:12   ` Andrew Cooper
2023-02-02 11:08 ` [PATCH 09/10] xen/tools: add sve parameter in XL configuration Luca Fancellu
2023-02-02 11:08 ` Luca Fancellu [this message]

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=20230202110816.1252419-11-luca.fancellu@arm.com \
    --to=luca.fancellu@arm.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=bertrand.marquis@arm.com \
    --cc=julien@xen.org \
    --cc=sstabellini@kernel.org \
    --cc=wei.chen@arm.com \
    --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.