Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1897470pxv; Sat, 26 Jun 2021 03:44:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxGtA8PsCQStmG2ON/1yS/W1Lov1PrZDibBxw+EpxLspDJ9JawbMP8SXrFZL5eU3goxdM+z X-Received: by 2002:a05:6402:1a:: with SMTP id d26mr21110227edu.105.1624704257190; Sat, 26 Jun 2021 03:44:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624704257; cv=none; d=google.com; s=arc-20160816; b=yGzgV7bhhamtLcKhEVo/uxge9RA2yKaUQCeLatxWQu0m31SlvL+Eaz/VXP+gfhYcf4 np6mQ4CQCd1RiXQajy2clXwQNrwDwcag6TvnG7AmLicxqBNqr8WYb2odeg0Jhk7FDo1a pyI9zI9igV5cBAD3FQyffg7WpQZmd7pRCUT078zOmlT5wyLzEysm6PiilP74OGmxJo7e BsQZic5u6h9Coa8Y32297/qvI1k1t7QXGjVlSg5NSo86pBPZf5qIhGCo+vhw7PFRBDM/ BRdGZMNcOSPDPdpeAcGaZBdgRfjtU/4utq2Ra0NGzrjPqRSOPXz7oVjad8HcwXReietr Y+pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version:date :message-id:subject:references:in-reply-to:cc:to:from; bh=RGLskqaru4+NnRWa8ggSKZ1RAMN5NAFKDqEy72tWOFA=; b=PGJvYbZDDuY6WSjg18xX2Zo5TDncyUG00xef0+2Q4GAOvgsdBsfBexYTCRX7EvUWG3 B6NrAz2MousYhYySd3DXzY/FDJ3HR5YZusBD6Zj68CDRdKQSVYneTOJ+fjqISLdEU+Ws QQOyz92yb15QrKjJAiTBvxyQXS2H0nsSH/9F2l7QnT3FaqcSfmrqvpkjdOoin6G5CoyB gwHktZ8ltoWV5346zv9+qGmCY4wxuxYqM9sj/+z/EE/d5sZ0uYNTb4SsM4bD1JxoMKxD 2lqt27YRqTgApLdW5kSdZ26BEBIM6Fm6ZkpJuxQN4qh7Kk3yiotqJCvQ9vDYYAwf1Nxe 8Gmw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id mm22si8536885ejb.68.2021.06.26.03.43.54; Sat, 26 Jun 2021 03:44:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230099AbhFZKlc (ORCPT + 99 others); Sat, 26 Jun 2021 06:41:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229991AbhFZKlS (ORCPT ); Sat, 26 Jun 2021 06:41:18 -0400 Received: from ozlabs.org (ozlabs.org [IPv6:2401:3900:2:1::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A61BC061574 for ; Sat, 26 Jun 2021 03:38:56 -0700 (PDT) Received: by ozlabs.org (Postfix, from userid 1034) id 4GBr2Q3R6Mz9t0Y; Sat, 26 Jun 2021 20:38:54 +1000 (AEST) From: Michael Ellerman To: Benjamin Herrenschmidt , Michael Ellerman , Paul Mackerras , Christophe Leroy Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org In-Reply-To: <5bdc8cbc9a95d0779e27c9ddbf42b40f51f883c0.1624425798.git.christophe.leroy@csgroup.eu> References: <5bdc8cbc9a95d0779e27c9ddbf42b40f51f883c0.1624425798.git.christophe.leroy@csgroup.eu> Subject: Re: [PATCH v2] powerpc/kprobes: Fix Oops by passing ppc_inst as a pointer to emulate_step() on ppc32 Message-Id: <162470384231.3589875.12558061004579567759.b4-ty@ellerman.id.au> Date: Sat, 26 Jun 2021 20:37:22 +1000 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 23 Jun 2021 05:23:30 +0000 (UTC), Christophe Leroy wrote: > Trying to use a kprobe on ppc32 results in the below splat: > BUG: Unable to handle kernel data access on read at 0x7c0802a6 > Faulting instruction address: 0xc002e9f0 > Oops: Kernel access of bad area, sig: 11 [#1] > BE PAGE_SIZE=4K PowerPC 44x Platform > Modules linked in: > CPU: 0 PID: 89 Comm: sh Not tainted 5.13.0-rc1-01824-g3a81c0495fdb #7 > NIP: c002e9f0 LR: c0011858 CTR: 00008a47 > REGS: c292fd50 TRAP: 0300 Not tainted (5.13.0-rc1-01824-g3a81c0495fdb) > MSR: 00009000 CR: 24002002 XER: 20000000 > DEAR: 7c0802a6 ESR: 00000000 > > NIP [c002e9f0] emulate_step+0x28/0x324 > LR [c0011858] optinsn_slot+0x128/0x10000 > Call Trace: > opt_pre_handler+0x7c/0xb4 (unreliable) > optinsn_slot+0x128/0x10000 > ret_from_syscall+0x0/0x28 > > [...] Applied to powerpc/next. [1/1] powerpc/kprobes: Fix Oops by passing ppc_inst as a pointer to emulate_step() on ppc32 https://git.kernel.org/powerpc/c/511eea5e2ccdfdbf3d626bde0314e551f247dd18 cheers