Skip to contentSkip to conversation

arm64: Allow the user to select the max SVE vector length

PATCH Applied Oliver Upton 2 participants 2 messages Jun 20, 2024 – Jul 5, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64: Allow the user to select the max SVE vector length

Add a new flag, --sve-max-vl, which allows the user to specify an SVE vector length for the VM. Just zero out unsupported VLs from what KVM supports rather than cooking up the bitmap from scratch.

---
 arm/aarch64/include/kvm/kvm-config-arch.h |  6 ++-
 arm/aarch64/kvm-cpu.c                     | 65 ++++++++++++++++++++---
 arm/include/arm-common/kvm-config-arch.h  |  3 +-
 3 files changed, 65 insertions(+), 9 deletions(-)
arm/aarch64/include/kvm/kvm-config-arch.h +5 -1
index eae8080d3fd9..642fe672d833 100644
@@ -2,6 +2,7 @@
 #define KVM__KVM_CONFIG_ARCH_H
 
 int vcpu_affinity_parser(const struct option *opt, const char *arg, int unset);
+int sve_vl_parser(const struct option *opt, const char *arg, int unset);
 
 #define ARM_OPT_ARCH_RUN(cfg)						\
 	OPT_BOOLEAN('\0', "aarch32", &(cfg)->aarch32_guest,		\
@@ -19,7 +20,10 @@ int vcpu_affinity_parser(const struct option *opt, const char *arg, int unset);
 			"Specify random seed for Kernel Address Space "	\
 			"Layout Randomization (KASLR)"),		\
 	OPT_BOOLEAN('\0', "no-pvtime", &(cfg)->no_pvtime, "Disable"	\
-			" stolen time"),
+			" stolen time"),				\
+	OPT_CALLBACK('\0', "sve-max-vl", NULL, "vector length",		\
+		     "Specify the max SVE vector length (in bits) for "	\
+		     "all vCPUs", sve_vl_parser, kvm),
 #include "arm-common/kvm-config-arch.h"
 
 #endif /* KVM__KVM_CONFIG_ARCH_H */
arm/aarch64/kvm-cpu.c +58 -7

81 lines not on this page · raw message

arm/include/arm-common/kvm-config-arch.h +2 -1
index 23a74867a474..4722d8f8acf7 100644
@@ -13,7 +13,8 @@ struct kvm_config_arch {
 	u64		kaslr_seed;
 	enum irqchip_type irqchip;
 	u64		fw_addr;
-	bool no_pvtime;
+	unsigned int	sve_max_vq;
+	bool		no_pvtime;
 };
 
 int irqchip_parser(const struct option *opt, const char *arg, int unset);

base-commit: da4cfc3e540341b84c4bbad705b5a15865bc1f80

Signature · 1 line
2.45.2.741.gdbec12cfda-goog
Applied
#1 lore raw
Quoted 5 lines · Oliver Upton

Add a new flag, --sve-max-vl, which allows the user to specify an SVE vector length for the VM. Just zero out unsupported VLs from what KVM supports rather than cooking up the bitmap from scratch.

Applied to kvmtool (master), thanks!

[1/1] arm64: Allow the user to select the max SVE vector length

      https://git.kernel.org/will/kvmtool/c/ca31abf5d9c3

Cheers,

Signature · 5 lines
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev