Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp1116605rdb; Fri, 2 Feb 2024 14:27:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IHo82pbSSV8X0Az0hf7FmrQ2H4xw0voR21bzO4Suvs7BKRzi2RzTfbDYsM5Ytw8fpH7bV+m X-Received: by 2002:a17:902:a388:b0:1d9:65e6:4acc with SMTP id x8-20020a170902a38800b001d965e64accmr4444208pla.42.1706912853291; Fri, 02 Feb 2024 14:27:33 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706912853; cv=pass; d=google.com; s=arc-20160816; b=kiujnOTEQx63Fx0MA7Zm2TJue+AR2efh5abpsIHUsSSQYIIHYMLlEErOIEMUjRaSXV jerS2rzcL6IeSVndS0O31X6Q+QFZtUfYcud4cDqzc1wQhRE+8KFBc6aVRwSailNjEUoN Pgaiuhw+wDIU/oCAyIZcbRqknBvkq+uff9LUw1Hml0lF/PVMy0B61iBMl0J8jauciPeH vqbhhZIM2I3pHVYXZs3Gd6luJnqUcueeOELNJxagRkz6nXsqfo55Ln5u0+/0tksu31Kx GqW8HDvfOBibzC/OAOmH0n5VQq7qXqDohyxSGlSg6iYwuqwth4fGPSmii7P/FlLJ4onn FD6Q== 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=sNyqIbKGi0aGVOVLD44ssIoLe6QNqeVe9459dcb6Bvo=; fh=N2GjS0UeBXePQCWvDGva0GzQLSOoBSHvv0ZDKz02+I8=; b=0ikdMvyJ/k7vDQ4B1MDfTwgojiGO5EPLMc31GDRqbzg9MkMHFCErmf0dxOQIz+ga3n uVjf/rtkgmoR2sFCSRPe3l8i8BtEA+WyYZvw4+EFfYZ6O9Ek1w7Nvb8HVJLoEppddS4z Nvi4vGxw+Vo39s+uEsJNFGc+dDQNH6HHflqV/oA4kfOC+LD/s9jSKiqxmotr7SBFbqKq 00qLRc0gn6ipfPlfQt2Yd0VRJ8vcvUsI18gKB6b8x3bAz5tjx2QQyqTvkdqpIinnyS4C 1c5hHEgTTn4UZ7rw09Eecp2N9xza57kZz1EXMRx8MHGrSdNz9NFC1OWFrmfN6N/eo0Zp Fwvg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@alien8.de header.s=alien8 header.b=jFDFX3UJ; 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-50657-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50657-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de X-Forwarded-Encrypted: i=1; AJvYcCU9io8N6wcLylm6kXm37DJe4ibC48+euIrvNN+ToYaafD0a9rHgvPxxylmoDbaZwm+1ipmf+MAmMlcG3mIPgXKzZs+vo6r17des7W1P1A== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id ja15-20020a170902efcf00b001d76a322667si2301028plb.72.2024.02.02.14.27.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 14:27:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-50657-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=alien8 header.b=jFDFX3UJ; 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-50657-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50657-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 9D05FB23FCB for ; Fri, 2 Feb 2024 22:22:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 00BEF85934; Fri, 2 Feb 2024 22:22:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (4096-bit key) header.d=alien8.de header.i=@alien8.de header.b="jFDFX3UJ" 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 7BD82839F2; Fri, 2 Feb 2024 22:22:47 +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=1706912570; cv=none; b=Xaq1HcL3SugLLQYsTnZq6caqkfwqvZqv7ZpcO7W39fSrEzIW1nvAbizAC1G65OfrsO7Om9sN/oWCZoHxtUYWMdQsG8W/H1p7jLIV/jcRWw4n95DrGH+WPRWefzwNDvu8Syc1L1kPK/8D0AOGD/TJdw+hNEDRj2BoOjb+wE+qYV0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706912570; c=relaxed/simple; bh=4PZhvHo6uDCpPEVMml9xvzWJSuoXozqaUH+5H4e84BA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=HrtDIx1ybBg0nfwp3PWuT7yfFGTLrPnBJf/A/7jQ1fIZu4fxzpjrP6VBoJl93W7BInBF/D40A47Wj6PiPqDV7kelQ5X2dvzJx649PNADwaO4pvVk9nPhU1qHPSc2I0VZnXDxoBD//0m28PBAw4/TnK9ogvheGNTLJSDk0EMH2lQ= 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=jFDFX3UJ; 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 B031B40E01A9; Fri, 2 Feb 2024 22:22:44 +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 4ZSY74Yz66Xt; Fri, 2 Feb 2024 22:22:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=alien8; t=1706912562; bh=sNyqIbKGi0aGVOVLD44ssIoLe6QNqeVe9459dcb6Bvo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jFDFX3UJ3LdDOh3U9RxCfy+dLlli8OwkPJl6vDX+UDne+orVAQ2kB/SsYbVG0l+CH iuM3/2vkYvZJjy4BUuriq1obO1sW2lDqM/wHIMxtdPdPhZyd5NIySH7J5FRIoAnUOi 3fTdZBufBCgpT7V4zin4UVfiHBKpak6dUTTWgL0VT1dqRTTbYEvXcWlWW4dXoHDuko PUBhNg8KfqZJ8Z/PAZtZQkWwEbPPE0g+ZZDtbfOgpFsZgx/tY9rd3oC7F4wA5tymuP Alsw8hkdgkmOCE2BU+TV5ZxhvO7Wm42+4zxg62zmBDE7FUaPoVhBjE7LwGOHh1Weq8 rTX/TlZUsQOtJFZkdQrAkGp6MXNQUpshH8ZBUHjDGiNy4gCiUl2Ij11bIi71a5MpCh RP3kFmYrJS7ECjhILLBivwgh/fhJOfqqyFVG4A7lzUR8+HGDvK5gck2/UhBY83YSYu 6hIrqOeGmOHZ7bRoF1BvxBp8ODlzW+0O3Sh8rEslLATqbJlpNE0N83b5Cmxls2a0Ko 2xsjfW+p85wOQI0ZalJsCsj6r1wkZe0nsPzn90nrC3FCvlFTvqYhsn21vnAv88YV4T 5W0eM2fSxn++NnQyQ110Kg1fzh1orPW2Gf76lfBpTq/sFx/jB+iGZrjapP7fRiJOaX 6r9jrEyyWrMFnpjA0sf7xu7c= Received: from zn.tnic (pd953021b.dip0.t-ipconnect.de [217.83.2.27]) (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 1080040E00C5; Fri, 2 Feb 2024 22:22:26 +0000 (UTC) Date: Fri, 2 Feb 2024 23:22:20 +0100 From: Borislav Petkov To: "Luck, Tony" Cc: Tong Tiangen , Thomas Gleixner , Ingo Molnar , "wangkefeng.wang@huawei.com" , Dave Hansen , "x86@kernel.org" , "H. Peter Anvin" , Andy Lutomirski , Peter Zijlstra , Andrew Morton , Naoya Horiguchi , "linux-kernel@vger.kernel.org" , "linux-edac@vger.kernel.org" , "linux-mm@kvack.org" , Guohanjun Subject: Re: [PATCH -next v4 2/3] x86/mce: rename MCE_IN_KERNEL_COPYIN to MCE_IN_KERNEL_COPY_MC Message-ID: <20240202222220.GIZb1rHG3NiZKmdRXu@fat_crate.local> References: <20240111135548.3207437-1-tongtiangen@huawei.com> <20240111135548.3207437-3-tongtiangen@huawei.com> <20240131070258.GGZbnwov0g918F-FGz@fat_crate.local> <3009aadd-69d6-c797-20b4-95cf926b6dd9@huawei.com> <20240201142016.GFZbuooG9CRoK90U2C@fat_crate.local> <39c1e4d2-b1d0-91ae-595e-1add4698dd7f@huawei.com> <20240202133911.GBZbzwf-M37M-J3EJX@fat_crate.local> <20240202194257.GFZb1FwcPPO8WXF86H@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 Fri, Feb 02, 2024 at 09:36:27PM +0000, Luck, Tony wrote: > There are two places in the pipeline where poison is significant. > > 1) When the memory controller gets a request to fetch some data. If the ECC > check on the bits returned from the DIMMs the memory controller will log > a "UCNA" signature error to a machine check bank for the memory channel > where the DIMMs live. If CMCI is enabled for that bank, then a CMCI is > sent to all logical CPUs that are in the scope of that bank (generally a > CPU socket). The data is marked with a POISON signature and passed > to the entity that requested it. Caches support this POISON signature > and preserve it as data is moved between caches, or written back to > memory. This may have been a prefetch or a speculative read. In these > cases there won't be a machine check. Linux uc_decode_notifier() will > try to offline pages when it sees UCNA signatures. Yap, deferred errors. > 2) When a CPU core tries to retire an instruction that consumes poison > data, or needs to retire a poisoned instruction. These log an SRAR signature > into a core scoped bank (on most Xeons to date bank 0 for poisoned instructions, > bank 1 for poisoned data consumption). Then they signal a machine check. And that is the #MC on a poison data load thing. FWIW, the other vendor does it very similarly. > Partial cacheline stores to data marked as POISON in the cache maintain > the poison status. Full cacheline writes (certainly with MOVDIR64B instruction, > possibly with some AVX512 instructions) can clear the POISON status (since > you have all new data). A sequence of partial cache line stores that overwrite > all data in a cache line will NOT clear the POISON status. That's interesting - partial stores don't clear poison data. > Nothing is logged or signaled when updating data in the cache. Ok, no #MC on writing to poisoned cachelines. Ok, so long story short, #MC only on loads. Good. Now, since you're explaining things today :) pls explain to me what this patchset is all about? You having reviewed patch 3 and all? Why is this pattern: if (copy_mc_user_highpage(dst, src, addr, vma)) { memory_failure_queue(page_to_pfn(src), 0); not good anymore? Or is the goal here to poison straight from the #MC handler and not waste time and potentially get another #MC while memory_failure_queue() on the source address is done? Or something completely different? Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette