Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4127324imu; Tue, 18 Dec 2018 09:27:09 -0800 (PST) X-Google-Smtp-Source: AFSGD/XCe1LL7Entzo9xx8aBUrK1TqgxBY2c9ywd4voVVWjlz0nSeyJl4f4evbY5Var9zTgK1D4k X-Received: by 2002:a62:1484:: with SMTP id 126mr3000240pfu.257.1545154029377; Tue, 18 Dec 2018 09:27:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545154029; cv=none; d=google.com; s=arc-20160816; b=N7vPxYrCa+97zJGV+STebdlGDDaYd98QFkrN03OZIyisujlqr9yT33JIcj/FW/k1oo LdD7yU3nCBT++hB/DEHAyG4/lREgr2qBJF7ygNUZ7gUmJ6j5Bi5wW3qW8FU/TqBi7YP+ kJpQPXmP3I/YtJulEFQvGB539ppP3+VUhE+Kvhf/Nrhrm1I98YAI+oV8gKPKsJ7kOEZV FO5O8e6p5OvyVRaD0ilXdm5Tlxs4wM4d1STlq7Xn2LWWu8Jd4xSao72FF62HDl9XX7gR 8uJRKIhF6tbQnoAlLFdp2iKJsfRWG5gsosdhk+zeqsm9ZxlGSa+zcY2xCSovWDIClPM5 XC4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=BQW99PsZ63VINy2Tlfuvx1EViNHJWklQFsAihrja4w4=; b=MDpHuCRwFwW0virDF3p3pT8mA+Qg6ebXmX+0RdEHzwxKj/Cf9ol413GR38l4GRseib 1HljKtpbM+Tz33Sa3JXLJcMA9e6Abv2H6FaubXkdHEcPDPyfV2TsKNICPyo8yrGaCC5w b8OxVn1na6kGXNO8Hrx+N5PjjwwzNzA5LsyqRl5R7PNl5x6EDq2aXMUXEoHPX0gP6Xgq +pmIV+aAfu3zBFjdH3fZupv1XLBiY6kKlSLyq1ETjLz2QgzHGggAtP1dzpAcP+rlf+o/ 4KZbJovy5y0ksdDaUEdbEGNSO6frh/gVDi071No86gInZY3dfTnJKwXXVWE2CZwtIe6t 4UtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jidC26qx; 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 e8si14044859pgn.325.2018.12.18.09.26.47; Tue, 18 Dec 2018 09:27:09 -0800 (PST) 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=jidC26qx; 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 S1726867AbeLRRYj (ORCPT + 99 others); Tue, 18 Dec 2018 12:24:39 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:45872 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726555AbeLRRYj (ORCPT ); Tue, 18 Dec 2018 12:24:39 -0500 Received: by mail-wr1-f65.google.com with SMTP id t6so16561440wrr.12 for ; Tue, 18 Dec 2018 09:24:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=BQW99PsZ63VINy2Tlfuvx1EViNHJWklQFsAihrja4w4=; b=jidC26qxonJMPGCp6H3rwhcXgWDLAOUI5vCDLT5iXq2JGyxoMHSwGpD2SAWJlNSXag pLIS8FGdKd/NVQzg9HLt/+AxnKY/gMjWvKSnf2oxgy/9prqc1pwbLe8UD8OAYmN11Ara 8B5+kly/F6VocBhVHR+Q/n8oRnlv11cEg3u3X8174glB4gneAYmn2P0ESPviEioFVmu1 5zF3WYASVnEkr15fbUoVpcFwE8Y5t1gz7g3+vM8u/70yThd90RNqU2kyCY7fN88kTQcA gZInZU/xk5QwJHRFJD3WQptwlNc8IZxaO+6AoZ6t5M8EsSdGWeLz+1L11d06BOhUpE1y vRig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=BQW99PsZ63VINy2Tlfuvx1EViNHJWklQFsAihrja4w4=; b=hWng23p8lJDNZcVbuyyOI2xgVYfY2g2q4JdRhIcpjP7zOQnV45yh/b8XLui1LJCtcT zRNMYSD0K9KeKf9de/DmyoPx5/lSaxNGV+R2T+nhyTz+793WhT9OMtdAgW2O23e/mgas slpNk6Vf8kf10loLZ0siWmI4VtGidB0ifae+31VWTpv/3d0jO1MWSXMspkk/7hf+sTPB P8x7n0ThzKGc61Sby6mVzNlZtvkRrBE74NmrrmbMYxnFXs2Q1iS12R+aX128jZh0DQHV GjhxR+O7SzDoT1CnqAAY7OF/zJrAFLVIfH/PSTkiDP7OBImvIUqPTlt7KjB6Z3gapnUy p2cQ== X-Gm-Message-State: AA+aEWbNdJMulmUPSgZXgRjhYIhFAoWgJbve9+TI0FNObb8uIxnBKSg6 mTvrKWtKDW8upIQst+WqRg== X-Received: by 2002:adf:94e4:: with SMTP id 91mr16473465wrr.322.1545153876954; Tue, 18 Dec 2018 09:24:36 -0800 (PST) Received: from localhost (host171-129-dynamic.1-87-r.retail.telecomitalia.it. [87.1.129.171]) by smtp.gmail.com with ESMTPSA id o9sm1903233wmh.3.2018.12.18.09.24.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 18 Dec 2018 09:24:36 -0800 (PST) Date: Tue, 18 Dec 2018 18:24:35 +0100 From: Andrea Righi To: Masami Hiramatsu Cc: Ingo Molnar , "Naveen N . Rao" , Anil S Keshavamurthy , "David S . Miller" , Yonghong Song , Andy Lutomirski , Thomas Gleixner , Borislav Petkov , "H . Peter Anvin" , x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 0/3] x86: kprobes: Show correct blaclkist in debugfs Message-ID: <20181218172134.GA2902@xps-13> References: <154503482486.26176.6224515860220847638.stgit@devbox> <20181217154713.GA1308@Dell> <20181218135026.6f96a89247e9b70fa45afbe9@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181218135026.6f96a89247e9b70fa45afbe9@kernel.org> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 18, 2018 at 01:50:26PM +0900, Masami Hiramatsu wrote: ... > > Side question: there are certain symbols in arch/x86/xen that should be > > blacklisted explicitly, because they're non-attachable. > > > > More exactly, all functions defined in arch/x86/xen/spinlock.c, > > arch/x86/xen/time.c and arch/x86/xen/irq.c. > > > > The reason is that these files are compiled without -pg to allow the > > usage of ftrace within a Xen domain apparently (from > > arch/x86/xen/Makefile): > > > > ifdef CONFIG_FUNCTION_TRACER > > # Do not profile debug and lowlevel utilities > > CFLAGS_REMOVE_spinlock.o = -pg > > CFLAGS_REMOVE_time.o = -pg > > CFLAGS_REMOVE_irq.o = -pg > > endif > > > Actually, the reason why you can not probe those functions via > tracing/kprobe_events is just a side effect. You can probe it if you > write a kprobe module. Since the kprobe_events depends on some ftrace > tracing functions, it sometimes cause a recursive call problem. To avoid > this issue, I have introduced a CONFIG_KPROBE_EVENTS_ON_NOTRACE, see > commit 45408c4f9250 ("tracing: kprobes: Prohibit probing on notrace function"). > > If you set CONFIG_KPROBE_EVENTS_ON_NOTRACE=n, you can continue putting probes > on Xen spinlock functions too. OK. > > > Do you see a nice and clean way to blacklist all these functions > > (something like arch_populate_kprobe_blacklist()), or should we just > > flag all of them explicitly with NOKPROBE_SYMBOL()? > > As I pointed, you can probe it via your own kprobe module. Like systemtap, > you still can probe it. The blacklist is for "kprobes", not for "kprobe_events". > (Those are used to same, but since the above commit, those are different now) > > I think the most sane solution is, identifying which (combination of) functions > in ftrace (kernel/trace/*) causes a problem, marking those NOKPROBE_SYMBOL() and > removing CONFIG_KPROBE_EVENTS_ON_NOTRACE. OK. Thanks for the clarification! -Andrea