[PATCH v6 4/4] arm64: paravirt: Enable errata based on implementation CPUs
Marc Zyngier
maz at kernel.org
Fri Feb 7 06:31:12 PST 2025
On Fri, 07 Feb 2025 14:08:44 +0000,
Catalin Marinas <catalin.marinas at arm.com> wrote:
>
> On Wed, Feb 05, 2025 at 01:22:22PM +0000, Shameer Kolothum wrote:
> > static inline bool is_midr_in_range(struct midr_range const *range)
> > {
> > - return midr_is_cpu_model_range(read_cpuid_id(), range->model,
> > - range->rv_min, range->rv_max);
> > + int i;
> > +
> > + if (!target_impl_cpu_num)
> > + return midr_is_cpu_model_range(read_cpuid_id(), range->model,
> > + range->rv_min, range->rv_max);
> > +
> > + for (i = 0; i < target_impl_cpu_num; i++) {
> > + if (midr_is_cpu_model_range(target_impl_cpus[i].midr,
> > + range->model,
> > + range->rv_min, range->rv_max))
> > + return true;
> > + }
> > + return false;
> > }
>
> It's a interesting approach but how does this work in practice if an
> erratum requires a firmware counterpart? Do we expect firmwares on all
> machines involved to have workarounds for the other machines? Or is KVM
> going to intercept those SMCs and pretend the EL3 counterpart is there?
KVM already traps SMCs, and could do something on behalf of the guest
(such as pretending that the mitigation has happened if not on the
correct host) *IF* the mitigation is architected (à la WA{1,2,3}).
If it is implementation specific, then we can immediately stop
pretending that a guest running on those systems can be migrated.
The only thing it helps a bit is big-little.
Overall, this isn't meant to be foolproof at all. It is only giving
people enough ammunition to make it plain that the cross-platform
story is a bit of a sad joke right now.
Thanks,
M.
--
Without deviation from the norm, progress is not possible.
More information about the linux-arm-kernel
mailing list