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: <CALCETrXS7BvtS3P3J8hnbt3GGvezx-935uxanSN_a=CU6s1d3g@mail.gmail.com>
Date:	Sat, 10 Jan 2015 12:17:13 -0800
From:	Andy Lutomirski <luto@...capital.net>
To:	Denys Vlasenko <vda.linux@...glemail.com>
Cc:	Borislav Petkov <bp@...en8.de>,
	Denys Vlasenko <dvlasenk@...hat.com>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Oleg Nesterov <oleg@...hat.com>,
	"H. Peter Anvin" <hpa@...or.com>,
	Frederic Weisbecker <fweisbec@...il.com>,
	X86 ML <x86@...nel.org>, Alexei Starovoitov <ast@...mgrid.com>,
	Will Drewry <wad@...omium.org>,
	Kees Cook <keescook@...omium.org>
Subject: Re: [PATCH 3/4] x86: open-code register save/restore in
 trace_hardirqs thunks

On Sat, Jan 10, 2015 at 12:14 PM, Denys Vlasenko
<vda.linux@...glemail.com> wrote:
> On Sat, Jan 10, 2015 at 3:23 PM, Borislav Petkov <bp@...en8.de> wrote:
>> Bah, I see it. This nasty '$' gets forgotten a lot, maybe we should have
>> a check for that in some scripts :-)
>>
>> Here's the fix:
>>
>> ---
>> Index: b/arch/x86/lib/thunk_64.S
>> ===================================================================
>> --- a/arch/x86/lib/thunk_64.S   2015-01-10 15:18:04.418737613 +0100
>> +++ b/arch/x86/lib/thunk_64.S   2015-01-10 15:17:18.882736556 +0100
>> @@ -67,7 +67,7 @@ restore:
>>         movq_cfi_restore 6*8, rdx
>>         movq_cfi_restore 7*8, rsi
>>         movq_cfi_restore 8*8, rdi
>> -       addq 9*8, %rsp
>> +       addq $9*8, %rsp
>>         CFI_ADJUST_CFA_OFFSET -9*8
>>         ret
>
> Thanks!
>
> After I've seen the disassembly I myself posted, I can't help but wonder
> why we use 5-byte instructions to store and load regs on stack when
> pushes and pops are 1 or 2-byte long.
>

I asked this once, and someone told me that push/pop has lower
throughput.  I find this surprising.

--Andy

> Especially that 32-bit code *does* use push/pops.
>
> Can you test the attached patch with your kvm guest testcase?

Tt could be worth adding a macro along the lines of pushq_cfi_save
that does the pushq_cfi and the CFI_REL_OFFSET.

--Andy

-- 
Andy Lutomirski
AMA Capital Management, LLC
--
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