Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1078088yba; Thu, 9 May 2019 10:21:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqywP4UsoWEdu9myeQynm7vWhrQpvOksfnyvmPT79c3B8pneB5I8hVzku5ZdcsI0bOdbm5LS X-Received: by 2002:a17:902:7e04:: with SMTP id b4mr6715456plm.211.1557422481336; Thu, 09 May 2019 10:21:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557422481; cv=none; d=google.com; s=arc-20160816; b=CcROdCJidYZC4aX3D6FQibK83IULLZjkw4tDNq5UY8RnS7pl4kb7XALtzl//dNWxXJ /ZzRPGsOmLO0dl0+LqWfH4eWCOrLiwH3iIy2hfaiF6/MpP4f6F+FBu0FkA7/+jSQ2lVp NQWrfEhoPz4915on00rWrvQIVm8liobyY7ZQjX8/8NWevOgp5lKKtPbx6ERYGd6Hsa/3 e02MV91rV34KWkO7jPLPs8lC6VUB1IOGzeudbt9fqm8QmXO2MiG6IffqWs3MOrBV4ypc BkjYvUMj6FwdJo+8oVtZ2C75oNPFMY1gKcNp2cVE/D1kXQCGoI20lBBcICC5d1dDdv69 aUuA== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=h9oK3RsLQP7A0Z8d5uEJwqxM0kwLaT657qEgfdThiz0=; b=U5dh8t6E/tOrphxP/hctOG5N+yDUrtBVezLyYsK0257tQMCVuMnkiQ5AjjV7R2Mqig YxVwjTVdKffOyqTHw+x+UXbyxc9KmxQHByrhBns3wVzhxtoAfXTp5cJJSxf3EKqd59/X mWm+wlTuUJW0gna6ovOf+gccItdqb7U+6YlMMAyRb5DigOAPAhqoAJ/tLU2myd5MNy7b tzH3o5DkZ9kvp+XVn2Xe1LkLAVHI8YJTCYgswT1Cun9pV1zok6ynZGUloZb0H3maGSN6 qAGzzaCF5fneOPSz8/an/uXAqv3L7kWbPbKIn7azrnm8C2mqNmwZXt9GaVKAZC29i2yb JfYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="ZmDFKam/"; 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 c7si4322807pfp.40.2019.05.09.10.21.05; Thu, 09 May 2019 10:21:21 -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="ZmDFKam/"; 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 S1726824AbfEIRTC (ORCPT + 99 others); Thu, 9 May 2019 13:19:02 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:52004 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726620AbfEIRTC (ORCPT ); Thu, 9 May 2019 13:19:02 -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-Transfer-Encoding :Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To: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=h9oK3RsLQP7A0Z8d5uEJwqxM0kwLaT657qEgfdThiz0=; b=ZmDFKam/fMA79ssTdityQOLPmr IksuipOforKZi0mU4GnsCvS63QktfJcCEqwLiBqsvQObZ8YTIzQ/diRiczfU6MMxVoRdkKLvIaLzZ 26CrOAvas1A6QpLFWO+4ipn/jQk4ShpkE2YvdG0JU//CoZbWiUClosxmP3AkKbAKz25OTkXcjOBNS GKDFSYEVgy6DWEizZvJ9OFlq5Mg4qpRDcVStqjVqsU4xC43zdMAMwmBbIOb/L1vVjl6feijiY5tr/ lcIA42F9qSapoW0//LhPr+tc+qk0Q+aAhuAgzw7rDgnzhm8yZO634in7uWey3LbQ+h6W+qjrRK6Lk y/cyfYVA==; 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 1hOmgs-0006Dd-Jr; Thu, 09 May 2019 17:18:42 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 981EF2019FECA; Thu, 9 May 2019 19:18:40 +0200 (CEST) Date: Thu, 9 May 2019 19:18:40 +0200 From: Peter Zijlstra To: Andy Lutomirski Cc: Masami Hiramatsu , Josh Poimboeuf , linux-kernel@vger.kernel.org, Linus Torvalds , Ingo Molnar , Andrew Morton , Andy Lutomirski , Nicolai Stange , Thomas Gleixner , Borislav Petkov , "H. Peter Anvin" , x86@kernel.org, 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-kselftest@vger.kernel.org Subject: Re: [PATCH 2/4] x86/kprobes: Fix frame pointer annotations Message-ID: <20190509171840.GZ2623@hirez.programming.kicks-ass.net> References: <20190508074901.982470324@infradead.org> <20190508080612.721269814@infradead.org> <20190508115416.nblx7c2kocidpytm@treble> <20190508120416.GL2589@hirez.programming.kicks-ass.net> <20190508124248.u5ukpbhnh4wpiccq@treble> <20190508153907.GM2589@hirez.programming.kicks-ass.net> <20190508184848.qerg3flv3ej3xsev@treble> <20190509102030.dfa62e058f09d0d8cbdd6053@kernel.org> <20190509081431.GO2589@hirez.programming.kicks-ass.net> <81170F0B-A2BB-4CD6-A1B5-5E7E0DDBC282@amacapital.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <81170F0B-A2BB-4CD6-A1B5-5E7E0DDBC282@amacapital.net> 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 Thu, May 09, 2019 at 09:20:06AM -0700, Andy Lutomirski wrote: > > +ENTRY(call_to_exception_trampoline) > > + /* > > + * On entry the stack looks like: > > + * > > + * 2*4(%esp) > > + * 1*4(%esp) RET-IP > > + * 0*4(%esp) func > > + * > > + * transform this into: > > + * > > + * 19*4(%esp) > > + * 18*4(%esp) gap / RET-IP > > + * 17*4(%esp) gap / func > > + * 16*4(%esp) ss > > + * 15*4(%esp) sp / > > + * 14*4(%esp) flags > > + * 13*4(%esp) cs > > + * 12*4(%esp) ip / RET-IP > > + * 11*4(%esp) orig_eax > > + * 10*4(%esp) gs > > + * 9*4(%esp) fs > > + * 8*4(%esp) es > > + * 7*4(%esp) ds > > + * 6*4(%esp) eax > > + * 5*4(%esp) ebp > > + * 4*4(%esp) edi > > + * 3*4(%esp) esi > > + * 2*4(%esp) edx > > + * 1*4(%esp) ecx > > + * 0*4(%esp) ebx > > + */ > > + pushl %ss > > + pushl %esp # points at ss > > + addl $3*4, (%esp) # point it at > > + pushfl > > + pushl %cs > > + pushl 5*4(%esp) # RET-IP > > + subl 5, (%esp) # point at CALL instruction > > + pushl $-1 > > + pushl %gs > > + pushl %fs > > + pushl %es > > + pushl %ds > > + pushl %eax > > + pushl %ebp > > + pushl %edi > > + pushl %esi > > + pushl %edx > > + pushl %ecx > > + pushl %ebx > > + > > + ENCODE_FRAME_POINTER > > + > > + movl %esp, %eax # 1st argument: pt_regs > > + > > + movl 17*4(%esp), %ebx # func > > + CALL_NOSPEC %ebx > > + > > + movl PT_OLDESP(%esp), %eax > > + > > + movl PT_EIP(%esp), %ecx > > + movl %ecx, -1*4(%eax) > > + > > + movl PT_EFLAGS(%esp), %ecx > > + movl %ecx, -2*4(%eax) > > + > > + movl PT_EAX(%esp), %ecx > > + movl %ecx, -3*4(%eax) > > + > > + popl %ebx > > + popl %ecx > > + popl %edx > > + popl %esi > > + popl %edi > > + popl %ebp > > + > > + lea -3*4(%eax), %esp > > + popl %eax > > + popfl > > + ret > > +END(call_to_exception_trampoline) > Potentially minor nit: you’re doing popfl, but you’re not doing > TRACE_IRQ_whatever. This makes me think that you should either add > the tracing (ugh!) or you should maybe just skip the popfl. Yeah, so we really should not change flags I suppose. If this lives I'll remove the popfl.