[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201209183509.GH13566@gaia>
Date: Wed, 9 Dec 2020 18:35:09 +0000
From: Catalin Marinas <catalin.marinas@....com>
To: Will Deacon <will@...nel.org>
Cc: linux-kernel@...r.kernel.org, linux-mm@...ck.org,
linux-arm-kernel@...ts.infradead.org, Jan Kara <jack@...e.cz>,
Minchan Kim <minchan@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
"Kirill A . Shutemov" <kirill.shutemov@...ux.intel.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Vinayak Menon <vinmenon@...eaurora.org>,
kernel-team@...roid.com
Subject: Re: [PATCH 2/2] arm64: mm: Implement arch_wants_old_faultaround_pte()
On Wed, Dec 09, 2020 at 04:39:50PM +0000, Will Deacon wrote:
> diff --git a/arch/arm64/include/asm/cpufeature.h b/arch/arm64/include/asm/cpufeature.h
> index da250e4741bd..3424f5881390 100644
> --- a/arch/arm64/include/asm/cpufeature.h
> +++ b/arch/arm64/include/asm/cpufeature.h
> @@ -764,6 +764,18 @@ static inline bool cpu_has_hw_af(void)
> ID_AA64MMFR1_HADBS_SHIFT);
> }
>
> +static inline bool system_has_hw_af(void)
> +{
> + u64 mmfr1;
> +
> + if (!IS_ENABLED(CONFIG_ARM64_HW_AFDBM))
> + return false;
> +
> + mmfr1 = read_sanitised_ftr_reg(SYS_ID_AA64MMFR1_EL1);
> + return cpuid_feature_extract_unsigned_field(mmfr1,
> + ID_AA64MMFR1_HADBS_SHIFT);
> +}
Could we not add a new system-wide cpu feature that checks for hardware
AF? This read_sanitised_ftr_reg() does a binary search on each
invocation.
--
Catalin
Powered by blists - more mailing lists