lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <DB7PR08MB30827C81CD6CDB03B17A1BDEF7890@DB7PR08MB3082.eurprd08.prod.outlook.com>
Date:   Thu, 19 Sep 2019 01:55:10 +0000
From:   "Justin He (Arm Technology China)" <Justin.He@....com>
To:     Catalin Marinas <Catalin.Marinas@....com>,
        Suzuki Poulose <Suzuki.Poulose@....com>
CC:     Will Deacon <will@...nel.org>, Mark Rutland <Mark.Rutland@....com>,
        James Morse <James.Morse@....com>,
        Marc Zyngier <maz@...nel.org>,
        Matthew Wilcox <willy@...radead.org>,
        "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-mm@...ck.org" <linux-mm@...ck.org>,
        Punit Agrawal <punitagrawal@...il.com>,
        Anshuman Khandual <Anshuman.Khandual@....com>,
        Jun Yao <yaojun8558363@...il.com>,
        Alex Van Brunt <avanbrunt@...dia.com>,
        Robin Murphy <Robin.Murphy@....com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Jérôme Glisse <jglisse@...hat.com>,
        Ralph Campbell <rcampbell@...dia.com>,
        "hejianet@...il.com" <hejianet@...il.com>,
        "Kaly Xin (Arm Technology China)" <Kaly.Xin@....com>
Subject: RE: [PATCH v4 1/3] arm64: cpufeature: introduce helper
 cpu_has_hw_af()

Hi Suzuki

> -----Original Message-----
> From: Catalin Marinas <catalin.marinas@....com>
> Sent: 2019年9月19日 0:46
> To: Suzuki Poulose <Suzuki.Poulose@....com>
> Cc: Justin He (Arm Technology China) <Justin.He@....com>; Will Deacon
> <will@...nel.org>; Mark Rutland <Mark.Rutland@....com>; James Morse
> <James.Morse@....com>; Marc Zyngier <maz@...nel.org>; Matthew
> Wilcox <willy@...radead.org>; Kirill A. Shutemov
> <kirill.shutemov@...ux.intel.com>; linux-arm-kernel@...ts.infradead.org;
> linux-kernel@...r.kernel.org; linux-mm@...ck.org; Punit Agrawal
> <punitagrawal@...il.com>; Anshuman Khandual
> <Anshuman.Khandual@....com>; Jun Yao <yaojun8558363@...il.com>;
> Alex Van Brunt <avanbrunt@...dia.com>; Robin Murphy
> <Robin.Murphy@....com>; Thomas Gleixner <tglx@...utronix.de>;
> Andrew Morton <akpm@...ux-foundation.org>; Jérôme Glisse
> <jglisse@...hat.com>; Ralph Campbell <rcampbell@...dia.com>;
> hejianet@...il.com; Kaly Xin (Arm Technology China) <Kaly.Xin@....com>
> Subject: Re: [PATCH v4 1/3] arm64: cpufeature: introduce helper
> cpu_has_hw_af()
>
> On Wed, Sep 18, 2019 at 03:20:41PM +0100, Suzuki K Poulose wrote:
> > On 18/09/2019 14:19, Jia He wrote:
> > > diff --git a/arch/arm64/include/asm/cpufeature.h
> b/arch/arm64/include/asm/cpufeature.h
> > > index c96ffa4722d3..206b6e3954cf 100644
> > > --- a/arch/arm64/include/asm/cpufeature.h
> > > +++ b/arch/arm64/include/asm/cpufeature.h
> > > @@ -390,6 +390,7 @@ extern DECLARE_BITMAP(boot_capabilities,
> ARM64_NPATCHABLE);
> > >           for_each_set_bit(cap, cpu_hwcaps, ARM64_NCAPS)
> > >   bool this_cpu_has_cap(unsigned int cap);
> > > +bool cpu_has_hw_af(void);
> > >   void cpu_set_feature(unsigned int num);
> > >   bool cpu_have_feature(unsigned int num);
> > >   unsigned long cpu_get_elf_hwcap(void);
> > > diff --git a/arch/arm64/kernel/cpufeature.c
> b/arch/arm64/kernel/cpufeature.c
> > > index b1fdc486aed8..c5097f58649d 100644
> > > --- a/arch/arm64/kernel/cpufeature.c
> > > +++ b/arch/arm64/kernel/cpufeature.c
> > > @@ -1141,6 +1141,12 @@ static bool has_hw_dbm(const struct
> arm64_cpu_capabilities *cap,
> > >           return true;
> > >   }
> > > +/* Decouple AF from AFDBM. */
> > > +bool cpu_has_hw_af(void)
> > > +{
> > Sorry for not having asked this earlier. Are we interested in,
> >
> > "whether *this* CPU has AF support ?" or "whether *at least one*
> > CPU has the AF support" ? The following code does the former.
> >
> > > + return (read_cpuid(ID_AA64MMFR1_EL1) & 0xf);
>
> In a non-preemptible context, the former is ok (per-CPU).

Yes, just as what Catalin explained, we need the former because the
pagefault occurred in every cpus

--
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.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ