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: <08d8c27c0495452cad52b62b362dd1d1.squirrel@www.firstfloor.org>
Date:	Wed, 18 May 2011 04:57:45 +0200
From:	"Andi Kleen" <andi@...stfloor.org>
To:	"Fenghua Yu" <fenghua.yu@...el.com>
Cc:	"Ingo Molnar" <mingo@...e.hu>,
	"Thomas Gleixner" <tglx@...utronix.de>,
	"H Peter Anvin" <hpa@...or.com>,
	"Asit K Mallick" <asit.k.mallick@...el.com>,
	"Linus Torvalds" <torvalds@...ux-foundation.org>,
	"Avi Kivity" <avi@...hat.com>,
	"Arjan van de Ven" <arjan@...radead.org>,
	"Andrew Morton" <akpm@...ux-foundation.org>,
	"Andi Kleen" <andi@...stfloor.org>,
	"linux-kernel" <linux-kernel@...r.kernel.org>,
	"Fenghua Yu" <fenghua.yu@...el.com>
Subject: Re: [PATCH 9/9] x86/lib/memset_64.S: Optimize memset by enhanced REP
 MOVSB/STOSB

> From: Fenghua Yu <fenghua.yu@...el.com>
>
> Support memset() with enhanced rep stosb. On processors supporting
> enhanced
> REP MOVSB/STOSB, the alternative memset_c_e function using enhanced rep
> stosb
> overrides the fast string alternative memset_c and the original function.

FWIW most memsets and memcpys are generated by modern gccs as inline code,
depending on alignment etc., so will never call your new function.
Same may be true for memmove (not fully sure)

One way to work around this would be to add suitable logic
to the string.h macros and make sure the out of line code is always
called for large copies if the count is constant and large enough.

There used to be such logic, but it was removed partly later.

The only problem is that it's hard to decide if the count is variable
and where a good threshold is.

Or maybe it would be better to just fix gcc to use the new instructions,
but then it would be difficult to patch them in.

-Andi


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