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 Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DEFA6FF8868 for ; Tue, 28 Apr 2026 11:21:20 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4g4dKq2Tnnz2xlt; Tue, 28 Apr 2026 21:21:19 +1000 (AEST) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip=63.228.1.57 ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1777375279; cv=none; b=MFn8a+YeH8CkRef6+O/M6FsnO+lhQcXYT3O5/qbX/4hA4jgBsMIeVKV+0ZGgpYBbYeG12UnQmYeLYTTHOQdXNr7iWcEg1fB2MnH0BoilEpSp4UIWVdPsTsu2bvj9qbP7xQoZzHwsZS2/wAs6IqZAOjcK/wqFNC2FsvsshkUEEwNudMd+e48b3c8EdlYSI2ysRmvi5GmGoKBYjwXRRlsUd8c6+26e4DxsJw2DVay01S034Rk0lHcz8cnFGaNu9Tq0OjoEMx0MB/FAz/gL936hV/h7z91apyG4D7E3B08bnF5KOUGHibLm+5guDgIs+ioxz3CeMQ1K6vJhRg0aqNsGBA== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1777375279; c=relaxed/relaxed; bh=wVlN3F/adnpU3EbVMRovr5PQ7UzNKrgvugpJLXSzjvA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=P9YUmD8KgbgD4fXFuC2sANP9EqnkRNWrQZ/8j3DoUpEV4E5x7TxbYdtWJOK+6J1h3V1dhpE8GgkTVjwrn+HHZ+UZBKWzlZ06dZjzmd0nhQYyDu5QbFC3gm1KOwfTkdfWS+VM5TYGXp9B51p9ZPTwB4DsWKiGpxKHxN4NNJW/nDkVFTxNS0oJN90S51xmFLAdxSYrl3qmPYEFqFRt0nlWIuPCv2zfurRCbRPaXEUQ5tRbzDr+ev8hrES/9L7PSQO9dySDIKDawjC/sjysYwKCMztf2OiL3X2RKO6X/Fur5QzeRrgTkCTQZxbFewbptFraZE6J358CxjINXBdSGDWFGw== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org; spf=pass (client-ip=63.228.1.57; helo=gate.crashing.org; envelope-from=segher@kernel.crashing.org; receiver=lists.ozlabs.org) smtp.mailfrom=kernel.crashing.org Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.crashing.org (client-ip=63.228.1.57; helo=gate.crashing.org; envelope-from=segher@kernel.crashing.org; receiver=lists.ozlabs.org) Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by lists.ozlabs.org (Postfix) with ESMTP id 4g4dKn6PSyz2xYw; Tue, 28 Apr 2026 21:21:17 +1000 (AEST) Received: from gate.crashing.org (localhost [127.0.0.1]) by gate.crashing.org (8.18.1/8.18.1/Debian-2) with ESMTP id 63SBKIxF1057213; Tue, 28 Apr 2026 06:20:18 -0500 Received: (from segher@localhost) by gate.crashing.org (8.18.1/8.18.1/Submit) id 63SBKHXo1057211; Tue, 28 Apr 2026 06:20:17 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Tue, 28 Apr 2026 06:20:17 -0500 From: Segher Boessenkool To: Yury Norov Cc: Linus Torvalds , "Christophe Leroy (CS GROUP)" , Andrew Morton , David Laight , Thomas Gleixner , linux-alpha@vger.kernel.org, Yury Norov , linux-kernel@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kvm@vger.kernel.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, sparclinux@vger.kernel.org, linux-um@lists.infradead.org, dmaengine@vger.kernel.org, linux-efi@vger.kernel.org, linux-fsi@lists.ozlabs.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux-wpan@vger.kernel.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, linux-spi@vger.kernel.org, linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-serial@vger.kernel.org, linux-usb@vger.kernel.org, xen-devel@lists.xenproject.org, linux-fsdevel@vger.kernel.org, ocfs2-devel@lists.linux.dev, bpf@vger.kernel.org, kasan-dev@googlegroups.com, linux-mm@kvack.org, linux-x25@vger.kernel.org, rust-for-linux@vger.kernel.org, linux-sound@vger.kernel.org, sound-open-firmware@alsa-project.org, linux-csky@vger.kernel.org, linux-hexagon@vger.kernel.org, loongarch@lists.linux.dev, linux-m68k@vger.kernel.org, linux-openrisc@vger.kernel.org, linux-parisc@vger.kernel.org, linux-sh@vger.kernel.org, linux-arch@vger.kernel.org Subject: Re: [RFC PATCH v1 7/9] x86: Add unsafe_copy_from_user() Message-ID: References: <0ee46bb228d97163fbdc14f2a7c52b93d8bc34ce.1777306795.git.chleroy@kernel.org> <63a4d0f6-0eb3-48cd-9f98-bf7b223b2606@kernel.org> X-Mailing-List: linuxppc-dev@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Archive: , List-Subscribe: , , List-Unsubscribe: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Hi! On Mon, Apr 27, 2026 at 06:30:16PM -0400, Yury Norov wrote: > On Mon, Apr 27, 2026 at 02:52:05PM -0700, Linus Torvalds wrote: > > On Mon, 27 Apr 2026 at 12:19, Yury Norov wrote: > > > > > > This is what Linus said when added x86 implementation for copy_from_user() > > > in c512c69187197: > > > > Note that some things have happily changed in the six+ years since... > > > > > That's partly because we have no current users of it, but also partly > > > because the copy_from_user() case is slightly different and cannot > > > efficiently be implemented in terms of a unsafe_get_user() loop (because > > > gcc can't do asm goto with outputs). > > > > now everybody can do asm goto with outputs. > > > > Yes, it's disabled on older versions, so it's not *always* available, > > but all modern versions do it. And if you care about performance, you > > won't be using an old compiler. > > The minimal GCC version is 8.1, and asm goto with outputs is supported > since GCC-11. That would brake the build, if we just switch to using it > without "CC_IS_GCC && (GCC_VERSION >= 110100)" guard. > > Is it worth to maintain 2 version of the function? I don't know... GCC 11 was released five years and a day ago. The last GCC 11 release (that of 11.5) is not even two years ago though (but there will be no more!) So it would be not conservative at all to require GCC 11 as minimum now, some people might even call it a bit aggressive. But in a year (or maybe two) the lay of the land will be rather different. Segher