Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp86220ybp; Thu, 3 Oct 2019 10:32:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqyXnYtClQK2YM1DEADZ/1t5ZvwiOx+9ObLFDIpAVU4PRDraUZTUd9KhFFkaF9Io/IMet0Ok X-Received: by 2002:a50:ee10:: with SMTP id g16mr10745769eds.267.1570123939568; Thu, 03 Oct 2019 10:32:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570123939; cv=none; d=google.com; s=arc-20160816; b=rcy8QgODF442v/yp/GeFVBh1mbT0IyROfQC8Z3ehKMdaiZuMapT3A5CAiZOUPAGV0l ANkC1JZVLd4+41/y5/qTjXAunB4IlJW4pkLUwye+usHpsJh4prY8p20AL1DMPp9EVqeu KS/un/tPY+Vsq5dfAaGEZsb2/8Am7MCC9WTKT+NpWYAgM/09FUjUOcaM+Nms5G9toKAx z5nj8KTCkdtegrS+i+Sw1BAS8WaTC7AkDLhioH7k4EYZJ7mKuMFG/IwcHzbw9EXIVoM1 lSIF0ZI5l8c6ivE+oXJdjMULtrLkhcB6nX7SGZxGncJDwkiN1jyNkS7bpcsHrvYuZ50y LgWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=N8nqULJYwYK3dqUx+/t/jn1dSQrJxj1g21IHuN5Q3Ws=; b=doBAPQj7Mbzxy1DB9DB/QdIibrkhjympxVktz1ZSDYCQPjWX9XAPi5tR9faeJf/7yK a65gSHYkfrlTyfTEAP+7b/j7Em5gjS+HeCIGRIsF5WxIvwT6IEyHdKj+mc4lFYtbBz96 fyPB0pb1mdG8/RpfuEHo6DqA6MQLnV/OfKf2A/cs55GQeT9YY9SpAIdte9aQ5bMDrcBC gOJuvNha+n+CcdFz5NBMhTmm1B3DmEBMNQAi0riTrHWksCLP+5d5X/saCFmLVjPPoSd7 k6eZ7in/MQIyFV9C/F+j2BUDLY8U0TGtrlulEateSesWgmBdKoGEWiWIrREHzwH24mLh bgjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rxlzUdI1; 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 d19si1597751ejy.353.2019.10.03.10.31.55; Thu, 03 Oct 2019 10:32:19 -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=@kernel.org header.s=default header.b=rxlzUdI1; 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 S2389627AbfJCQSq (ORCPT + 99 others); Thu, 3 Oct 2019 12:18:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:45372 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389609AbfJCQSn (ORCPT ); Thu, 3 Oct 2019 12:18:43 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6419A20865; Thu, 3 Oct 2019 16:18:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570119522; bh=go4gISpPptYozRWU+BE/wujcGDmxrPipOM0pk7HrB70=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rxlzUdI1NF+u0aS9GTERD9K8rJQCZFMYH4Atz78KSRr6nENHNW9CJvaZUCGXGTtzJ urSPHqlKHy4kJSvZMuARuJrfBjxHCMC98jaU828Hn66SObqVlmTYH5YL2oOmuUWMCo +lcatqxpDnPb+VyUVjSJ5rudg/2ZglBJ8d0t4F9w= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yazen Ghannam , Borislav Petkov , "linux-edac@vger.kernel.org" , James Morse , Mauro Carvalho Chehab , Tony Luck , Sasha Levin Subject: [PATCH 4.19 096/211] EDAC/amd64: Decode syndrome before translating address Date: Thu, 3 Oct 2019 17:52:42 +0200 Message-Id: <20191003154508.826678578@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191003154447.010950442@linuxfoundation.org> References: <20191003154447.010950442@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yazen Ghannam [ Upstream commit 8a2eaab7daf03b23ac902481218034ae2fae5e16 ] AMD Family 17h systems currently require address translation in order to report the system address of a DRAM ECC error. This is currently done before decoding the syndrome information. The syndrome information does not depend on the address translation, so the proper EDAC csrow/channel reporting can function without the address. However, the syndrome information will not be decoded if the address translation fails. Decode the syndrome information before doing the address translation. The syndrome information is architecturally defined in MCA_SYND and can be considered robust. The address translation is system-specific and may fail on newer systems without proper updates to the translation algorithm. Fixes: 713ad54675fd ("EDAC, amd64: Define and register UMC error decode function") Signed-off-by: Yazen Ghannam Signed-off-by: Borislav Petkov Cc: "linux-edac@vger.kernel.org" Cc: James Morse Cc: Mauro Carvalho Chehab Cc: Tony Luck Link: https://lkml.kernel.org/r/20190821235938.118710-6-Yazen.Ghannam@amd.com Signed-off-by: Sasha Levin --- drivers/edac/amd64_edac.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c index 1613df20774f9..94265e4385146 100644 --- a/drivers/edac/amd64_edac.c +++ b/drivers/edac/amd64_edac.c @@ -2501,13 +2501,6 @@ static void decode_umc_error(int node_id, struct mce *m) goto log_error; } - if (umc_normaddr_to_sysaddr(m->addr, pvt->mc_node_id, err.channel, &sys_addr)) { - err.err_code = ERR_NORM_ADDR; - goto log_error; - } - - error_address_to_page_and_offset(sys_addr, &err); - if (!(m->status & MCI_STATUS_SYNDV)) { err.err_code = ERR_SYND; goto log_error; @@ -2524,6 +2517,13 @@ static void decode_umc_error(int node_id, struct mce *m) err.csrow = m->synd & 0x7; + if (umc_normaddr_to_sysaddr(m->addr, pvt->mc_node_id, err.channel, &sys_addr)) { + err.err_code = ERR_NORM_ADDR; + goto log_error; + } + + error_address_to_page_and_offset(sys_addr, &err); + log_error: __log_ecc_error(mci, &err, ecc_type); } -- 2.20.1