Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3242655yba; Mon, 6 May 2019 20:30:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqxICOyyVN84HjgWkXywFrX/uLBgBkc8TEnWgAjpkprv4P4ug4HQT8B7C7Ru2UK/K/QoswJS X-Received: by 2002:a17:902:5c6:: with SMTP id f64mr23368192plf.208.1557199823088; Mon, 06 May 2019 20:30:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557199823; cv=none; d=google.com; s=arc-20160816; b=k2Ir+n0WaCwBVy49yvM5hNnRknJzyjf5gto5YeO4Ie2MTq9hlLh4RTnxwOUVjgk+FE TmUueAXvXtMkWNGZj3vJrCIjw1Tr/jWIdr2SF1poeU42S9IP44oXbmctEiw7jdRixpGO SHihaPMTuY/UuvuUOY52S0NS7lAfKavr4bz8ga4hKJrFlugyl1Hia/LutnVG01M/F4Hq oMVc9BZp80ReW/sdCVNBQcBzrXDhF1jXLw3aSiTODM7SY/Glpi1UyATPbGp9sBB/WkNC /KX9VFyHToZrYIoiudnWqQassueTTPVmAiSFAFMbbWgRWPzferm4GPLFEoFfXV+Ty+eK Duvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=R/noB65+Fd0EtB5jindlqg68zm1kIzE0gEKXXHcvn94=; b=fWRRPFCV0ZLeuIpvamwMFr7W/Fqw7Z3KQpv9ZO4D43xLX8aNa8MsvKEvPF6XHKU0Zv VzLYcbmwkb02o8MQG72YfXIg1QXEJMpOYKl2BCDp2SbLvCUN3+w32zw2nhUS/KNZ7vDW eaZfKO9xivZ492aYPmY5Jlfdl2RyL3+nZwCXTPfCSvMIXxfEM502ijwPvYPyQQxOcqno Reeu21AW/kJwBbRT7cFJCqQB6q1rG+1Rb8kjgPmG0zmN7ri0D07y5nujCiPn4P7qTC1e h5OHt3P4hX9O8st/9PYc/zt0hv4vv09DBDdT5VQXUVXBcT361uKW19B6r0TczptcYQUN LFeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=DG2xlulf; 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 x4si17620493plv.329.2019.05.06.20.30.06; Mon, 06 May 2019 20:30:23 -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=DG2xlulf; 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 S1727210AbfEGD3P (ORCPT + 99 others); Mon, 6 May 2019 23:29:15 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:34273 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726947AbfEGD3O (ORCPT ); Mon, 6 May 2019 23:29:14 -0400 Received: by mail-lj1-f193.google.com with SMTP id s7so7504301ljh.1 for ; Mon, 06 May 2019 20:29:13 -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; bh=R/noB65+Fd0EtB5jindlqg68zm1kIzE0gEKXXHcvn94=; b=DG2xlulfe4TTtjwKg5Jp1xduUBYvL0FZXB9N1jpK7TAE6uYF4tpucaXoUi8R5d9l/+ KytcIWEKsvMcy0fp+OpEeYKcHIMZN9WN7rp9vnbGoWccBQuAPieF3W305wOTrvjQbR3o QSx3rkOQMZZZvtBKSjpN+Rv+b8+W+G1Cxk73Y= 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; bh=R/noB65+Fd0EtB5jindlqg68zm1kIzE0gEKXXHcvn94=; b=nC0HO786jdtAKvL+M25z4qZL1ai37O/RHzgDAIp2n6Nio6clmWvBJbrnS16EjNNabi Z65+EzNKhz0SUWrlY+lvQKaT0xnnBdsj/Vqwn88Af9xi28Gw1kvxN3thXoBgszJHakbx +QnoU6SJZxtD6+biO5esquT+9IhLka4h1Um9sRmnXU0wDa7L3uSGtFkM0tSJ9SATT7Q6 MAq3do0X6Vg8M96QX3Co5pf28nXFpfhqqoPUS3dPCxU9//Jc6mpRF8o6BevM3MWkIEiJ LMr4AACfJhG8sObWmDhUlxfTTiNToHa5Cz18AsmG06urCC8Oktc8I8SsJ7Mqr1XJEbAQ rrCg== X-Gm-Message-State: APjAAAXsYPFanlwPxBlRA5i8IqN3y8FNep1alNnI/N4xaX4e4NEmC3h/ T+6IweaMctWrYFXAqeMUU/sjzaVSSZg= X-Received: by 2002:a2e:7e0a:: with SMTP id z10mr733754ljc.9.1557199752582; Mon, 06 May 2019 20:29:12 -0700 (PDT) Received: from mail-lj1-f179.google.com (mail-lj1-f179.google.com. [209.85.208.179]) by smtp.gmail.com with ESMTPSA id r25sm1308113ljc.79.2019.05.06.20.29.09 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 May 2019 20:29:10 -0700 (PDT) Received: by mail-lj1-f179.google.com with SMTP id q10so12930732ljc.6 for ; Mon, 06 May 2019 20:29:09 -0700 (PDT) X-Received: by 2002:a2e:9644:: with SMTP id z4mr116194ljh.22.1557199749357; Mon, 06 May 2019 20:29:09 -0700 (PDT) MIME-Version: 1.0 References: <20190502181811.GY2623@hirez.programming.kicks-ass.net> <20190506095631.6f71ad7c@gandalf.local.home> <20190506130643.62c35eeb@gandalf.local.home> <20190506145745.17c59596@gandalf.local.home> <20190506162915.380993f9@gandalf.local.home> <20190506174511.2f8b696b@gandalf.local.home> <20190506210416.2489a659@oasis.local.home> <20190506215353.14a8ef78@oasis.local.home> <20190506225819.11756974@oasis.local.home> <20190506232158.13c9123b@oasis.local.home> In-Reply-To: <20190506232158.13c9123b@oasis.local.home> From: Linus Torvalds Date: Mon, 6 May 2019 20:28:53 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC][PATCH 1/2] x86: Allow breakpoints to emulate call functions To: Steven Rostedt Cc: Peter Zijlstra , 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 , Masami Hiramatsu Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 6, 2019 at 8:22 PM Steven Rostedt wrote: > > But still, we need to emulate the call, which requires pushing the > return code back onto the stack. I believe that part is the part we are > struggling with. Yes. But I was looking at the ftrace parts because I didn't see the bug in the low-level x86 side, so... The x86 int3 faulting code itself looks so *trivially* simple, and it does work for the trivial test-case too. Which was what made me go "Hmm, maybe there's timing or something". But it could obviously also be that the trivial test-case is just too trivial, and doesn't involve nmi etc etc. Linus