Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1386583lqa; Mon, 29 Apr 2024 07:14:26 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWs3O6bZCOvjpM6IeApDTIc+S2U9HKdzRbsFjrg7jcEvlr++JK2f0wvsDG9+nlRyjh9ZJQofeInkUakqqY863fvEjMGpil8qu8mGl4CMw== X-Google-Smtp-Source: AGHT+IEgjBNZ05T2on2Jk+lUAJHOf4Yc3JqFS9YcRODwjufcpWH5kJbtP7dpnVhiqmrFKzMEjoJw X-Received: by 2002:a17:902:e849:b0:1eb:7334:1228 with SMTP id t9-20020a170902e84900b001eb73341228mr6893855plg.3.1714400065868; Mon, 29 Apr 2024 07:14:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714400065; cv=pass; d=google.com; s=arc-20160816; b=qhCb2fPoAEvBUiOPdef8nHyN6sg9fLh+yA27JQqJdVI4HlYOhRuI5mvfAzv2nz13IW 3tKDGIOTx67g2xlsXMmO9W0m/E3g8zaWUzFSbPj0hunMXnqyp5CB6T7LLs1JtK1hAmsu SOtwoo/Csv1HZpntvJmcabjlUDLVcUkIO/Xxpof1Nl4EgRE1p7xxuqs9dmgV3tqsXvkn QBbK7WacoWCVJcsvo9UoTYmz3iyAVx9bAi7E9OTOCQMUS4sL/XLNKVElgMuezPobnKEI SptniPyR5jdRjA+1tMAxUFzkeiHc05VAHfHExMU5n7rOfBRJ8Y0/AnRlBTOt8T0nsi7s 5dLg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=oE13an3Sp1ZiL8L+oexSnFWbk2LomH2Gdl8IFWAPmBc=; fh=jb1WRtInB41ba+u4J4OkhJWUqpvIwCTfy5V56t0SZnY=; b=avGRPO3tz/Tqf/wD8qnYtqrqFhrbJYrxoe0iNHa6ur6BYPhWxiUbZx9eH/vyjKYY/H vvcKJnvbNB0WGXwMHrknsf2nzWxCoqC451Zh/nijsylDnDYbWGLXMb1YeF78GozKauNM GcAjOYy7eE6BhKiipZVA51DcqnRd5+mb1KK5kw4p8u+mZtBKC56u+AYY4pk7m9kLh2K9 MMe9UMHaWI0oKQdH9l/Tz6sbO6PYkgE8nTv73yPwSTqV+894is4ySwucGLY8RyHpEpyq xQybZsmM+UxO1m22FYjQvGA2xT/3tLnMQH6X7xoo6Okq73QKttwbgw/FtETdq6OLyFjY hP3Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@alien8.de header.s=alien8 header.b=YcUNS3Iq; arc=pass (i=1 spf=pass spfdomain=alien8.de dkim=pass dkdomain=alien8.de dmarc=pass fromdomain=alien8.de); spf=pass (google.com: domain of linux-kernel+bounces-162425-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162425-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id u8-20020a1709026e0800b001e905a72e0esi15906797plk.470.2024.04.29.07.14.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 07:14:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-162425-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=alien8 header.b=YcUNS3Iq; arc=pass (i=1 spf=pass spfdomain=alien8.de dkim=pass dkdomain=alien8.de dmarc=pass fromdomain=alien8.de); spf=pass (google.com: domain of linux-kernel+bounces-162425-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162425-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 79688281664 for ; Mon, 29 Apr 2024 14:13:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6970077F11; Mon, 29 Apr 2024 14:13:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (4096-bit key) header.d=alien8.de header.i=@alien8.de header.b="YcUNS3Iq" 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 89F849468; Mon, 29 Apr 2024 14:13:03 +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=1714399985; cv=none; b=Tve5/F7aP6rrnKVc3h+1t47wMEVRueUuPlJ79CHcvgy6eCbYIQ5XzLYjjQa57ROryMEPa8QgnULhA9prOQ60EpTiEELbhBCJtVLJ579h4LN3f9a55FpINeVm+DdiBb5bMVJeqDLInPZIBuuTtYCoQp9sKdPH2JzgginDiZ8y94U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714399985; c=relaxed/simple; bh=3gAkZO77w6Vg/FEj8UDrJXdxtegquGNjwt6XnnvslHo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=s9CfZk/YMsoOZkKM0ZmHnIXlo++0HwhLUq/p5lk3vXILc89V0opFIPvj40LwYK8Iv2lQjcP6XqKTHaj+soeiwSGuQSdVIq3fcsrm3UVnOrZlYqkt0BBRphCUhHw9r8w1dP0rwAN8SIWHDt9q6uifustlXDvromKecRoormRlr7o= 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=YcUNS3Iq; 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 Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTP id 9263C40E0187; Mon, 29 Apr 2024 14:13:01 +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 BnmjDi5cs7Hs; Mon, 29 Apr 2024 14:12:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=alien8; t=1714399977; bh=oE13an3Sp1ZiL8L+oexSnFWbk2LomH2Gdl8IFWAPmBc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=YcUNS3IqG3cdvTCOxDmGgWIHR4cqdTpT1EMz/hhxhrAtUIroLJN6O5oOM/P+81bQX PiZ3Txn0Zd6S1auEhZwouMkK0TJo4C/Xm6YUhdWt79m3rgJd1mkiRPNOn4tmA4ebqv eC8REkxxV8dSmk4CnNps/FHnRwl3qWl3a1+zhpHsQzr86PcQ/Eqid1G8Gu7NrHvfW2 sF0ib0TZaCAltoXUULIXWSIqvU7045bR2nKrnjvuA86ffxpzhQ/atUYILCpcQxZh9g eo01CuXplF3hMPmAZppm06XFP4esrw7SJRFwmMpbI0HpOWT6sqXlhJnKJtPiWZEKks 1b0wJYAm1g6x1gOS8nNkgBZo2+KG9j9iJIGyPbapIF1+/vrPvw6prD82q1xlj1/dEq XCTiYl0PUaGWbaTrYe9GMelYVstUQXKzh6TeDgAoS5T4Xdq3ko8yJtlxDQ9PzZOBwB zaIEmdDbpD3HzFO+cK0LH3isfShMuvewJ1MeMOjIxWLoSJS9lUuAadpfXTBtOcER0I rZAclthPHh/xurXgnmRqTm/a7IL4O/VppU+lUIYEX1TZrEHZKpTodOFYGSV4F8FODt DohmsijoYWhzat0KupGj7+jZwOnyz0cpEOJy8Fld54BFT0lC7hfykCbRdZPCN73EwB DSYP+P1gX9dQd4V7VIj5Edkc= Received: from zn.tnic (pd953020b.dip0.t-ipconnect.de [217.83.2.11]) (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 66DC240E016B; Mon, 29 Apr 2024 14:12:49 +0000 (UTC) Date: Mon, 29 Apr 2024 16:12:44 +0200 From: Borislav Petkov To: Yazen Ghannam Cc: robert.richter@amd.com, linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org, tony.luck@intel.com, x86@kernel.org, Avadhut.Naik@amd.com, John.Allen@amd.com Subject: Re: [PATCH v2 07/16] x86/mce/amd: Simplify DFR handler setup Message-ID: <20240429141244.GGZi-q3NdmI17pai4N@fat_crate.local> References: <20240404151359.47970-1-yazen.ghannam@amd.com> <20240404151359.47970-8-yazen.ghannam@amd.com> <20240424190658.GHZilYUvw1KfSfVd_e@fat_crate.local> <20240429125956.GNZi-ZzN1Izxps8ztT@fat_crate.local> Precedence: bulk X-Mailing-List: linux-kernel@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: On Mon, Apr 29, 2024 at 09:56:56AM -0400, Yazen Ghannam wrote: > Right, I mean we should do things the simpler way unless there's a real issue > to address. You need to pay attention to past issues before you go, simplify it and break it again. > I'm not opposed to this, but I don't understand what is at risk. > > Is it that the function pointer may not be written atomically? So even if we > write it again with the same value, a concurrent interrupt on another core may > see a partially updated (corrupt) pointer? Yes, it won't happen, they say as it is guaranteed by the architecture. But I've heard those "promises". > intel_init_cmci() does not do this check. So is it more at risk, or is the AMD > code just more cautious? > > Again I'm not against the current code. I just think we should simplify it, if > possible. So in looking at the INTR_CFG MSR, I think we should do a function which does MCA init stuff only on the BSP exactly for things like that. There you can set the interrupt handler pointer, the INTR_CFG MSR and so on. And we don't have such function and I've needed a function like that in the past. And just for the general goal of not doing ugly code which should run only once but is run per-CPU just because our infrastructure doesn't allow it. Wanna give that a try? Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette