Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3731003yba; Tue, 7 May 2019 06:16:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqx8PNpSdJpu7yXdxqLtyDafF6BodUWmWFThFpf3bkR4Yqa2AUomrTCuktLbP0yBW4qpqVxj X-Received: by 2002:a63:4c54:: with SMTP id m20mr31556605pgl.316.1557235001337; Tue, 07 May 2019 06:16:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557235001; cv=none; d=google.com; s=arc-20160816; b=D5iZl50bnBP9ra64k6z7aZkRW9ckGenNlfwMRra9SRAdz0tkIbPw27+QOVi2wsXrrY vcsZojhLhzC4BXBGzvUUy+V6fsF2avcGAmYJvMticQHyATvU35V2TeHo953xokzSaU/V WkfhMRs6ksCAjWxKp+Q3Dcmacl3/4KalT4mChYHUjXiZ2OIFb3ciA3IGzgD0fEWVzjqi /Gy3HU9Lv36/sNeOakb3dxW5rQZ7GI2GzqMIw1hRuXdyLHFkAA5z/p3QtqnZaQBB8jYq zvSTXxvJLFNcZYi/suDbFSpZE83w/WZynXjZu99m6f9SGJkT6SLLsG/ihtdzTFvxYrS1 rwaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=Pg7IAnT0abALbYrqngP6+DFImPXLk5TBVfCVAwdqmcg=; b=jPWdB59SGCOy4VS/b7jrF7OvR27vbSFxwar44ID745BgPQ3WUB+ZR4d2oaa2ZTR+Jn FI4cc6/4+BMcgmxM98Gx/0tME+Z42oyHhQwjbDdZbQuHw6qeAgNVDliIu4eWsgrTf9uf DPcxNqEFENvenUlF7wGOflK4kRSBMHiF95YpsvDVcX+DhvB8u4ncdAOZuQKpN3xt8gVF 8VfYKEBVJ1eNTt9Hz+J8wkWmcD4efTMcqOvonkrbUsKVXRAWNY0xnFg92qaPvhUm23Fb u1pT2BJiRIssIEL/7GyphBNYDGX1cvvXRsHu+kcrpWWHZJYvqsCI4fmmLA+qK5UmvgyI dOCA== ARC-Authentication-Results: i=1; mx.google.com; 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 ck7si21493628plb.43.2019.05.07.06.16.24; Tue, 07 May 2019 06:16:41 -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; 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 S1726488AbfEGNOI (ORCPT + 99 others); Tue, 7 May 2019 09:14:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:43412 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726321AbfEGNOH (ORCPT ); Tue, 7 May 2019 09:14:07 -0400 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 70D8B2053B; Tue, 7 May 2019 13:14:04 +0000 (UTC) Date: Tue, 7 May 2019 09:14:02 -0400 From: Steven Rostedt To: David Laight Cc: 'Peter Zijlstra' , Linus Torvalds , Andy Lutomirski , "Linux List Kernel Mailing" , Ingo Molnar , Andrew Morton , "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" , "open list:KERNEL SELFTEST FRAMEWORK" , stable Subject: Re: [RFC][PATCH 1/2] x86: Allow breakpoints to emulate call functions Message-ID: <20190507091403.556daba7@gandalf.local.home> In-Reply-To: References: <20190502185225.0cdfc8bc@gandalf.local.home> <20190502193129.664c5b2e@gandalf.local.home> <20190502195052.0af473cf@gandalf.local.home> <20190503092959.GB2623@hirez.programming.kicks-ass.net> <20190503092247.20cc1ff0@gandalf.local.home> <2045370D-38D8-406C-9E94-C1D483E232C9@amacapital.net> <20190506081951.GJ2606@hirez.programming.kicks-ass.net> <20190507085753.GO2606@hirez.programming.kicks-ass.net> <20190507113050.GR2606@hirez.programming.kicks-ass.net> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 7 May 2019 12:57:15 +0000 David Laight wrote: > > Only the INT3 thing needs 'the gap', but the far bigger change here is > > that kernel frames now have a complete pt_regs set and all sorts of > > horrible crap can go away. > > I'm not doubting that generating the 'five register' interrupt stack frame > for faults in kernel space makes life simpler just suggesting that the > 'emulated call' can be done by emulating the 'iret' rather than generating > a gap in the stack. But how would the user put something on the stack? I don't see how emulating an iret helps here. Can you write some pseudo code to explain what you mean. I also believe the gap is only added for kernel->kernel entries. > > > For 32bit 'the gap' happens naturally when building a 5 entry frame. Yes > > it is possible to build a 5 entry frame on top of the old 3 entry one, > > but why bother... > > Presumably there is 'horrid' code to generate the gap in 64bit mode? > (less horrid than 32bit, but still horrid?) > Or does it copy the entire pt_regs into a local stack frame and use > that for the iret? On x86_64, the gap is only done for int3 and nothing else, thus it is much less horrid. That's because x86_64 has a sane pt_regs storage for all exceptions. -- Steve