Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2936192yba; Sun, 28 Apr 2019 12:44:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqyfpPboDr4KWXa3vQdfI6Ai+F4HOr46P5ofGsa2RE726Q3Q9ooUjzDwbI4sZc+msXb0SroW X-Received: by 2002:a63:6b08:: with SMTP id g8mr55255620pgc.211.1556480695694; Sun, 28 Apr 2019 12:44:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556480695; cv=none; d=google.com; s=arc-20160816; b=grB6YS6pxwzVfM/Gvt2QCoK0xvr9JHgnt/tmeozuLa9zgzUVXfb8Og4XFI0DxhQv3G CpjUXdWYBejxMYf89vN0WT/slvfuon0m7NNu8LSCTDvmtWUy1FcaCS0VucuSQRRVueeH bInR4vZETF/DNLktdsEQRICn5h4C5vE4gwp9xlspKj8OMoGMYphWWpMO6LqwOj2A5aBA 9edM8QVc6YT8ma7aGLK/4qsRQmt1q86QBMqB8FxbuVPkdbjp+dsed8s2AXFej+0S7Zv0 m/X1rQFxMQBWuR0ibMA6qHqphm0pz8tXzf8WtHFO3K+Kg61dKLvRoosPs2/jrlkmyPCk nBKw== 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=I0FloPxMj1kKZi8rwhwEN97i8mjMlshkSq6nUdTjg9k=; b=CxeA+oxGxsGI3K0BkIP6xV2++YKl4nNFLaojr9LrpcO2cQaxXNAuLUbxz+STJDyNt+ Gs7l+8UuYiBW+YukUxkxcEyWMREFuZHewdnTYammWxWPgweD6v+fJIGCIvGxFiXjoDi+ MUgE/WkdlimW8ILOAIoCDJAgijBLB5+CmrodfgyQSRyQ56x9hau+0q5eAB0NUNS7swtN pFoQJyCVQe3x1SxwhaH5TlRY6Tk2Sk3X0sKgR/VqdF6PuuIIe0djVj3qHgkBRijime+P jSSV9vvqtf3w4gcoUKrN657wwuNoxRdsKrcQ/ugmZQBto4d5s1/LrOiXMxg5Fom6QvrP AbIw== 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 f16si29883918pgh.309.2019.04.28.12.44.39; Sun, 28 Apr 2019 12:44:55 -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 S1726435AbfD1Tnu convert rfc822-to-8bit (ORCPT + 99 others); Sun, 28 Apr 2019 15:43:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:33798 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725975AbfD1Tnu (ORCPT ); Sun, 28 Apr 2019 15:43:50 -0400 Received: from oasis.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 E6A1420679; Sun, 28 Apr 2019 19:43:46 +0000 (UTC) Date: Sun, 28 Apr 2019 15:43:45 -0400 From: Steven Rostedt To: Andy Lutomirski Cc: Nicolai Stange , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , x86@kernel.org, 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 , Andy Lutomirski , Joerg Roedel , linux-kernel@vger.kernel.org, live-patching@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH 1/4] x86/thread_info: introduce ->ftrace_int3_stack member Message-ID: <20190428154345.789635b3@oasis.local.home> In-Reply-To: References: <20190427100639.15074-1-nstange@suse.de> <20190427100639.15074-2-nstange@suse.de> <20190428135143.09d35bb6@oasis.local.home> 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=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 28 Apr 2019 11:08:34 -0700 Andy Lutomirski wrote: > > > > Perhaps adding another slot into pt_regs that gets used by int3 to > > store a slot to emulate a call on return? > > > > > > That’s not totally nuts, although finding pt_regs isn’t entirely trivial. I meant on the int3 handler (which stores the pt_regs). > > I still think I prefer an approach where we just emulate the call directly. Then, on the return of int3, if there's anything in that slot, then we could possibly shift the exception handler frame (that was added by the hardware), insert the slot data into the top of the stack, and then call iret (which the int3 handler, would add the return ip to be the function being called), which would in essence emulate the call directly. I believe the complexity comes from the exception frame added by the hardware is where we need to put the return of the call for the emulation. -- Steve