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] [day] [month] [year] [list]
Message-ID: <5463BFE2.4000404@ezchip.com>
Date:	Wed, 12 Nov 2014 15:15:30 -0500
From:	Chris Metcalf <cmetcalf@...hip.com>
To:	Chen Gang <gang.chen.5i5j@...il.com>
CC:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	<jepler@...ythonic.net>
Subject: Re: [PATCH] arch: tile: kernel: kgdb.c: Use memcpy() instead of pointer
 copy one by one

On 11/1/14 21:17, Chen Gang wrote:
> >Not only memcpy() is faster than pointer copy, but also let code more
> >clearer and simple, which can avoid compiling warning (the original
> >implementation copy registers by exceeding member array border).
> >
> >The related warning (with allmodconfig under tile):
> >
> >     CC      arch/tile/kernel/kgdb.o
> >   arch/tile/kernel/kgdb.c: In function 'sleeping_thread_to_gdb_regs':
> >   arch/tile/kernel/kgdb.c:140:31: warning: iteration 53u invokes undefined behavior [-Waggressive-loop-optimizations]
> >      *(ptr++) = thread_regs->regs[reg];
> >                                  ^
> >   arch/tile/kernel/kgdb.c:139:2: note: containing loop
> >     for (reg = 0; reg <= TREG_LAST_GPR; reg++)
> >     ^
> >
> >Signed-off-by: Chen Gang<gang.chen.5i5j@...il.com>
> >---
> >  arch/tile/kernel/kgdb.c | 6 +-----
> >  1 file changed, 1 insertion(+), 5 deletions(-)
> >

Taken into the tile tree - thanks!

See my recent email about changing the shape of the pt_regs and sigcontext
structures to make the regs[] usage explicit.  But even with that, I
think your change makes sense to simplify the code in this location.

-- 
Chris Metcalf, EZChip Semiconductor
http://www.ezchip.com

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ