Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2766243imu; Thu, 29 Nov 2018 09:53:10 -0800 (PST) X-Google-Smtp-Source: AFSGD/WiJDGrCK6l+PclDG8zBFjYtPjDvj56VzYRkaZlFiOUux/2L4KgoPsvfS2EBfALKB63JB4t X-Received: by 2002:a63:c64f:: with SMTP id x15mr1994820pgg.16.1543513990474; Thu, 29 Nov 2018 09:53:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543513990; cv=none; d=google.com; s=arc-20160816; b=b4jWJtk7d86tRPtX4bTEDvKIU3olJGBXPmaV5M+qWI+p9eoKVvQw5e3KBOR2vAyUOd kQ4rqWuSSll2xV6ic9BKwV3HBbrwP5GX9Sd0oxjK8wQwZRKUTDgZocJJG4/bL/oeyDWM OzRSVc/zUnUC7GIrBPkGnRz9x7UZ8gimNM1MeNL56ajb6mJDfwH2lChj3F7U2PfWlChe oCk6nTlEn6emVJvzjmBq2KAzDZPKtEyCl5JTZXgqJCJ6ug87YcMeoNsUjlHh0qO3vcn8 RBxFnMHWc7ykySqAPfaLb2LoAoUhkD2Ti+I3H/supsZ2QPmMndFM1H4rByoW4yNIzpU7 ZY7w== 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=9eAD1FlhoNaI8od/JETaoVJBfVG8KUjUrJgH6gdEefs=; b=qJ/Xj8ztpS40YpBCmkr/+xfJORsRR++7/dyqx06XE+T96cYlPJrJpXcfqKqGDJooay 7jqnBE67E8WKvJmyBt4OQ79LwZTaIPTZgMKcg484YXUWOBhmMe55CiItvQqMfROkRPh2 bzc4n2/WhkzgaipsBzgKPprb9rQecksCPaKalXBTWXaDm6pQqJwTpda8Wb4l86ELs3d1 OEKS97N/bZ0Rpj5dMSekdvjbirZfiIEA2x4Iy+ahIb65Y4DolbybHgpR8dnaQSjaXuD2 9glyf43Qcrk8h4IE/t6m2XdR20rAVEYzS9gJ7wwd294jAWAzB55uRHveurCr/xQg+uCW XZuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b="N4aj4C/+"; 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 j39si2684004plb.272.2018.11.29.09.52.54; Thu, 29 Nov 2018 09:53:10 -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=pass header.i=@linux-foundation.org header.s=google header.b="N4aj4C/+"; 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 S1731038AbeK3E5A (ORCPT + 99 others); Thu, 29 Nov 2018 23:57:00 -0500 Received: from mail-lf1-f66.google.com ([209.85.167.66]:40865 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730457AbeK3E47 (ORCPT ); Thu, 29 Nov 2018 23:56:59 -0500 Received: by mail-lf1-f66.google.com with SMTP id v5so2100309lfe.7 for ; Thu, 29 Nov 2018 09:50:48 -0800 (PST) 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=9eAD1FlhoNaI8od/JETaoVJBfVG8KUjUrJgH6gdEefs=; b=N4aj4C/+0fPBJ5+LMGSIrXc/on9r39woqdLZ0ZHErSm6GOzaBWC7k56Hz1kBRkGjUC hJdQGo5ScWD9H5YcOxCoBNZn7nCnNkXSBD1TVsD234RSJ+t1/luwgKQjQOwZAnZhv64f hrAfwWquiW9HLutDRyhd9NLkYkVDyXYkNvn2U= 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=9eAD1FlhoNaI8od/JETaoVJBfVG8KUjUrJgH6gdEefs=; b=ZfltxzupMuKa2CiE1HCFcL2X3VGzKMBSRZxQ+Ox9PexbbJjs0jAzr92Hi5AoL62x8d txMU8z7DWbHccsX/uDTstCd1f6XzbKTbVRgu0BPyKvBl7oqiCagyLvh3pCy14IvDVZTu TcxOnZvdyYt7qg9vSEogyXiT2Tv+j3aP39DJ+JrAaa5mjusbjp5wFMw/zePtw5djriP3 wLPj0H/DfJbIv7xkC6ZQApiwCSLaefPneDeckiuQ8dCfAXcFF0ChmpH9rQeNl4q25wTT hQN1bkIw0S9vBcFz3LHwl0SkrWqHTXFGtBrcJBTExhJI0uK4OZS8xpQ8oGDc6WqZqxhN NrJA== X-Gm-Message-State: AA+aEWaEEqc50S8IHvKHjXLIGScyweTOSSjcbjoGMrNoMnV5EIHb0NGX m8l6q3wbC2i2HlsF9l6hkFjOXNHCso4= X-Received: by 2002:a19:5d42:: with SMTP id p2mr1755143lfj.83.1543513846829; Thu, 29 Nov 2018 09:50:46 -0800 (PST) Received: from mail-lj1-f176.google.com (mail-lj1-f176.google.com. [209.85.208.176]) by smtp.gmail.com with ESMTPSA id p19-v6sm394400ljb.47.2018.11.29.09.50.44 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Nov 2018 09:50:45 -0800 (PST) Received: by mail-lj1-f176.google.com with SMTP id z80-v6so2529122ljb.8 for ; Thu, 29 Nov 2018 09:50:44 -0800 (PST) X-Received: by 2002:a2e:2416:: with SMTP id k22-v6mr1921520ljk.80.1543513843985; Thu, 29 Nov 2018 09:50:43 -0800 (PST) MIME-Version: 1.0 References: <20181126160217.GR2113@hirez.programming.kicks-ass.net> <20181126171036.chcbmb35ygpxziub@treble> <20181126175624.bruqfbkngbucpvxr@treble> <20181126200801.GW2113@hirez.programming.kicks-ass.net> <20181126212628.4apztfazichxnt7r@treble> <20181127084330.GX2113@hirez.programming.kicks-ass.net> <20181129094210.GC2131@hirez.programming.kicks-ass.net> <20181129143853.GO2131@hirez.programming.kicks-ass.net> <20181129163342.tp5wlfcyiazwwyoh@treble> <0A629D30-ADCF-4159-9443-E5727146F65F@amacapital.net> <20181129121307.12393c57@gandalf.local.home> <20181129124404.2fe55dd0@gandalf.local.home> In-Reply-To: <20181129124404.2fe55dd0@gandalf.local.home> From: Linus Torvalds Date: Thu, 29 Nov 2018 09:50:28 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 4/4] x86/static_call: Add inline static call implementation for x86-64 To: Steven Rostedt Cc: Andy Lutomirski , Josh Poimboeuf , Peter Zijlstra , Andrew Lutomirski , "the arch/x86 maintainers" , Linux List Kernel Mailing , Ard Biesheuvel , Ingo Molnar , Thomas Gleixner , mhiramat@kernel.org, jbaron@akamai.com, Jiri Kosina , David.Laight@aculab.com, bp@alien8.de, julia@ni.com, jeyu@kernel.org, Peter Anvin 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 Thu, Nov 29, 2018 at 9:44 AM Steven Rostedt wrote: > > Well, the current method (as Jiri mentioned) did get the OK from at > least Intel (and that was with a lot of arm twisting to do so). Guys, when the comparison is to: - create a huge honking security hole by screwing up the stack frame or - corrupt random registers because we "know" they aren't in use then it really sounds pretty safe to just say "ok, just make it aligned and update the instruction with an atomic cmpxchg or something". Of course, another option is to just say "we don't do the inline case, then", and only ever do a call to a stub that does a "jmp" instruction. Problem solved, at the cost of some I$. Emulating a "jmp" is trivial, in ways emulating a "call" is not. Linus