]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: arm64: Advertise ID_AA64PFR0_EL1.CSV3=1 if the CPUs are Meltdown-safe
authorMarc Zyngier <maz@kernel.org>
Thu, 26 Nov 2020 17:27:13 +0000 (17:27 +0000)
committerMarc Zyngier <maz@kernel.org>
Mon, 30 Nov 2020 16:02:53 +0000 (16:02 +0000)
commitb44c56f93d1cc25dabba4dd4083122fe7363f2a4
treeda117b4f2caab5247116ef5cb944781e1291ba65
parent76c0427579f8b376bcfce716c8d28d925703c685
KVM: arm64: Advertise ID_AA64PFR0_EL1.CSV3=1 if the CPUs are Meltdown-safe

Cores that predate the introduction of ID_AA64PFR0_EL1.CSV3 to
the ARMv8 architecture have this field set to 0, even of some of
them are not affected by the vulnerability.

The kernel maintains a list of unaffected cores (A53, A55 and a few
others) so that it doesn't impose an expensive mitigation uncessarily.

As we do for CSV2, let's expose the CSV3 property to guests that run
on HW that is effectively not vulnerable. This can be reset to zero
by writing to the ID register from userspace, ensuring that VMs can
be migrated despite the new property being set.

Reported-by: Will Deacon <will@kernel.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/include/asm/kvm_host.h
arch/arm64/kvm/arm.c
arch/arm64/kvm/sys_regs.c