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 05500CD4F4C for ; Sun, 8 Sep 2024 13:53:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9818B6B0098; Sun, 8 Sep 2024 09:53:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 932246B009F; Sun, 8 Sep 2024 09:53:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8209E6B00CB; Sun, 8 Sep 2024 09:53:12 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 649E26B0098 for ; Sun, 8 Sep 2024 09:53:12 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id D11021C6958 for ; Sun, 8 Sep 2024 13:53:11 +0000 (UTC) X-FDA: 82541712582.15.66BCCCB Received: from pegase2.c-s.fr (pegase2.c-s.fr [93.17.235.10]) by imf28.hostedemail.com (Postfix) with ESMTP id 8926DC0003 for ; Sun, 8 Sep 2024 13:53:09 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=csgroup.eu; spf=pass (imf28.hostedemail.com: domain of christophe.leroy@csgroup.eu designates 93.17.235.10 as permitted sender) smtp.mailfrom=christophe.leroy@csgroup.eu ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1725803508; a=rsa-sha256; cv=none; b=PpYJqG4OIqne0dbr81I7vQNeWWyMzCjme34jCEreJiM/3XXRZeDMaJ6EFIbV3m+PR3M8aU HBOP2NFjmHRjhh6jgB1tms0iK2WUIumMvGMW7qSj09Hfo0DYbPGczv5T7k/T8kReFi5zpD pAJgJPteXsgiCuXi0YB/PK+RStXht+k= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=csgroup.eu; spf=pass (imf28.hostedemail.com: domain of christophe.leroy@csgroup.eu designates 93.17.235.10 as permitted sender) smtp.mailfrom=christophe.leroy@csgroup.eu ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1725803508; 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=U2H7fpDnsolqVbQMNMvmnO1Z15wz6rPuHvM8JpTwCwM=; b=J3atirJGUGiIGKpwL6ojSxhvEmdWMoqJHZR/PcqryM0FTyItD/f65+Y0yTUS0nu/v2+5o8 5pWUkjTWFRoVtiRzGeJKbhiB4g7VdHrwgfyzhVS+0n66QL4Gur9sJhfakxbHZ4GuU1HE54 XNKbfB/jC0iAP2KukAZ9imJD6uR50vQ= Received: from localhost (mailhub3.si.c-s.fr [172.26.127.67]) by localhost (Postfix) with ESMTP id 4X1ryW1Z3zz9sS7; Sun, 8 Sep 2024 15:53:07 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from pegase2.c-s.fr ([172.26.127.65]) by localhost (pegase2.c-s.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xr9tftewbl7Q; Sun, 8 Sep 2024 15:53:07 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase2.c-s.fr (Postfix) with ESMTP id 4X1rvW6thvz9sWW; Sun, 8 Sep 2024 15:50:31 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 3E3AC8BFDA; Fri, 6 Sep 2024 20:40:50 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id DQ3Yl1oMtObJ; Fri, 6 Sep 2024 20:40:50 +0200 (CEST) Received: from [192.168.235.70] (unknown [192.168.235.70]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 6735D8BFD1; Fri, 6 Sep 2024 20:40:49 +0200 (CEST) Message-ID: Date: Fri, 6 Sep 2024 20:40:49 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 3/9] x86: vdso: Introduce asm/vdso/page.h To: Arnd Bergmann , 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 References: <20240903151437.1002990-1-vincenzo.frascino@arm.com> <20240903151437.1002990-4-vincenzo.frascino@arm.com> <11527a80-7453-4624-b406-e88c5692b015@app.fastmail.com> Content-Language: fr-FR From: Christophe Leroy In-Reply-To: <11527a80-7453-4624-b406-e88c5692b015@app.fastmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 8926DC0003 X-Stat-Signature: 69ueaxeknbd1irky8uxxgic735g44dnm X-Rspam-User: X-HE-Tag: 1725803589-733162 X-HE-Meta: U2FsdGVkX193sv6RhUc3pumnwlTtMdnkiXar8fGzh6xn07kTk/ah0bWICy2J8tNZ6hwMQO48a08fa+ePhbED1r7aUHAiv4JdyIcixTMn//ipHmhjd4R0QdSRjxQpmgN/7/n7SozdsEZAcd4kp0dLTN8u9zdd0IDfvV06Lqq0yOX3HgjxMTrikpUOpHtshcWb25NeqEjdFvVOHNpL2ek1Dbphxek/V+EfnD8rc5x1EioJETR6GJiKXP32DHE0ttWDwcHyaqIl0OUqtegk/3wO4p3mockSYhRNz3RfUgqWgYZgGBttvsM1AulLMCdh81ILO6dGn7uzXSpI9oZbwrCNN1zUcl9z5DRI75qYqi6iaIk38fB7mWs4Hcla/yjN07Ok9Ay5IoE5O5kkQIvtjZNg0p8rvW+m0isWfU5TwvwX1/3keX0ygq584KzLwe/iE5sq7sTlNpFsqG2yxuJJ0ZFw5m31ffGzazWFAafiU6u6te2gD2vKVXfMOi/4f1OnnEXgasqZtImf5WJC3gt4AYHzKsT0K3moxEt25xTWp0ZQlD/lMRsR9iSmrAqgYD7fIdr3z12QCT6jgKv28TAvHTDLtwfIUjOFqy9hiAnWhh5M3IUR8Q8Mxke+l3tEwIR2ddSOibEvhEkfCoEk+8JQ/8+gGX43w9bwXyaQiAmLvPkoXy/eP1Hol3AtKX2mmkZLz0UUxfxvafefgCmVP7jZ0PyOyCBltCLfGN2XS0jv6TkLiuSEPoUiwCOBROxWempOGAzAcY0CXNalS8NKh5piY0snlI577Vz5+eZHivt2n9/8K8QQcc94WXKPP8oFj/phXRRTYzo0mZsXG1qY/7x63HR3g1tc4AUsBPgzkoubAzu4IOeXNhFELIRdGz+RShufEFmBU0x4MsVv2OxzRLo4YQR0O2tJ3MDq6H4gPWgkLqYwOU3OTOticOG/+j8q+R+cukCUl5rkWx9w3+u0ZbJtGBK ruRyXNtP IkdzfS5WCzXSa4F/fPtPAgCbN21JKx4jnHBd9dlFpS+7SQpMofxMoYBvzGIDLTEAAJRuu7twuLf+KjaZ9DycUr14gpdzMo/hBgfZMzolBa0a2n9kbwjTYIZmkUx6b3PojDR6ybNx8yfXPH2SfFwgI+31JW0sIUxOh+xOsNa7CG1SlV10/51bIQk4qcw== 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 Arnd, Le 06/09/2024 à 21:19, Arnd Bergmann a écrit : > On Fri, Sep 6, 2024, at 11:20, Vincenzo Frascino wrote: >> On 04/09/2024 15:52, Arnd Bergmann wrote: >>> On Tue, Sep 3, 2024, at 15:14, Vincenzo Frascino wrote: >> Looking at the definition of PAGE_SIZE and PAGE_MASK for each architecture they >> all depend on CONFIG_PAGE_SHIFT but they are slightly different, e.g.: >> >> x86: >> #define PAGE_SIZE (_AC(1,UL) << PAGE_SHIFT) >> >> powerpc: >> #define PAGE_SIZE (ASM_CONST(1) << PAGE_SHIFT) >> >> hence I left to the architecture the responsibility of redefining the constants >> for the VSDO. > > ASM_CONST() is a powerpc-specific macro that is defined the > same way as _AC(). We could probably just replace all ASM_CONST() > as a cleanup, but for this purpose, just remove the custom PAGE_SIZE > and PAGE_SHIFT macros. This can be a single patch fro all > architectures. > I'm not worried about _AC versus ASM_CONST, but I am by the 1UL versus 1. The two functions below don't provide the same result: #define PAGE_SIZE (1 << 12) #define PAGE_MASK (~(PAGE_SIZE - 1)) unsigned long long f(unsigned long long x) { return x & PAGE_MASK; } #define PAGE_SIZE_2 (1UL << 12) #define PAGE_MASK_2 (~(PAGE_SIZE_2 - 1)) unsigned long long g(unsigned long long x) { return x & PAGE_MASK_2; } 00000000 : 0: 54 84 00 26 clrrwi r4,r4,12 4: 4e 80 00 20 blr 00000008 : 8: 54 84 00 26 clrrwi r4,r4,12 c: 38 60 00 00 li r3,0 10: 4e 80 00 20 blr This can be a problem on 32 bits platforms with 64 bits phys_addr_t Christophe