[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <54EC643D.3040005@redhat.com>
Date: Tue, 24 Feb 2015 12:45:01 +0100
From: Denys Vlasenko <dvlasenk@...hat.com>
To: Andy Lutomirski <luto@...capital.net>
CC: Borislav Petkov <bp@...en8.de>, "H. Peter Anvin" <hpa@...or.com>,
X86 ML <x86@...nel.org>, LKML <linux-kernel@...r.kernel.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Alexander van Heukelum <heukelum@...tmail.fm>
Subject: Re: RFC: (almost) getting rid of FIXUP/RESTORE_TOP_OF_STACK?
On 02/24/2015 12:58 AM, Andy Lutomirski wrote:
>> - Next possible change is to use PUSH insns to build the stack. Something along the lines of
>> swapgs
>> mov %rsp,%gs:old_rsp
>> mov %gs:kernel_stack,%rsp
>> sti
>> push $__USER_DS /* pt_regs->ss */
>> push %gs:old_rsp /* ->rsp */
>> push %r11 /* ->rflags */
>> push $__USER_CS /* ->cs */
>> push %rcx /* ->rip */
>> push %rax /* ->orig_rax */
>> push %rdi
>> push %rsi
>> push %rdx
>> push %rcx
>> push $-ENOSYS /* ->rax */
>> push %r8
>> push %r9
>> push %r10
>> push %r11
>> sub $(6*8),%rsp /* rbx, rbp, r12-r15 not saved */
Correction:
push %r11
sub $(6*8),%rsp /* rbx, rbp, r12-r15 not saved */
should be
sub $(7*8),%rsp /* r11, rbx, rbp, r12-r15 not saved */
since we don't need to save r11 either.
>
> Yay!
"yay!" as in "I like this!" or as in "I am surprised" ?
> Can we have a macro PUSH_XYZ for most of this?
Yes, it can be a macro. I'm not sure we'll have more than one
such place, tho.
Do you want a macro even if it will be once-use only?
--
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