Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp6438173yba; Wed, 1 May 2019 12:17:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqzH92CdvBUDHWRpSnbsL1vic72tD5XyUoA0cWjrLUVLIBB9IqrleBeApg12krbtQRpYvQmD X-Received: by 2002:a63:d408:: with SMTP id a8mr42631125pgh.184.1556738227600; Wed, 01 May 2019 12:17:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556738227; cv=none; d=google.com; s=arc-20160816; b=Ick8exZqgagn7+D+8jbcEV7L+HghA/Wh6aEVaaa6B58hV5guTxXD34xsZt1C+lXU/2 i4Yw3kST5+f3yQ8+zSJoF5Y7rZiwnoMpTQTLWCEQFDFTlHvIYwq2GhLchX1QYuc+FcsO /oZDmHZUSjYf31bODsqTf3CDIkkniKW0j+bFjBwHl/hd/EAuwcznTItTv1HVlNf4xrh/ rY86gbXvj1fIKQoIdl/N419wrqHe8B+WkRWzYo7PC30rsVlZwtsLEjTl1QegmE6V4m+r shqzBqN5wvIFPYqogeO3US0M3GObeTX7Dj50AbWvTceRlqfHgWI4gqYRmsOSUy/nqTst flOA== 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=CQZu/nhAN5edPKc+7iLxYRmq0e/3BquQrybqmy+ub08=; b=E5bO9I09MavaKH8Vjymu0aw2Qz6HrcCVi1+NrUDZEMssKvow0X+2CQ1SZObSAcbgUM QJ8VHvGON/0rS6W4LunhKf9cSOm8UNlZ56yPnqlHs46Lp17W7xC7K31gL247Yr8TxeJM AB3PpOX+MFyGhPuWPMzqBwOpcB6WEC9EEoPUNbWUrdrYd+cpReVSjGpySe9kzl4sxTqJ mFt+QXdUGulHauv6Gqhe58QjE7awVxfIPWnmt5/nMWSgKlCKLwfucd4FSCkGEOSQuLfw UCgXK6jn7ZQO911gUvJukl9AL7Swgu3n9YZgCpKF1FSvV7sPC3ISXtuVpv2TwHA0hsAi Sq2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b="kV7BH9e/"; 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 x1si13071871pfo.49.2019.05.01.12.16.52; Wed, 01 May 2019 12:17:07 -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=merlin.20170209 header.b="kV7BH9e/"; 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 S1726183AbfEATOI (ORCPT + 99 others); Wed, 1 May 2019 15:14:08 -0400 Received: from merlin.infradead.org ([205.233.59.134]:47726 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726019AbfEATOI (ORCPT ); Wed, 1 May 2019 15:14:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.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=CQZu/nhAN5edPKc+7iLxYRmq0e/3BquQrybqmy+ub08=; b=kV7BH9e/fZOTUtilmbKXOkCiV cz68cQ45IykgvQQvjPtQ91s1A3FHoc4l8yPl6DtyoAUW7psmDTq8TptOuHRy2DWwxof2ScJ0n26g8 +p3QtsdE8qhgm5ys0tT6IZP/bZVqrceefDeDn3zbQWrd0WSiBJnE7Dez8c9R1B5K96xBI5BzioGke aOQm85JWi3oV0BrQvPO3gcl2SE1WsnnhDDPHJZpLgGkuPaHyZ5hov9fbcukmlTq9Y5TcvpvRxWY3C +qIr+b+4qcPdAZqkigz6+8+61KkKJf2x7Hefo+6LTLtysSYIp4SLDWa351erSFGEgA45thEMbmePY Zk5Af9Wfg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1hLufX-0002s6-8q; Wed, 01 May 2019 19:13:27 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id 7370D984EB4; Wed, 1 May 2019 21:13:24 +0200 (CEST) Date: Wed, 1 May 2019 21:13:24 +0200 From: Peter Zijlstra To: Linus Torvalds Cc: Steven Rostedt , Andy Lutomirski , 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: [RFC][PATCH] ftrace/x86: Emulate call function while updating in breakpoint handler Message-ID: <20190501191324.GU7905@worktop.programming.kicks-ass.net> References: <20190430135602.GD2589@hirez.programming.kicks-ass.net> <20190430130359.330e895b@gandalf.local.home> <20190430132024.0f03f5b8@gandalf.local.home> <20190430134913.4e29ce72@gandalf.local.home> <20190501131117.GW2623@hirez.programming.kicks-ass.net> 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 Wed, May 01, 2019 at 12:03:52PM -0700, Linus Torvalds wrote: > On Wed, May 1, 2019 at 6:11 AM Peter Zijlstra wrote: > > > > Here goes, compile tested only... > > Ugh, two different threads. This has the same bug (same source) as the > one Steven posted: This is what Steve started from; lets continue in the other thread. > > --- a/arch/x86/entry/entry_32.S > > +++ b/arch/x86/entry/entry_32.S > > @@ -1479,6 +1479,13 @@ ENTRY(int3) > > ASM_CLAC > > pushl $-1 # mark this as an int > > > > + testl $SEGMENT_RPL_MASK, PT_CS(%esp) > > + jnz .Lfrom_usermode_no_gap > > + .rept 6 > > + pushl 5*4(%esp) > > + .endr > > +.Lfrom_usermode_no_gap: > > This will corrupt things horribly if you still use vm86 mode. Checking > CS RPL is simply not correct. I'll go fix; I never really understood that vm86 crud and I cobbled this 32bit thing together based on the 64bit version (that Josh did a while ago).