From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B583C43219 for ; Tue, 30 Apr 2019 13:56:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DDF0B20675 for ; Tue, 30 Apr 2019 13:56:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="H8XTc5j2" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727739AbfD3N4f (ORCPT ); Tue, 30 Apr 2019 09:56:35 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:53398 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725938AbfD3N4e (ORCPT ); Tue, 30 Apr 2019 09:56:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=NS87uwDQqCa5ycxzBLjKsw5By0nZC4LG/TYFnxCupVk=; b=H8XTc5j2ZI2Vzp8lcHgyTWodr mwzl5LQi5LGfHTMv1K3gjDJxbBwKoNDshvjXn8jdOx/xQ7Yuq+UkY0po0Jlxv8EVlFQ8E1eY/3Db8 MPKfIuYD3O2UisrYjZ/S5sQBaKs5MtFOK3X2sHwLEmur/IyAGe8Lm0+I3RV2nOJlAzRG1TVFYWT2h FUFPC3mnB7yh5aFabW6f7AkR28Qp2qMdPzb2leUPJ6Rc9OvX4LtNnU1tSzN1nwkY59fny3YqvU+wl EvOwqe01uzxNZOZVYguRNTgUT1QVxdggMAwU6kjk2bmwqwtC3vtmOD1kN5iusaETy5+He6OVsw0KK V1QKStQSg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1hLTEq-00059H-1m; Tue, 30 Apr 2019 13:56:04 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 8A4A529B2FDBD; Tue, 30 Apr 2019 15:56:02 +0200 (CEST) Date: Tue, 30 Apr 2019 15:56:02 +0200 From: Peter Zijlstra To: Linus Torvalds Cc: Andy Lutomirski , Steven Rostedt , Nicolai Stange , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , the arch/x86 maintainers , Josh Poimboeuf , Jiri Kosina , Miroslav Benes , Petr Mladek , Joe Lawrence , Shuah Khan , Konrad Rzeszutek Wilk , Tim Chen , Sebastian Andrzej Siewior , Mimi Zohar , Juergen Gross , Nick Desaulniers , Nayna Jain , Masahiro Yamada , Joerg Roedel , Linux List Kernel Mailing , live-patching@vger.kernel.org, "open list:KERNEL SELFTEST FRAMEWORK" Subject: Re: [PATCH 3/4] x86/ftrace: make ftrace_int3_handler() not to skip fops invocation Message-ID: <20190430135602.GD2589@hirez.programming.kicks-ass.net> References: <20190428133826.3e142cfd@oasis.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 29, 2019 at 01:07:33PM -0700, Linus Torvalds wrote: > On Mon, Apr 29, 2019 at 12:24 PM Andy Lutomirski wrote: > > > Side note: we *already* depend on sti shadow working in other parts of the kernel, namely sti->iret. > > > > Where? STI; IRET would be nuts. > > Sorry, not 'sti;iret' but 'sti;sysexit' > > > before commit 4214a16b02971c60960afd675d03544e109e0d75 > > x86/asm/entry/64/compat: Use SYSRETL to return from compat mode SYSENTER > > > > we did sti; sysxit, but, when we discussed this, I don't recall anyone > > speaking up in favor of the safely of the old code. > > We still have that sti sysexit in the 32-bit code. We also have both: "STI; HLT" and "STI; MWAIT" where we rely on the STI shadow. Getting an NMI in between shouldn't hurt too much, but if that in turn can lead to an actual interrupt happening, we're up some creek without no paddle. Most moden systems don't use either anymore though. As mwait_idle_with_hints() relies on MWAIT ECX[0]=1 to allow MWAIT to wake from pending interrupts.