From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762047AbcLVGmY (ORCPT ); Thu, 22 Dec 2016 01:42:24 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45844 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754320AbcLVGmX (ORCPT ); Thu, 22 Dec 2016 01:42:23 -0500 Date: Thu, 22 Dec 2016 00:42:19 -0600 From: Josh Poimboeuf To: Masami Hiramatsu Cc: linux-kernel@vger.kernel.org, x86@kernel.org Subject: Detecting kprobes generated code addresses Message-ID: <20161222064219.2urtfm426rv3vtqb@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.30]); Thu, 22 Dec 2016 06:42:20 +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 information? -- Josh