Skip to content

Commit 8cfd5be

Browse files
jingzhangosoupton
authored andcommitted
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 <[email protected]> [oliver: restrict features that are illogical to change] Reviewed-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Oliver Upton <[email protected]>
1 parent d5a32b6 commit 8cfd5be

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

arch/arm64/kvm/sys_regs.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2057,7 +2057,13 @@ static const struct sys_reg_desc sys_reg_descs[] = {
20572057
.get_user = get_id_reg,
20582058
.set_user = set_id_reg,
20592059
.reset = read_sanitised_id_aa64pfr0_el1,
2060-
.val = ID_AA64PFR0_EL1_CSV2_MASK | ID_AA64PFR0_EL1_CSV3_MASK, },
2060+
.val = ~(ID_AA64PFR0_EL1_AMU |
2061+
ID_AA64PFR0_EL1_MPAM |
2062+
ID_AA64PFR0_EL1_SVE |
2063+
ID_AA64PFR0_EL1_RAS |
2064+
ID_AA64PFR0_EL1_GIC |
2065+
ID_AA64PFR0_EL1_AdvSIMD |
2066+
ID_AA64PFR0_EL1_FP), },
20612067
ID_SANITISED(ID_AA64PFR1_EL1),
20622068
ID_UNALLOCATED(4,2),
20632069
ID_UNALLOCATED(4,3),

0 commit comments

Comments
 (0)