RE: [PATCH v5 1/3] arm64: cpufeature: introduce helper cpu_has_hw_af()
From: Justin He (Arm Technology China)
Date: Thu Sep 19 2019 - 21:14:40 EST
Hi Catalin
> -----Original Message-----
> From: Catalin Marinas <catalin.marinas@xxxxxxx>
> Sent: 2019å9æ20æ 0:37
> To: Justin He (Arm Technology China) <Justin.He@xxxxxxx>
> Cc: Will Deacon <will@xxxxxxxxxx>; Mark Rutland
> <Mark.Rutland@xxxxxxx>; James Morse <James.Morse@xxxxxxx>; Marc
> Zyngier <maz@xxxxxxxxxx>; Matthew Wilcox <willy@xxxxxxxxxxxxx>; Kirill A.
> Shutemov <kirill.shutemov@xxxxxxxxxxxxxxx>; linux-arm-
> kernel@xxxxxxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; linux-
> mm@xxxxxxxxx; Suzuki Poulose <Suzuki.Poulose@xxxxxxx>; Punit
> Agrawal <punitagrawal@xxxxxxxxx>; Anshuman Khandual
> <Anshuman.Khandual@xxxxxxx>; Alex Van Brunt
> <avanbrunt@xxxxxxxxxx>; Robin Murphy <Robin.Murphy@xxxxxxx>;
> Thomas Gleixner <tglx@xxxxxxxxxxxxx>; Andrew Morton <akpm@linux-
> foundation.org>; JÃrÃme Glisse <jglisse@xxxxxxxxxx>; Ralph Campbell
> <rcampbell@xxxxxxxxxx>; hejianet@xxxxxxxxx; Kaly Xin (Arm Technology
> China) <Kaly.Xin@xxxxxxx>
> Subject: Re: [PATCH v5 1/3] arm64: cpufeature: introduce helper
> cpu_has_hw_af()
>
> On Fri, Sep 20, 2019 at 12:12:02AM +0800, Jia He wrote:
> > diff --git a/arch/arm64/kernel/cpufeature.c
> b/arch/arm64/kernel/cpufeature.c
> > index b1fdc486aed8..fb0e9425d286 100644
> > --- a/arch/arm64/kernel/cpufeature.c
> > +++ b/arch/arm64/kernel/cpufeature.c
> > @@ -1141,6 +1141,16 @@ static bool has_hw_dbm(const struct
> arm64_cpu_capabilities *cap,
> > return true;
> > }
> >
> > +/* Decouple AF from AFDBM. */
> > +bool cpu_has_hw_af(void)
> > +{
> > + return (read_cpuid(ID_AA64MMFR1_EL1) & 0xf);
> > +}
> > +#else /* CONFIG_ARM64_HW_AFDBM */
> > +bool cpu_has_hw_af(void)
> > +{
> > + return false;
> > +}
> > #endif
>
> Please place this function in cpufeature.h directly, no need for an
> additional function call. Something like:
>
> static inline bool cpu_has_hw_af(void)
> {
> if (IS_ENABLED(CONFIG_ARM64_HW_AFDBM))
> return read_cpuid(ID_AA64MMFR1_EL1) & 0xf;
> return false;
> }
>
Ok, thanks
--
Cheers,
Justin (Jia He)
> --
> Catalin
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.