Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp849492ybi; Fri, 21 Jun 2019 09:10:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqwnvIaGdK/T9E3uBCmtk6x9nLxxsPshBZHFKs/dTUJndIjIqHwqBG2XJ7k80c9+fX/6ebID X-Received: by 2002:a17:902:9a42:: with SMTP id x2mr116753661plv.106.1561133429561; Fri, 21 Jun 2019 09:10:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561133429; cv=none; d=google.com; s=arc-20160816; b=kRpMdAlK2/Pk+BE/TcFjxSuVlzYIwzG6ba8fAaWoX6DS2N1D5yyaDZ8VKpfRHUHCt+ BZdFtFE0gar3A5HCm5/Smoku3YQCfe1EvSHW48XJ69ruDWSpUQK9GgerHAxnLSKREj/W D992BO8TzW+6ExF63bR1R+WZ0mzOsaJcGM/ZDYsj7m9Vt7yuw3aSjK5Ij4Wxn5nnuhhI OjIrU4p8B+iajTjVvIda5Gl/AjYZMjMYb6V10cwvkJDYPRfNh3QIIDiQ1XgzK/VeA5W8 l23wFR2/zMacS763GXm+ZCUUW5DP+85OIEF0w5yu+cubxo3bK5DHQqjPCwYlTqjJ3Ig/ YioQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=LdsD9Ij+mX1BqCc+ySVhRljh0XbLfcEhaVLoZZeTfr4=; b=I58MNmilxN8L0d1PHiKos121yI5gyanIIjxgIChL/gjS+CHUD9Wf+QVXoCKzwX/oZ/ EKJafBDRHjLH+cX1nxdTzQ7+FctFZ5n1908yaYPKdDuejMrsE3RFTPnfp0mVlyjLnFzH qxWb0IA6HDhXE5Egv/wl5FUS4fZ3pRlazjwgxKS29kUeHwRvxU1+behV1QQgRo+T7k/R UyNPLiWHUqbmgTxvHzR5QAfibdgmoLzumK4hNGAj7OxdGXNhVhCDZtwdhr/t7weB47ZU w2vXSglVQDPIJzgHwoqzJHDsczrEY/6fjDsqk0sp/i2P1V1mW7IOYDd00S06ReU9L3cD 9Zgg== ARC-Authentication-Results: i=1; mx.google.com; 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 x139si635117pgx.495.2019.06.21.09.10.13; Fri, 21 Jun 2019 09:10:29 -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; 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 S1726111AbfFUQJb (ORCPT + 99 others); Fri, 21 Jun 2019 12:09:31 -0400 Received: from foss.arm.com ([217.140.110.172]:35520 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726032AbfFUQJb (ORCPT ); Fri, 21 Jun 2019 12:09:31 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6A63C344; Fri, 21 Jun 2019 09:09:30 -0700 (PDT) Received: from p8cg001049571a15.blr.arm.com (p8cg001049571a15.blr.arm.com [10.162.42.140]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 076A83F575; Fri, 21 Jun 2019 09:09:27 -0700 (PDT) From: Anshuman Khandual To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Anshuman Khandual , Ralf Baechle , Paul Burton , James Hogan , Andrew Morton , linux-mips@vger.kernel.org Subject: [PATCH] mips/kprobes: Export kprobe_fault_handler() Date: Fri, 21 Jun 2019 21:39:18 +0530 Message-Id: <1561133358-8876-1-git-send-email-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Generic kprobe_page_fault() calls into kprobe_fault_handler() which must be available with and without CONFIG_KPROBES. There is one stub implementation for !CONFIG_KPROBES. For CONFIG_KPROBES all subscribing archs must provide a kprobe_fault_handler() definition. Currently mips has an implementation which is defined as 'static inline'. Make it available for generic kprobes to comply with the above new requirement. Cc: Ralf Baechle Cc: Paul Burton Cc: James Hogan Cc: Andrew Morton Cc: linux-mips@vger.kernel.org Cc: linux-mm@kvack.org Reported-by: kbuild test robot Signed-off-by: Anshuman Khandual --- arch/mips/include/asm/kprobes.h | 1 + arch/mips/kernel/kprobes.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/mips/include/asm/kprobes.h b/arch/mips/include/asm/kprobes.h index 3cf8e4d..68b1e5d 100644 --- a/arch/mips/include/asm/kprobes.h +++ b/arch/mips/include/asm/kprobes.h @@ -41,6 +41,7 @@ do { \ #define kretprobe_blacklist_size 0 void arch_remove_kprobe(struct kprobe *p); +int kprobe_fault_handler(struct pt_regs *regs, int trapnr); /* Architecture specific copy of original instruction*/ struct arch_specific_insn { diff --git a/arch/mips/kernel/kprobes.c b/arch/mips/kernel/kprobes.c index 81ba1d3..6cfae24 100644 --- a/arch/mips/kernel/kprobes.c +++ b/arch/mips/kernel/kprobes.c @@ -398,7 +398,7 @@ static inline int post_kprobe_handler(struct pt_regs *regs) return 1; } -static inline int kprobe_fault_handler(struct pt_regs *regs, int trapnr) +int kprobe_fault_handler(struct pt_regs *regs, int trapnr) { struct kprobe *cur = kprobe_running(); struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); -- 2.7.4