From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1ADCFC433E6 for ; Fri, 8 Jan 2021 23:16:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D1BAC23AAA for ; Fri, 8 Jan 2021 23:16:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726013AbhAHXP6 (ORCPT ); Fri, 8 Jan 2021 18:15:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725306AbhAHXP5 (ORCPT ); Fri, 8 Jan 2021 18:15:57 -0500 Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D3CEC061574; Fri, 8 Jan 2021 15:15:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=TmO09cObcPohwfcznvarkJ3GaxSuxbSBMS5Y5aaVzdk=; b=TyXKOGDk9E8YintME3xbAqr/B9 K+tYo9PPw3b3nuqfZ1us1zZLL7vIzv0mkZbT9jkIetntI8a0A/SRNJ12IlxJZgEeA6O9ieAa1ClrH 61WReUB0glKhhrH33J4teA1L77tLr8VzY+HQvewUAqesj0rUIqgb+E91EYKhNuGZmfm7cOzmNqzEE KOYZfImxWooGC26vkLSXNU05SkgqezmppqCDEt8XJSNnO9Kr6glaka/Y8Y6Osoz+If7t4DLqntkO9 Q6fbLpuHyCmW672fn/PAoYFMQcrjsoPrJZArUbhYCSbVp6HnOSanMwRo016uKcqCh9MFKPS2Tl7u6 uHVGhTbg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1ky0yF-0005sk-M4; Fri, 08 Jan 2021 23:15:04 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id 9605A9866B2; Sat, 9 Jan 2021 00:14:59 +0100 (CET) Date: Sat, 9 Jan 2021 00:14:59 +0100 From: Peter Zijlstra To: "Luck, Tony" Cc: Borislav Petkov , "x86@kernel.org" , Andrew Morton , Darren Hart , Andy Lutomirski , "linux-kernel@vger.kernel.org" , "linux-edac@vger.kernel.org" , "linux-mm@kvack.org" Subject: Re: [PATCH 2/2] futex, x86/mce: Avoid double machine checks Message-ID: <20210108231459.GC2453@worktop.programming.kicks-ass.net> References: <20210108222251.14391-1-tony.luck@intel.com> <20210108222251.14391-3-tony.luck@intel.com> <20210108224715.GB2453@worktop.programming.kicks-ass.net> <4493a015ffcd4d82bbea7d1e5c2e73e4@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4493a015ffcd4d82bbea7d1e5c2e73e4@intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 08, 2021 at 11:08:58PM +0000, Luck, Tony wrote: > > I think this is horrid; why can't we have it return something different > > then -EFAULT instead? > > I did consider this ... but it appears that architectures aren't unified in the > return value from get_user() But surely none are currently returning -EMEMERR or whatever name we come up with. > Here's another function involved in the futex call chain leading to this: > > static int get_futex_value_locked(u32 *dest, u32 __user *from) > { > int ret; > > pagefault_disable(); > ret = __get_user(*dest, from); > pagefault_enable(); > > return ret ? -EFAULT : 0; > } > > It seems like the expectation here is just "zero or not" and we > don't care what the "not" value is ... just turn it into -EFAULT. Yeah, saw that, but that should be trivially fixable I'm thinking.