Received: by 10.223.176.5 with SMTP id f5csp945578wra; Fri, 9 Feb 2018 09:45:35 -0800 (PST) X-Google-Smtp-Source: AH8x225SxIgYLje3ELKSz/HK4Sscpo8q699DPrDSHhR9X3I9jE5NbRhZYQOgifno9AhgS1jrPCIU X-Received: by 10.98.59.5 with SMTP id i5mr3662527pfa.146.1518198335549; Fri, 09 Feb 2018 09:45:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518198335; cv=none; d=google.com; s=arc-20160816; b=xrNqen7kuptHxidSp59Vx4Jwy5upK17szNmPcHNiz7lAeC9CkgVKxuCPzkwv5FRfMk 4WDN8VNaf32wO//QJki0rxR2rjiiZ6Gsx8cuCGaUMkkburQG4aV8SYj2YPtStvkdJc92 mZA1Kur7u4McQVgifB7uB5O5+E+ErO78+6+GD5a9ovJTdUyM1XKLKGGqo3mrTZqrQRAd UTxyYiBACM9/ox7zC5NY92mu1cWlfJ0PMdbMlKZuDP6T5sLSzbOl2h0eSJjfXJ8HNy24 e3gl6XRaIspIoB0C/cj+A2MY0E7bANNy9tSiFRdhyqcqBe6Kyai9eglKxYG9V7Wn9b+/ 8/+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dmarc-filter :arc-authentication-results; bh=P8KTBg3iLuVyL9jSaX8eR7aypHZCGYIPCvaNHp4ulkM=; b=mx4rL516yq7q68/eic6mXw1/XqEcmbrWakOqALR2Dks8FkfJYTR/mIBbDpvJItb8UU ws1/NMCrWW5u4S5E+DKQJwGjJBN5DhLdlEK4r0X13Rz9E2L4DO7zKBNX7wZm71r3h/nt IiOBVWhc4u38ZBi3Vgx6iW6kEJbHuuSUJibe4uJUivXEU9X8dmzY1GmjX2B4+3uMab9b /0RUxVIjzzvKVkCqW1stcEwQfa7HsSp6iXJqVMPcaba8Vl2NnYXIwUgHnTIAbDw2WLu/ gC0c2dGAUJYuNya+Gw+ouD7OhsWcMeN8oL0yU0IuglQ3WrwFfUAV8/TnqNApdpHSciF1 16Kw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m14si13719pgt.277.2018.02.09.09.45.21; Fri, 09 Feb 2018 09:45:35 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751700AbeBIRoR (ORCPT + 99 others); Fri, 9 Feb 2018 12:44:17 -0500 Received: from mail.kernel.org ([198.145.29.99]:55808 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751070AbeBIRoQ (ORCPT ); Fri, 9 Feb 2018 12:44:16 -0500 Received: from mail-it0-f41.google.com (mail-it0-f41.google.com [209.85.214.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 027D2217AA for ; Fri, 9 Feb 2018 17:44:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 027D2217AA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=luto@kernel.org Received: by mail-it0-f41.google.com with SMTP id k131so11904495ith.4 for ; Fri, 09 Feb 2018 09:44:15 -0800 (PST) X-Gm-Message-State: APf1xPBCuy+MrXqu/B+XZkvD5ydLQ+MzuBxn4GkCq8g1gD3YLllgyvWu v9INQ87ilGvFZ1PsbJRwR5FHlAMVDaD1uWgtfBGaDA== X-Received: by 10.36.214.9 with SMTP id o9mr4255542itg.132.1518198255507; Fri, 09 Feb 2018 09:44:15 -0800 (PST) MIME-Version: 1.0 Received: by 10.2.176.212 with HTTP; Fri, 9 Feb 2018 09:43:55 -0800 (PST) In-Reply-To: References: <1518168340-9392-1-git-send-email-joro@8bytes.org> <1518168340-9392-10-git-send-email-joro@8bytes.org> From: Andy Lutomirski Date: Fri, 9 Feb 2018 17:43:55 +0000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 09/31] x86/entry/32: Leave the kernel via trampoline stack To: Linus Torvalds Cc: Joerg Roedel , 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 , Denys Vlasenko , Eduardo Valentin , Greg KH , Will Deacon , "Liguori, Anthony" , Daniel Gruss , Hugh Dickins , Kees Cook , Andrea Arcangeli , Waiman Long , Pavel Machek , Joerg Roedel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 9, 2018 at 5: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. > The 64-bit code mostly uses a bunch of push instructions for this.