Re: [PATCH v10 06/12] KVM: arm64: Allow userspace to change ID_AA64ISAR{0-2}_EL1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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/

Kristina
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux