[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b01bb1772b291e23ea82ff5855ee7e12@kernel.org>
Date: Tue, 12 May 2020 11:39:57 +0100
From: Marc Zyngier <maz@...nel.org>
To: Anshuman Khandual <anshuman.khandual@....com>
Cc: linux-arm-kernel@...ts.infradead.org,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>,
James Morse <james.morse@....com>,
linux-kernel@...r.kernel.org, kvmarm@...ts.cs.columbia.edu
Subject: Re: [PATCH] arm64/cpufeature: Add ID_AA64MMFR0_PARANGE_MASK
Anshuman,
On 2020-05-12 03:13, Anshuman Khandual wrote:
> This replaces multiple open encoding (0x7) with
> ID_AA64MMFR0_PARANGE_MASK
> thus cleaning the clutter. It modifies an existing ID_AA64MMFR0 helper
> and
> introduces a new one i.e id_aa64mmfr0_iparange() and
> id_aa64mmfr0_parange()
> respectively.
>
> Cc: Catalin Marinas <catalin.marinas@....com>
> Cc: Will Deacon <will@...nel.org>
> Cc: Marc Zyngier <maz@...nel.org>
> Cc: James Morse <james.morse@....com>
> Cc: linux-arm-kernel@...ts.infradead.org
> Cc: linux-kernel@...r.kernel.org
> Cc: kvmarm@...ts.cs.columbia.edu
>
> Signed-off-by: Anshuman Khandual <anshuman.khandual@....com>
> ---
> This applies after (https://patchwork.kernel.org/patch/11541893/).
>
> arch/arm64/include/asm/cpufeature.h | 11 ++++++++++-
> arch/arm64/kernel/cpufeature.c | 5 ++---
> arch/arm64/kvm/reset.c | 9 +++++----
> 3 files changed, 17 insertions(+), 8 deletions(-)
>
> diff --git a/arch/arm64/include/asm/cpufeature.h
> b/arch/arm64/include/asm/cpufeature.h
> index 1291ad5a9ccb..320cfc5b6025 100644
> --- a/arch/arm64/include/asm/cpufeature.h
> +++ b/arch/arm64/include/asm/cpufeature.h
> @@ -706,8 +706,17 @@ void arm64_set_ssbd_mitigation(bool state);
>
> extern int do_emulate_mrs(struct pt_regs *regs, u32 sys_reg, u32 rt);
>
> -static inline u32 id_aa64mmfr0_parange_to_phys_shift(int parange)
> +#define ID_AA64MMFR0_PARANGE_MASK 0x7
I still disagree with this 7. Per the letter of the architecture, it
is wrong and should be 0xf, just like any other property described
in an ID register.
> +
> +static inline u32 id_aa64mmfr0_parange(u64 mmfr0)
> {
> + return mmfr0 & ID_AA64MMFR0_PARANGE_MASK;
> +}
> +
> +static inline u32 id_aa64mmfr0_iparange(u64 mmfr0)
There is also no such thing as an IPA range in the architecture.
Everything is PA. The only thing that actually describe an IPA
range is what KVM makes of it.
Overall, this patch confuses me more than anything else. I'd rather
you fix ID_AA64MMFR0_PARANGE_MASK to have the right value and be
done with it.
M.
--
Jazz is not dead. It just smells funny...
Powered by blists - more mailing lists