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: <SN1PR0301MB15500F5D6D59CB344A8BF9FE9B600@SN1PR0301MB1550.namprd03.prod.outlook.com>
Date:	Wed, 26 Aug 2015 01:49:38 +0000
From:	Zhao Qiang <qiang.zhao@...escale.com>
To:	Scott Wood <scottwood@...escale.com>
CC:	Laura Abbott <labbott@...hat.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>,
	"lauraa@...eaurora.org" <lauraa@...eaurora.org>,
	Xiaobo Xie <X.Xie@...escale.com>,
	"benh@...nel.crashing.org" <benh@...nel.crashing.org>,
	Li Leo <LeoLi@...escale.com>,
	"paulus@...ba.org" <paulus@...ba.org>
Subject: RE: [PATCH v6 3/3] qe_common: add qe_muram_ functions to manage muram

> -----Original Message-----
> From: Wood Scott-B07421
> Sent: Wednesday, August 26, 2015 12:23 AM
> To: Zhao Qiang-B45475
> Cc: Laura Abbott; linux-kernel@...r.kernel.org; linuxppc-
> dev@...ts.ozlabs.org; lauraa@...eaurora.org; Xie Xiaobo-R63061;
> benh@...nel.crashing.org; Li Yang-Leo-R58472; paulus@...ba.org
> Subject: Re: [PATCH v6 3/3] qe_common: add qe_muram_ functions to manage
> muram
> 
> On Tue, 2015-08-25 at 02:19 -0500, Zhao Qiang-B45475 wrote:
> > On 08/25/2015 12:15 PM, Laura Abbott wrote
> > > -----Original Message-----
> > > From: Laura Abbott [mailto:labbott@...hat.com]
> > > Sent: Tuesday, August 25, 2015 12:15 PM
> > > To: Zhao Qiang-B45475; Wood Scott-B07421
> > > Cc: linux-kernel@...r.kernel.org; linuxppc-dev@...ts.ozlabs.org;
> > > lauraa@...eaurora.org; Xie Xiaobo-R63061; benh@...nel.crashing.org;
> > > Li Yang-Leo-R58472; paulus@...ba.org
> > > Subject: Re: [PATCH v6 3/3] qe_common: add qe_muram_ functions to
> > > manage muram
> > >
> > > On 08/24/2015 08:03 PM, Zhao Qiang wrote:
> > > >
> > > > > -----Original Message-----
> > > > > From: Laura Abbott [mailto:labbott@...hat.com]
> > > > > Sent: Tuesday, August 25, 2015 7:32 AM
> > > > > To: Zhao Qiang-B45475; Wood Scott-B07421
> > > > > Cc: linux-kernel@...r.kernel.org; linuxppc-dev@...ts.ozlabs.org;
> > > > > lauraa@...eaurora.org; Xie Xiaobo-R63061;
> > > > > benh@...nel.crashing.org; Li Yang-Leo-R58472; paulus@...ba.org
> > > > > Subject: Re: [PATCH v6 3/3] qe_common: add qe_muram_ functions
> > > > > to manage muram
> > > > >
> > > > > There doesn't seem to be a check for allocation failure from the
> > > > > gen_alloc.
> > > >
> > > > gen_pool_alloc will return 0 if there is error, but if the address
> > > > returned is just 0x0, it can't distinguish it is address or error.
> > > >
> > >
> > > Yes, that's a bad limitation of gen_pool. Maybe one day that will
> > > get fixed.
> > > In a previous out of tree driver, I worked around this by offsetting
> > > the gen_pool_add by a constant so any return value was non-zero and
> > > out of memory was zero and then subtracting the constant off of the
> return value.
> > > Not sure if that's better or worse than just fixing gen_alloc.
> > >
> >
> > The workaround works for non alignment allocation, but for alignment
> > allocation, It need to align bytes to addr 0, offsetting the
> > gen_pool_add maybe make wrong alignment
> 
> It would work if the offset you add is a multiple of the size of muram.

The QE apps ask different bytes alignment for different use due to hardware restriction.
Why don’t we deal with it in gen_pool_alloc func instead of a workaround?
It is more reasonable.

> 
> -Scott

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ