[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170730003819.GI5664@ram.oc3035372033.ibm.com>
Date: Sat, 29 Jul 2017 17:38:19 -0700
From: Ram Pai <linuxram@...ibm.com>
To: Thiago Jung Bauermann <bauerman@...ux.vnet.ibm.com>
Cc: linuxppc-dev@...ts.ozlabs.org, linux-kernel@...r.kernel.org,
linux-arch@...r.kernel.org, linux-mm@...ck.org, x86@...nel.org,
linux-doc@...r.kernel.org, linux-kselftest@...r.kernel.org,
arnd@...db.de, corbet@....net, mhocko@...nel.org,
dave.hansen@...el.com, mingo@...hat.com, paulus@...ba.org,
aneesh.kumar@...ux.vnet.ibm.com, akpm@...ux-foundation.org,
khandual@...ux.vnet.ibm.com
Subject: Re: [RFC v6 15/62] powerpc: helper functions to initialize AMR, IAMR
and UMOR registers
On Thu, Jul 27, 2017 at 05:40:44PM -0300, Thiago Jung Bauermann wrote:
>
> Ram Pai <linuxram@...ibm.com> writes:
>
> > Introduce helper functions that can initialize the bits in the AMR,
> > IAMR and UMOR register; the bits that correspond to the given pkey.
> >
> > Signed-off-by: Ram Pai <linuxram@...ibm.com>
>
> s/UMOR/UAMOR/ here and in the subject as well.
yes. fixed it.
>
> > --- a/arch/powerpc/mm/pkeys.c
> > +++ b/arch/powerpc/mm/pkeys.c
> > @@ -16,3 +16,47 @@
> > #include <linux/pkeys.h> /* PKEY_* */
> >
> > bool pkey_inited;
> > +#define pkeyshift(pkey) ((arch_max_pkey()-pkey-1) * AMR_BITS_PER_PKEY)
> > +
> > +static inline void init_amr(int pkey, u8 init_bits)
> > +{
> > + u64 new_amr_bits = (((u64)init_bits & 0x3UL) << pkeyshift(pkey));
> > + u64 old_amr = read_amr() & ~((u64)(0x3ul) << pkeyshift(pkey));
> > +
> > + write_amr(old_amr | new_amr_bits);
> > +}
> > +
> > +static inline void init_iamr(int pkey, u8 init_bits)
> > +{
> > + u64 new_iamr_bits = (((u64)init_bits & 0x3UL) << pkeyshift(pkey));
> > + u64 old_iamr = read_iamr() & ~((u64)(0x3ul) << pkeyshift(pkey));
> > +
> > + write_amr(old_iamr | new_iamr_bits);
> > +}
>
> init_iamr should call write_iamr, not write_amr.
excellent catch. thanks.
RP
Powered by blists - more mailing lists