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 05218CCF9F7 for ; Wed, 25 Sep 2024 21:23:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8AE0D6B0083; Wed, 25 Sep 2024 17:23:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 85E196B00A4; Wed, 25 Sep 2024 17:23:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6FF0D6B00AF; Wed, 25 Sep 2024 17:23:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 4FBE36B0083 for ; Wed, 25 Sep 2024 17:23:49 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id F3D4E1A063A for ; Wed, 25 Sep 2024 21:23:48 +0000 (UTC) X-FDA: 82604537736.24.DE6B692 Received: from fout-a8-smtp.messagingengine.com (fout-a8-smtp.messagingengine.com [103.168.172.151]) by imf19.hostedemail.com (Postfix) with ESMTP id E8FEA1A0012 for ; Wed, 25 Sep 2024 21:23:46 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=arndb.de header.s=fm1 header.b=ca1tJi6p; dkim=pass header.d=messagingengine.com header.s=fm2 header.b="E C+Mms8"; dmarc=pass (policy=none) header.from=arndb.de; spf=pass (imf19.hostedemail.com: domain of arnd@arndb.de designates 103.168.172.151 as permitted sender) smtp.mailfrom=arnd@arndb.de ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1727299411; a=rsa-sha256; cv=none; b=ctMIqz6f01U284/hRpFCM0i7jv61Y3lt6xUXXex//2RXPZUXqXQ3CpncSePFhRICoY4IRA TpYmLMUuKAlDzo2zoaVyryP5tn0bUlsQ6uPhMDP5vBSZzwPmiucg9RcsZfEjnZYtjEzVAr w3mnGHn5Q+ezBUy9egzPJNLjUb8Qfr4= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=arndb.de header.s=fm1 header.b=ca1tJi6p; dkim=pass header.d=messagingengine.com header.s=fm2 header.b="E C+Mms8"; dmarc=pass (policy=none) header.from=arndb.de; spf=pass (imf19.hostedemail.com: domain of arnd@arndb.de designates 103.168.172.151 as permitted sender) smtp.mailfrom=arnd@arndb.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1727299411; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=J4rpxeCJhm3KEquxWD8v+82nmx/qaZF3d61PNtHrW8w=; b=FR8Gq1unsUNR62sm05VelzCCoeJrbhIA0Ke7PxxyB1Dl4q0tnVCysRhbjsqRFzbP760xzu yIfuz9+j3eNZl99ZEFOFQAXGcGYa+XN+xO/qFsZvFtEsJqFM+hFYYDmOxxinljyWddjs2b IqN7mSuhObxXZolNnkjrWivyZKN9QWI= Received: from phl-compute-10.internal (phl-compute-10.phl.internal [10.202.2.50]) by mailfout.phl.internal (Postfix) with ESMTP id 49B2313801A0; Wed, 25 Sep 2024 17:23:46 -0400 (EDT) Received: from phl-imap-11 ([10.202.2.101]) by phl-compute-10.internal (MEProxy); Wed, 25 Sep 2024 17:23:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1727299426; x=1727385826; bh=J4rpxeCJhm3KEquxWD8v+82nmx/qaZF3d61PNtHrW8w=; b= ca1tJi6pDZvE5CPs/r8S9UQTH3C1ga5zv48dC7UC9YMKaHGXQa4887dbwmf1O9BB CGFNEK6yigIqj/UprPTj7035JvNyCzdd+BfU51/GEfZDTknC6cyXzaDTjP+02cZ8 bTsu5TEPwZ7/RFrgZj5v0K2QIyNwCyK1Mn2C9IzFSgnq9EO52M0dWs3BNoV8udin Y1dz6T27a6nD+jrurpbXVaXhRGkvMtWw9g9RXvUaEWm09Sc1iL8jbEmzEBAcu6SE pkfiKLVCMILNjZwAgQoL3V6E/OA/DnjfGx2BqjnL1Ka8/QsGTodIhjVXV2w7pSB7 iiRMwt+tAwENKL6xj3EMNA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1727299426; x= 1727385826; bh=J4rpxeCJhm3KEquxWD8v+82nmx/qaZF3d61PNtHrW8w=; b=E C+Mms89jGN6AKKsB98qBSQUb2LTRlF+nN5PIZUJouqwYf6sRqwuC5sXCEGgr3jtt Wjp2yN28INCOUO8iYFA5LI0UvTYPrOhoy3VLBBbQYxsY1PP8tZSZHDKCuT6VoSz1 +YR+rcG3bJ18n2Wpfd64MV5sz7eHHPNmd6puRkcWN9MqfxObsiAh1lQ/venbzmss obzm43j4Bfpcp1/PRL4SiORI7RSP6TxBrfZMvpUQzGW4QH9vdCa1qhvpTeQs1l8B fETX5iIRgkLtyDl1xWB86vxELeU5TCAQwWTPXqrYVw8arvbOZ92afFS7m4zjEXE4 QZ9RLkrQE0cCjJqtCyj7A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvddthedgudeitdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefoggffhffvvefkjghfufgtgfesthhqredtredt jeenucfhrhhomhepfdetrhhnugcuuegvrhhgmhgrnhhnfdcuoegrrhhnugesrghrnhgusg druggvqeenucggtffrrghtthgvrhhnpeekvdeuhfeitdeuieejvedtieeijeefleevffef leekieetjeffvdekgfetuefhgfenucffohhmrghinhepkhgvrhhnvghlrdhorhhgnecuve hluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghrnhgusegr rhhnuggsrdguvgdpnhgspghrtghpthhtohepvddtpdhmohguvgepshhmthhpohhuthdprh gtphhtthhopegsphesrghlihgvnhekrdguvgdprhgtphhtthhopehvihhntggvnhiiohdr fhhrrghstghinhhosegrrhhmrdgtohhmpdhrtghpthhtoheptghhrhhishhtohhphhgvrd hlvghrohihsegtshhgrhhouhhprdgvuhdprhgtphhtthhopehmrghthhhivghurdguvghs nhhohigvrhhssegvfhhfihgtihhoshdrtghomhdprhgtphhtthhopehmphgvsegvlhhlvg hrmhgrnhdrihgurdgruhdprhgtphhtthhopehnphhighhgihhnsehgmhgrihhlrdgtohhm pdhrtghpthhtoheprhhoshhtvgguthesghhoohgumhhishdrohhrghdprhgtphhtthhope hluhhtoheskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepmhhhihhrrghmrghtsehkvghr nhgvlhdrohhrgh X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id D92022220071; Wed, 25 Sep 2024 17:23:43 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface MIME-Version: 1.0 Date: Wed, 25 Sep 2024 21:23:21 +0000 From: "Arnd Bergmann" To: "Christophe Leroy" , "Vincenzo Frascino" , linux-kernel@vger.kernel.org, Linux-Arch , linux-mm@kvack.org Cc: "Andy Lutomirski" , "Thomas Gleixner" , "Jason A . Donenfeld" , "Michael Ellerman" , "Nicholas Piggin" , "Naveen N Rao" , "Ingo Molnar" , "Borislav Petkov" , "Dave Hansen" , "H. Peter Anvin" , "Theodore Ts'o" , "Andrew Morton" , "Steven Rostedt" , "Masami Hiramatsu" , "Mathieu Desnoyers" Message-Id: In-Reply-To: <626baa55-ca84-49ba-9131-c1657e0c0454@csgroup.eu> References: <20240923141943.133551-1-vincenzo.frascino@arm.com> <20240923141943.133551-2-vincenzo.frascino@arm.com> <626baa55-ca84-49ba-9131-c1657e0c0454@csgroup.eu> Subject: Re: [PATCH v2 1/8] x86: vdso: Introduce asm/vdso/mman.h Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Rspam-User: X-Stat-Signature: eqnpuijbeo7yw5kq95ye9fy6djcixehf X-Rspamd-Queue-Id: E8FEA1A0012 X-Rspamd-Server: rspam02 X-HE-Tag: 1727299426-70109 X-HE-Meta: U2FsdGVkX1/OXx7O6NINC3wBGNxOSUJYAMxHy5G4K3wQCuF0G0qEkXGTJYOJsATMcYUhzMXgK79dMD/fmBBXImaBZhrtFUXKKTRdUNRcd/5VOtC7xvLK6jqslBKozrjaxSkyKcN+SqiWhsTgY7tDi/8SBRISg1nc8NJHan+ZYeDBcADi0RlbVdqh13jZaQhJNDT9K+7+DUkk1tj9Ybmkb0zo46iv5rcE9h9cDP4EY+PPneVRyqHiJffP5SqVwO+aiTuJ59M+PXiss4YSWywuoMvbt/0PSaJxhF8bj0MT/dn2Ya/fGG7ub+clxPnrkAxK0WfWEFaDrL9op+hxrn0mcle1ZB6jEGPkR2Cs1pEZf78dy16u2DwDhLzF61Mquj/Pq5VDTD/hEqY11PwT841GyqAW9RUm0jPbsXUkR67Nia+pvkmHzd+6ra+RLlUoo8YJbx2LYFrjUd9fd2pZQOeu4Asw6mW9MO76vNq6bvcwZdIwapjNCf7ULtwE9gDf7QJCHh2Vf6LxLhICS7QoahW+/dNmVFyjpXtD7MnhayUNF1GEIeyDs3e37DP0zYyEnpQmSEGev0ra/2l1H89Zzo6JOqmD2GT27iUjhEvGcm+y0FYZhw0aM2Pq1qazrAFU38qZi5R/VCfyjGK536Uq+0Har6myed2eh/2qpH+9yGsKlqjqX0AKLdbV3RkdQ5MzwAW+qu0YjMoYS11GERcHdL0mpOmxaVKtp6NOs29zeWb23u4D1BUkv3r1jQlzLjDVJCliqb9l84/ETe2iHwx0U6xOsstv4z8d5BidA28iDDR0VOxVhX2UvNbHhDb0rTo6E/oBMGInJ7R07H2oil+Wfm6i8x/l4FRsco6ajZwjRic/nSGoX3EABaXwKYNE95uSFItMd9vhL6V2hWr5+2iOqTU2zRWxQVJTeKxey51CcRVMMYc2GnnrJfId/l18U8omMdwen4aLsSlj221v0cg6ujJ 62KB4SCQ efo0nNEhQ2APhIzd3idKTMvxGYCeUthbVZMoiFm1jhPA/KRXkmezKq8wIKOq3p+eYx/9CTn3BaHK508PXPGW5sAvdZEAxRCMT2Y5CRHX+fDJVTrPkv7qOhI60DMrpQuh4F28miZVlAdicnToEYW9YkTtA2zEE7nclPLb1uBGocaTvKXZjyE3t7dFBbQBo8FKqantRwfQNCWccV+evzvzpVIbvkGm+nhmNWvNKkN8Lh/qkPYK2+3BWiPyfGl8AE+7+cKws 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: List-Subscribe: List-Unsubscribe: On Wed, Sep 25, 2024, at 06:51, Christophe Leroy wrote: > Le 23/09/2024 =C3=A0 16:19, Vincenzo Frascino a =C3=A9crit=C2=A0: >> @@ -0,0 +1,15 @@ >> + >> +/* SPDX-License-Identifier: GPL-2.0 */ >> +#ifndef __ASM_VDSO_MMAN_H >> +#define __ASM_VDSO_MMAN_H >> + >> +#ifndef __ASSEMBLY__ >> + >> +#include >> + >> +#define VDSO_MMAP_PROT PROT_READ | PROT_WRITE >> +#define VDSO_MMAP_FLAGS MAP_DROPPABLE | MAP_ANONYMOUS > > I still can't see the point with that change. > > Today 4 architectures implement getrandom and none of them require tha= t=20 > indirection. Please leave prot and flags as they are in the code. > > Then this file is totally pointless, VDSO code can include=20 > uapi/linux/mman.h directly. > > VDSO is userland code, it should be safe to include any UAPI file ther= e. I think we are hitting an unfortunate corner case in the build system here, based on the way we handle the uapi/ file namespace in the kernel: include/uapi/linux/mman.h includes three headers: asm/mman.h, asm-generic/hugetlb_encode.h and linux/types.h. Two of these exist in both include/uapi/ and include/, so while building kernel code we end up picking up the non-uapi version which on some architectures includes many other headers. I agree that moving the contents out of uapi/ into vdso/ namespace is not a solution here because that removes the contents from the installed user headers, but we still need to do something to solve the issue. The easiest workaround I see for this particular file is to move the contents of arch/{arm,arm64,parisc,powerpc,sparc,x86}/\ include/asm/mman.h into a different file to ensure that the only existing file is the uapi/ one. Unfortunately this does not help to avoid it regressing again in the future. To go a little step further I would also move uapi/asm-generic/hugetlb_encode.h to uapi/linux/hugetlb_encode.h or merge it into uapi/linux/mman.h. This file has no business in asm-generic/* since there is only one copy. After looking at this file for way too long, I somehow ended up with a (completely unrelated) cleanup series that I now posted at https://lore.kernel.org/lkml/20240925210615.2572360-1-arnd@kernel.org/T/= #t Arnd