{"id":812687,"url":"http://patchwork.ozlabs.org/api/patches/812687/?format=json","web_url":"http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20170912043859.32473-4-bsingharora@gmail.com/","project":{"id":2,"url":"http://patchwork.ozlabs.org/api/projects/2/?format=json","name":"Linux PPC development","link_name":"linuxppc-dev","list_id":"linuxppc-dev.lists.ozlabs.org","list_email":"linuxppc-dev@lists.ozlabs.org","web_url":"https://github.com/linuxppc/wiki/wiki","scm_url":"https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git","webscm_url":"https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/","list_archive_url":"https://lore.kernel.org/linuxppc-dev/","list_archive_url_format":"https://lore.kernel.org/linuxppc-dev/{}/","commit_url_format":"https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id={}"},"msgid":"<20170912043859.32473-4-bsingharora@gmail.com>","list_archive_url":"https://lore.kernel.org/linuxppc-dev/20170912043859.32473-4-bsingharora@gmail.com/","date":"2017-09-12T04:38:58","name":"[v1,3/4] powerpc/mce: Hookup ierror (instruction) UE errors","commit_ref":null,"pull_url":null,"state":"superseded","archived":true,"hash":"e052de17b18da7677c1cb840f9b92cfe27c30f10","submitter":{"id":9347,"url":"http://patchwork.ozlabs.org/api/people/9347/?format=json","name":"Balbir Singh","email":"bsingharora@gmail.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20170912043859.32473-4-bsingharora@gmail.com/mbox/","series":[{"id":2612,"url":"http://patchwork.ozlabs.org/api/series/2612/?format=json","web_url":"http://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=2612","date":"2017-09-12T04:38:55","name":"Revisit MCE handling for UE Errors","version":1,"mbox":"http://patchwork.ozlabs.org/series/2612/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/812687/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/812687/checks/","tags":{},"related":[],"headers":{"Return-Path":"<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>","X-Original-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Delivered-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Received":["from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xrshj3Y6Hz9s1h\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue, 12 Sep 2017 14:47:01 +1000 (AEST)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xrshj22LjzDqYV\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue, 12 Sep 2017 14:47:01 +1000 (AEST)","from mail-pf0-x243.google.com (mail-pf0-x243.google.com\n\t[IPv6:2607:f8b0:400e:c00::243])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128\n\tbits)) (No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3xrsWv1X1dzDrFM\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tTue, 12 Sep 2017 14:39:23 +1000 (AEST)","by mail-pf0-x243.google.com with SMTP id e69so3997445pfg.4\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tMon, 11 Sep 2017 21:39:23 -0700 (PDT)","from firefly.ozlabs.ibm.com ([122.99.82.10])\n\tby smtp.gmail.com with ESMTPSA id\n\tc62sm1165226pfl.84.2017.09.11.21.39.18\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tMon, 11 Sep 2017 21:39:20 -0700 (PDT)"],"Authentication-Results":["ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"XDid6j22\"; dkim-atps=neutral","lists.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"XDid6j22\"; dkim-atps=neutral","ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=gmail.com\n\t(client-ip=2607:f8b0:400e:c00::243; helo=mail-pf0-x243.google.com;\n\tenvelope-from=bsingharora@gmail.com; receiver=<UNKNOWN>)","lists.ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"XDid6j22\"; dkim-atps=neutral"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=iywKuPgUibNPv4DNzC66PNh35dvLVxcnan3KIb7mHLY=;\n\tb=XDid6j22IiV2lzV85rF1mw72JsXaz3GqqXNTvFa8eTw4yIzfNPCeooUC72lMKjWF3h\n\tY/Vsn6rw1bFSd3o/UnbQwIO5Nb7Clpgz7ekShOWD9XK0uKcg/v8N9WsxTy2xT64O5UO0\n\tcMpX5ou9BofNQBcO+77lt7V/a+ldaZ0/5m1598y8Dt3Nrt27Qiz/j0/4JiK3tFxkhfWu\n\t+XyLeEJDTfPvs98J4KV2x9X6i/qT+j8ZstQiLZthEwbgPPC1MggB9+y9KCiG8ZEw2l4s\n\tE5hPX4OrfXj1RHiXLRRb9USoBADup5lVZoFLW7MadL3MHDfijCwfECgW4wq/+pXlW2nX\n\t+Q3Q==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=iywKuPgUibNPv4DNzC66PNh35dvLVxcnan3KIb7mHLY=;\n\tb=Ndt43pUMGVsqUreCayXCHyC7E15aHJDrlsLaFjGCwInNNJB60okZXINx8X7kAYdMfF\n\tvIKX5RZrFsxRakxVEV1b+Z/EBfoAwq5Z4znJYjjXbbqHCSvV5vvIiNlOckXI9MJPWf2y\n\tSvFcFMUOD9tOT0ee1do5pNDFTVr7+LtvdtUaGhkfJjiKJZnlU3KexNEBY281vs9frx7R\n\tRuX9Q3RFfVYMxVhN/NLC4h33MXTasrCIYs1vA9VyFx8WpXttU4cZA8TRA9MdtqofWUd9\n\teUE5rDnD09ajzzBrLoyVzDUKd3xIAOVkYrzjkei8SaqbOvHkWwDEKIWUg7BK2/9ecnNN\n\tL/5g==","X-Gm-Message-State":"AHPjjUis99nCYoyr3vRKkDMba7o3esPwTObPbFUZUnrmGU5aPJwmEhd2\n\trpgIzvQMlvJSvQ==","X-Google-Smtp-Source":"ADKCNb5i7t2XBbUAttMzgCR4u9ngNsX4+l1rMeu/nCua5cYeiTkWPgwEaDuZA8NnwjWS5isvmoOXaw==","X-Received":"by 10.84.248.7 with SMTP id p7mr15686427pll.237.1505191161412;\n\tMon, 11 Sep 2017 21:39:21 -0700 (PDT)","From":"Balbir Singh <bsingharora@gmail.com>","To":"mpe@ellerman.id.au","Subject":"[PATCH v1 3/4] powerpc/mce: Hookup ierror (instruction) UE errors","Date":"Tue, 12 Sep 2017 14:38:58 +1000","Message-Id":"<20170912043859.32473-4-bsingharora@gmail.com>","X-Mailer":"git-send-email 2.9.5","In-Reply-To":"<20170912043859.32473-1-bsingharora@gmail.com>","References":"<20170912043859.32473-1-bsingharora@gmail.com>","X-BeenThere":"linuxppc-dev@lists.ozlabs.org","X-Mailman-Version":"2.1.23","Precedence":"list","List-Id":"Linux on PowerPC Developers Mail List\n\t<linuxppc-dev.lists.ozlabs.org>","List-Unsubscribe":"<https://lists.ozlabs.org/options/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe>","List-Archive":"<http://lists.ozlabs.org/pipermail/linuxppc-dev/>","List-Post":"<mailto:linuxppc-dev@lists.ozlabs.org>","List-Help":"<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help>","List-Subscribe":"<https://lists.ozlabs.org/listinfo/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe>","Cc":"mahesh@linux.vnet.ibm.com, linuxppc-dev@lists.ozlabs.org,\n\tnpiggin@gmail.com","Errors-To":"linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org","Sender":"\"Linuxppc-dev\"\n\t<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>"},"content":"Hookup instruction errors (UE) for memory offling via memory_failure()\nin a manner similar to load/store errors (derror). Since we have access\nto the NIP, the conversion is a one step process in this case.\n\nSigned-off-by: Balbir Singh <bsingharora@gmail.com>\n---\n arch/powerpc/kernel/mce_power.c | 23 ++++++++++++++++++++---\n 1 file changed, 20 insertions(+), 3 deletions(-)","diff":"diff --git a/arch/powerpc/kernel/mce_power.c b/arch/powerpc/kernel/mce_power.c\nindex 956dadc..e0a7b1c 100644\n--- a/arch/powerpc/kernel/mce_power.c\n+++ b/arch/powerpc/kernel/mce_power.c\n@@ -490,7 +490,8 @@ static int mce_find_instr_ea_and_pfn(struct pt_regs *regs, uint64_t *addr,\n \n static int mce_handle_ierror(struct pt_regs *regs,\n \t\tconst struct mce_ierror_table table[],\n-\t\tstruct mce_error_info *mce_err, uint64_t *addr)\n+\t\tstruct mce_error_info *mce_err, uint64_t *addr,\n+\t\tuint64_t *phys_addr)\n {\n \tuint64_t srr1 = regs->msr;\n \tint handled = 0;\n@@ -542,8 +543,23 @@ static int mce_handle_ierror(struct pt_regs *regs,\n \t\t}\n \t\tmce_err->severity = table[i].severity;\n \t\tmce_err->initiator = table[i].initiator;\n-\t\tif (table[i].nip_valid)\n+\t\tif (table[i].nip_valid) {\n \t\t\t*addr = regs->nip;\n+\t\t\tif (mce_err->severity == MCE_SEV_ERROR_SYNC &&\n+\t\t\t\ttable[i].error_type == MCE_ERROR_TYPE_UE) {\n+\t\t\t\tunsigned long pfn;\n+\t\t\t\tstruct mm_struct *mm;\n+\n+\t\t\t\tif (user_mode(regs))\n+\t\t\t\t\tmm = current->mm;\n+\t\t\t\telse\n+\t\t\t\t\tmm = &init_mm;\n+\n+\t\t\t\tpfn = addr_to_pfn(mm, regs->nip);\n+\t\t\t\tif (pfn != ULONG_MAX)\n+\t\t\t\t\t*phys_addr = pfn;\n+\t\t\t}\n+\t\t}\n \t\treturn handled;\n \t}\n \n@@ -671,7 +687,8 @@ static long mce_handle_error(struct pt_regs *regs,\n \t\thandled = mce_handle_derror(regs, dtable, &mce_err, &addr,\n \t\t\t\t&phys_addr);\n \telse\n-\t\thandled = mce_handle_ierror(regs, itable, &mce_err, &addr);\n+\t\thandled = mce_handle_ierror(regs, itable, &mce_err, &addr,\n+\t\t\t\t&phys_addr);\n \n \tif (!handled && mce_err.error_type == MCE_ERROR_TYPE_UE)\n \t\thandled = mce_handle_ue_error(regs);\n","prefixes":["v1","3/4"]}