Hi Catalin
> -----Original Message-----
> From: Catalin Marinas <[email protected]>
> Sent: 2019年9月20日 0:37
> To: Justin He (Arm Technology China) <[email protected]>
> Cc: Will Deacon <[email protected]>; Mark Rutland
> <[email protected]>; James Morse <[email protected]>; Marc
> Zyngier <[email protected]>; Matthew Wilcox <[email protected]>; Kirill A.
> Shutemov <[email protected]>; linux-arm-
> [email protected]; [email protected]; linux-
> [email protected]; Suzuki Poulose <[email protected]>; Punit
> Agrawal <[email protected]>; Anshuman Khandual
> <[email protected]>; Alex Van Brunt
> <[email protected]>; Robin Murphy <[email protected]>;
> Thomas Gleixner <[email protected]>; Andrew Morton <akpm@linux-
> foundation.org>; Jérôme Glisse <[email protected]>; Ralph Campbell
> <[email protected]>; [email protected]; Kaly Xin (Arm Technology
> China) <[email protected]>
> 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.

Reply via email to