Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp2730456rdb; Wed, 15 Nov 2023 08:59:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IE4uIS0qFP6ecE1mFySEtPp77RJdIUYCEQBfTSVv/ppjsxMOH7zN8JMG0c9r0YiYXDDXI0Q X-Received: by 2002:a05:6808:1293:b0:3ae:e79d:79a0 with SMTP id a19-20020a056808129300b003aee79d79a0mr14220852oiw.30.1700067558223; Wed, 15 Nov 2023 08:59:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700067558; cv=none; d=google.com; s=arc-20160816; b=SHfsTqqbUQbVZlOXD8gQIzPPCNfKKNO6Xz8fgNqHKK0eHRZBVsMcYp/SxictbJT8qG NtI7CH+PD6ZkNjBDOz69k0f6m9Xz0sDXdtvyLujSzCI0hY9WEDORDMcUp2unQnt8/Qfx 0FQU5Ick5QT6jFrA2tO7otwsk0XXBalvkDLAg4mbF9xgJNDA9Xuz/WNcLT3EaVilKcca Eu0nGNDJ8E3eDsd+lxwKsj+yhfPTR1p75g65yZSqQtNHMwHIXU1pwnVdwLcFM9CLeJwC uYEFXkTFnlkmW70pgSa6wjuBz2N7HexQE/ZepMlSvaLOtH7f/4YZJGFvKHhTi85TRkw1 DsoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=ac4Ls6gftQvQgbcRf5XLhX5PwcgnIwraX4CtQN05HrE=; fh=z6c0fzFHchNks9S/ypHnVGlhx6dRJ36w9ILgOP8PNJY=; b=C0X/+glHPSJ03DIPvTqCH1VHendicv/ig36Vp5TaTGyh3tuB30Kz6WVRxl7DeNNrO0 7PdvLauqgia7FRWVEd9dZQP7POoWUgBiSc1+PV+IgBUK+75gxcpARgDxYlx/pVaTWe2m w+p6O6/OPi5nNNiCBw0RYywtQhdNHV8w2pS8agyJava7X844pjTjj94b4dUdMki0iSLa t9posQIwXnxZhnCZt18qNyWGRRo4L55VEUL5JCGRgPftQvOiYb/apSV0LDxJJ52SD417 pfHHQYKJZhCjLeHTF419o2qfdlKO28N3BW+EkmHu8ZkDrqesoBipCubCnnKU6E2nk5CF 8zqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=ISToxIFw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id l23-20020a635b57000000b005bdf5961646si10164026pgm.268.2023.11.15.08.59.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 08:59:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=ISToxIFw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id D2329821692E; Wed, 15 Nov 2023 08:59:16 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229630AbjKOQ7O (ORCPT + 99 others); Wed, 15 Nov 2023 11:59:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229497AbjKOQ7O (ORCPT ); Wed, 15 Nov 2023 11:59:14 -0500 Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62D7218E for ; Wed, 15 Nov 2023 08:59:09 -0800 (PST) Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-2c788f5bf53so81585531fa.2 for ; Wed, 15 Nov 2023 08:59:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; t=1700067547; x=1700672347; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=ac4Ls6gftQvQgbcRf5XLhX5PwcgnIwraX4CtQN05HrE=; b=ISToxIFwv32EAIpVkhDLFkDZCmzsjj7iEL7z4lL9dWknjh7m/SwyKBjF4gmLs7MbOp BBQDAjbMS1dSLB0rOsfeRW76HT+wYD78wxoI5/RfwL5PA07Is3NMz1Y/R2l8pz+ayAe0 edNZ/avSIq+f+GVmo8imQDB/SOG9TedAuXbl0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700067547; x=1700672347; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ac4Ls6gftQvQgbcRf5XLhX5PwcgnIwraX4CtQN05HrE=; b=NVHGl7eH8Dibrh0m+WxJmF4gS37wizhWGLrU+D7XdN1sosYzn9mZXSgRDPcomPj9+2 xnUbNeqTjQfvSZRALK3qgy4RRAvuH/rK0ZCQ8gGzEyyhVk2NEP5mR9qwlTv9OA4es1hg F8R7w2qLVH37PCxilfIEhwSPBexf/ex37/dJ+CqD/wauCV510UoTe9eH9O92954r4PhP Z3NshZL0T8bMWwP8ZHaG+8FkUWdnq/RKlWLH7ZDugUy1MdcH+oKF9uSOXZ6LyR/WrWca /h8DHXMiYA31RrmYKpPc209H7NtjdpC+63nMfMTznaEtlDqd9CHm6x6zLMeVgn0Hz871 LXfQ== X-Gm-Message-State: AOJu0YwanVkPdnICPxNzXY3zso/VAgXwJWGoTeKkJxlhQqs83yUhbOOm 6MuoLXV1thqU9W465yZHeZyORRMTIP4Hr+/W8nopg8Hg X-Received: by 2002:a05:651c:1549:b0:2c5:2813:5538 with SMTP id y9-20020a05651c154900b002c528135538mr5617596ljp.21.1700067547445; Wed, 15 Nov 2023 08:59:07 -0800 (PST) Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com. [209.85.167.44]) by smtp.gmail.com with ESMTPSA id i19-20020a2e8093000000b002c596731419sm1710679ljg.23.2023.11.15.08.59.06 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 15 Nov 2023 08:59:06 -0800 (PST) Received: by mail-lf1-f44.google.com with SMTP id 2adb3069b0e04-50943ccbbaeso10007901e87.2 for ; Wed, 15 Nov 2023 08:59:06 -0800 (PST) X-Received: by 2002:a19:7119:0:b0:507:9787:6773 with SMTP id m25-20020a197119000000b0050797876773mr9107681lfc.36.1700067545585; Wed, 15 Nov 2023 08:59:05 -0800 (PST) MIME-Version: 1.0 References: <20231115154946.3933808-1-dhowells@redhat.com> <20231115154946.3933808-6-dhowells@redhat.com> <3936726.1700066370@warthog.procyon.org.uk> In-Reply-To: <3936726.1700066370@warthog.procyon.org.uk> From: Linus Torvalds Date: Wed, 15 Nov 2023 11:58:48 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 05/10] iov_iter: Create a function to prepare userspace VM for UBUF/IOVEC tests To: David Howells Cc: Christian Brauner , Jens Axboe , Al Viro , Christoph Hellwig , David Laight , Matthew Wilcox , Brendan Higgins , David Gow , linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, linux-mm@kvack.org, netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, linux-kernel@vger.kernel.org, Andrew Morton , Christian Brauner , David Hildenbrand , John Hubbard , Huacai Chen , WANG Xuerui , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , loongarch@lists.linux.dev, linux-s390@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 15 Nov 2023 08:59:17 -0800 (PST) On Wed, 15 Nov 2023 at 11:39, David Howells wrote: > > I was trying to make it possible to do these tests before starting userspace > as there's a good chance that if the UBUF/IOVEC iterators don't work right > then your system can't be booted. Oh, I don't think that any unit test should bother to check for that kind of catastrophic case. If something is so broken that the kernel doesn't boot properly even into some basic test infrastructure, then bisection will trivially find where that breakage was introduced. And if it's something as core as the iov iterators, it won't even get past the initial developer unless it's some odd build system interaction. So extreme cases aren't even worth checking for. What's worth testing is "the system boots and works, but I want to check the edge cases". IOW, when it comes to things like user copies, it's things like alignment, and the page fault edge cases with EFAULT in particular. You can easily get the return value wrong for a user copy that ends up with an unaligned fault at the end of the last mapped page. Everything normal will still work fine, because nobody does something that odd. But those are best handled as user mode tests. Linus