From patchwork Sat Feb 11 01:17:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qiuxu Zhuo X-Patchwork-Id: 55666 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1279052wrn; Fri, 10 Feb 2023 17:49:02 -0800 (PST) X-Google-Smtp-Source: AK7set8rKFBxX6P44KryzGkOwSbCeiRThdxlkCZK6R+t1SI1V39U5TmqvoopRlOHvtlDXH2oR1Oo X-Received: by 2002:a50:d682:0:b0:4ab:1050:561e with SMTP id r2-20020a50d682000000b004ab1050561emr11994584edi.12.1676080142613; Fri, 10 Feb 2023 17:49:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676080142; cv=none; d=google.com; s=arc-20160816; b=0PTRFCc+2hPvtiyhk9euGcswJx9jfCTaCEsBeaKtuaeCrRP8XueOvpF5kvnrLTF24O oqNzjX/vh3CoH3qgajXFioBU2YzYk9tJnbS8da5b14BYhT6xYDL/sNNQUtHTe0SAsHtb RnhlcRMbI+J52rzJCZEuAghqinThlp9dLkr1JCnAeghcMkbZ+0qqhElG/ehw5nn4NNza vrHrtDOdJ9pQ7hrG+J6vfy0wVBNZnveu1oNt71IeyAhfWPPLhf5/nxchnptEvmB5Yiwz N8iuGMXA97XEDSUdHZFTqyOdXKC7ISD7ScK1VVaeW7+nAicwf71AgspD4ZuNhb3f87Pi M3ZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=f8kHTEcjIat7FvUl4Jqu7/5mdmQ0SVrveowyZoCTYsE=; b=z8AD56Id42kiVbJRtM2gmYXRbozWMM1qul6K1Bd0fK9qXYpGjOrpTr/ed1308OnSWu /IJQRWVxyuMMF5OiviVI+UZbbVDH27C5NjKlfO7LParfjNfxgR0V9RQ8HoGPG5L/Ek+2 28O4I/ZAuzepc/fzxyoe++ailnesl6TTRzUPVs7gieOr5iishauD5iai/9WXhGIKgTmJ k4IkHoFnxllDK7ueriHE8HsQssirWF1T1/Y7WjNm73IoTdAAER/gMC+wTgyX+29Hh2bJ 3etPSTVbLWLMQHWp7Jv5WtdIcLBInkcoGfMFyiKNF7STbqKjK5mX6OsnkEu5M6jh+MEV +LKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="ZW/B5D2l"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t21-20020aa7d715000000b004acb31af1e8si1641966edq.561.2023.02.10.17.48.39; Fri, 10 Feb 2023 17:49:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="ZW/B5D2l"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229853AbjBKBSD (ORCPT + 99 others); Fri, 10 Feb 2023 20:18:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229447AbjBKBSC (ORCPT ); Fri, 10 Feb 2023 20:18:02 -0500 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B25D63A08D; Fri, 10 Feb 2023 17:18:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676078281; x=1707614281; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=4hf1OloHBVcxR02BTOFRj9IkRyZKjqy/ZG29ImkR/mg=; b=ZW/B5D2lbfx5/fy5z2THVTJ2Aqx28uwfiKVRXx9v5U8QcE1RwDwiOm8K BeRN4DEjEf5r42x1nyRR7BBH54H3I2HH1nXPzwuD31YnZ98aqRyCI9m2i oSwKYJIm1Z/bhPdDgKPpqZHag2hjH4mtgVDmlU58uCeguxRLlbuGVd3/V z854/KcBxrsEF9d2xayKXEWVVnFEX4rTcc+1/IfsTVsyarenz+aIO6AIm Cph9oaiK8gIdmHSrD1whVfZHq5d5e3Ab95JCrPPw2/fYQ7MHVzEjEoJvd YGSyiFe7AJUgTOSkGECU5/3wrR4Vy4cRxnAbtriaVqTYN6+oEm0j4gNPy Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10617"; a="314210621" X-IronPort-AV: E=Sophos;i="5.97,287,1669104000"; d="scan'208";a="314210621" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Feb 2023 17:18:01 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10617"; a="670188088" X-IronPort-AV: E=Sophos;i="5.97,287,1669104000"; d="scan'208";a="670188088" Received: from qiuxu-clx.sh.intel.com ([10.239.53.105]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Feb 2023 17:17:58 -0800 From: Qiuxu Zhuo To: Tony Luck Cc: Qiuxu Zhuo , Borislav Petkov , Aristeu Rozanski , Mauro Carvalho Chehab , Feng Xu , linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/1] EDAC/skx: Fix overflows on the DRAM row address mapping arrays Date: Sat, 11 Feb 2023 09:17:28 +0800 Message-Id: <20230211011728.71764-1-qiuxu.zhuo@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757360629377760427?= X-GMAIL-MSGID: =?utf-8?q?1757497411697452840?= The current DRAM row address mapping arrays skx_{open,close}_row[] only support ranks with sizes up to 16G. Decoding a rank address to a DRAM row address for a 32G rank by using either one of the above arrays by the skx_edac driver, will result in an overflow on the array. For a 32G rank, the most significant DRAM row address bit (the bit17) is mapped from the bit34 of the rank address. Add this new mapping item to both arrays to fix the overflow issue. Fixes: 4ec656bdf43a ("EDAC, skx_edac: Add EDAC driver for Skylake") Reported-by: Feng Xu Tested-by: Feng Xu Signed-off-by: Qiuxu Zhuo --- v1->v2: Fix the Fixes tag in the commit message. drivers/edac/skx_base.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/edac/skx_base.c b/drivers/edac/skx_base.c index 9397abb42c49..0a862336a7ce 100644 --- a/drivers/edac/skx_base.c +++ b/drivers/edac/skx_base.c @@ -510,7 +510,7 @@ static bool skx_rir_decode(struct decoded_addr *res) } static u8 skx_close_row[] = { - 15, 16, 17, 18, 20, 21, 22, 28, 10, 11, 12, 13, 29, 30, 31, 32, 33 + 15, 16, 17, 18, 20, 21, 22, 28, 10, 11, 12, 13, 29, 30, 31, 32, 33, 34 }; static u8 skx_close_column[] = { @@ -518,7 +518,7 @@ static u8 skx_close_column[] = { }; static u8 skx_open_row[] = { - 14, 15, 16, 20, 28, 21, 22, 23, 24, 25, 26, 27, 29, 30, 31, 32, 33 + 14, 15, 16, 20, 28, 21, 22, 23, 24, 25, 26, 27, 29, 30, 31, 32, 33, 34 }; static u8 skx_open_column[] = {