Received: by 10.223.176.5 with SMTP id f5csp919515wra; Fri, 9 Feb 2018 09:18:06 -0800 (PST) X-Google-Smtp-Source: AH8x227zaIXPN79ZFXrvXuohb9Cev+EjgZkytpwgm0WW0pbqHVhPMItWiQ5m7oXogrix5bonqzAV X-Received: by 10.98.253.5 with SMTP id p5mr3593155pfh.132.1518196686190; Fri, 09 Feb 2018 09:18:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518196686; cv=none; d=google.com; s=arc-20160816; b=Zd64ETJrvLmh0vU6fap+z1WkXy14+1wgwX67Ow2zRnbnat4NuA0QAagqZOuZTWnsFv p723FnU7ZKQtAbXfz5XM42a88nkEDCZmWIBoVsVyLboO6GPd9A8x0nVBxtdlJDXKgwsU 2IHKn8FiJPKEghLHvBP1brDjTmZ/cIMixeRsOHc+B4aRrRpx3O7nzr+7+8d2R9Ao/6bw knfTShNzuWoWB6ASbx9UAnVGTq5CRNa4PLYgGjt13BEtWGxEz5JGxmOqZ5v/y6s1r0Bg Ycem4kDoUPYYPowazcDRH9PD+dU0H6TKLW6gesxRcUXQ2i2Tfz8FXK6RlX3lFlDkUZkJ sGYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=XysxeZXMVtIeH/HMNCFjDBPdoEFWF2teWOQsdBNbsjM=; b=vS+D/4/uhNcfuSgyiopg/ENWgf7uQ1ZZg3tgO14WuziqFPbp8V9sEDyo4/j5ZsCUDv Q9BDfBb+TrpUA9g9igH7MMLDygmHNJh7q/sboGTui9r2FeB9lLlXSgSUd0GYzN865phh m1R60Um+whVOm7XeeS8QHNf3HtJiROk+wgFhvzM1suZnU9ZxpjRodWZ+ejAYwjJcaG6D TcUS0T+iqpUz3iXXlAioA5/1aE6mL56UTzPTzpePnmmWMNVm5EvNqTsmvKa4OjCG9axu 1rGbM3u627u6XZe3t6qOaMYToUCz8XWcV/9Q/MbMmZpYXfaQi3M7qFPOcZKxogTXqBiB By+A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a9si2012096pfg.61.2018.02.09.09.17.52; Fri, 09 Feb 2018 09:18:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752310AbeBIRRP (ORCPT + 99 others); Fri, 9 Feb 2018 12:17:15 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:53126 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751070AbeBIRRN (ORCPT ); Fri, 9 Feb 2018 12:17:13 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DAFD38190285; Fri, 9 Feb 2018 17:17:12 +0000 (UTC) Received: from [10.43.17.120] (unknown [10.43.17.120]) by smtp.corp.redhat.com (Postfix) with ESMTP id A32BB2026DFD; Fri, 9 Feb 2018 17:17:07 +0000 (UTC) Subject: Re: [PATCH 09/31] x86/entry/32: Leave the kernel via trampoline stack 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 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 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Fri, 09 Feb 2018 17:17:13 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Fri, 09 Feb 2018 17:17:13 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'dvlasenk@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.