[RFC PATCH v7 23/28] KVM: arm64: Add kvm-arm.ignore_spe_errata kernel parameter
Lorenzo Stoakes (ARM)
ljs at kernel.org
Tue Nov 3 11:37:08 PST 2026
On Thu, Sep 03, 2026 at 05:06:18PM +0100, Alexandru Elisei wrote:
> 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>
Hmm, is this for testing purposes somehow? If so it should say so, if not
then why don't we specifically detect the erratum and handle it by default?
Also you're explicitly addressing ARM64_ERRATUM_3023823, I think you should
explicitly mention this and explain what it is and why this is worth doing.
And in general - does it make sense to have a generalised 'ignore errata'?
Surely you either want to workaround the errata automatically or disallow
broken things?
And if you want to do the latter you'd want to be able to specify which?
In which case perhaps you could specify a comma-separated list of the
specific errata you want to workaround perhaps?
> ---
> 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.
> +
NIT: Should be in alphabetical order. Also this is very bare-boned, should
mention the erratum and the consequences of ignoring it.
If it's got security implications this should be mentioned here too.
> 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);
This will be an error if empty (e.g. just kvm-arm.ignore_spe_errata).
if intended, you should document that, otherwise you should handle an empty
input.
> +}
> +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)
Small note, but seems odd for something that is called a workaround to
actually be indicating that a bug exists. Maybe 'has_erratum_3023823'? Will
comment on relevant patch obv.
> return -EINVAL;
>
> if (!try_module_get(spe_pmu->pmu.module))
> --
> 2.43.0
>
>
--
Cheers, Lorenzo
More information about the linux-arm-kernel
mailing list