From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.alien8.de (mail.alien8.de [65.109.113.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 34C7E1AA782; Mon, 7 Apr 2025 13:24:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=65.109.113.108 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744032270; cv=none; b=bxnFeaT2/Oqe88btzHgzQHU+ykA5WtmtYdH8hxRhU1snpSLmHdRioRTH0HYEWT519IbuD9CFEq2LbPpHn75qzryCjfQmDvQHw1pGxkaF+OwkLGj3nQbWOgPaX3yBpxztbdm9shvX+kpRpKdvPPjavdBtD3e407eMnuegx1zSvHk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744032270; c=relaxed/simple; bh=7MKE9mFleaTuQ/AAGc7oL8jCWobkupwJUnHgXS/kZxc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=kyVL7040aUr25Kk1psjNcRVSIrZAp155meSH3DEJooi4wbOsJtuTcuQwA73OkWhSvst3zWzJHdyp3m7aX0220ZnQeyxvZPxg8e5tY5zuVRbIT6ocIQTQdHo9lCPcCdMH02XLh3agy+37toUK7UtLOWQwcD2wjer4N4qZiwEV0U8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=alien8.de; spf=pass smtp.mailfrom=alien8.de; dkim=pass (4096-bit key) header.d=alien8.de header.i=@alien8.de header.b=aON3oDu9; arc=none smtp.client-ip=65.109.113.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=alien8.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alien8.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (4096-bit key) header.d=alien8.de header.i=@alien8.de header.b="aON3oDu9" Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTP id 108AA40E0214; Mon, 7 Apr 2025 13:24:25 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at mail.alien8.de Authentication-Results: mail.alien8.de (amavisd-new); dkim=pass (4096-bit key) header.d=alien8.de Received: from mail.alien8.de ([127.0.0.1]) by localhost (mail.alien8.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id FI8F30-yL5u7; Mon, 7 Apr 2025 13:24:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=alien8; t=1744032261; bh=Bwd1Fjl4tRLoCdhvfj8ue9tcBASGoKEebRawcxyd9w4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=aON3oDu9OySFjvyQ7K0o9KMuP8bAHGTFfgEnAHOT6jSYqOHTPZ0cQBQE6QlhVP1WG OINIlAFrQICQkysDX5ufbTKpBsv1+iUfz0sTIs4jKS858abTCVhEXrqmtlD8AZKCZF 3gxVJIw7Ph9micAAarBkhVLOwpbnYYjLMUTWwHCEIHYYLjgfwEJkmFJsxwazjLWS5u thJJer7Pe9DpJy8AtGQOfvm05NHzvt44m+ZKIwYq3eFLIt0ZiA9LVy+ycs7pdRQufG uefJO+W9Ijl0sphqlN3yVInHYuNAWoBMGy8vb7D1soE63RTBxfqud+DA4UuUARZZwL TNXfBHNvElWB54wRyTFIjldvbQRJcSvWRZyk22pt0Pgm/n3EkCi31jvoN/Sj3l2pBG PITl1T7cHCP/iHk+xTKTcm3ecXhBA+L9NdbqAn97t8yd3mH0P3Rsk7ILPcH98kXiCo Vo8ORd8pKhtWVdWHtERh6xDV/YVaa2Q78ksdogi06niFpCAXkOxOAVfLTM+wO+3JXn sf0gZHZraxDK7xeHDvRJKsktiBicYsEh1oRJABdoEz9XeIWHNcUUuScjmYACfld1Qc Kr2mecSFlXNF663A1EJsJ63i6l5qTmgyTCI+u09VQe7oylUHE+x4iPV320iwgKIF9t 55Tzjm4jC5pmPjtL1Oqdgt9Y= Received: from zn.tnic (pd95303ce.dip0.t-ipconnect.de [217.83.3.206]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id B61AD40E0215; Mon, 7 Apr 2025 13:24:16 +0000 (UTC) Date: Mon, 7 Apr 2025 15:24:15 +0200 From: Borislav Petkov To: Yazen Ghannam Cc: Naveen Krishna Chatradhi , Muralidhara M K , linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] RAS/AMD/{ATL,FMPM}: Get masked address Message-ID: <20250407132415.GCZ_PR_82FKBcsIuGr@fat_crate.local> References: <20250401-fix-fmpm-extra-records-v1-0-840bcf7a8ac5@amd.com> <20250401-fix-fmpm-extra-records-v1-2-840bcf7a8ac5@amd.com> Precedence: bulk X-Mailing-List: linux-edac@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20250401-fix-fmpm-extra-records-v1-2-840bcf7a8ac5@amd.com> On Tue, Apr 01, 2025 at 08:49:01PM +0000, Yazen Ghannam wrote: > +u64 amd_atl_masked_addr(u64 addr) > +{ > + /* > + * Row retirement is done on MI300 systems, and some bits are 'don't care' > + * for comparing addresses with unique physical rows. > + * This includes all column bits and the row[13] bit. > + */ > + if (df_cfg.rev == DF4p5 && df_cfg.flags.heterogeneous) > + return addr & ~(MI300_UMC_MCA_ROW13 | MI300_UMC_MCA_COL); > + > + return addr; > +} > +EXPORT_SYMBOL_GPL(amd_atl_masked_addr); Uff, an exported silly helper. Make that static inline and stick into a header so that compiler can inline and optimize. And that header should be drivers/ras/amd/atl/internal.h Also, the helper should be called "atl_mask_address()" or so as all our functions have verbs in imperative tone. > diff --git a/include/linux/ras.h b/include/linux/ras.h > index a64182bc72ad..e822275bed6a 100644 > --- a/include/linux/ras.h > +++ b/include/linux/ras.h Internal helpers go into the internal header, not here. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette