From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759432AbcAKKod (ORCPT ); Mon, 11 Jan 2016 05:44:33 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:34311 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757510AbcAKKoa (ORCPT ); Mon, 11 Jan 2016 05:44:30 -0500 Date: Mon, 11 Jan 2016 11:44:25 +0100 From: Ingo Molnar 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 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> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * 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