=back
+=item B<sve="vl">
+
+The `sve` parameter enables Arm Scalable Vector Extension (SVE) usage for the
+guest and sets the maximum SVE vector length, the option is applicable only to
+AArch64 guests.
+A value equal to "disabled" disables the feature, this is the default value.
+Allowed values are "disabled", "128", "256", "384", "512", "640", "768", "896",
+"1024", "1152", "1280", "1408", "1536", "1664", "1792", "1920", "2048", "hw".
+Specifying "hw" means that the maximum vector length supported by the platform
+will be used.
+Please be aware that if a specific vector length is passed and its value is
+above the maximum vector length supported by the platform, an error will be
+raised.
+
+=back
+
=head3 x86
=over 4
return fmt.Errorf("invalid union key '%v'", x.Type)}
x.ArchArm.GicVersion = GicVersion(xc.arch_arm.gic_version)
x.ArchArm.Vuart = VuartType(xc.arch_arm.vuart)
+x.ArchArm.SveVl = SveType(xc.arch_arm.sve_vl)
if err := x.ArchX86.MsrRelaxed.fromC(&xc.arch_x86.msr_relaxed);err != nil {
return fmt.Errorf("converting field ArchX86.MsrRelaxed: %v", err)
}
return fmt.Errorf("invalid union key '%v'", x.Type)}
xc.arch_arm.gic_version = C.libxl_gic_version(x.ArchArm.GicVersion)
xc.arch_arm.vuart = C.libxl_vuart_type(x.ArchArm.Vuart)
+xc.arch_arm.sve_vl = C.libxl_sve_type(x.ArchArm.SveVl)
if err := x.ArchX86.MsrRelaxed.toC(&xc.arch_x86.msr_relaxed); err != nil {
return fmt.Errorf("converting field ArchX86.MsrRelaxed: %v", err)
}
TeeTypeOptee TeeType = 1
)
+type SveType int
+const(
+SveTypeHw SveType = -1
+SveTypeDisabled SveType = 0
+SveType128 SveType = 128
+SveType256 SveType = 256
+SveType384 SveType = 384
+SveType512 SveType = 512
+SveType640 SveType = 640
+SveType768 SveType = 768
+SveType896 SveType = 896
+SveType1024 SveType = 1024
+SveType1152 SveType = 1152
+SveType1280 SveType = 1280
+SveType1408 SveType = 1408
+SveType1536 SveType = 1536
+SveType1664 SveType = 1664
+SveType1792 SveType = 1792
+SveType1920 SveType = 1920
+SveType2048 SveType = 2048
+)
+
type RdmReserve struct {
Strategy RdmReserveStrategy
Policy RdmReservePolicy
ArchArm struct {
GicVersion GicVersion
Vuart VuartType
+SveVl SveType
}
ArchX86 struct {
MsrRelaxed Defbool
*/
#define LIBXL_HAVE_BUILDINFO_ARCH_ARM_TEE 1
+/*
+ * libxl_domain_build_info has the arch_arm.sve_vl field.
+ */
+#define LIBXL_HAVE_BUILDINFO_ARCH_ARM_SVE_VL 1
+
/*
* LIBXL_HAVE_SOFT_RESET indicates that libxl supports performing
* 'soft reset' for domains and there is 'soft_reset' shutdown reason
#include "libxl_libfdt_compat.h"
#include "libxl_arm.h"
+#include <xen-tools/arm-arch-capabilities.h>
+
#include <stdbool.h>
#include <libfdt.h>
#include <assert.h>
return ERROR_FAIL;
}
+ /* Parameter is sanitised in libxl__arch_domain_build_info_setdefault */
+ if (d_config->b_info.arch_arm.sve_vl) {
+ /* Vector length is divided by 128 in struct xen_domctl_createdomain */
+ config->arch.sve_vl = d_config->b_info.arch_arm.sve_vl / 128U;
+ }
+
return 0;
}
/* ACPI is disabled by default */
libxl_defbool_setdefault(&b_info->acpi, false);
+ /* Sanitise SVE parameter */
+ if (b_info->arch_arm.sve_vl) {
+ unsigned int max_sve_vl =
+ arch_capabilities_arm_sve(physinfo->arch_capabilities);
+
+ if (!max_sve_vl) {
+ LOG(ERROR, "SVE is unsupported on this machine.");
+ return ERROR_FAIL;
+ }
+
+ if (LIBXL_SVE_TYPE_HW == b_info->arch_arm.sve_vl) {
+ b_info->arch_arm.sve_vl = max_sve_vl;
+ } else if (b_info->arch_arm.sve_vl > max_sve_vl) {
+ LOG(ERROR,
+ "Invalid sve value: %d. Platform supports up to %u bits",
+ b_info->arch_arm.sve_vl, max_sve_vl);
+ return ERROR_FAIL;
+ } else if (b_info->arch_arm.sve_vl % 128) {
+ LOG(ERROR,
+ "Invalid sve value: %d. It must be multiple of 128",
+ b_info->arch_arm.sve_vl);
+ return ERROR_FAIL;
+ }
+ }
+
if (b_info->type != LIBXL_DOMAIN_TYPE_PV)
return 0;
(1, "optee")
], init_val = "LIBXL_TEE_TYPE_NONE")
+libxl_sve_type = Enumeration("sve_type", [
+ (-1, "hw"),
+ (0, "disabled"),
+ (128, "128"),
+ (256, "256"),
+ (384, "384"),
+ (512, "512"),
+ (640, "640"),
+ (768, "768"),
+ (896, "896"),
+ (1024, "1024"),
+ (1152, "1152"),
+ (1280, "1280"),
+ (1408, "1408"),
+ (1536, "1536"),
+ (1664, "1664"),
+ (1792, "1792"),
+ (1920, "1920"),
+ (2048, "2048")
+ ], init_val = "LIBXL_SVE_TYPE_DISABLED")
+
libxl_rdm_reserve = Struct("rdm_reserve", [
("strategy", libxl_rdm_reserve_strategy),
("policy", libxl_rdm_reserve_policy),
("arch_arm", Struct(None, [("gic_version", libxl_gic_version),
("vuart", libxl_vuart_type),
+ ("sve_vl", libxl_sve_type),
])),
("arch_x86", Struct(None, [("msr_relaxed", libxl_defbool),
])),
}
}
+ if (!xlu_cfg_get_string (config, "sve", &buf, 1)) {
+ e = libxl_sve_type_from_string(buf, &b_info->arch_arm.sve_vl);
+ if (e) {
+ fprintf(stderr, "Unknown sve \"%s\" specified\n", buf);
+ exit(EXIT_FAILURE);
+ }
+ }
+
parse_vkb_list(config, d_config);
d_config->virtios = NULL;