[RFC PATCH v7 23/28] KVM: arm64: Add kvm-arm.ignore_spe_errata kernel parameter
Alexandru Elisei
alexandru.elisei at arm.com
Thu Sep 3 09:06:18 PDT 2026
Add a new kernel command line parameter, kvm-arm.ignore_spe_errata with the
effect of ignoring any errata that might inhibit userspace from creating a
SPE enabled virtual machine.
Signed-off-by: Alexandru Elisei <alexandru.elisei at arm.com>
---
Documentation/admin-guide/kernel-parameters.txt | 3 +++
arch/arm64/kvm/spe.c | 10 +++++++++-
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index 68647ff4bdd2..2d91ce8e8c4b 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -3299,6 +3299,9 @@ Kernel parameters
notrap: clear WFI instruction trap
+ kvm-arm.ignore_spe_errata=
+ [KVM,ARM] Ignore SPE errata and expose SPE to guests.
+
kvm_cma_resv_ratio=n [PPC,EARLY]
Reserves given percentage from system memory area for
contiguous memory allocation for KVM hash pagetable
diff --git a/arch/arm64/kvm/spe.c b/arch/arm64/kvm/spe.c
index ce68789d184b..3e82edc8be85 100644
--- a/arch/arm64/kvm/spe.c
+++ b/arch/arm64/kvm/spe.c
@@ -21,8 +21,16 @@ struct spe_pmu_entry {
struct arm_spe_pmu *spe_pmu;
};
+static bool ignore_spe_errata;
+
static void kvm_spe_update_irq_level(struct kvm_vcpu *vcpu, bool level);
+static int __init kvm_ignore_spe_errata(char *arg)
+{
+ return kstrtobool(arg, &ignore_spe_errata);
+}
+early_param("kvm-arm.ignore_spe_errata", kvm_ignore_spe_errata);
+
void kvm_spe_add_instance(struct arm_spe_pmu *spe_pmu)
{
struct spe_pmu_entry *entry;
@@ -290,7 +298,7 @@ static int kvm_spe_set_spe_id(struct kvm_vcpu *vcpu, int spe_id)
return 0;
}
- if (spe_pmu->has_workaround_3023823)
+ if (spe_pmu->has_workaround_3023823 && !ignore_spe_errata)
return -EINVAL;
if (!try_module_get(spe_pmu->pmu.module))
--
2.43.0
More information about the linux-arm-kernel
mailing list