Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4950517yba; Tue, 30 Apr 2019 06:59:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqy463g4AMnHLQ8HnaqRAIr0gz/trHj1/XE8NdEkj2EIXU05sM2tknRM8J7O+I+FboLY1lA6 X-Received: by 2002:a17:902:8345:: with SMTP id z5mr16824787pln.255.1556632785426; Tue, 30 Apr 2019 06:59:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556632785; cv=none; d=google.com; s=arc-20160816; b=vcaa2RwPbp4NWzh0f28c6yTU5uGlq0Jjc1etJ0s73vot9iosFiXInjoiuzi2JGX4zT qDQ/MipwlhedZS0HoFh+z9yF7G9bPOf+5rz7YgkGTZQhlBJHOl+IXsZXs2UpOr518ek5 LgpDQVbiHPUuIRc9wYyTHXTo1sL4H6ZJll1AlSin5tSV42G0IUa0PrTLhsTCDONtf011 RN+iHhCQITmodkK3shp+AuLDLJlVYptMIq0eIJ9HGKJZHxEFOJc4Z5SKX3Slb45P5jsf hNugSlqNx3M0Raa+XvimhL7D8AlxE2ckf+V8xu2cUEA0n7+T3q4UMGDFsCWwuXw2AF68 UHgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=NS87uwDQqCa5ycxzBLjKsw5By0nZC4LG/TYFnxCupVk=; b=Pw7WY+2paY9ivmeRGQDfz/zdmWqhEPLj8QGIxVLmuQjQJClV6F1/vrr1RHEkrvt+L/ OpI0vefxgiAHIuE0ujbcYASMLVJCNn0c5MftiyIJQPntk8rMJATJ0GnA2n7E4J8ecYsX MH4RAL6FAkUwdxprJnJvRqZchTvF1DQwaJlgtcJrU242WjVCoTrp5kk3xIUDWhqPQwHl nuasXsrrNMdgYV7b12liKbcyCYLaEtste/K8u5l2bVLOxRrDq1B2Lf3d2gn6tObGwBCK cqeDHpu7A8Pq+OYTlXCMrglsCvdKrSAp8TaKbXovkf1OvmSIVwMg4ifuBfz4uJC2NphE AmFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=H8XTc5j2; 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 f12si34260935pgo.388.2019.04.30.06.59.29; Tue, 30 Apr 2019 06:59:45 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=H8XTc5j2; 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 S1727728AbfD3N4f (ORCPT + 99 others); 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.