From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f52.google.com (mail-wm0-f52.google.com [74.125.82.52]) by kanga.kvack.org (Postfix) with ESMTP id 020A4828F3 for ; Mon, 11 Jan 2016 05:44:31 -0500 (EST) Received: by mail-wm0-f52.google.com with SMTP id f206so261319536wmf.0 for ; Mon, 11 Jan 2016 02:44:30 -0800 (PST) Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com. [2a00:1450:400c:c09::241]) by mx.google.com with ESMTPS id kq7si809889wjb.150.2016.01.11.02.44.29 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Jan 2016 02:44:29 -0800 (PST) Received: by mail-wm0-x241.google.com with SMTP id l65so25631855wmf.3 for ; Mon, 11 Jan 2016 02:44:29 -0800 (PST) Date: Mon, 11 Jan 2016 11:44:25 +0100 From: Ingo Molnar Subject: Re: [PATCH v8 3/3] x86, mce: Add __mcsafe_copy() Message-ID: <20160111104425.GA29448@gmail.com> References: <19f6403f2b04d3448ed2ac958e656645d8b6e70c.1452297867.git.tony.luck@intel.com> <20160110112635.GC22896@pd.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160110112635.GC22896@pd.tnic> Sender: owner-linux-mm@kvack.org List-ID: To: Borislav Petkov Cc: Tony Luck , Dan Williams , Andy Lutomirski , linux-nvdimm , "linux-kernel@vger.kernel.org" , Andrew Morton , Robert , "linux-mm@kvack.org" , X86 ML * Borislav Petkov wrote: > On Sat, Jan 09, 2016 at 05:40:05PM -0800, Tony Luck wrote: > > BUT ... it's all going to be very messy. We don't have any CPUID > > capability bits to say whether we support recovery, or which instructions > > are good/bad choices for recovery. > > We can always define synthetic ones and set them after having checked > MCA capability bits, f/m/s, etc., maybe even based on the list you're > supplying... So such a synthetic CPUID bit would definitely be useful. Also, knowing whether a memcpy function is recoverable or not, should not be delegated to callers: there should be the regular memcpy APIs, plus new APIs that do everything they can to provide recoverable memory copies. Whether it's achieved via flag checking, a function pointer or code patching is an implementation detail that's not visible to drivers making use of the new facility. I'd go for the simplest, most robust solution initially, also perhaps with boot time messages to make sure users know which variant is used and now. Thanks, Ingo -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org