Received: by 10.223.185.116 with SMTP id b49csp518504wrg; Sat, 10 Feb 2018 12:19:09 -0800 (PST) X-Google-Smtp-Source: AH8x224eY0/UStdF47U04nqTW9YwDwVCRn6VOaZeeyuLtprjAngXVd1Gq+lD2hawj01bD58nB5/h X-Received: by 2002:a17:902:1c1:: with SMTP id b59-v6mr6368909plb.325.1518293948909; Sat, 10 Feb 2018 12:19:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518293948; cv=none; d=google.com; s=arc-20160816; b=YriOHRz1U6pPw03QVG0N7hAwrQUSVyeI+CY6ixxJRo25Os3cFnXA5gJNFChWQlNj+N 6cePJnbHS2UIiZ9jsTequibF4dH1FxOzKz66yGIqOQKI1uuf10nTBP8P0CRBIcGmtOKs nECcxTZ2SVWhaBnWoWcC/oIaUgVleMxc6WLJaEY7sIiOpnBEvSC6EyOeCbGyOWZInYRA 7XxS9gBnR82J57kTQ5ogBeVQg6Ao31HBhY+DF54NDw7nooYTNSo9Ll/YteOmIzlUhdY/ /EtbZ0FH68fgdDSXp0Ag9AdNhM/RqVfSZT6c0A3d42O9p3NuFLcc6z1rI5+D1vLuQWc/ /J3Q== 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:dkim-signature :arc-authentication-results; bh=5DqJm5YGfCXe/ZoaNAp21MK1DqvzkYY0Fu93uulpIM8=; b=NzSsK4awBihixRYr6pwxR3MGZX3cP0DV7dFzaGN05CZ4mKLW9xIMocDGxIufvzPNRp tiUtZNqSJ7hMm5hJZCKWTFQCSfahYFSiGmFFzvDLfN7D8kUGWQQpeGEAPkbDsIJgKx6S d5Sy4GyLtv2VfShpCnawT1L6I7M+wWLIg2t4D9t7+hBrDDKkJOz8oiE9UqwnpE7MQN0X rU+VqAoU9xgz9hjCd9gHcvdKvUyTO+b+8UQrO1wCEQGR2ctQfXr8LQoiVnlERMUKoPt7 Y/Ye0j08Ehc3ajr2Ah3wLryMKc0PQdqBApmXPDOxcCDkxIl57Md1s8nL7FdcBxqJ9Knb zkbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=gBlIkiNq; 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 t5si3716252pfj.99.2018.02.10.12.18.54; Sat, 10 Feb 2018 12:19:08 -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; dkim=fail header.i=@gmail.com header.s=20161025 header.b=gBlIkiNq; 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 S1752222AbeBJUSU (ORCPT + 99 others); Sat, 10 Feb 2018 15:18:20 -0500 Received: from mail-it0-f66.google.com ([209.85.214.66]:39375 "EHLO mail-it0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751182AbeBJUSS (ORCPT ); Sat, 10 Feb 2018 15:18:18 -0500 Received: by mail-it0-f66.google.com with SMTP id c80so2361394itb.4 for ; Sat, 10 Feb 2018 12:18:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=5DqJm5YGfCXe/ZoaNAp21MK1DqvzkYY0Fu93uulpIM8=; b=gBlIkiNqBXBRwHEZaIhm4vH4Flczxt3fjImn3n7tWUK9R1bl8zLdl9x+yh7bQLJgDY A9izOHss1Jllu1XiXqxIG7F8lWv+Ga9sIAA/dtJvDszqDrS/YzGACbwmK6p9kIE/s6Yr pqNXTRplQulcsQIAHt3GFKig4TFFPXHMId917cJGKWoUkPBAzJcgUkYjTqdw/ZTRFqmH bbOVOWGIAOyPPAgp7H/vcwIfNlezobcYp4YnM0opaUEtq+4/bjANgwpoBFZ9ITZbK3kL AKLCPu44ib6WpJpTJZNUab8TzgyvU6rwyIhlaLw0rRGS+WKcCeCKuup7fSn2BXkBy41s ypPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=5DqJm5YGfCXe/ZoaNAp21MK1DqvzkYY0Fu93uulpIM8=; b=r75qR78hHqq+zEnPhSo8mF2JDPy4xJd8+fJ8waHI7VGbMvK9xL5lkePaRvV8qEFQNs GbL0lG22SBcmDFb5M73K7Dl8c+GblCYQN9fgT2DVMiO0E0nFFSbDcJG5AEinD27D0x2d nGExLYwmeQ4qXqU+QjAfP4qvPajHhvaseiYP5TEGRy6SZM5HnNocKWnhyKqkJtexx3q4 f+j2zzKd9d867nHfI5sn9lH3FQ12IDvSoGbOanZx9pCTGuzvn4UtbDDQ/H1ZUhNOS2wv RlvcF8ZnrSCfNx0xgfw0UjgfGvwkxUPsjJYBj6ukmQHxljTLskG6BxGjvUCOlwknU+vX /h/g== X-Gm-Message-State: APf1xPCP2LN5+NQ6lsDHSJswaxtsY3Tc0wzoDNA55pKJg9hFkXizI/TO QGTsB6mx/UZuBnSj3aMP0rvo8hQ3PoZcDdfAS+o= X-Received: by 10.36.179.14 with SMTP id e14mr8643347itf.139.1518293897935; Sat, 10 Feb 2018 12:18:17 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.59.196 with HTTP; Sat, 10 Feb 2018 12:18:17 -0800 (PST) In-Reply-To: <50431bff2cda445490f5242c1189c8cd@AcuMS.aculab.com> References: <1518168340-9392-1-git-send-email-joro@8bytes.org> <1518168340-9392-10-git-send-email-joro@8bytes.org> <50431bff2cda445490f5242c1189c8cd@AcuMS.aculab.com> From: Linus Torvalds Date: Sat, 10 Feb 2018 12:18:17 -0800 X-Google-Sender-Auth: CSQIqAjjyMekQx_MqWVreHvkCSs Message-ID: Subject: Re: [PATCH 09/31] x86/entry/32: Leave the kernel via trampoline stack To: David Laight Cc: Denys Vlasenko , 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 , 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 Sat, Feb 10, 2018 at 7:26 AM, David Laight wrote: > > The alignment doesn't matter, 'rep movsl' will still work. .. no it won't. It might not copy the last two bytes or whatever, because the shift of the count will have ignored the low bits. But since an unaligned stack pointer really shouldn't be an issue, it's fine to not care. >> 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. > > It very much depends on the cpu. No again. It does NOT depend on the CPU, since the only CPU's that are relevant to this patch are the ones that don't do 64-bit. If you run a 32-bit Linux on a 64-bit CPU, performance simply isn't an issue. The problem is between keyboard and chair, not in the kernel. And absolutely *no* 32-bit-only CPU does "rep movs" really well. Some of them do it even worse than others (P4), but none of them do a great job. That said, none of them should do _such_ a shitty job that this will be in the least noticeable compared to all the crazy %cr3 stuff. Linus