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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2CBC3C54E76 for ; Thu, 5 Jan 2023 12:05:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 93F388E0002; Thu, 5 Jan 2023 07:05:57 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 917108E0001; Thu, 5 Jan 2023 07:05:57 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7DF0E8E0002; Thu, 5 Jan 2023 07:05:57 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 7043E8E0001 for ; Thu, 5 Jan 2023 07:05:57 -0500 (EST) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 4E37D140DA3 for ; Thu, 5 Jan 2023 12:05:57 +0000 (UTC) X-FDA: 80320616754.21.392C0B3 Received: from new3-smtp.messagingengine.com (new3-smtp.messagingengine.com [66.111.4.229]) by imf28.hostedemail.com (Postfix) with ESMTP id 43E80C000A for ; Thu, 5 Jan 2023 12:05:55 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=arndb.de header.s=fm2 header.b=FJXChScY; dkim=pass header.d=messagingengine.com header.s=fm2 header.b=NFfyIaQ0; spf=pass (imf28.hostedemail.com: domain of arnd@arndb.de designates 66.111.4.229 as permitted sender) smtp.mailfrom=arnd@arndb.de; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1672920355; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=UhZB23ikggupzfYjMRU5YJTnDOqqv+WR2zf5S9u612M=; b=pchSJD5tAzdz7ROCp+wqTjs+xZl0yiGqoE8/snqIrieM0dP5Cn2TRnECZIE+tmE2+2qghr DPzDdDSlUP91HkGg/9SDCnleyok8ypFzkLxTrx1nbONNiWwEFoKKnJoHrEGP0i/gtPuJap DXBq3XdprYt06GZRLkH0OtxBteBh+7U= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=arndb.de header.s=fm2 header.b=FJXChScY; dkim=pass header.d=messagingengine.com header.s=fm2 header.b=NFfyIaQ0; spf=pass (imf28.hostedemail.com: domain of arnd@arndb.de designates 66.111.4.229 as permitted sender) smtp.mailfrom=arnd@arndb.de; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1672920355; a=rsa-sha256; cv=none; b=PhEpLJKpkHJ950PvoR0HWmEEWjmYk9R+jHLVUAb81R5kRs3vz3a6RsLRvFPbDsezNkkmAx CWzWnCwDXHrRESGKGbxxR5R5rb/k89zEL9zeLkAeS/M9WW1SfqHFHb7aaXfnN6KNUo5AUv VO0u4YHe4q0s+GPdVBmgBITb8xNuzss= Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailnew.nyi.internal (Postfix) with ESMTP id 0B263581B7D; Thu, 5 Jan 2023 07:05:53 -0500 (EST) Received: from imap51 ([10.202.2.101]) by compute6.internal (MEProxy); Thu, 05 Jan 2023 07:05:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm2; t=1672920353; x=1672927553; bh=UhZB23ikgg upzfYjMRU5YJTnDOqqv+WR2zf5S9u612M=; b=FJXChScYkJolw+hfqvehLDIFUK 5Cg8CQlycAieHhINtFVxj5zsts7SunrKUwOEwJrQi0IRPZJ6d686tiLX3qYCN+Ov peuj6uacGf5FJWSmfyO2xgvyukwsPBYdmwGGKl/FCOaIqCaOlwZQEGEZGkV4sNWV 5GbEZuqyimzsav1KXI29aDE0cEfszY+sjgC8OhIHTCpbPFyk65mnUchZBh+glxcQ QKFSN61tZJBYwsPh/9n5W9JUxb8Xr7KNrU2ShThyrZAnX0Ggjaw1dbnENvXcTVJX gpYDFjgJuWamA0e7zeMFeKRN0V2IUzFpaJ1lRJWXKcKXZppVhfB02RfJNRbw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1672920353; x=1672927553; bh=UhZB23ikggupzfYjMRU5YJTnDOqq v+WR2zf5S9u612M=; b=NFfyIaQ0qjdgH1MxPldB9drAERMIhtMbPrqmyan05qhK cdl62dHKpKYVGS/fQCW/+4OaWjDrJNyiuE/rRhW22vCtMKy5Y8IiwmTApPd74seJ V1qPeKqGdTaJv1gQVC1vxuVXaCchfiicOfcTUiopp2DVFYz3grYYwGnb+qAPE/QT 5+wnMcpSAq9TWGW0zSGQGIBKK0BNtt4d4QWon+tBB6fvuMQBrxJlewFiwT/sdOjq VHX6MaNR2DL1QeEPK/cqbJGB6yjFVY3Ae53VYVDzNcHsGOhvZkQ/hga13+7lMojr GKpTfqYlbOPf+NdcSybgTXgDZETFX1qKxGLZxfmb2w== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrjeekgdefjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvvefutgesthdtredtreertdenucfhrhhomhepfdetrhhn ugcuuegvrhhgmhgrnhhnfdcuoegrrhhnugesrghrnhgusgdruggvqeenucggtffrrghtth gvrhhnpeevhfffledtgeehfeffhfdtgedvheejtdfgkeeuvefgudffteettdekkeeufeeh udenucffohhmrghinhepkhgvrhhnvghlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomheprghrnhgusegrrhhnuggsrdguvg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id E6BA2B60086; Thu, 5 Jan 2023 07:05:51 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.7.0-alpha0-1185-g841157300a-fm-20221208.002-g84115730 Mime-Version: 1.0 Message-Id: <5b69db0b-9eed-42ce-8e93-4b656022433f@app.fastmail.com> In-Reply-To: <20230105104019.GA7446@tellis.lin.mbt.kalray.eu> References: <20230103164359.24347-1-ysionneau@kalray.eu> <7c531595-e987-422b-bcf7-48ad0ba49ce6@app.fastmail.com> <20230105104019.GA7446@tellis.lin.mbt.kalray.eu> Date: Thu, 05 Jan 2023 13:05:32 +0100 From: "Arnd Bergmann" To: "Jules Maselbas" Cc: "Yann Sionneau" , "Albert Ou" , "Alexander Shishkin" , "Andrew Morton" , "Aneesh Kumar" , "Ard Biesheuvel" , "Arnaldo Carvalho de Melo" , "Boqun Feng" , bpf@vger.kernel.org, "Christian Brauner" , devicetree@vger.kernel.org, "Eric W. Biederman" , "Eric Paris" , "Ingo Molnar" , "Jan Kiszka" , "Jason Baron" , "Jiri Olsa" , "Jonathan Corbet" , "Josh Poimboeuf" , "Kees Cook" , "Kieran Bingham" , "Krzysztof Kozlowski" , Linux-Arch , linux-arm-kernel@lists.infradead.org, linux-audit@redhat.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-perf-users@vger.kernel.org, linux-pm@vger.kernel.org, linux-riscv@lists.infradead.org, "Marc Zyngier" , "Mark Rutland" , "Masami Hiramatsu" , "Namhyung Kim" , "Nicholas Piggin" , "Oleg Nesterov" , "Palmer Dabbelt" , "Paul Moore" , "Paul Walmsley" , "Peter Zijlstra" , "Rob Herring" , "Sebastian Reichel" , "Steven Rostedt" , "Thomas Gleixner" , "Waiman Long" , "Will Deacon" , "Alex Michon" , "Ashley Lesdalons" , "Benjamin Mugnier" , "Clement Leger" , "Guillaume Missonnier" , "Guillaume Thouvenin" , "Jean-Christophe Pince" , "Jonathan Borne" , "Julian Vetter" , "Julien Hascoet" , "Julien Villette" , "Louis Morhet" , "Luc Michel" , =?UTF-8?Q?Marc_Poulhi=C3=A8s?= , "Marius Gligor" , "Samuel Jones" , "Thomas Costis" , "Vincent Chardon" Subject: Re: [RFC PATCH 00/25] Upstream kvx Linux port Content-Type: text/plain X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 43E80C000A X-Stat-Signature: yx5abc8zd8j1qc4wn7agwr3wkqdjpztr X-HE-Tag: 1672920355-512138 X-HE-Meta: U2FsdGVkX19FA69yX59obDKMlSh3gsRr3rHru1U1oHVME3y2/+Wva8qzKzg/CMsmt5SVO0GWc6BobsF2QxVI32LQxHbkfvDZ+7g7In4Ih6vM3yzh1v7p+jkkyRJz7DLRro0pfFYkN6c/FxEaPJCRH3YwvSFYj5n0on0+GyvmtNfKpyStIEs+TVXuHNqZxTO9k4I7ofN06zN4mmyB/6xtFO4upZbvHc+F+fIZEsiH/5d1UXDeH/+jWeQSZAB8Zl3Nb0ytpaTJ6H6lJBI5vGXkB6geO054UYGVcxPTPSvs52bs9B3RH5Dx5n2QVthQfhwKlku9c8j5ykmJZRBVON9ZxTp6cGww4SfaPG/z7XfdJE+6bxb92gywYCRUJGuhY6CRQbZ7yzB90jC+bKDu4cJ9T2V6jhge8JhD78fSuKMGDsdp6ihkSVQtyH9J2X5NDqIpY26mbT526Jx95BDWYm3ssvPPbrvi/K5UrIDoF8KkB+RmAcxmz8GvXfnjkZCG96mtdWOHW9ViZg1qbTv8DL8wpS6f/HCHGimgrNyuDFpSolMQPACoCSdgSxzACncvfgK65Su220WmJGviorm/WGrGlDb3QtoQxNyjpFXViyKo/Um8uPPanDzZ1B++CoyqvHIWQNq74iTOKf9yH6VDOIbUWGtn6g3qNO4kxl5/bRY0sbW2nX+qopdaDdSUubea45l8MrP9QGvQZRsbR8FyVoIL/7mQbpjcw7Wdi9t89xnS9kvGCY1i1KdumUcjSrBWT+3NcUIanNzK8PAz9ot3hQ6QviFxHwesLWBco7SLoUgkzO4urRvwe6UKPdzQEPpp/6uW37ZRnnp5BG19TWxDbPhH6IasoigrEaaqNUdf/TXcguyQqMl3CLGUxzH1tfaWmCqQ+Qnf3uxBSTDDhItdyEnXQM7nSJ5nTVXzX7YWMCMyEB6WsoCPXbBAiOh4YGm/dH0Sngx5W5t2yKOTxyq4ye4 IhQBzECi T1KSBdKAVdhGImiE= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Jan 5, 2023, at 11:40, Jules Maselbas wrote: > On Wed, Jan 04, 2023 at 04:58:25PM +0100, Arnd Bergmann wrote: >> On Tue, Jan 3, 2023, at 17:43, Yann Sionneau wrote: >> I commented on the syscall patch directly, I think it's >> important to stop using the deprecated syscalls as soon >> as possible to avoid having dependencies in too many >> libc binaries. Almost everything else can be changed >> easily as you get closer to upstream inclusion. >> >> I did not receive most of the other patches as I'm >> not subscribed to all the mainline lists. For future >> submissions, can you add the linux-arch list to Cc for >> all patches? > > We misused get_maintainers.pl, running it on each patch instead > of using it on the whole series. next time every one will be in > copy of every patch in the series and including linux-arch. Be careful not to make the list too long though, there is usually a limit of 1024 characters for the entire Cc list, above this your mails may get dropped by the mailing lists. >> Reading the rest of the series through lore.kernel.org, >> most of the comments I have are for improvements that >> you may find valuable rather than serious mistakes: >> >> - the {copy_to,copy_from,clear}_user functions are >> well worth optimizing better than the byte-at-a-time >> version you have, even just a C version built around >> your __get_user/__put_user inline asm should help, and >> could be added to lib/usercopy.c. > > right, we are using memcpy for {copy_to,copy_from}_user_page > which has a simple optimized version introduced in > (kvx: Add some library functions). > I wonder if it is possible to do the same for copy_*_user functions. copy_from_user_page() is only about managing cache aliases, not user access, and it's not used anywhere in the fast path, so it's a bit different. arch/arm/lib/copy_template.S has an example for how you can share the same assembler implementation between memcpy() and copy_from_user(), but it's not very intuitive. The tricky bit with copy_from_user() is the partial copy that relies on copying the exact amount of data that can be accessed including the last byte before the end of the mapping, and returning the correct count of non-copied bytes. If you want a C version, you can probably use the copy_from_kernel_nofault implementation mm/maccess.c as a template, but have to add code for the correct return value. Arnd