Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3845899yba; Tue, 7 May 2019 08:00:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqxSdMufH3QpzgSQyYu4PeUBj4LAYD5F3AjdXh9fSoufm+RR+ph95B9hHW154j9edgfo2OeQ X-Received: by 2002:a65:500d:: with SMTP id f13mr41535525pgo.250.1557241222295; Tue, 07 May 2019 08:00:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557241222; cv=none; d=google.com; s=arc-20160816; b=YaTmnovKK6mEhtezNkEd/ewiLVnMchEU4+vrJoUzzUsGRKjHXPh0uCE6KnI5E1o6Lz Q0jF9/NbxXhUy2mLE4jpBuuZctP9si7gz6ikoiPKxmF3KqVhDyxS5I2ixAPWPNKvoo8+ JqMRVnbKN2p/7moB4XNHszKvIWgWzVZVb7LBEs6/mGgptIwQTmy3NwssFBVAQEB/ILZv i9ry4q/48Yh+d5JI8H5WX99ng7K15PD7VtPNBtsj/WtuhTVgdI7tLjnHArxg172yFvBi Y8scVE9yDGrwV5AOeoCcIEdcteX7y0tMnu19NF4BCl3s6YflFem1Tqwsgsepyx0AQEgd VesA== 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=rbrh0+eAfH6c7Xl2PV8FyhyJfKNvVcOio3KOqwrWtto=; b=g3lxdvBqkBJwcx+ZKE05AUqHWIR4l3K2erL1PnVV/0ldY+9MaqTgev4OYJQ7CcpOwP waE/NORJk/db382UIopJ9LIxEbGA9bqpgFm0o13CbJypD2l5UOZnPNsx6Tf1UX0ZSzI2 bvrsDFxJ2usMcsdgiWvR7j82QUC3gMw16AyaBMoQYgbOXpggkHZOV+37Pv4W06Q9VDo7 6le+2vKSqoPmSQzpSLud5nsdPcjnUWDlO29OhgWQs9gQBuedoonAWfCzksfsSS6rWg+b Tx6us1Uem7ssytQRQjM0VmNqf8osKRWJK8hXdyzKgj1Aav2djLP/6dp/BYcJOT8HBgH/ /qXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=Rbs4zhZW; 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 g13si4561925pgj.272.2019.05.07.08.00.05; Tue, 07 May 2019 08:00:22 -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=Rbs4zhZW; 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 S1726572AbfEGO5n (ORCPT + 99 others); Tue, 7 May 2019 10:57:43 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:42867 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726322AbfEGO5n (ORCPT ); Tue, 7 May 2019 10:57:43 -0400 Received: by mail-lj1-f196.google.com with SMTP id y10so8113529lji.9 for ; Tue, 07 May 2019 07:57:42 -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=rbrh0+eAfH6c7Xl2PV8FyhyJfKNvVcOio3KOqwrWtto=; b=Rbs4zhZWSZAoIEvFW8ZqicaczCDoK8wfJtXVM/czDDUkauJt0TcGt6pZghqByNBQb0 ehSlEkONi7tskD0aHaudB30RNMZSHHZykUVA+izGKdIq/z2+gRVDVhHjGCa4I43HAqLa yuB6PrQdRmt/3nK2dXUGpm0su0mwkDdFFseIs= 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=rbrh0+eAfH6c7Xl2PV8FyhyJfKNvVcOio3KOqwrWtto=; b=Jqs5g2k0SS60bd0JKjhc11IqAtxEV41qQVAtCrsTAY3NGpq6sejt5VwrSXEgUF8oXy wrEZlwf0MHjU3wrRMSd18JmyOxh2QjJolFB7oyOnurDZ4uVoV+QwTjj0ROSbIOYdFHDP I7xRqSfZYCJZw8YSJk/l2eXj4Oe3AFNFnnjdF0uZiDcJxMH+zNFpU7+jHSIc++/pDki5 VL2XwL4caYqI0IWM5cPvzID6PSTMUR0VX62H9SvstIxqPL/8/Bzlpt8A/tGtaobzU7eo byYpUMDmLbGD/nXn2t+nIhMsKU/lAEu358RloRXNbSFQQKjiBljPeFYjRIzVe/zeyZbf HBAw== X-Gm-Message-State: APjAAAVNyYHBt7gG9uZXdGJysUg8Y2NBHxWdb2qMExXtbOGgfq+yLHzY DWsnzKTVFWPmmdf6HbcjEdiQGOnYL8s= X-Received: by 2002:a2e:5dcb:: with SMTP id v72mr2170175lje.54.1557241060933; Tue, 07 May 2019 07:57:40 -0700 (PDT) Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com. [209.85.208.177]) by smtp.gmail.com with ESMTPSA id o28sm3384679lfi.64.2019.05.07.07.57.39 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 May 2019 07:57:40 -0700 (PDT) Received: by mail-lj1-f177.google.com with SMTP id z1so2420537ljb.3 for ; Tue, 07 May 2019 07:57:39 -0700 (PDT) X-Received: by 2002:a2e:9ac8:: with SMTP id p8mr16118039ljj.79.1557241059252; Tue, 07 May 2019 07:57:39 -0700 (PDT) MIME-Version: 1.0 References: <20190502181811.GY2623@hirez.programming.kicks-ass.net> <20190503092247.20cc1ff0@gandalf.local.home> <2045370D-38D8-406C-9E94-C1D483E232C9@amacapital.net> <20190506081951.GJ2606@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> <48BDF7B6-252B-4D29-9116-844363010BC0@amacapital.net> In-Reply-To: <48BDF7B6-252B-4D29-9116-844363010BC0@amacapital.net> From: Linus Torvalds Date: Tue, 7 May 2019 07: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 , Masami Hiramatsu 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 Tue, May 7, 2019 at 7:48 AM Andy Lutomirski wrote: > > IOW I think your trick only works if the old and new states are CALL, but= we don=E2=80=99t know that until we=E2=80=99ve looked up the record, at wh= ich point we can just use the result of the lookup. It would indeed only work for call instructions. I was thinking we'd know that because we only ever batch up call instructions, though. But it doesn't matter. I was looking at the ftrace code because I thought there was some subtle timing bug or race or similar. But it turned out my "memmove()" was the problem. See the patch I just sent out. Linus