Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp660724img; Mon, 18 Mar 2019 11:19:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqyn/X3axkNX95Bs/gyQPkLE3tIA8NqXXAs1vetlCLfFYOv21hszrnpV0A1067DORrT/VZgO X-Received: by 2002:a65:6554:: with SMTP id a20mr18860032pgw.170.1552933145160; Mon, 18 Mar 2019 11:19:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552933145; cv=none; d=google.com; s=arc-20160816; b=Wg9fQLbRZPWP8FrHRVVf+HT486V4A7Cf4t/5MIA7nE4GTITSrOebPGnqSqcy5RML7o yQqAKcnCxZJ/Wj3y1ZpcE+RnTVh6gJ+cTGwT+2srrd+zN1Mv1aP1qF0hRPcwIvzWdH40 bTQpGOD7DIMf/CvbiiR7QXlN/HlaVfBeh6GxZfCG/XTUEY21eL2PwcccUDZMv9ekSISW he0mzZsmB+Kk4CjNorRSF3Kz0wp++b/ooTcVRCNL+J1xHJzzR10UjmXBsUUiecx6nVuA WGn727rw6hSu1wMTiWBLcGCaH4e6FNoGroRmUsf5un4RK/47ih3PLAednBL0eZrDd7A4 BCag== 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 :in-reply-to:references:mime-version:dkim-signature; bh=UdsCkIVdw68rRdzVGZvJmOdhvTueF9O0zaboX1ty06E=; b=VhNHoIQ3dIaREzx4t5KUPFK/ag1HdBHVytkFUvEI73fj5Y6M7+GvQHtTkgOGXkjSga MyLuoPCMvzNT7Zzi0cFRWGHiNO9qOBh+B6W0uzsicVhwk6NMszUp3UeD1nJFCobsCTfW Mj6owA4O6Nay2LnkIgkFA60XM01DWvjgAcjqJ1vno2TVRCcjlMtErF88Z84F+SgiLBgJ 8ApOArNHGOWsoy+SHiSWGmv8rmemSNU8ZQjnyynbROQfVEDYdv0RQUSs3aSfbZwGYDPp NSu9Iv8X8dFU7NQRkrygCsfMCDrBXNjDfAL8Tw8EJsaQVDvMgJqNHPkZke/HJr0sAd7F 41mQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=gVjbBeGa; 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 a4si10004771plp.431.2019.03.18.11.18.49; Mon, 18 Mar 2019 11:19:05 -0700 (PDT) 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=pass header.i=@linux-foundation.org header.s=google header.b=gVjbBeGa; 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 S1727135AbfCRSQR (ORCPT + 99 others); Mon, 18 Mar 2019 14:16:17 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:35841 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726703AbfCRSQR (ORCPT ); Mon, 18 Mar 2019 14:16:17 -0400 Received: by mail-lj1-f195.google.com with SMTP id v10so14961805lji.3 for ; Mon, 18 Mar 2019 11:16:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=UdsCkIVdw68rRdzVGZvJmOdhvTueF9O0zaboX1ty06E=; b=gVjbBeGaRuXWfxnw2PgJLqcu+kZy5YrsflyzciEpWRf5FWI1cwc4L4k8UVi45ePpPU 2Fx+Q4epYVLypb0XS1Ex2jC8QOPFr2sHCVkudEy/b+qYvx3nibrpXxje5Reb+zobWh/U vPNpujfuyYJN4DBJKwMUuDYSrNpQRZQUsWgCY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=UdsCkIVdw68rRdzVGZvJmOdhvTueF9O0zaboX1ty06E=; b=aT8NYkTkHpVfbrK2VHAFcNhxvnzi4cSNsmGXzYG07MBlJqPfx1yJPMMA/cHq6X2EvI VRPV8ImFD7CsZNMKSO5UXWOrwkXUMkI0wdRxGbPryLmt8MLQRIdr34RhNOaD1fDSTYgD kVoiGaJ+podqyoUrEtJSeJec6Ll5v+0wvNPhU+BrDqgBM9hPVxscFnze2bPHp31YiG9Z hCbywPQwlln+pO8OLpy+NOlW3Owr73SzSuZ81tlJlVjVyBeh0iP8igwhaqsxYdeZ53Yv Xt9cJ1Ff48zzgzp7wyVclNqb+Dsl39QsCcO9qgu5Mj4+PUXQclsYQRATKO1qOePXOPFe Ji7A== X-Gm-Message-State: APjAAAXC0tPWgftvHHFd04DB1ELQh/uVJ2EyGaFEZLTaCeK+JP0sYB/q cRwbaUnHBo5bGYM2+Oo6zVDmRmFdy84= X-Received: by 2002:a2e:8508:: with SMTP id j8mr2801735lji.26.1552932974942; Mon, 18 Mar 2019 11:16:14 -0700 (PDT) Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com. [209.85.167.50]) by smtp.gmail.com with ESMTPSA id q9sm2139319lfk.40.2019.03.18.11.16.14 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Mar 2019 11:16:14 -0700 (PDT) Received: by mail-lf1-f50.google.com with SMTP id 5so466930lft.12 for ; Mon, 18 Mar 2019 11:16:14 -0700 (PDT) X-Received: by 2002:ac2:424c:: with SMTP id m12mr11243580lfl.62.1552932638336; Mon, 18 Mar 2019 11:10:38 -0700 (PDT) MIME-Version: 1.0 References: <20190318153840.906404905@infradead.org> <20190318155139.963285969@infradead.org> <20190318173657.GV6058@hirez.programming.kicks-ass.net> <20190318175135.GE6521@hirez.programming.kicks-ass.net> In-Reply-To: <20190318175135.GE6521@hirez.programming.kicks-ass.net> From: Linus Torvalds Date: Mon, 18 Mar 2019 11:10:22 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 01/25] x86: Make SMAP 64-bit only To: Peter Zijlstra Cc: Thomas Gleixner , Peter Anvin , Julien Thierry , Will Deacon , Andy Lutomirski , Ingo Molnar , Catalin Marinas , James Morse , valentin.schneider@arm.com, Brian Gerst , Josh Poimboeuf , Andrew Lutomirski , Borislav Petkov , Denys Vlasenko , Linux List Kernel Mailing , Dmitry Vyukov , Steven Rostedt 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 Mon, Mar 18, 2019 at 10:51 AM Peter Zijlstra wrote: > > How about I do a patch that schedules EFLAGS for both 32bit and 64bit, > mark this for backporting to infinity. > > And then at the end, after the objtool-ac bits land, I do a patch > removing the EFLAGS scheduling for x86_64. Sounds sane to me. And we can make it AC-conditional if it's actually shown to be visible from a performance standpoint. But iirc pushf/popf isn't really that expensive - in fact I think it's pretty cheap when system flags don't change. Which would be the common case unless you'd also make the popf do the irq restore part and simply make finish_lock_switch() re-enable irq's by doing an irqrestore? I think popf is like 20 cycles or something (and pushf is just single cycles). Probably not worth worrying about in the task switch context. Linus