Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1361099ybb; Sun, 29 Mar 2020 02:43:27 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvjFfs5OLMGGrMWcQ1f3ym/FBNkvtkw5LcljyHpf3aP/lRx0Fxd4Bi6W5vO2t1LXk+Iz9H5 X-Received: by 2002:aca:ac46:: with SMTP id v67mr4407645oie.62.1585475007175; Sun, 29 Mar 2020 02:43:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585475007; cv=none; d=google.com; s=arc-20160816; b=TJHDfdJj104Xr9ErGNBlVOnET2OeyboMH3OsN4h2/6p4+32ejtqu6zmLqOYpbHwsuc jXYzYwBfFCutGH1mQcj1bJwA4pw/2nnFDknhAlxTFoIKtmg5FWXnTzEvAJ87p5Wkg4kX BNp/wsGr3kObvbTFvylmtS7xy2My+43HRIk44hHXAI901Y+lfMtFnV8mct8DcwaDmoH2 0rupfaOSJ8pvvSn44S2Z1sn56jkGsWGCgYD7JLNrOnnwv1hqiuRapQxv3oUZS3TUzrSd NxGJHoHfmvMk9ocwXQ1VqzEpqwesyPrCp9LL9w1h/tAZzTweiE07IY78dzf6hOsx9Wis 3IdQ== 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=e+KzW4oOf+FK+cIVEE9+mxV954O1EsAAZMtwTb2/AiA=; b=GQJM2L59pISl3NCsj0N/LmGsQQBh81PAj5ctjh13vKKmQHMIyU95x/8qB/7jyrmJls 8s1jiYQkxg5B18UfUeoWR67hD6kTOY6J8jRRQCxRCnznPXVeayfJY30oIBOnnltq51LQ 80qoEpWBMByWXMuzorhq+ylJ3w4xCeLzBuHZgQ+eiTpJBDP8uXHVs93UQx9ur7vLpYw7 rJ4GPB9kwkPyDHGwmedG0KA5AEBmsMn2yToK5FCRfd4vwsAgVXXQjZ3WuWYyX66+yonW VLVZqkwxFatZx8SWkS7w8PV29YIk5Lxq+xoxHmhSkCWxMMCVdTD0bMMvnyClQtQNmuLO ffWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=jxacIkuy; 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 v1si146613otp.155.2020.03.29.02.43.14; Sun, 29 Mar 2020 02:43:27 -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=jxacIkuy; 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 S1728089AbgC2Jle (ORCPT + 99 others); Sun, 29 Mar 2020 05:41:34 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:40865 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727962AbgC2JlM (ORCPT ); Sun, 29 Mar 2020 05:41:12 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 48qrFH3Dc8z9v0C7; Sun, 29 Mar 2020 11:41:07 +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=jxacIkuy; 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 t__N2wGlMKWx; Sun, 29 Mar 2020 11:41:07 +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 48qrFH2Bxfz9v0Bs; Sun, 29 Mar 2020 11:41:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1585474867; bh=e+KzW4oOf+FK+cIVEE9+mxV954O1EsAAZMtwTb2/AiA=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=jxacIkuyms1Ak8FQPSkb7ccErhQGPuliL8+3WJUJlZ6JCTdzMuSOsM+Scusz6cwqr /CIF+wWSSFr1FqD8y3ChipdieUyY7ER+PNRqwh5w1yIcP2UrKYGvUfnvYUElsmbsoK o3QcWNv/waivv+Wz6ztrrCiNcfXi+4c6KjXoEGWM= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 460738B770; Sun, 29 Mar 2020 11:41:10 +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 fvyO_Ustp_Me; Sun, 29 Mar 2020 11:41:10 +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 BFC458B752; Sun, 29 Mar 2020 11:41:09 +0200 (CEST) Received: by pc16570vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 9201F65653; Sun, 29 Mar 2020 09:41:09 +0000 (UTC) Message-Id: In-Reply-To: References: From: Christophe Leroy Subject: [PATCH 09/12] powerpc/32: Blacklist functions running with MMU disabled 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:09 +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, all functions running with MMU disabled have to be blacklisted. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/cpu_setup_6xx.S | 2 ++ arch/powerpc/kernel/entry_32.S | 3 +++ arch/powerpc/kernel/fpu.S | 1 + arch/powerpc/kernel/idle_6xx.S | 1 + arch/powerpc/kernel/idle_e500.S | 1 + arch/powerpc/kernel/l2cr_6xx.S | 1 + arch/powerpc/kernel/misc.S | 2 ++ arch/powerpc/kernel/misc_32.S | 2 ++ arch/powerpc/kernel/swsusp_32.S | 2 ++ arch/powerpc/kernel/vector.S | 1 + 10 files changed, 16 insertions(+) diff --git a/arch/powerpc/kernel/cpu_setup_6xx.S b/arch/powerpc/kernel/cpu_setup_6xx.S index f6517f67265a..f8b5ff64b604 100644 --- a/arch/powerpc/kernel/cpu_setup_6xx.S +++ b/arch/powerpc/kernel/cpu_setup_6xx.S @@ -288,6 +288,7 @@ _GLOBAL(__init_fpu_registers) mtmsr r10 isync blr +_ASM_NOKPROBE_SYMBOL(__init_fpu_registers) /* Definitions for the table use to save CPU states */ @@ -483,4 +484,5 @@ _GLOBAL(__restore_cpu_setup) 1: mtcr r7 blr +_ASM_NOKPROBE_SYMBOL(__restore_cpu_setup) diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S index e652f6506888..94f78c03cb79 100644 --- a/arch/powerpc/kernel/entry_32.S +++ b/arch/powerpc/kernel/entry_32.S @@ -313,6 +313,7 @@ stack_ovf: mtspr SPRN_SRR1,r10 SYNC RFI +_ASM_NOKPROBE_SYMBOL(stack_ovf) #endif #ifdef CONFIG_TRACE_IRQFLAGS @@ -1337,6 +1338,7 @@ nonrecoverable: bl unrecoverable_exception /* shouldn't return */ b 4b +_ASM_NOKPROBE_SYMBOL(nonrecoverable) .section .bss .align 2 @@ -1391,4 +1393,5 @@ _GLOBAL(enter_rtas) mtspr SPRN_SRR0,r8 mtspr SPRN_SRR1,r9 RFI /* return to caller */ +_ASM_NOKPROBE_SYMBOL(enter_rtas) #endif /* CONFIG_PPC_RTAS */ diff --git a/arch/powerpc/kernel/fpu.S b/arch/powerpc/kernel/fpu.S index 3235a8da6af7..1dfccf58fbb1 100644 --- a/arch/powerpc/kernel/fpu.S +++ b/arch/powerpc/kernel/fpu.S @@ -119,6 +119,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_VSX) /* restore registers and return */ /* we haven't used ctr or xer or lr */ blr +_ASM_NOKPROBE_SYMBOL(load_up_fpu) /* * save_fpu(tsk) diff --git a/arch/powerpc/kernel/idle_6xx.S b/arch/powerpc/kernel/idle_6xx.S index 433d97bea1f3..69df840f7253 100644 --- a/arch/powerpc/kernel/idle_6xx.S +++ b/arch/powerpc/kernel/idle_6xx.S @@ -187,6 +187,7 @@ BEGIN_FTR_SECTION mtspr SPRN_HID1, r9 END_FTR_SECTION_IFSET(CPU_FTR_DUAL_PLL_750FX) b transfer_to_handler_cont +_ASM_NOKPROBE_SYMBOL(power_save_ppc32_restore) .data diff --git a/arch/powerpc/kernel/idle_e500.S b/arch/powerpc/kernel/idle_e500.S index 308f499e146c..72c85b6f3898 100644 --- a/arch/powerpc/kernel/idle_e500.S +++ b/arch/powerpc/kernel/idle_e500.S @@ -90,3 +90,4 @@ _GLOBAL(power_save_ppc32_restore) #endif b transfer_to_handler_cont +_ASM_NOKPROBE_SYMBOL(power_save_ppc32_restore) diff --git a/arch/powerpc/kernel/l2cr_6xx.S b/arch/powerpc/kernel/l2cr_6xx.S index 2020d255585f..5f07aa5e9851 100644 --- a/arch/powerpc/kernel/l2cr_6xx.S +++ b/arch/powerpc/kernel/l2cr_6xx.S @@ -455,5 +455,6 @@ _GLOBAL(__inval_enable_L1) sync blr +_ASM_NOKPROBE_SYMBOL(__inval_enable_L1) diff --git a/arch/powerpc/kernel/misc.S b/arch/powerpc/kernel/misc.S index 65f9f731c229..5be96feccb55 100644 --- a/arch/powerpc/kernel/misc.S +++ b/arch/powerpc/kernel/misc.S @@ -36,6 +36,8 @@ _GLOBAL(add_reloc_offset) add r3,r3,r5 mtlr r0 blr +_ASM_NOKPROBE_SYMBOL(reloc_offset) +_ASM_NOKPROBE_SYMBOL(add_reloc_offset) .align 3 2: PPC_LONG 1b diff --git a/arch/powerpc/kernel/misc_32.S b/arch/powerpc/kernel/misc_32.S index d80212be8698..1edcc41e15fc 100644 --- a/arch/powerpc/kernel/misc_32.S +++ b/arch/powerpc/kernel/misc_32.S @@ -246,6 +246,7 @@ _GLOBAL(real_readb) sync isync blr +_ASM_NOKPROBE_SYMBOL(real_readb) /* * Do an IO access in real mode @@ -263,6 +264,7 @@ _GLOBAL(real_writeb) sync isync blr +_ASM_NOKPROBE_SYMBOL(real_writeb) #endif /* CONFIG_40x */ diff --git a/arch/powerpc/kernel/swsusp_32.S b/arch/powerpc/kernel/swsusp_32.S index cbdf86228eaa..f73f4d72fea4 100644 --- a/arch/powerpc/kernel/swsusp_32.S +++ b/arch/powerpc/kernel/swsusp_32.S @@ -395,6 +395,7 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_USE_HIGH_BATS) li r3,0 blr +_ASM_NOKPROBE_SYMBOL(swsusp_arch_resume) /* FIXME:This construct is actually not useful since we don't shut * down the instruction MMU, we could just flip back MSR-DR on. @@ -406,4 +407,5 @@ turn_on_mmu: sync isync rfi +_ASM_NOKPROBE_SYMBOL(turn_on_mmu) diff --git a/arch/powerpc/kernel/vector.S b/arch/powerpc/kernel/vector.S index 25c14a0981bf..403ab2c32dc8 100644 --- a/arch/powerpc/kernel/vector.S +++ b/arch/powerpc/kernel/vector.S @@ -89,6 +89,7 @@ _GLOBAL(load_up_altivec) REST_32VRS(0,r4,r6) /* restore registers and return */ blr +_ASM_NOKPROBE_SYMBOL(load_up_altivec) /* * save_altivec(tsk) -- 2.25.0