Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp2701538rdb; Wed, 15 Nov 2023 08:12:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IE3zVtD8sO7Dx+w+MoUDMI94AvmfwQOHEZJrckOA/Fuf2InnWr3PzPA/f4bD942QM0Cls/O X-Received: by 2002:a17:902:c081:b0:1cc:31c4:377b with SMTP id j1-20020a170902c08100b001cc31c4377bmr5368908pld.63.1700064762933; Wed, 15 Nov 2023 08:12:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700064762; cv=none; d=google.com; s=arc-20160816; b=d3kj3jZBbTE02+fVNg5MVp9yEw1XGO9Gm+NwI7M2u62luRWQVvNMk9K7XX567SUb08 +RL9gqoWQgckpGjnkkiJTCo9hD0S41Yga/5gYHKqMFbXX4zeba/s7/w22Ded05VQMbxC bgItTWvOhFBdMJmpLNxu1JeJyZBbejGqV8X6YgD97LC8REMfbpwFs0BVVVZVdkUKTsEO TWLMYormZ5pMIdUPJmypWQI8haG7bgApXYJpfjz/pEr3vxXpKMZHw/m89oXjl1MrEP24 e4AB+WZMubKVw/ov3pv3sLddNdxqRepvHHDqgBUFPH1qftOoo3ap5QwLXa6ncmDIktS1 AheA== 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=1ab4jnXj8Bjx21zU5WbouPNL4gj/h303kBNvkdQgDmY=; fh=z6c0fzFHchNks9S/ypHnVGlhx6dRJ36w9ILgOP8PNJY=; b=h+SFUiUWlXXoLDiS04Y0EuSa5QSI0/zeMkkFm4pRg7+QEKY8cTngJwrq2BI+abJ09Z yfi8lxcbGbdqs66jhjWIEkGRiw1+P6a7bxqeWXLqWrLDBoZgqOCiGA6YIOVtx/plvDWg pJPdovwbA12AeEMEgKB1oCJLjvsu72y5EvAFaNbc4XkvTsQirSy+1TvwdvLg7AcTY8Nh WvF1R0ch1aEMncztI0Ym3cHKJqi352agtfTEbfDGDhMHD1Ga0Ia7b3iM339KKtSuWq8n Se8qlEJNNjvsD5nZPb+f5QFaBijdQT/02LXnv0kB5p2x7Sl+wDLjzO7wSrtmom6Sfi/p GV2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=B2OkhE7x; 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 by6-20020a056a02058600b005b88c8a25e4si2055463pgb.491.2023.11.15.08.12.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 08:12:42 -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=B2OkhE7x; 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 B9165820E51F; Wed, 15 Nov 2023 08:12:41 -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 S231904AbjKOQMl (ORCPT + 99 others); Wed, 15 Nov 2023 11:12:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232405AbjKOQMj (ORCPT ); Wed, 15 Nov 2023 11:12:39 -0500 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA2F7FA for ; Wed, 15 Nov 2023 08:12:35 -0800 (PST) Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-9df8d0c2505so209756666b.0 for ; Wed, 15 Nov 2023 08:12:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; t=1700064754; x=1700669554; 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=1ab4jnXj8Bjx21zU5WbouPNL4gj/h303kBNvkdQgDmY=; b=B2OkhE7x05d4w3oQTaBkB6Io4Ug4UjGVP9vrDzCyeOtkX22hK3oo0Wb1PE1NUihxxo 4CDEkzae3AL2iJ31u2arE6FuhIui1xKbXOuWOMvuLcWLy28X4wTLvOutjRnooR/Vx0z8 JiK+UxgfvX6gGgcp9y6taxYXzgG9i8tpqq+YQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700064754; x=1700669554; 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=1ab4jnXj8Bjx21zU5WbouPNL4gj/h303kBNvkdQgDmY=; b=q9u2C9YHQHnbbKGd1hNWnvTgen1HB1a1lHZH+++YL4ox6Yf6Sp4iU5QRVmld7lh4tp aAX1Jzsddat1r5Su9Zo/7j2tfcADb76o39g2SMCVVzInbte4buSuqk0s4VjLbWHsY+Ef f/f7j76koQTasayON7+rBeaWFWN0lt3+7fMtb+uO1+/noI0RmqbMu/kVyAQUIirL8MRF 4T1cik8nnUcwy7fEdE2j760H8qZovpUbbwdxAsRqDmR1dIWE237/twD5tc8tL8xvDNOS QI6fo9XKW5/cWIYvOM7RxrrFIRb9KTw3C/tifMhSrZXlb3GHKL/zTYbLTWAkMTEVCSXv M1VA== X-Gm-Message-State: AOJu0YysbM/hWW+xGzTZ08ahBpe/TnbU/jaJvvh9Hta/JMsvHw4FjyPh 81Xoe1fwVENaPuyof8FvY7dJI2leKUrl2VRr8t1EZvWi X-Received: by 2002:a17:906:730f:b0:9b2:b15b:383d with SMTP id di15-20020a170906730f00b009b2b15b383dmr6766559ejc.11.1700064754378; Wed, 15 Nov 2023 08:12:34 -0800 (PST) Received: from mail-ed1-f41.google.com (mail-ed1-f41.google.com. [209.85.208.41]) by smtp.gmail.com with ESMTPSA id i11-20020a170906264b00b0099bd5d28dc4sm7302909ejc.195.2023.11.15.08.12.34 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 15 Nov 2023 08:12:34 -0800 (PST) Received: by mail-ed1-f41.google.com with SMTP id 4fb4d7f45d1cf-540c54944c4so2072910a12.1 for ; Wed, 15 Nov 2023 08:12:34 -0800 (PST) X-Received: by 2002:aa7:da07:0:b0:542:ff1b:6c7a with SMTP id r7-20020aa7da07000000b00542ff1b6c7amr5958727eds.9.1700064753769; Wed, 15 Nov 2023 08:12:33 -0800 (PST) MIME-Version: 1.0 References: <20231115154946.3933808-1-dhowells@redhat.com> <20231115154946.3933808-6-dhowells@redhat.com> In-Reply-To: <20231115154946.3933808-6-dhowells@redhat.com> From: Linus Torvalds Date: Wed, 15 Nov 2023 11:12:17 -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_BLOCKED,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:12:42 -0800 (PST) On Wed, 15 Nov 2023 at 10:50, David Howells wrote: > > This requires access to otherwise unexported core symbols: mm_alloc(), > vm_area_alloc(), insert_vm_struct() arch_pick_mmap_layout() and > anon_inode_getfile_secure(), which I've exported _GPL. > > [?] Would it be better if this were done in core and not in a module? I'm not going to take this, even if it were to be sent to me through Christian. I think the exports really show that this shouldn't be done. And yes, doing it in core would avoid the exports, but would be even worse. Those functions exist for setting up user space. You should be doing this in user space. I'm getting really fed up with the problems that ther KUnit tests cause. We have a long history of self-inflicted pain due to "unit testing", where it has caused stupid problems like just overflowing the kernel stack etc. This needs to stop. And this is where I'm putting my foot down. No more KUnit tests that make up interfaces - or use interfaces - that they have absolutely no place using. From a quick look, what you were doing was checking that the patterns you set up in user space came through ok. Dammit, what's wrong with just using read()/write() on a pipe, or splice, or whatever. It will test exactly the same iov_iter thing. Kernel code should do things that can *only* be done in the kernel. This is not it. Linus