From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: AH8x225QTF8seIIYZF/0iDzRrzLj90TgTE++z811vK5S8uuvaF3JmogQS60qxCj9LTF+xZQEs8kc ARC-Seal: i=1; a=rsa-sha256; t=1517334534; cv=none; d=google.com; s=arc-20160816; b=y5Z8lf/Bwx1ABLEvc5IpS0DoWkDHtVsE5bi5ZhaSMU0wBKGij+7q4zLMFUFb0TRu2p jYrqBx5ISyjckrOCVwZmwkeFNvuRIARGdkZrhFOdnbPQrNRdRP8v89gqaWgZyO1XG4UT Y6Y6rdELMPB1XceWrJUJp9rgKl+lJ2SAOl9A5ZVXMtG/nY0UXrMDTHVmZb6DMyDexAN5 1RyzXUSKbS1+IbGuDknUT0FRr04xsNI/GYhZHUsfGSNB/KV+53rjWS7T1qRJQebLpNmk J0pzMM8y9/oQJi5LGT0P75KAKRZkW4Mo+6Y6CZOAyyFi28MQPiSkPzKJrRbcc9h4YorR eG9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:arc-authentication-results; bh=XX51hV1NAhQHfS6Dq/QjC18wOiaC/blOR7NL8iip2JU=; b=bT20CLB+fYjAEyVwPSzzzYUWwegYBqVz4BO8UkM0aYCvcUazu6lJ6jfNoxVfhbWKj1 qwwOjK5PIsa8KakQ4Aa1lRGkNVdbgmvD+v8YxuzDBsubC1UsOl794J1sAgDuHleT4LXY JCBoQKMH3qSMsbWDXhCD2+XPh5AulfMRINNeZAPuyeRES/xjg0Uu7n5MKe/m+WHOLaGL gdL7Mg07MgUckb8A2xmGJDxxu9AAUoVTuqUMgb3wL9OsbTKKQ8LAv9Dfm9qQFmTjIW+0 vuzQrraP0zeFU77m6Mi/a/kPKyy6XK9eNK2a5B10UiDpaJc+uiYhq/yfTctL4SD9ztjL pTeQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of jpoimboe@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=jpoimboe@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Authentication-Results: mx.google.com; spf=pass (google.com: domain of jpoimboe@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=jpoimboe@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Date: Tue, 30 Jan 2018 11:48:50 -0600 From: Josh Poimboeuf To: David Woodhouse Cc: arjan@linux.intel.com, tglx@linutronix.de, karahmed@amazon.de, x86@kernel.org, linux-kernel@vger.kernel.org, tim.c.chen@linux.intel.com, bp@alien8.de, peterz@infradead.org, pbonzini@redhat.com, ak@linux.intel.com, torvalds@linux-foundation.org, gregkh@linux-foundation.org, mingo@kernel.org, luto@kernel.org, linux@dominikbrodowski.net Subject: Re: [PATCH] x86/speculation: Use Indirect Branch Prediction Barrier in context switch Message-ID: <20180130174850.bwypk4r5yn2344jb@treble> References: <1517263487-3708-1-git-send-email-dwmw@amazon.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1517263487-3708-1-git-send-email-dwmw@amazon.co.uk> User-Agent: Mutt/1.6.0.1 (2016-04-01) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: =?utf-8?q?1590966106432961445?= X-GMAIL-MSGID: =?utf-8?q?1591040576942996088?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: On Mon, Jan 29, 2018 at 10:04:47PM +0000, David Woodhouse wrote: > From: Tim Chen > > Flush indirect branches when switching into a process that marked itself > non dumpable. This protects high value processes like gpg better, > without having too high performance overhead. I wonder what the point of this patch is. An audit of my laptop shows only a single user of PR_SET_DUMPABLE: systemd-coredump. [ And yes, I have gpg-agent running. Also, a grep of the gnupg source doesn't show any evidence of it being used there. So the gpg thing seems to be a myth. ] But also, I much preferred the original version of the patch which only skipped IBPB when 'prev' could ptrace 'next'. If performance is a concern, let's look at that in more detail. But I don't see how the solution to a performance issue could possibly be "leave (almost) all tasks vulnerable by default." If the argument is that everyone should "rebuild the world" with retpolines, then this patch would still be pointless, as we wouldn't even need IBPB. -- Josh