Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3999501yba; Tue, 7 May 2019 10:24:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqyxMT0ZGhl/yWxIVYF2nE+gTw6oXZt0OochKVUHlGSalhtWEAm/bdKVbP4uA4S8tVVIGEYe X-Received: by 2002:a63:3:: with SMTP id 3mr39960454pga.360.1557249861224; Tue, 07 May 2019 10:24:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557249861; cv=none; d=google.com; s=arc-20160816; b=xJAHAyEugjCRoIhArAZ5XbeAObNTO0GARa/yo6vQ/tnQzxMbVaVPkriXAziiuSFfO8 wCiq2A9AqC9A19lj4ymOVqHNcCjKT8PC1sG6PnUAZfO/OGMc3VsqmfXb7p3b/gZCWo7O s703EUkVhYoDbxGxvb9bAHwDBsQk7qSDfdvgaeeTCLrvYHiIKl68LyObSOHQVv33/Wz4 YSFjRuj6Iq3OexhwJBJZj1qJ+NgPyhdrl21xZ+hu/bDyKi/tvtnwuyeFr8edoawHKXZL B6kOVjdDBTtxRFkmngCaTlqnub5ArsMGmwPjG8MBD3DAM4F6UK0UFpp/Up8PJuoMZ8Jw yEMA== 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=6PNDzrjcpUnF2ox8n27775TY/wH+ql2a/Pdl5jrIFYE=; b=NIYMI2gdQszLuLc27/qq5MxcrSwMv6xe+OUqc9s1q4dLIyXaAIJwDnXWd4c9xL/mbs mFXx5ckwYHGeSxD/RL0mQQz4GAXZwjgbuoC2EXJWvhG6/I5MW9InM8H4+zmCD6g3ibgA Xzq5y7FMLZrjPVf4ykhkL2PBkBJd4oTEehJvwNJAfHBtKMkPJNShVq18OKYpiyNf4jUI 1Gyx+otQc2++vPCCm+cSCboAa4jHyW7XFxACJ8rvpHwRievVjygjVlFv/Lb4REIsO6zq S7d+ZNQydMUWb/2fFb22mXOwxlEOPrZ7lpDCS+HbEYM1t1W6WmKMd99amCkXSt9whEU4 yr0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=USDDugBC; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h26si19911779pfn.240.2019.05.07.10.24.04; Tue, 07 May 2019 10:24:21 -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=@gmail.com header.s=20161025 header.b=USDDugBC; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727297AbfEGRWl (ORCPT + 99 others); Tue, 7 May 2019 13:22:41 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:37477 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726406AbfEGRWk (ORCPT ); Tue, 7 May 2019 13:22:40 -0400 Received: by mail-lj1-f196.google.com with SMTP id 132so7315917ljj.4; Tue, 07 May 2019 10:22:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=6PNDzrjcpUnF2ox8n27775TY/wH+ql2a/Pdl5jrIFYE=; b=USDDugBCti1omKMaJ+lePP2NJJOBT+kdaOAPkCwlDm/xFScLP7RKjwiA4OVbkYYsZ/ rB+Cets8kTZOPyUTpYJGf13gmuMdIiBUUEomgjZBYMULBx4mW2MUDtSxtls7yQyxm/x8 IIfFFtxJI7iSASALqypt4rmoNTeF92lJlKkPM/ZriDb/pe6763gpQmp430bcDrFSZ26o 5OKhmwk6QGhLN14rcQWGDs5vmrc/gzH3GEIrOW2WyF2KVb8j6l1R5LFP3ACxgI/lZ482 QkE2DO+hGaLN7KG1YZfEFY+DjuuHBGirKhCKJ3ZMHY4qhEH+I/zIASL3Uoep0lLI+vUX 6esA== 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=6PNDzrjcpUnF2ox8n27775TY/wH+ql2a/Pdl5jrIFYE=; b=KKViP/R+zaePeWKhUo/nLYpB28w3yBR9AhhZgVKJ2D1nE4c5AffFO0tkm0RGhf7CFZ v9EtPNE0YUi3Anukh9eiGpFxYd2vKiFiyJiE8xoiAlJoTRtLES3zrFkyCxiirOP/IB2Q WeLMQ8sGp/ZSGJt2+ONhYqi3it7QdKzlfDsWWHj2Ajpc7RLmaFNMmZ9/TlESyT4Ydb9i 0UVaWjnc+vSLtXrW+KPscG85MLkmw7vjDg/n8Tu5BIHQ7TP2304Coxx9gZV07+gdUoC2 WH1k8z2RvzB5uTad2bEKQ1B6HgIowXOqDfinnpPmvToFsy4QbvU3wIpl2IAltXI1i31r jr3Q== X-Gm-Message-State: APjAAAXLxZQR0/EAoff1LSvoa3zLZuma7trPNJSetP4knFs92+nDZ/bz 7/Naa5d/cxXijwRsNxkC1pBlo3i6KLioetsJGto= X-Received: by 2002:a2e:5301:: with SMTP id h1mr17664822ljb.196.1557249758675; Tue, 07 May 2019 10:22:38 -0700 (PDT) MIME-Version: 1.0 References: <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> <20190507092731.GH2650@hirez.programming.kicks-ass.net> <20190507082716.73cd5a01@gandalf.local.home> <20190507124131.GO2623@hirez.programming.kicks-ass.net> <20190507085417.381d96d0@gandalf.local.home> In-Reply-To: <20190507085417.381d96d0@gandalf.local.home> From: Masami Hiramatsu Date: Wed, 8 May 2019 02:22:26 +0900 Message-ID: Subject: Re: [RFC][PATCH 1/2] x86: Allow breakpoints to emulate call functions To: Steven Rostedt 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 , 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 2019=E5=B9=B45=E6=9C=887=E6=97=A5(=E7=81=AB) 21:54 Steven Rostedt : > > On Tue, 7 May 2019 14:41:31 +0200 > Peter Zijlstra wrote: > > > > Kprobes sets the FTRACE_OPS_FL_IPMODIFY flag, thus > > > they can never be put at the same location that is being live patched= . > > > > OK, so do we want to allow kprobes that also modify regs->sp ? Because > > then we need to change these trampolines a bit. > > > > I'd prefer not to allow kprobes this. > > I believe no kprobe changes sp, because it would have had the same > issues we are trying to solve now. And even though we are changing > things to allow it, it's not a regression to keep kprobes from doing it. No, kprobes doesn't allow to change sp. At this moment we can't change "®s->sp" since it is just a value :) kprobes user (e.g. function fault-injection) will change regs->ip, that is why kprobes sets IPMODIFY flag. Thank you, --=20 Masami Hiramatsu mailto:masami.hiramatsu@gmail.com