Commit 4e76efda authored by James Morse's avatar James Morse Committed by Greg Kroah-Hartman
Browse files

KVM: arm64: Disable MPAM visibility by default and ignore VMM writes



commit 6685f5d5 upstream.

commit 011e5f5b ("arm64/cpufeature: Add remaining feature bits in
ID_AA64PFR0 register") exposed the MPAM field of AA64PFR0_EL1 to guests,
but didn't add trap handling. A previous patch supplied the missing trap
handling.

Existing VMs that have the MPAM field of ID_AA64PFR0_EL1 set need to
be migratable, but there is little point enabling the MPAM CPU
interface on new VMs until there is something a guest can do with it.

Clear the MPAM field from the guest's ID_AA64PFR0_EL1 and on hardware
that supports MPAM, politely ignore the VMMs attempts to set this bit.

Guests exposed to this bug have the sanitised value of the MPAM field,
so only the correct value needs to be ignored. This means the field
can continue to be used to block migration to incompatible hardware
(between MPAM=1 and MPAM=5), and the VMM can't rely on the field
being ignored.

Signed-off-by: default avatarJames Morse <james.morse@arm.com>
Co-developed-by: default avatarJoey Gouly <joey.gouly@arm.com>
Signed-off-by: default avatarJoey Gouly <joey.gouly@arm.com>
Reviewed-by: default avatarGavin Shan <gshan@redhat.com>
Tested-by: default avatarShameer Kolothum <shameerali.kolothum.thodi@huawei.com>
Reviewed-by: default avatarMarc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20241030160317.2528209-7-joey.gouly@arm.com


Signed-off-by: default avatarOliver Upton <oliver.upton@linux.dev>
Acked-by: default avatarMarc Zyngier <maz@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e2ccaf2d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment