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 C0BF5CE7AFB for ; Fri, 6 Sep 2024 10:56:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1955C6B0089; Fri, 6 Sep 2024 06:56:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 145B06B008A; Fri, 6 Sep 2024 06:56:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 00D266B008C; Fri, 6 Sep 2024 06:56:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id D7A8C6B0089 for ; Fri, 6 Sep 2024 06:56:06 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 9167316111D for ; Fri, 6 Sep 2024 10:56:06 +0000 (UTC) X-FDA: 82534008732.07.99311BF Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf07.hostedemail.com (Postfix) with ESMTP id 77F8440009 for ; Fri, 6 Sep 2024 10:56:04 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf07.hostedemail.com: domain of vincenzo.frascino@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=vincenzo.frascino@arm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1725620092; a=rsa-sha256; cv=none; b=lhfmeWAKRGi5RXsDR1w4T0+bO3KcTBsn9LVm0MWdkLBCqpp31eI4Ij5OBxY89UqDepVzdj 4SoWZkFx8qaUuQ9UGW08Aft1BKzVjBc1QvIm4JhcNLoVm9CHo3PpzTpWVJxa7ZXeKCMK7i 4bKNaAGwylQgJEwSr34EwxXZJPSJM1Q= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf07.hostedemail.com: domain of vincenzo.frascino@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=vincenzo.frascino@arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1725620092; 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; bh=A72bMmZTWFjZp7+Fx5EUDX694jcIsUeZ1q6IhUfjxls=; b=8Xv3kmOcBYdLEFk4scAG7zW7IxqYzRTZYminvCiFJVXRm0kXLx5XvmbddbsGEE0kl1BC6B 86jW9Di0fFhUGm4/wjgg0qVWdn/RMDOMeaq+J2vgWRQ2C9IqiO8SYkkb7odzFjQSOru/VO 79cASbtNb/vLyqAKu1f94tlK9n8U040= Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 82855FEC; Fri, 6 Sep 2024 03:56:30 -0700 (PDT) Received: from [10.1.196.72] (e119884-lin.cambridge.arm.com [10.1.196.72]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B6EC73F66E; Fri, 6 Sep 2024 03:56:00 -0700 (PDT) Message-ID: <043e992f-487e-4102-9543-16da1f57b7bc@arm.com> Date: Fri, 6 Sep 2024 11:55:59 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/9] x86: vdso: Introduce asm/vdso/mman.h To: Christophe Leroy , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, 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 , Arnd Bergmann , Andrew Morton , Steven Rostedt , Masami Hiramatsu , Mathieu Desnoyers References: <20240903151437.1002990-1-vincenzo.frascino@arm.com> <20240903151437.1002990-2-vincenzo.frascino@arm.com> <710f9663-e99c-40e2-9c0e-2f5e6e854653@csgroup.eu> Content-Language: en-US From: Vincenzo Frascino In-Reply-To: <710f9663-e99c-40e2-9c0e-2f5e6e854653@csgroup.eu> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 77F8440009 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: xto1jwcdubd845o43i54jtw6surupf94 X-HE-Tag: 1725620164-366915 X-HE-Meta: U2FsdGVkX1+WzCtcDjxsYcjjz9m4Y61uKpjAi3GPYPzB11XqfjL0KJHuMzUBRq7SM0f02GyoWTYQlLRSQvD2A/KZKkHOO8PCKh1J5+CbBU4zEkoJR1bCrpWkBZ1vCpw2LmFQ4pmJfccga3dn5U4M5hBPuqoxlNVY8dEpmBkQCVAnoKGWi3DpUYgJxHDgdtz7DX4PhKuKBQ5JGipI3ilplYAWzU7mxs5CFsFQWiV2/mK8MDcxMhNHQGYfw+ulyzbCpM+joR3fl7f460O/CHUbuJHsPUwdcx5Kua4RJlnekb4Zd2CjwXxrKDZHT22abm/uUAAH3YlKp6QjwQ7d/ohudZMOu3DcfQGpHTMIFooGRq+DMxzYQ7PMKfXwmmkiRfBR3xuaPCBRa4vwt7rbweSpLjVGgpU9FgU/h0r7/IjTzeaKukwGGVv4VlDyULPSp1I3Ja8LlMFmcXmZSxQgJUGx4AsCoHB9aoZw+7PQpENk0kT4IfY73R2eEYpoepRI+QtrDUzSR8Wmg6PuGYEhL8gIlJn/ryk/1jncWYO8qFJ5Mm0TS/66umUm/R7SWxJsCyVi+YVhIBGz7OJ2raxfsw2pEXsLRdS0w9WxPuqTnVb6aFPrCm9JGcIwf36U6+InAZVVnHy4D+6WZGBIuQOyGteVu82e5pVw+wfJNRkY3ZXIQ0KXIVYBnRny+4LPGJ3dMCfab3bUHLU7PB5R3Cxukc74YrbnbtFLnSd4cY9LUV6fJp1nNU1U++DB6tUqvMQvO/M0qzLbQ2CveuhB/HAJsGBTktLMvqPSpcXRUJ7QoIBqfUsfNqlqjinZ7TX3xr3HFn5tZjCpQzNvTiPOSWoo8lVlkLvEc/pqbgWI9Yk5dshnkwpGIaM/6GF54hoqiLyfORW7ZetGagTG7gH5wOuC5oHTibpTVVh57MSP9sc/y3B3cCvcAo3WSELkSQ3i7IhtHvNMrqWIDh9ZQCeDsXl3hs3 HazDXpVT F2YMYGDOP5CAWiF1aEHJkBWu4HvbKSol5fewSraxzaKtAQCvYFJCLD82lX6vGTpaQuC9Q6guZxuHPXM9dkTNRyzN3Lk0xz3slMyXAQdIrTPHjNlx6pvzMJDbO7px6l/N/1eY4uTXDrdMQFmz1YwWBunf8deySBB4pveFhYFeNCKGgy2CZOn9EC4/kswh1JhB+qStZqUWxzzURI/o2bfATgJzSeluEEbnFAXqVgKNjhLXe9aPqa45MbkRuDM6IZqTZN1kV 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: Hi Christophe, Thank you for your review. On 04/09/2024 17:56, Christophe Leroy wrote: > > > Le 03/09/2024 à 17:14, Vincenzo Frascino a écrit : ... >> +/* 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 benefit of duplicating those two defines in every arch. > > I understand your point that some arch might in the future want to use different > flags, but unless we already have one such architecture in mind we shouldn't > make things more complicated than needed. > > In case such an architecture is already identified it should be said in the > commit message > I do not have such an architecture in mind, hence I did not add it to the commit message. Apart being future proof the real problem here is to handle the mman.h header. As Arnd was saying [1] (and I agree), including it on some architectures might be problematic if they change it in a way that is incompatible with compat vdso. In this way we make sure that the each architecture that decides to include it specifically validates it for this purpose. I am not a fan of complicating code either but this seems the lesser evil. I am open to any solution you can come up that is better then this one. The other issue I see is that being these defines in a uapi header that is included directly by userspace splitting it requires some validation to make sure we do not break the status quo. [1] https://lore.kernel.org/lkml/cb66b582-ba63-4a5a-9df8-b07288f1f66d@app.fastmail.com/ >> + >> +#endif /* !__ASSEMBLY__ */ >> + >> +#endif /* __ASM_VDSO_MMAN_H */ -- Regards, Vincenzo