From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1765884AbcLVGuG (ORCPT ); Thu, 22 Dec 2016 01:50:06 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35400 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750922AbcLVGuF (ORCPT ); Thu, 22 Dec 2016 01:50:05 -0500 Date: Thu, 22 Dec 2016 00:40:50 -0600 From: Josh Poimboeuf To: Masami Hiramatsu Cc: linux-kernel@vger.kernel.org, x86@kernel.org Subject: Detecting kprobes generated code addresses Message-ID: <20161222064050.nxt4baiknnovwmjb@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline User-Agent: Mutt/1.6.0.1 (2016-04-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 22 Dec 2016 06:40:52 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Masami, I would like to make __kernel_text_address() be able to detect whether an address belongs to code which was generated by kprobes. As far as I can tell, that information seems to be in the 'pages' lists of kprobe_insn_slots and kprobe_optinsn_slots. But they seem to be protected by mutexes. Do you know if there's a sleep-free way to access that protected -- Josh