# Re: \[PATCH v5 13/21\] arm64: Allow ID\_AA64MMFR1\_EL1.VH to be overridden from the command line

- From: Suzuki K Poulose \<suzuki.poulose@arm.com\>
- Date: 2021-01-25 13:21:43 
- List: linux-arm-kernel
- Page: https://ratatoskr.run/linux-arm-kernel/2021/01/6246150
- Thread: https://ratatoskr.run/linux-arm-kernel/2021/01/6248353/t.md

```text
On 1/25/21 10:50 AM, Marc Zyngier wrote:
> As we want to be able to disable VHE at runtime, let's match
> "id_aa64mmfr1.vh=" from the command line as an override.
> This doesn't have much effect yet as our boot code doesn't look
> at the cpufeature, but only at the HW registers.
>
> Signed-off-by: Marc Zyngier <maz@kernel.org>
> Acked-by: David Brazdil <redacted>
> ---
>   arch/arm64/include/asm/cpufeature.h |  2 ++
>   arch/arm64/kernel/cpufeature.c      |  5 ++++-
>   arch/arm64/kernel/idreg-override.c  | 11 +++++++++++
>   3 files changed, 17 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm64/include/asm/cpufeature.h b/arch/arm64/include/asm/cpufeature.h
> index 4179cfc8ed57..b0ed37da4067 100644
> --- a/arch/arm64/include/asm/cpufeature.h
> +++ b/arch/arm64/include/asm/cpufeature.h
> @@ -818,6 +818,8 @@ static inline unsigned int get_vmid_bits(u64 mmfr1)
>   	return 8;
>   }
>   
> +extern struct arm64_ftr_override id_aa64mmfr1_override;
> +
>   u32 get_kvm_ipa_limit(void);
>   void dump_cpu_features(void);
>   
> diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
> index 4b84a1e1dc51..c1d6712c4249 100644
> --- a/arch/arm64/kernel/cpufeature.c
> +++ b/arch/arm64/kernel/cpufeature.c
> @@ -557,6 +557,8 @@ static const struct arm64_ftr_bits ftr_raz[] = {
>   
>   #define ARM64_FTR_REG(id, table) ARM64_FTR_REG_OVERRIDE(id, table, &no_override)
>   
> +struct arm64_ftr_override id_aa64mmfr1_override;

Does this need to be ro_after_init ?

Otherwise, looks good to me:

Acked-by: Suzuki K Poulose <suzuki.poulose@arm.com>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
```
