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=-3.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 DC8CFC433DB for ; Fri, 8 Jan 2021 23:15:17 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0914B23A75 for ; Fri, 8 Jan 2021 23:15:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0914B23A75 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 388FE8D01BD; Fri, 8 Jan 2021 18:15:16 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 312658D01B7; Fri, 8 Jan 2021 18:15:16 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 18C048D01BD; Fri, 8 Jan 2021 18:15:16 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0097.hostedemail.com [216.40.44.97]) by kanga.kvack.org (Postfix) with ESMTP id F2DAB8D01B7 for ; Fri, 8 Jan 2021 18:15:15 -0500 (EST) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id ADECE3A9B for ; Fri, 8 Jan 2021 23:15:15 +0000 (UTC) X-FDA: 77684165790.13.tax99_1100407274f6 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin13.hostedemail.com (Postfix) with ESMTP id 8AA9518140B67 for ; Fri, 8 Jan 2021 23:15:15 +0000 (UTC) X-HE-Tag: tax99_1100407274f6 X-Filterd-Recvd-Size: 3133 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by imf44.hostedemail.com (Postfix) with ESMTP for ; Fri, 8 Jan 2021 23:15:15 +0000 (UTC) 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> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000638, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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.