Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1360400ybb; Sun, 29 Mar 2020 02:42:10 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvJ7oOp6Lh2hyPVnVEBmENNqvMXLgBsFwvWRk5jObw466hMy8xw9iJVoCcl9lutmM3O6cKC X-Received: by 2002:aca:ad93:: with SMTP id w141mr4537306oie.54.1585474930649; Sun, 29 Mar 2020 02:42:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585474930; cv=none; d=google.com; s=arc-20160816; b=oxuJLCWP6W3+8mWqJp9izXJVSK39oCNyZN3kTk1K6yc8vyNhNdyzZOF2YXWoLdhn0G ijoro3d7X5tBXfJNDM9XjAd+AQ7vOmJP8EqAqkgzVIyaxplGY27PKIbEyYtzihqWRPDq QbOfTatAznMlJIxs+uqu3+EEX4vqfYLOiuykrNXXO0K79agvagyhynEPJaxxN7J//5Xt Iq8mbdwoY0Ihaq+VK3h/bcXXiXLHAjDkbd5DboMQqvgllkEzggvp9WQlcVZLiE9MuDdg qtsM7BFpp345MByoXIt0TRzwawP+055A7awo01AIWB6E9ChXG2WnjBw8K2DTXra4NEGS 5W3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:cc:to:subject:from:references :in-reply-to:message-id:dkim-signature; bh=1+0/qh8OYDcN/HQrOT+0DoyQR3W0aMKm4tVxmPpQB8A=; b=TbcijgAJLn7+KLzZQtBPAHOoZW/+MLimxw0YPZs4MfI2lhtbyzYNW2XXPFCiRXgEXh vAy5Q9Opj6NUig/tR0/pQH6zPqqdXQiEVK8yFKfzFZeKw4Lz7ItEhhS9d7hD5pOOM152 Zihi3FZZird8D1Kb8ZN9MTrDOXxMx289nHn+//yPAmlfmZ2E0VLKbKALUcRhu70K+uFy DTlcTvMaVO0+xZX1T2MJYr9TiYFIB0Xd415FB66szWS4hrNdasy0s9eS+mACGWvrG6cT peTXVBH8lHJnJgM5TrIiHPGH48ntMH+TnWtWzcM1OZdRvDqN6EB5WTAihEODVJdNyLrM /6Jw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=lTwjTb7C; 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 d10si3619764otc.287.2020.03.29.02.41.58; Sun, 29 Mar 2020 02:42:10 -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=@c-s.fr header.s=mail header.b=lTwjTb7C; 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 S1728079AbgC2JlZ (ORCPT + 99 others); Sun, 29 Mar 2020 05:41:25 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:22551 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728060AbgC2JlT (ORCPT ); Sun, 29 Mar 2020 05:41:19 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 48qrFQ4ZWNz9v0C7; Sun, 29 Mar 2020 11:41:14 +0200 (CEST) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=lTwjTb7C; dkim-adsp=pass; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id kFeBz-EGvLz1; Sun, 29 Mar 2020 11:41:14 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 48qrFQ3SDvz9v0Bm; Sun, 29 Mar 2020 11:41:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1585474874; bh=1+0/qh8OYDcN/HQrOT+0DoyQR3W0aMKm4tVxmPpQB8A=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=lTwjTb7CTAXB4RES5MSB1UyhuowXTUIAQwEiKyKpXUAb+sqh22PNDejSm3liSmXGA bsTbEWril1mgIhmkZb0CiibGngH68FCl7P9JlTrUld26x/sBLWyItIJd75sq+aUmaw UKXuPhaB9uQSWM1KSkqBqtNwuEwaGlyzG73nHPig= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 33D278B772; Sun, 29 Mar 2020 11:41:17 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id yXe11cGB6l17; Sun, 29 Mar 2020 11:41:17 +0200 (CEST) Received: from pc16570vm.idsi0.si.c-s.fr (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id E01AB8B752; Sun, 29 Mar 2020 11:41:16 +0200 (CEST) Received: by pc16570vm.idsi0.si.c-s.fr (Postfix, from userid 0) id A401F65653; Sun, 29 Mar 2020 09:41:12 +0000 (UTC) Message-Id: In-Reply-To: References: From: Christophe Leroy Subject: [PATCH 12/12] powerpc/entry32: Blacklist exception exit points for kprobe. To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , naveen.n.rao@linux.vnet.ibm.com Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Sun, 29 Mar 2020 09:41:12 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org kprobe does not handle events happening in real mode. The very last part of exception exits cannot support a trap. Blacklist them from kprobe. While we are at it, remove exc_exit_start symbol which is not used to avoid having to blacklist it. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/entry_32.S | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S index 7035e838d422..e161fb7a0568 100644 --- a/arch/powerpc/kernel/entry_32.S +++ b/arch/powerpc/kernel/entry_32.S @@ -810,6 +810,7 @@ fast_exception_return: lwz r11,GPR11(r11) SYNC RFI +_ASM_NOKPROBE_SYMBOL(fast_exception_return) #if !(defined(CONFIG_4xx) || defined(CONFIG_BOOKE)) /* check if the exception happened in a restartable section */ @@ -1049,6 +1050,8 @@ exc_exit_restart: exc_exit_restart_end: SYNC RFI +_ASM_NOKPROBE_SYMBOL(exc_exit_restart) +_ASM_NOKPROBE_SYMBOL(exc_exit_restart_end) #else /* !(CONFIG_4xx || CONFIG_BOOKE) */ /* @@ -1070,7 +1073,6 @@ exc_exit_restart_end: exc_exit_restart: lwz r11,_NIP(r1) lwz r12,_MSR(r1) -exc_exit_start: mtspr SPRN_SRR0,r11 mtspr SPRN_SRR1,r12 REST_2GPRS(11, r1) @@ -1080,6 +1082,7 @@ exc_exit_restart_end: PPC405_ERR77_SYNC rfi b . /* prevent prefetch past rfi */ +_ASM_NOKPROBE_SYMBOL(exc_exit_restart) /* * Returning from a critical interrupt in user mode doesn't need @@ -1193,6 +1196,7 @@ ret_from_crit_exc: mtspr SPRN_SRR0,r9; mtspr SPRN_SRR1,r10; RET_FROM_EXC_LEVEL(SPRN_CSRR0, SPRN_CSRR1, PPC_RFCI) +_ASM_NOKPROBE_SYMBOL(ret_from_crit_exc) #endif /* CONFIG_40x */ #ifdef CONFIG_BOOKE @@ -1204,6 +1208,7 @@ ret_from_crit_exc: RESTORE_xSRR(SRR0,SRR1); RESTORE_MMU_REGS; RET_FROM_EXC_LEVEL(SPRN_CSRR0, SPRN_CSRR1, PPC_RFCI) +_ASM_NOKPROBE_SYMBOL(ret_from_crit_exc) .globl ret_from_debug_exc ret_from_debug_exc: @@ -1214,6 +1219,7 @@ ret_from_debug_exc: RESTORE_xSRR(CSRR0,CSRR1); RESTORE_MMU_REGS; RET_FROM_EXC_LEVEL(SPRN_DSRR0, SPRN_DSRR1, PPC_RFDI) +_ASM_NOKPROBE_SYMBOL(ret_from_debug_exc) .globl ret_from_mcheck_exc ret_from_mcheck_exc: @@ -1225,6 +1231,7 @@ ret_from_mcheck_exc: RESTORE_xSRR(DSRR0,DSRR1); RESTORE_MMU_REGS; RET_FROM_EXC_LEVEL(SPRN_MCSRR0, SPRN_MCSRR1, PPC_RFMCI) +_ASM_NOKPROBE_SYMBOL(ret_from_mcheck_exc) #endif /* CONFIG_BOOKE */ /* -- 2.25.0