Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp968670yba; Fri, 3 May 2019 13:34:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqxUWuc7XwNILpGk42WN1lTHCs9PBpwZiPAAarmONYtY2tVGh0hwStnykAxxgiaUxOyQEvnR X-Received: by 2002:a63:d345:: with SMTP id u5mr12457284pgi.83.1556915685255; Fri, 03 May 2019 13:34:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556915685; cv=none; d=google.com; s=arc-20160816; b=PUoJzZ/cBQsnkDYtm+OtqAo78DaRcwzBPK7r4v5O02O06cMtO5V/daU+cR3fGZILCF qDDmj9hUPpoEAXSAuw72uX2k1bd3OeWEnuTIRkomT84p0v5IpNMIi5CdFPmN6XwzFq+5 mNXemKzCsa+P5kNbZiPIQBlBEEB/0FjJ1ec6fzuv3QluuIbcmEKTrO7MOPVTmTZSS8ap BKBRflaaafspZuvfakFaX3noHjVPAq024x1YNIXCibWR//Yyi+w8mphsXbjYZPoiMyUr LTdNuqYBK1rlEapFvm/auXfLSLqwZHyLlJcj7IzRZ2pVuRMMkJ9lY+xO2L7oRsPLrd+T qZCw== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=FSgswcQFEYeHSdxX8AtrFGdX43ZrY81aC7FjCdnF1lw=; b=VPa83j9hIG846LDFVNMzWe5PSGxUX92zCocyw+x7g62A8YpDFqhjfvTg7RxQo4vArP DZQWNpHKJJGJOevsYi/o/UNW0FFkUK0mEYWK+FcpL6/763i8uYRjs55XtKL/gBSlUVSn pvzQ5ldEAwXzxR9GcZBkatiddMkEx/SmTZsfXUPGPC3EuOP+CQ+oK8hKjpmMAS8t7NbX CwLw+qXYGAftnWX+/FcETunU29ChoADBPl0LM8O8yp6ajvOHTFzEbdZ9R2gsiWWoPr3D STheRiiJfc2Ky3/IseL1qA48uDhqYEv3JlauWkwCqWMwTYUoDtFFAJKIwlDs+8GKivE6 UQ9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=hNiCDOYP; 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 f8si3660990pfh.200.2019.05.03.13.34.29; Fri, 03 May 2019 13:34: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=pass header.i=@linux-foundation.org header.s=google header.b=hNiCDOYP; 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 S1726645AbfECS5n (ORCPT + 99 others); Fri, 3 May 2019 14:57:43 -0400 Received: from mail-lf1-f65.google.com ([209.85.167.65]:32887 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725997AbfECS5n (ORCPT ); Fri, 3 May 2019 14:57:43 -0400 Received: by mail-lf1-f65.google.com with SMTP id j11so5139876lfm.0 for ; Fri, 03 May 2019 11:57:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=FSgswcQFEYeHSdxX8AtrFGdX43ZrY81aC7FjCdnF1lw=; b=hNiCDOYPcNqnXKK/3FcnwPtAVxPFyrBg+J8d2W/RIoQtc6yDsjbQlTRVrCZF7yVBbf GTfzaeel2+A/oHQFAzZEgiHULvVGHr0RUbX7HmdD+IU7HwQy2urlZR/fO3433IvfJrgP +aivOpr26ud9zTNlsEaBbSi32zQ6a4Z2OLgV4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=FSgswcQFEYeHSdxX8AtrFGdX43ZrY81aC7FjCdnF1lw=; b=MgKR3VNCkU/5ltgZNPvktidGRewY7GUw7diTPwwxI6KL4ry9Ek/lTYhnRz+CseN6hC oVi0g8N6LlXMfRU6qwYUArT0KgtbyILQsK6Ts+PDQuGEt1bTYCigjt8ApK+SSibRKF4/ 05fOjcg+/TzLCfpj7HPGrazd+gcXJLf8TK0PIX8BUA3OO3ow2xBbwxJlusv0p8c3EGaF mYtZOYTLyJtV0lT0jnr+w9Dd7ksjTo2IcgOBTAToZAoTlvjK2wYAD1OOFESDNmes8PC0 QNmpr1t2BBsXGYSV9RKs3EP5JbBCz/y5eLqdSwnENdwgGc+90CFZVwG8nDaAC0JHFidG 1wvw== X-Gm-Message-State: APjAAAUySqq/MQT/ZQQ3Nwa75eHUN6f0waJea9zkstOTrRvjMb74nAZt 4TEFDP/a34EBdMpNiVJgu606M2lzM3s= X-Received: by 2002:a19:c746:: with SMTP id x67mr5789857lff.152.1556909860872; Fri, 03 May 2019 11:57:40 -0700 (PDT) Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com. [209.85.167.46]) by smtp.gmail.com with ESMTPSA id w2sm602941ljh.72.2019.05.03.11.57.38 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 May 2019 11:57:39 -0700 (PDT) Received: by mail-lf1-f46.google.com with SMTP id u17so5126251lfi.3 for ; Fri, 03 May 2019 11:57:38 -0700 (PDT) X-Received: by 2002:a19:ca02:: with SMTP id a2mr5916283lfg.88.1556909858698; Fri, 03 May 2019 11:57:38 -0700 (PDT) MIME-Version: 1.0 References: <20190501203152.397154664@goodmis.org> <20190501232412.1196ef18@oasis.local.home> <20190502162133.GX2623@hirez.programming.kicks-ass.net> <20190502181811.GY2623@hirez.programming.kicks-ass.net> <20190502202146.GZ2623@hirez.programming.kicks-ass.net> <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> In-Reply-To: <2045370D-38D8-406C-9E94-C1D483E232C9@amacapital.net> From: Linus Torvalds Date: Fri, 3 May 2019 11:57:22 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC][PATCH 1/2] x86: Allow breakpoints to emulate call functions To: Andy Lutomirski Cc: Steven Rostedt , Peter Zijlstra , 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 3, 2019 at 9:21 AM Andy Lutomirski wrote: > > So here=E2=80=99s a somewhat nutty suggestion: how about we tweak the 32-= bit entry code to emulate the sane 64-bit frame, not just for int3 but alwa= ys? What would the code actually end up looking like? I don't necessarily object, since that kernel_stack_pointer() thing certainly looks horrible, but honestly, my suggestion to just pass in the 'struct pt_regs' and let the call emulation fix it up would have also worked, and avoided that bug (and who knows what else might be hiding). I really think that you're now hitting all the special case magic low-level crap that I wanted to avoid. Linus