Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2066488lqt; Sun, 21 Apr 2024 23:31:33 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXcPBt/06LEaQbD/Tednn5ps4vcyWOCk5gLvYJiWgrVGxSuQFl+53hmojmGLpLHw+vYZoPwMgN2M+bKpzR0DJecJBBcv9Qvp5MOmkHODA== X-Google-Smtp-Source: AGHT+IHygtKACDGdlsEeFvdUJ2a0Dq18+Gkyv/cQBZsIFuZlQFpGVJoErozLlDEMkvW8l2m93595 X-Received: by 2002:ad4:41d0:0:b0:6a0:6649:c7f3 with SMTP id a16-20020ad441d0000000b006a06649c7f3mr8677536qvq.41.1713767493552; Sun, 21 Apr 2024 23:31:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713767493; cv=pass; d=google.com; s=arc-20160816; b=ANir/Cfq11cam3lEinzH7MYTL3oHGBg4zU/zsvpm5oM840sHSDhvpE6ez1ICywcka4 qnfSQFPBqAvAdj+173PLHkFTJ4Q5CAo06yhMPVQQMivrJTO+TIM0XcYpbqLg0CGqCuiD pudWGwlzOWh0mkoWpOKeCmWwu6NEfUZ2efrLZSGFHmSsdhB+NVO378jsRr5t1E0nIV2/ 1Kh2REydr993SBMww0FVSn/CRLDrOkiEBcs6uvOjAWKL3+W5WCSBdE3YpK7ymF588SvA 2OOhoh8k68LdVedGLZC27x6suADzahQM3LVw4Vhghco4pLk6u3k+U9dH8oVKwK91qbxx S1gA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=L3a0jSRw+MZFp8s/6+dJnOk39w0ZIQV4LLLA+ljmtU0=; fh=mI9f/xSTJlSmyjSGKyHiYAR1ofn1iJyvriHYVAFI9Uc=; b=ZSqmS4uMFEZRmhRa61v1C7ga0KCgmJ9DxSNupO+C3QCp4Dwm3CzYAlobWz5ov/4Exa M7L0kDvrjX/3sAtHhiTSMw7tF8VNuj/JXTFjIcqvTXPq2sx+j114iakcT+YLh9DZQvBk SJpwV+570OYvBcDq40si2+m4V5rP3lVBsiqjh7SdqGutbIB5ANAxrUgdLew3C/aDQFY9 RmmfNfBL/+RBT+QmqzkI4y+vY6DZ9ZEAt9YqlLtZmR5X2vJJ6yherYSooGAxYGyiJ4vd saiuD9JDVC7YkV0J9CAH2aISmHgFQY1okd6QVVPf7ELRwf4/rO470QiYKtDfk/NEHEbG aDrA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=K3pMlGzO; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-152790-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-152790-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id r19-20020a056214125300b0069b2a0fce8esi9770299qvv.595.2024.04.21.23.31.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Apr 2024 23:31:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-152790-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=K3pMlGzO; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-152790-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-152790-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 4C30F1C21CC8 for ; Mon, 22 Apr 2024 06:31:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DC4CD481A4; Mon, 22 Apr 2024 06:31:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="K3pMlGzO" Received: from mail-vk1-f169.google.com (mail-vk1-f169.google.com [209.85.221.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AF96F47F73 for ; Mon, 22 Apr 2024 06:31:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713767485; cv=none; b=Y/JvaFMVoyZES4+oQFiYOgX1nhkGBExhrihoQ2dhBVEjtskJFESeM4cB9Dg1okxEMOv8oArbbXcFR5nHCdgYgy8NoM8gCbuuVbvk/ixehbO1jzi2ndZblEls6B8Q93HWHRguB/UxqEOWuyDBs7rno7p35r30BSMfFvwIxwbnOwo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713767485; c=relaxed/simple; bh=L3a0jSRw+MZFp8s/6+dJnOk39w0ZIQV4LLLA+ljmtU0=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=OF82ZI1Nfbye7tHIrFV7WgRjQKIFW98LZZo1okGzow86Re2VEyzB/V/2aoHHBc3fUjy7msd5gde/q2bu7JpAA9yZIfEMIfBwwQh3zHGFkMf4HSAea1rf4rB72fAK9kb7WUUdIBptZz2duNeKjZ9OI9gTMRMmhuP6Z9k45X4H8o4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=K3pMlGzO; arc=none smtp.client-ip=209.85.221.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-vk1-f169.google.com with SMTP id 71dfb90a1353d-4db24342894so1042101e0c.0 for ; Sun, 21 Apr 2024 23:31:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1713767482; x=1714372282; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=L3a0jSRw+MZFp8s/6+dJnOk39w0ZIQV4LLLA+ljmtU0=; b=K3pMlGzO85ohHDE9G/IkCDv+6K+jODlWotKTp0+WThmOWLdIaLhZoUg4XUyJhYRwg3 lBspf3dvZbBlYPpV3qS9LVSEONbcL1BsySIi4h66qq3uYOFL8zJZXQqn8kGko1Sv7Ut8 9NJHIoMDrRqL7FDhs2PlF8n7fnsay657CcS0k8+QQZhxmNegQ8BMVLu5uD/bbqoBSkq3 HXRYxBGtuRP/qRxhXoq54o0dMkyzX50pm+BZ7VT62O1lXwW0IK6JYw9vaMNa1sH3eSg9 x7KsZYKiJy5d/OyVOhzXqNSvkAcjqExgDH1hKumF360L5WvaIo5lg4TxqxzLYPfftsAR wbQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713767482; x=1714372282; h=content-transfer-encoding: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=L3a0jSRw+MZFp8s/6+dJnOk39w0ZIQV4LLLA+ljmtU0=; b=KZ+3t8S9jMq/vTKhb1Afw8FRjhm099WTVSJQ2wZAALzRzMxTO2m+3TWIDu3yCP9/rF BYdduiIwtA9AN0ZxeO/owjELvlqBzlbSujoPCYAG1YabeeM0yUcVXQmluH6OfY3+qDQN vQ8v+vH314AAIWbUiHhOTMf4vFZJNYuT1U45zEFz3EQw/hPLoM69ruHhMnmBqqLP8nUC XL8ET4m52WiqkMIhoC716no0EfeCwcO4rYt4uiLRvXw3h8h1rYVZbC6sKg/mlgl2F/q/ +m4sYDbPCHeFUICpAHF+tWacruIdKfQ+Ze0DW8Uvophe39s/AiWIATnRukd9O/ZIKCKK 0YNQ== X-Forwarded-Encrypted: i=1; AJvYcCVhm6pmMItYIBQkUaoSm34WFXS5rNsVnX+F/4C46bzb+gR3DHzMNuvc66taOkUOZCd00tY8tSmySNv7bgMsbuI0jmTn/h6YOz6Wp0lB X-Gm-Message-State: AOJu0YwfEUA3z0Z2B1MDJzEUT3FnnzcGOWLVZ88Wl4r1QY5g/MtCy2Cr SNkzoPv6IPybQs9ddiBim+3zRmHihiOkJkmkWs1Q1B3ClZMtpU4kMpFJ4yRr8Aebj438AN6Igzg J6t87HwSe6anO2Pv5mcjmeQNZPLTmuxcnfhN/ X-Received: by 2002:a05:6122:7d3:b0:4d8:7339:4c35 with SMTP id l19-20020a05612207d300b004d873394c35mr5908761vkr.13.1713767482365; Sun, 21 Apr 2024 23:31:22 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240416095323.1107928-1-aliceryhl@google.com> <5a45ccc04cae4976900d031989104737@AcuMS.aculab.com> <98d51251e0dc470983b3fae339e0f3bf@AcuMS.aculab.com> In-Reply-To: <98d51251e0dc470983b3fae339e0f3bf@AcuMS.aculab.com> From: Alice Ryhl Date: Mon, 22 Apr 2024 08:31:11 +0200 Message-ID: Subject: Re: [PATCH v5 1/4] rust: uaccess: add userspace pointers To: David Laight Cc: "boqun.feng@gmail.com" , "a.hindborg@samsung.com" , "akpm@linux-foundation.org" , "alex.gaynor@gmail.com" , "arnd@arndb.de" , "arve@android.com" , "benno.lossin@proton.me" , "bjorn3_gh@protonmail.com" , "brauner@kernel.org" , "cmllamas@google.com" , "gary@garyguo.net" , "gregkh@linuxfoundation.org" , "joel@joelfernandes.org" , "keescook@chromium.org" , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , "maco@android.com" , "ojeda@kernel.org" , "rust-for-linux@vger.kernel.org" , "surenb@google.com" , "tkjos@android.com" , "viro@zeniv.linux.org.uk" , "wedsonaf@gmail.com" , "willy@infradead.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, Apr 21, 2024 at 9:49=E2=80=AFPM David Laight wrote: > > From: Alice Ryhl > > Sent: 21 April 2024 19:38 > > > > On Sun, Apr 21, 2024 at 8:08=E2=80=AFPM David Laight wrote: > > > > > > Should you be implementing 'struct iov_iter' ? > > > > > > Even if it means creating an IO_UBUF for ioctls? > > > (Although that might take some 'fettling' for read+write for ioctls.) > > > > That seems to be intended for when you have several chunks of memory > > in userspace that you want to treat as one contiguous chunk. That's > > not something I need in the Android Binder driver. > > It also transparently supports in-kernel users and some other cases. > > I think there is a patch intended for 6.10 that removes the 'read' > and 'write' driver 'ops' and requires that drivers support 'read_iter' > and 'write_iter'. Binder uses an ioctl, not read/write, so even if Binder could use it, there's no real advantage for Binder to do so. But it does sound like something we want to support eventually in the kernel. However, I've spent a long time on polishing this API, and it fits my needs well. I don't want to start over now that I am almost finished. So, I think that this could be a good follow-up to this patch that someone else is welcome to submit. Alice