Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp27003537rwd; Mon, 3 Jul 2023 19:08:59 -0700 (PDT) X-Google-Smtp-Source: APBJJlEyH4ke3C/hA1Y/EcjUjkVAwWy2wxjhow66lu1aY8WiCaLhGCREG011whinofU/eoDhmNeQ X-Received: by 2002:a17:90a:1a13:b0:263:53be:5120 with SMTP id 19-20020a17090a1a1300b0026353be5120mr10114941pjk.36.1688436539485; Mon, 03 Jul 2023 19:08:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688436539; cv=none; d=google.com; s=arc-20160816; b=PD/ffHHbTjinisB+5HeSe7Yfw6Yw8UbxTmD/2ZMHY5hK9iqt3A5Yiq55JvQBqxnHQP xZawn5GEUBwzjyn/c1OKRqFUgGpDnoRCK5d0hldO8FslyKxwgyTmzzv5w57QT8V431Xe UMstqCzsxbkj+1lUy7gpcV93UEOksCT8Cgn4XrOjQQPxVCl65k3qGf1sqbC6fY6woWLA xtzhgw87eDLEA6ecPCW02VDW+W4RvhZbsoVfsIX6S3IQXrOcWQTbDvERMtmp29k36Kyz suhJOssYRRtBG3o/WjeMQZGM38DAZnNn3wwDwBf05ebZ8aaSJ/XTIH6XYJrhwqY5pMy8 X9Sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=xRjzAE0n5uIgT1izeqo8Qt3qb3EDeNKGoRxIM7nbkoA=; fh=QsLXn1SO75Qt4VBPQkmcdgtQvHy7sUzy/XtTw7O5ucs=; b=ldzNz5EpQNQ3R5pcOwXE/vPCYVcnUSXOqqiNPb3V4cjYaYyVrIeFZ+cUObI9Mz4MUQ 4U9BWvqkiiUUX/KQjmifaJHynv/W2nqhL4MoUJHEyTu2hVV46bN+ySS9ULUxk4FmOI1G h9sfAaSGNRgmHUxukdevZTWE73n2ey/oC16DaqB8OHs1m844ufo5hK7LpLLfijmuyjBi /SGIAnKvaakinRjiwv5O7fdu0zTyTC8DrvpSTgaeTn/Bbljs82BVOr3LgVFv5pYgTfU5 gZhNhtGzaTog+sLnublR3M4E4yeotNOHAXfiHZqcrA7yAAY8oEcsIi+69jy9qscqWGih MbuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=eYRB9ymF; 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=canonical.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lb17-20020a17090b4a5100b0025bae648cfcsi12649307pjb.176.2023.07.03.19.08.41; Mon, 03 Jul 2023 19:08:59 -0700 (PDT) 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=@canonical.com header.s=20210705 header.b=eYRB9ymF; 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=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230521AbjGDBuy (ORCPT + 99 others); Mon, 3 Jul 2023 21:50:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229897AbjGDBuw (ORCPT ); Mon, 3 Jul 2023 21:50:52 -0400 Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1576E54 for ; Mon, 3 Jul 2023 18:50:50 -0700 (PDT) Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 74CF83F19A for ; Tue, 4 Jul 2023 01:50:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1688435448; bh=xRjzAE0n5uIgT1izeqo8Qt3qb3EDeNKGoRxIM7nbkoA=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=eYRB9ymFWvP4l1f3DIYXJm6h3CjvKssUan205Z10JGaWiTc4a9zxnvawFj7MKCnJz ZrrzPbgr4mspT+y2PuYzsyfjFJzBrgPMzazRg1rC9clALYNTfdIEymMOYZv1lADpV7 QeGASqTDQ1CYn1aEOQQ8WrYXS4hdPLNzkmkOxtqqNXRECesTLTAmHY74KGpNLBNYNJ hz8MuI7BjJgv0N9k9wMuyGM4m9ZI7hkOAXq2EvQV2B6X4ac6feee6xmydDeYFGvAlu mhMw6zPNCoSDTrBMNUHyyatWtrq9H2PUecVKbVLFixTtZAFXUKMV9CY1hAoGGx6VGV OcnrWwmD2EYgA== Received: by mail-pf1-f200.google.com with SMTP id d2e1a72fcca58-6686e4499b1so5143885b3a.1 for ; Mon, 03 Jul 2023 18:50:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688435446; x=1691027446; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xRjzAE0n5uIgT1izeqo8Qt3qb3EDeNKGoRxIM7nbkoA=; b=c0wcUMmO1C5QDHUMce65PaMc9re/3WGJ7sJqz61mBDMh26Lt7G6Z5bqv9RL3IVxC5s ZRM8gmlZOfkdS6EhZPeLlgCATc3ck794/c+SwpyA8S4nrJ2ufyDpKxf1vRVj5AyM0rET tgLTye9xOniwzi6U4ew7caFCHXfvgkHNFTjmH4ybtlOCO/MPKmhrCBmj6Jh9PzN0wkyL 0ETHcI3qWKaxR+zh4hE+Di+xKQ56UpxMilFgUlWDucVqDvHnodvEhQ7j7aKuPj6Wqacr XbEmCI9W8szR3sjRuI3D/1ggKz7CPU8j1+4Gz15dMjSxVsQTiizrs2ELiu9YFuOadvYT ka1A== X-Gm-Message-State: ABy/qLbjbMm19d6A4yLkpNC1v/YR6N1RmkjBeBLig81+ZtbVJM47aufd YHPXqaZYITANVsoDvbx7t+Ew68e6A6/7KpjJTX921uIGiCp+eifgL2yZKAnOCMDzwoyG84Ua8KQ VRI6XwsSgMZ5A64KmptH2jKaZd9J4tW5yrAhUt4VbufU4Dpg8WJ/QFLrtTw== X-Received: by 2002:a05:6a00:c91:b0:657:f26e:b01a with SMTP id a17-20020a056a000c9100b00657f26eb01amr12396882pfv.26.1688435446043; Mon, 03 Jul 2023 18:50:46 -0700 (PDT) X-Received: by 2002:a05:6a00:c91:b0:657:f26e:b01a with SMTP id a17-20020a056a000c9100b00657f26eb01amr12396872pfv.26.1688435445547; Mon, 03 Jul 2023 18:50:45 -0700 (PDT) MIME-Version: 1.0 References: <20230703162509.77828-1-koba.ko@canonical.com> <4ec2b7d2-11a5-6ab6-087a-175ed31faca4@web.de> In-Reply-To: From: Koba Ko Date: Tue, 4 Jul 2023 09:50:33 +0800 Message-ID: Subject: Re: [PATCH v2] EDAC/i10nm: shift exponent is negative To: "Luck, Tony" Cc: Markus Elfring , "linux-edac@vger.kernel.org" , "kernel-janitors@vger.kernel.org" , Borislav Petkov , James Morse , Mauro Carvalho Chehab , Robert Richter , LKML Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 On Tue, Jul 4, 2023 at 5:51=E2=80=AFAM Luck, Tony wro= te: > > > > UBSAN complains this error > > > ~~~ > > > UBSAN: shift-out-of-bounds in drivers/edac/skx_common.c:369:16 > > =E2=80=A6 > > > ~~~ > > > > > > when get rows, cols and ranks, the returned error value doesn't be > > > handled. > > > > > > check the return value is EINVAL, if yes, directly return 0. > > =E2=80=A6 > > > > * Please improve this change description further. > > To be specific. Initially you reported this because of the UBSAN error > report. But, after community discussion you now know that the problem > is that one or more of the rows/cols/ranks has a value that the EDAC driv= er > doesn't expect and probably can handle. > > So, in V2, the commit message should start with the information these > values are out of range and mention this was discovered when UBSAN > put out a warning about a negative shift. No need to include the whole > of the UBSAN stack trace. > > Then describe the two fixes that this patch includes. One is to change th= e > edac debug message into a console error message to enable further > debug of this issue. The other is to skip the unrecognized DIMM. > > > * How do you think about to add the tag =E2=80=9CFixes=E2=80=9D? > > This is a good idea. Use git blame, or dig into the GIT history to > find the commit where this code was introduced (hint .. git blame > says: > 88a242c98740 ("EDAC, skx_common: Separate common code out from skx_edac") > but that obviously just refactored code, so you should dig back more into > the history. > > > > V2: make error-print explicitly > > > --- > > > > Would you like to avoid a misplaced marker line here? > > > > See also: > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree= /Documentation/process/submitting-patches.rst?h=3Dv6.4#n686 > > That's an excellent resource. Thanks for your advices and I will modify. here's part of dmesg enabled EDAC_DEBUG ~~~ [ 4.032332] EDAC DEBUG: skx_register_mci: MC#1: mci =3D 00000000799db99e [ 4.032334] EDAC DEBUG: i10nm_get_dimm_config: dimmmtr 0xffffffff mcddrtcfg 0xffffffff (mc1 ch0 dimm0) [ 4.032335] EDAC DEBUG: skx_get_dimm_attr: bad ranks =3D 3 (raw=3D0xffff= ffff) [ 4.032337] EDAC DEBUG: skx_get_dimm_attr: bad rows =3D 7 (raw=3D0xfffff= fff) [ 4.032338] EDAC DEBUG: skx_get_dimm_attr: bad cols =3D 3 (raw=3D0xfffff= fff) [ 4.032339] EDAC DEBUG: i10nm_get_dimm_config: dimmmtr 0xffffffff mcddrtcfg 0xffffffff (mc1 ch0 dimm1) [ 4.032340] EDAC DEBUG: skx_get_dimm_attr: bad ranks =3D 3 (raw=3D0xffff= ffff) [ 4.032341] EDAC DEBUG: skx_get_dimm_attr: bad rows =3D 7 (raw=3D0xfffff= fff) [ 4.032341] EDAC DEBUG: skx_get_dimm_attr: bad cols =3D 3 (raw=3D0xfffff= fff) [ 4.032343] EDAC DEBUG: i10nm_get_dimm_config: dimmmtr 0xffffffff mcddrtcfg 0xffffffff (mc1 ch1 dimm0) [ 4.032344] EDAC DEBUG: skx_get_dimm_attr: bad ranks =3D 3 (raw=3D0xffff= ffff) [ 4.032345] EDAC DEBUG: skx_get_dimm_attr: bad rows =3D 7 (raw=3D0xfffff= fff) [ 4.032346] EDAC DEBUG: skx_get_dimm_attr: bad cols =3D 3 (raw=3D0xfffff= fff) [ 4.032347] EDAC DEBUG: i10nm_get_dimm_config: dimmmtr 0xffffffff mcddrtcfg 0xffffffff (mc1 ch1 dimm1) [ 4.032348] EDAC DEBUG: skx_get_dimm_attr: bad ranks =3D 3 (raw=3D0xffff= ffff) [ 4.032349] EDAC DEBUG: skx_get_dimm_attr: bad rows =3D 7 (raw=3D0xfffff= fff) [ 4.032349] EDAC DEBUG: skx_get_dimm_attr: bad cols =3D 3 (raw=3D0xfffff= fff) ~~~ I shared the whole dmesg through g-drive. https://drive.google.com/file/d/1epnDZNezGiJsK1eT4UNOi8_igcBSXtiF/view?usp= =3Dsharing > > -Tony