On Fri, Sep 22, 2023 at 06:18:37PM +0100, Kristina Martsenko wrote: > On 20/09/2023 19:33, Oliver Upton wrote: > > Almost all of the features described by the ISA registers have no KVM > > involvement. Allow userspace to change the value of these registers with > > a couple exceptions: > > > > - MOPS is not writable as KVM does not currently virtualize FEAT_MOPS. > > > > - The PAuth fields are not writable as KVM requires both address and > > generic authentication be enabled. > > > > - Override the kernel's handling of BC to LOWER_SAFE. > > > > Co-developed-by: Jing Zhang <jingzhangos@xxxxxxxxxx> > > Signed-off-by: Jing Zhang <jingzhangos@xxxxxxxxxx> > > Signed-off-by: Oliver Upton <oliver.upton@xxxxxxxxx> > > --- > > arch/arm64/kvm/sys_regs.c | 42 ++++++++++++++++++++++++++++----------- > > 1 file changed, 30 insertions(+), 12 deletions(-) > > > > diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c > > index 10e3e6a736dc..71664bec2808 100644 > > --- a/arch/arm64/kvm/sys_regs.c > > +++ b/arch/arm64/kvm/sys_regs.c > > @@ -1225,6 +1225,10 @@ static s64 kvm_arm64_ftr_safe_value(u32 id, const struct arm64_ftr_bits *ftrp, > > break; > > } > > break; > > + case SYS_ID_AA64ISAR2_EL1: > > + if (kvm_ftr.shift == ID_AA64ISAR2_EL1_BC_SHIFT) > > + kvm_ftr.type = FTR_LOWER_SAFE; > > + break; > > case SYS_ID_DFR0_EL1: > > if (kvm_ftr.shift == ID_DFR0_EL1_PerfMon_SHIFT) > > kvm_ftr.type = FTR_LOWER_SAFE; > > Nit: it shouldn't be necessary to override BC anymore, as it was recently fixed > in the arm64 code: > https://lore.kernel.org/linux-arm-kernel/20230912133429.2606875-1-kristina.martsenko@xxxxxxx/ Perfect, looks like that patch should go in 6.6 too. Thanks for the fix! -- Thanks, Oliver