From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt0-f198.google.com (mail-qt0-f198.google.com [209.85.216.198]) by kanga.kvack.org (Postfix) with ESMTP id 69AFB6B0007 for ; Fri, 9 Feb 2018 12:17:14 -0500 (EST) Received: by mail-qt0-f198.google.com with SMTP id g3so173710qtj.13 for ; Fri, 09 Feb 2018 09:17:14 -0800 (PST) Received: from mx1.redhat.com (mx3-rdu2.redhat.com. [66.187.233.73]) by mx.google.com with ESMTPS id r9si2340342qtm.387.2018.02.09.09.17.13 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Feb 2018 09:17:13 -0800 (PST) Subject: Re: [PATCH 09/31] x86/entry/32: Leave the kernel via trampoline stack References: <1518168340-9392-1-git-send-email-joro@8bytes.org> <1518168340-9392-10-git-send-email-joro@8bytes.org> From: Denys Vlasenko Message-ID: Date: Fri, 9 Feb 2018 18:17:07 +0100 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Linus Torvalds , Joerg Roedel Cc: Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , the arch/x86 maintainers , Linux Kernel Mailing List , linux-mm , Andy Lutomirski , Dave Hansen , Josh Poimboeuf , Juergen Gross , Peter Zijlstra , Borislav Petkov , Jiri Kosina , Boris Ostrovsky , Brian Gerst , David Laight , Eduardo Valentin , Greg KH , Will Deacon , "Liguori, Anthony" , Daniel Gruss , Hugh Dickins , Kees Cook , Andrea Arcangeli , Waiman Long , Pavel Machek , Joerg Roedel On 02/09/2018 06:05 PM, Linus Torvalds wrote: > On Fri, Feb 9, 2018 at 1:25 AM, Joerg Roedel wrote: >> + >> + /* Copy over the stack-frame */ >> + cld >> + rep movsb > > Ugh. This is going to be horrendous. Maybe not noticeable on modern > CPU's, but the whole 32-bit code is kind of pointless on a modern CPU. > > At least use "rep movsl". If the kernel stack isn't 4-byte aligned, > you have issues. Indeed, "rep movs" has some setup overhead that makes it undesirable for small sizes. In my testing, moving less than 128 bytes with "rep movs" is a loss. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org