From patchwork Mon May 29 06:26:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 768020 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wbmyT0ywlz9s74 for ; Mon, 29 May 2017 16:28:17 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="am6FbBC9"; 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 3wbmyS725WzDqK8 for ; Mon, 29 May 2017 16:28:16 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="am6FbBC9"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mail-pf0-x241.google.com (mail-pf0-x241.google.com [IPv6:2607:f8b0:400e:c00::241]) (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 3wbmx10ylyzDq9m for ; Mon, 29 May 2017 16:27:00 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="am6FbBC9"; dkim-atps=neutral Received: by mail-pf0-x241.google.com with SMTP id f27so11194269pfe.0 for ; Sun, 28 May 2017 23:27:00 -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=DrvYVexLtI2yad/EH/3Sl6FK04LR8rlbgrIGMM/z78M=; b=am6FbBC9eSjYXYBif12cf5y3WNaT8PFAL8kkEq66wJ9KkVD+QIEiUEiA0AE6RS8nj+ K1umv8sTy1PnEVAhanawVCiStC5CtrAwEZ6UnYhdAtudtzjVTzlhC4F6YU5Ckru5QXd1 9rQfI7mjLBV7x51eMSTJ02dum7gZg15QjL7JgeLQb4cKk6GugnoJKwKyFOf4Wf4tcWjr lU9NxW9p8jKTYfW48nTJ0cTnf1JNTacQUjo+BImNCctGhXn2Ah5ypGm4rG6QexH5p5Gy M9yZBO54Lo01ZhBmkX+DD+7Qaf7v2+8yAgkPGC0lQef0mKK63DGlcLq0uVUkWJCvnfvu vKtw== 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=DrvYVexLtI2yad/EH/3Sl6FK04LR8rlbgrIGMM/z78M=; b=lvuOxKT7EAQfd5cdRDZd/1DpXZ5NAvZfRLS2kdWfhUxx1x3kG06RIpHh7d6bmPPogv h9Bv1plg2fbJsb0bHuDvucvPnvTIxfuqOxvNAbjD1Sln2Xkay7y5atA6Ycc3pcZ/V7OK 79Vdae/BQicU/ENxQZM5Otfyzlf50by9q6gtvpFE6OzINeHMyHKlNnHvxpnmA2VWoCp0 15BscmUDey0i49A1bD8wAJ1FVWdXl2yvoDEtyJ1efXqz0mzJ3dGWJl5b+aOR9w3YNAE8 TaLgWyUbhqGQkp3xOWgyNvln4E8aHzdUyTOeh/qvUFTB0nEcWrjTlm2YbnE85rvO7Ax7 ySGg== X-Gm-Message-State: AODbwcAJXW4+0bMreQAnHjjWqavL7a6khMMArp4/a+pu41+X6T9M94G0 eUDAN7Xz9lgHmPz/ X-Received: by 10.99.126.67 with SMTP id o3mr16987834pgn.36.1496039218239; Sun, 28 May 2017 23:26:58 -0700 (PDT) Received: from roar.au.ibm.com (14-202-186-188.tpgi.com.au. [14.202.186.188]) by smtp.gmail.com with ESMTPSA id g20sm15083597pfk.21.2017.05.28.23.26.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 May 2017 23:26:56 -0700 (PDT) From: Nicholas Piggin To: linuxppc-dev@lists.ozlabs.org Subject: [PATCH] powerpc/64s: machine check handle ifetch from foreign real address for POWER9 Date: Mon, 29 May 2017 16:26:44 +1000 Message-Id: <20170529062644.21634-1-npiggin@gmail.com> X-Mailer: git-send-email 2.11.0 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nicholas Piggin Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" The i-side 0111b case was missed by 7b9f71f974 ("powerpc/64s: POWER9 machine check handler"). It is possible to trigger this exception by branching to a foreign real address (bits [8:12] != 0) with instruction relocation off, and verify the exception cause is found after this patch. Fixes: 7b9f71f974 ("powerpc/64s: POWER9 machine check handler") Reported-by: Mahesh Salgaonkar Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/mce.h | 15 ++++++++------- arch/powerpc/kernel/mce.c | 1 + arch/powerpc/kernel/mce_power.c | 3 +++ 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/arch/powerpc/include/asm/mce.h b/arch/powerpc/include/asm/mce.h index 81eff8631434..190d69a7f701 100644 --- a/arch/powerpc/include/asm/mce.h +++ b/arch/powerpc/include/asm/mce.h @@ -90,13 +90,14 @@ enum MCE_UserErrorType { enum MCE_RaErrorType { MCE_RA_ERROR_INDETERMINATE = 0, MCE_RA_ERROR_IFETCH = 1, - MCE_RA_ERROR_PAGE_TABLE_WALK_IFETCH = 2, - MCE_RA_ERROR_PAGE_TABLE_WALK_IFETCH_FOREIGN = 3, - MCE_RA_ERROR_LOAD = 4, - MCE_RA_ERROR_STORE = 5, - MCE_RA_ERROR_PAGE_TABLE_WALK_LOAD_STORE = 6, - MCE_RA_ERROR_PAGE_TABLE_WALK_LOAD_STORE_FOREIGN = 7, - MCE_RA_ERROR_LOAD_STORE_FOREIGN = 8, + MCE_RA_ERROR_IFETCH_FOREIGN = 2, + MCE_RA_ERROR_PAGE_TABLE_WALK_IFETCH = 3, + MCE_RA_ERROR_PAGE_TABLE_WALK_IFETCH_FOREIGN = 4, + MCE_RA_ERROR_LOAD = 5, + MCE_RA_ERROR_STORE = 6, + MCE_RA_ERROR_PAGE_TABLE_WALK_LOAD_STORE = 7, + MCE_RA_ERROR_PAGE_TABLE_WALK_LOAD_STORE_FOREIGN = 8, + MCE_RA_ERROR_LOAD_STORE_FOREIGN = 9, }; enum MCE_LinkErrorType { diff --git a/arch/powerpc/kernel/mce.c b/arch/powerpc/kernel/mce.c index 5f9eada3519b..92f185875694 100644 --- a/arch/powerpc/kernel/mce.c +++ b/arch/powerpc/kernel/mce.c @@ -268,6 +268,7 @@ void machine_check_print_event_info(struct machine_check_event *evt, static const char *mc_ra_types[] = { "Indeterminate", "Instruction fetch (bad)", + "Instruction fetch (foreign)", "Page table walk ifetch (bad)", "Page table walk ifetch (foreign)", "Load (bad)", diff --git a/arch/powerpc/kernel/mce_power.c b/arch/powerpc/kernel/mce_power.c index f913139bb0c2..d24e689e893f 100644 --- a/arch/powerpc/kernel/mce_power.c +++ b/arch/powerpc/kernel/mce_power.c @@ -236,6 +236,9 @@ static const struct mce_ierror_table mce_p9_ierror_table[] = { { 0x00000000081c0000, 0x0000000000180000, true, MCE_ERROR_TYPE_UE, MCE_UE_ERROR_PAGE_TABLE_WALK_IFETCH, MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, +{ 0x00000000081c0000, 0x00000000001c0000, true, + MCE_ERROR_TYPE_RA, MCE_RA_ERROR_IFETCH_FOREIGN, + MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, { 0x00000000081c0000, 0x0000000008000000, true, MCE_ERROR_TYPE_LINK,MCE_LINK_ERROR_IFETCH_TIMEOUT, MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, },