From patchwork Wed Sep 13 06:10:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balbir Singh X-Patchwork-Id: 813169 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xsWY51cWwz9sNr for ; Wed, 13 Sep 2017 16:12:41 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Rtc4MICY"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3xsWY46wXWzDrNC for ; Wed, 13 Sep 2017 16:12:40 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Rtc4MICY"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:400e:c05::242; helo=mail-pg0-x242.google.com; envelope-from=bsingharora@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Rtc4MICY"; dkim-atps=neutral Received: from mail-pg0-x242.google.com (mail-pg0-x242.google.com [IPv6:2607:f8b0:400e:c05::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3xsWWD09dkzDqlw for ; Wed, 13 Sep 2017 16:11:03 +1000 (AEST) Received: by mail-pg0-x242.google.com with SMTP id v5so7213515pgn.4 for ; Tue, 12 Sep 2017 23:11:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=Xu5i3yUtKY4zHhe7FEH7D2ZAruRktcFg55Peeyu3zZE=; b=Rtc4MICYRaDEj9/qdiSNiQwWhWeU1BRAyYB7TUTjfCTVRv1RgcdbsMzQMp4F1db1uO gBFYsEWvUxHberqQVfCHmS5djw2Uf3Amzc/sgwa3CaTHIVN+c2Ur6ZwLbIaBfwOVDsAq E/Ds3VURl4Z+05AipmQTKXV1Xn451GDIbS08gyCC7qoWmdn4G5yIIejKTW0xhpWsuSfF mN9fG2AWwJWdAd8nBGFhdI/teluE0axzJMqyURfvkjzJGsgh8dnsEsGFiGtKp0B42+xQ ANEsbKdHQdvqFSY/ICeYYn/fkI+IiD9zlJ6gXg9l6F46Ugn+zq1E9hOrgPOdnuYW5ynf o8Ig== 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:date:message-id; bh=Xu5i3yUtKY4zHhe7FEH7D2ZAruRktcFg55Peeyu3zZE=; b=hL6hjofYjA8ELe9YFWvPYcqtM4l7aJS8MQvzgA691hBLoj2SqpQ0oz8T9r1okLHgB/ 3TKf5i+DiW3aEHhjWWBiHJldomrw3wGjDmTP2PfD/LNlsP/49k/Uqk1fEDOO0xd+rMej h89scEqHN738OIL6nFUibvrQd+yRQ72xt5I2gmImMGehuvhg8cblF/47yxGRlsh6eS1T wuhLMmF+oMmwbuuqv2eUm0PrTKvXMmslotEdipuSXsLA9asfTrCyGZ96Q3R78/JmBSps PrSHLY7WMA35EOnnbV6Uqq55Ccjic9qvmeUCrUg073VmBQhabn/stwHLfyCn7EPPCke+ q3lw== X-Gm-Message-State: AHPjjUixUFk9JX1cIj6xMMgvxH3vXRhmkT4fdEOXMKuv+nZNAPyIgYm/ 9H7W8wxv9WfHiQ== X-Google-Smtp-Source: ADKCNb7fd0pRWpOskHmyf2cnpLmUTuHn0qKPmPY5TffCn2LD+tATZcK2QSlj3eZLw4InlyZiSRdftQ== X-Received: by 10.99.117.81 with SMTP id f17mr17459432pgn.314.1505283061652; Tue, 12 Sep 2017 23:11:01 -0700 (PDT) Received: from firefly.ozlabs.ibm.com.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id t65sm22581016pfk.59.2017.09.12.23.10.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Sep 2017 23:11:00 -0700 (PDT) From: Balbir Singh To: mpe@ellerman.id.au, npiggin@gmail.com, mahesh@linux.vnet.ibm.com Subject: [PATCH v2 0/4] Revisit MCE handling for UE Errors Date: Wed, 13 Sep 2017 16:10:44 +1000 Message-Id: <20170913061049.13256-1-bsingharora@gmail.com> X-Mailer: git-send-email 2.9.5 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.24 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" This patch series is designed to hook up memory_failure on UE errors, this is specially helpful for user_mode UE errors. The first two patches cleanup bits, remove dead code. I could not find any users of get_mce_fault_addr(). The second one improves printing of physical address The third patch walks kernel/user mode page tables in real mode to extract the effective address of the instruction that caused the UE error and the effective address it was trying to access (for load/store). The fourth patch hooks up the pfn for instruction UE errors (ierror). The fifth patch hooks up memory_failure to the MCE patch. TODO: Log the address in NVRAM, so that we can recover from bad pages at boot and keep the blacklist persistent. Changelog v2: - Remove pr_warn from real mode to a more delayed context, where its OK to warn. - Add a trivial patch to align prints of physical and effective address Changelog v1: - address review comments from Nick and Mahesh (initialization of pfn and more comments on failure when addr_to_pfn() or anaylse_instr() fail) - Hookup ierrors to the framework as well (comments from Mahesh) Balbir Singh (4): powerpc/mce.c: Remove unused function get_mce_fault_addr() powerpc/mce: Hookup derror (load/store) UE errors powerpc/mce: Hookup ierror (instruction) UE errors powerpc/mce: hookup memory_failure for UE errors arch/powerpc/include/asm/mce.h | 4 +- arch/powerpc/kernel/mce.c | 112 +++++++++++++++++++++++++--------------- arch/powerpc/kernel/mce_power.c | 103 +++++++++++++++++++++++++++++++++--- 3 files changed, 165 insertions(+), 54 deletions(-)