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: <DM5PR11MB002716440E31D3806A9658A2E99B9@DM5PR11MB0027.namprd11.prod.outlook.com>
Date:   Wed, 12 Apr 2023 17:03:08 +0000
From:   "Saleem, Shiraz" <shiraz.saleem@...el.com>
To:     Jason Gunthorpe <jgg@...dia.com>,
        Christophe JAILLET <christophe.jaillet@...adoo.fr>
CC:     "Ismail, Mustafa" <mustafa.ismail@...el.com>,
        Leon Romanovsky <leon@...nel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "kernel-janitors@...r.kernel.org" <kernel-janitors@...r.kernel.org>,
        "linux-rdma@...r.kernel.org" <linux-rdma@...r.kernel.org>
Subject: RE: [PATCH] RDMA/irdma: Slightly optimize irdma_form_ah_cm_frame()

> Subject: Re: [PATCH] RDMA/irdma: Slightly optimize
> irdma_form_ah_cm_frame()
> 
> On Thu, Feb 02, 2023 at 09:23:24PM +0100, Christophe JAILLET wrote:
> > There is no need to zero 'pktsize' bytes of 'buf', only the header
> > needs to be cleared, to be safe.
> > All the other bytes are already written with some memcpy() at the end
> > of the function.
> >
> > Doing so also gives the opportunity to the compiler to avoid the
> > memset() call. It can be inlined now that the length is known as compile time.
> >
> > Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
> > ---
> > Just in case, here is the diff of what is generated by gcc 11.3.0
> > before and after the patch.
> >
> >  .L736:
> > -# drivers/infiniband/hw/irdma/cm.c:340: 	memset(buf, 0, pktsize);
> > +# drivers/infiniband/hw/irdma/cm.c:340: 	memset(buf, 0, sizeof(*tcph));
> >  	call	__sanitizer_cov_trace_pc	#
> > -	xorl	%esi, %esi	#
> > -	movzwl	%r13w, %edx	# _194, __fortify_size
> > -	movq	%rbp, %rdi	# buf,
> > -	call	memset	#
> > -	leaq	104(%r12), %rax	#, _259
> > +	movl	$0, 16(%rbp)	#, MEM <char[1:20]> [(void *)buf_114]
> > +	leaq	104(%r12), %rax	#, _295
> > +# drivers/infiniband/hw/irdma/cm.c:342: 	sqbuf->totallen = pktsize;
> > +	movzwl	%r13w, %r13d	# _192, _192
> > +# drivers/infiniband/hw/irdma/cm.c:340: 	memset(buf, 0, sizeof(*tcph));
> > +	movq	$0, 0(%rbp)	#, MEM <char[1:20]> [(void *)buf_114]
> > +# drivers/infiniband/hw/irdma/cm.c:342: 	sqbuf->totallen = pktsize;
> > +	movq	%rax, %rdi	# _295,
> > +# drivers/infiniband/hw/irdma/cm.c:340: 	memset(buf, 0, sizeof(*tcph));
> > +	movq	$0, 8(%rbp)	#, MEM <char[1:20]> [(void *)buf_114]
> > +	movq	%rax, 64(%rsp)	# _295, %sfp
> >  # drivers/infiniband/hw/irdma/cm.c:342: 	sqbuf->totallen = pktsize;
> > ---
> >  drivers/infiniband/hw/irdma/cm.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Shiraz??
> 

Sorry for the delay as I didn't see this earlier.

Reviewed-by: Shiraz Saleem <shiraz.saleem@...el.com>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ