diff options
author | Jing Zhang <jingzhangos@google.com> | 2023-10-04 01:04:04 +0200 |
---|---|---|
committer | Oliver Upton <oliver.upton@linux.dev> | 2023-10-04 19:11:50 +0200 |
commit | 8cfd5be88ebe3d71be1a2c52fc72a355bb924b49 (patch) | |
tree | 6adda9e662ecd0d2fe626eef949bdc1a5535384f /arch | |
parent | KVM: arm64: Allow userspace to change ID_AA64MMFR{0-2}_EL1 (diff) | |
download | linux-8cfd5be88ebe3d71be1a2c52fc72a355bb924b49.tar.xz linux-8cfd5be88ebe3d71be1a2c52fc72a355bb924b49.zip |
KVM: arm64: Allow userspace to change ID_AA64PFR0_EL1
Allow userspace to change the guest-visible value of the register with
some severe limitation:
- No changes to features not virtualized by KVM (AMU, MPAM, RAS)
- Short of full GICv2 emulation in kernel, hiding GICv3 from the guest
makes absolutely no sense.
- FP is effectively assumed for KVM VMs.
Signed-off-by: Jing Zhang <jingzhangos@google.com>
[oliver: restrict features that are illogical to change]
Reviewed-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20231003230408.3405722-9-oliver.upton@linux.dev
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm64/kvm/sys_regs.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c index d850b05eb504..dbf915f88b17 100644 --- a/arch/arm64/kvm/sys_regs.c +++ b/arch/arm64/kvm/sys_regs.c @@ -2057,7 +2057,13 @@ static const struct sys_reg_desc sys_reg_descs[] = { .get_user = get_id_reg, .set_user = set_id_reg, .reset = read_sanitised_id_aa64pfr0_el1, - .val = ID_AA64PFR0_EL1_CSV2_MASK | ID_AA64PFR0_EL1_CSV3_MASK, }, + .val = ~(ID_AA64PFR0_EL1_AMU | + ID_AA64PFR0_EL1_MPAM | + ID_AA64PFR0_EL1_SVE | + ID_AA64PFR0_EL1_RAS | + ID_AA64PFR0_EL1_GIC | + ID_AA64PFR0_EL1_AdvSIMD | + ID_AA64PFR0_EL1_FP), }, ID_SANITISED(ID_AA64PFR1_EL1), ID_UNALLOCATED(4,2), ID_UNALLOCATED(4,3), |