Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3758872ybl; Sun, 25 Aug 2019 23:29:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqzl8W/yp8nSLNBsUudAmja/80wNN4mNZvgW8i9MfqfMN/tce2Oi855WsPVJskBp94k//8HS X-Received: by 2002:a62:cdc3:: with SMTP id o186mr18632264pfg.168.1566800964792; Sun, 25 Aug 2019 23:29:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566800964; cv=none; d=google.com; s=arc-20160816; b=Q+SuOh95aTJz+R0u7Ba2oW4tdzdnhlSj3zYci0fcwxMxKUqP6DtsYK3+i3JwgK/+9I 331QtVQHJn5uKnTmhAq/Tqs6zvYCYYsgIsvHUKQWQgIivHVYRSrcCgOaqr/LDTHlM9PD ugKYZltkxKTK89hB1kFAA5rp4iIXjL4RBPz7CfKftd049PU38mOgpmgSK/df80xWeMbT 4ZwjcQ7pnsKibmSU3nebPMm0eWLLJsECOCuGvvqKxQhm4OtYi08xJ9PO1LgK8nVNJiF6 hJWfbtfyzJ1gpNpJAfRKhEAIkRcrWQ5h9pk7BGUyXOF+F+JAqAezWJgv9Rnw5IWhVRP7 U8/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=KdvhWx5STJQuh3h6H3k/gde8WO2PhkrNqGMLuEz+X7g=; b=Rdlt33WTH737GvenHUytT7jI0Et3Y7X6tmQ1852NVcGBi9nnfP46LPEVu4dZY3LkBw nhsXADf9yDLXLmzWReH8PqLnunudMVrtxDxipAULHh6H4Oq0/uJwCsGZFE00adPdwPD5 MXsFGJKUIZ1eniRZsGvlTbej64MfcaonAbFubhCn8/9acUOMMk/jGqOQKuCv+Svo9DJ0 SHgjHEENLazjpMnWgGIRiKOjfW2diJn0nUIwSVhlNj9b0fxQoh2hERoBozsTL8rFrMEh bjmHhNokkTp6KBw+2NtvMxh3lmesJuV+F0a+VCwxGLvk0qr9B+dEDKMn8J70jIv+3hOX 1DjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fossix-org.20150623.gappssmtp.com header.s=20150623 header.b=nd0pExQX; 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 i71si8079727pge.3.2019.08.25.23.29.09; Sun, 25 Aug 2019 23:29:24 -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=@fossix-org.20150623.gappssmtp.com header.s=20150623 header.b=nd0pExQX; 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 S1727650AbfHZFgB (ORCPT + 99 others); Mon, 26 Aug 2019 01:36:01 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:42470 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725446AbfHZFgA (ORCPT ); Mon, 26 Aug 2019 01:36:00 -0400 Received: by mail-pg1-f194.google.com with SMTP id p3so9857525pgb.9 for ; Sun, 25 Aug 2019 22:36:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fossix-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=KdvhWx5STJQuh3h6H3k/gde8WO2PhkrNqGMLuEz+X7g=; b=nd0pExQXCUmwBnwOJDaiy3haAHBnMxeK18GFfX6DKysRajp/3+t/EoL2ktvKTIPeKU nCXANGDj7C2dqWaS5oxRVTnt87qrrAOD3/ZfUgkLnO3TM3nVDUxwSXJ15/gChK3CYZgw 07c304FGDN3hWgwsu5dCg/8wWOVu3wWXJbrxO5GzYIv2cpeaOVceYDIVrYCal/UwpkvP qkeMtnsAUxNidvn8t5zLMF9g29imsJGb4NQ1L4Z5JDFsbYO4hNcQCLMv7sKHp7g2D5FG 5ZOLEKcepdqtx6fYiz6z8bbncNalq8Jd3UlCPJLuvYpR278wnvLKJmxnnX1SkpVJG/Iu pJHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=KdvhWx5STJQuh3h6H3k/gde8WO2PhkrNqGMLuEz+X7g=; b=DOct9WzprmxHUUM7m9zur63mB7TJsTOmMsOfhkczdyoN8C3xdAlBUU4eUmkafFqsJl Xpg6ShHLG6rfZhqSRuos4R94pzDM4FUlCnZ7dJHsPP5SYvm0NZJj0ol8PGnb8SLGfRui Bfp0J9BA5PF7Ss4/PG4vl9+CoyCAF7ZWTgrflZvNr2t9SW3+oC0274KfuSyfflJ6qp7i nt6ABH3mNLzYhVTniHhxkHH5MDGgK8WfKNnZgePiIsBKpdTx3NiqKrHISWKwOI+NUw/p 6cstm+1MQFMPU6V5mhHnp17SFzEmLIIxQARx2/kkcMFViYx9tu2yck6iTR7APOvnspux HCDQ== X-Gm-Message-State: APjAAAUOqa+ExWms2jny3pUaOIcjnk2yCp/2BPRvhGKvnNUlOjSH9Sax xPU+BxAI9YGHnlczydLyFRJhXpSl710= X-Received: by 2002:a17:90a:cd04:: with SMTP id d4mr16762205pju.70.1566797760058; Sun, 25 Aug 2019 22:36:00 -0700 (PDT) Received: from localhost ([129.41.84.71]) by smtp.gmail.com with ESMTPSA id a128sm13260907pfb.185.2019.08.25.22.35.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Aug 2019 22:35:59 -0700 (PDT) From: Santosh Sivaraj To: Christophe Leroy , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] powerpc/mm: tell if a bad page fault on data is read or write. In-Reply-To: <4f88d7e6fda53b5f80a71040ab400242f6c8cb93.1566400889.git.christophe.leroy@c-s.fr> References: <4f88d7e6fda53b5f80a71040ab400242f6c8cb93.1566400889.git.christophe.leroy@c-s.fr> Date: Mon, 26 Aug 2019 11:05:56 +0530 Message-ID: <87k1b0ij43.fsf@santosiv.in.ibm.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Christophe Leroy writes: > DSISR has a bit to tell if the fault is due to a read or a write. > > Display it. > > Signed-off-by: Christophe Leroy Reviewed-by: Santosh Sivaraj > --- > arch/powerpc/mm/fault.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c > index 8432c281de92..b5047f9b5dec 100644 > --- a/arch/powerpc/mm/fault.c > +++ b/arch/powerpc/mm/fault.c > @@ -645,6 +645,7 @@ NOKPROBE_SYMBOL(do_page_fault); > void bad_page_fault(struct pt_regs *regs, unsigned long address, int sig) > { > const struct exception_table_entry *entry; > + int is_write = page_fault_is_write(regs->dsisr); > > /* Are we prepared to handle this fault? */ > if ((entry = search_exception_tables(regs->nip)) != NULL) { > @@ -658,9 +659,10 @@ void bad_page_fault(struct pt_regs *regs, unsigned long address, int sig) > case 0x300: > case 0x380: > case 0xe00: > - pr_alert("BUG: %s at 0x%08lx\n", > + pr_alert("BUG: %s on %s at 0x%08lx\n", > regs->dar < PAGE_SIZE ? "Kernel NULL pointer dereference" : > - "Unable to handle kernel data access", regs->dar); > + "Unable to handle kernel data access", > + is_write ? "write" : "read", regs->dar); > break; > case 0x400: > case 0x480: > -- > 2.13.3