From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752027AbbFNIlO (ORCPT ); Sun, 14 Jun 2015 04:41:14 -0400 Received: from mail-wi0-f181.google.com ([209.85.212.181]:33835 "EHLO mail-wi0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751494AbbFNIlF (ORCPT ); Sun, 14 Jun 2015 04:41:05 -0400 Date: Sun, 14 Jun 2015 10:40:59 +0200 From: Ingo Molnar To: Denys Vlasenko Cc: Linus Torvalds , Steven Rostedt , Borislav Petkov , "H. Peter Anvin" , Andy Lutomirski , Oleg Nesterov , Frederic Weisbecker , Alexei Starovoitov , Will Drewry , Kees Cook , x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 4/5] x86/asm/entry/32: Replace RESTORE_RSI_RDI[_RDX] with open-coded 32-bit reads Message-ID: <20150614084059.GA24562@gmail.com> References: <1433876051-26604-1-git-send-email-dvlasenk@redhat.com> <1433876051-26604-4-git-send-email-dvlasenk@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1433876051-26604-4-git-send-email-dvlasenk@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Denys Vlasenko wrote: > +8b 74 24 68 mov 0x68(%rsp),%esi > +8b 7c 24 70 mov 0x70(%rsp),%edi > +8b 54 24 60 mov 0x60(%rsp),%edx Btw., could you (in another patch) order the restoration properly, by pt_regs memory order, where possible? So this: > + movl RSI(%rsp), %esi > + movl RDI(%rsp), %edi > + movl RDX(%rsp), %edx > movl RIP(%rsp), %ecx > movl EFLAGS(%rsp), %r11d would become: movl RDX(%rsp), %edx movl RSI(%rsp), %esi movl RDI(%rsp), %edi movl RIP(%rsp), %ecx movl EFLAGS(%rsp), %r11d ... or so. In fact I'd suggest we structure movl based restoration precisely after the field order in the structure, and comment on cases where we depart from what's in pt_regs - to make it all easier to verify. Thanks, Ingo