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]
Date:	Fri, 06 Jan 2012 12:31:38 +0000
From:	"Jan Beulich" <JBeulich@...e.com>
To:	"Ingo Molnar" <mingo@...e.hu>
Cc:	<tglx@...utronix.de>, "Andrew Morton" <akpm@...ux-foundation.org>,
	"Linus Torvalds" <torvalds@...ux-foundation.org>,
	<linux-kernel@...r.kernel.org>, <hpa@...or.com>
Subject: Re: [PATCH] x86-64: fix memset() to support sizes of 4Gb and
 above

>>> On 06.01.12 at 12:05, Ingo Molnar <mingo@...e.hu> wrote:

> * Jan Beulich <JBeulich@...e.com> wrote:
> 
>> While currently there doesn't appear to be any reachable 
>> in-tree case where such large memory blocks may be passed to 
>> memset() (alloc_bootmem() being the primary non-reachable one, 
>> as it gets called with suitably large sizes in FLATMEM 
>> configurations), we have recently hit the problem a second 
>> time in our Xen kernels. Rather than working around it a 
>> second time, prevent others from falling into the same trap by 
>> fixing this long standing limitation.
>> 
>> Signed-off-by: Jan Beulich <jbeulich@...e.com>
> 
> Have you checked the before/after size of the hotpath?
> 
> The patch suggests that it got shorter by 3 instructions:
> 
>> -	movl %edx,%r8d
>> -	andl $7,%r8d
>> -	movl %edx,%ecx
>> -	shrl $3,%ecx
>> +	movq %rdx,%rcx
>> +	andl $7,%edx
>> +	shrq $3,%rcx
> 
> [...]
> 
>>  	movq %rdi,%r10
>> -	movq %rdx,%r11
>>  
> 
> [...]
> 
>> -	movl	%r11d,%ecx
>> -	andl	$7,%ecx
>> +	andl	$7,%edx
> 
> Is that quick impression correct? I have not tried building or 
> measuring it.

Yes, that's correct.

As the bodies of the individual flavors didn't change, I see no risk in
this change causing any performance degradation.

> Would be nice to add support for arch/x86/lib/memset_64.S as 
> well, and look at the before/after performance of it. In 
> userspace we can do a lot more accurate measurements of this 
> kind:

I'll see whether I can get this done, but I admit that I'm entirely
unfamiliar with this tool and its infrastructure. I hope doing this is
not going to be a requirement for acceptance of the patch.

Jan

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