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 474F8C5472E for ; Mon, 26 Aug 2024 08:38:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6D7746B04EC; Mon, 26 Aug 2024 04:37:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 687126B04ED; Mon, 26 Aug 2024 04:37:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 54F5E6B04EE; Mon, 26 Aug 2024 04:37:59 -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 358A66B04EC for ; Mon, 26 Aug 2024 04:37:59 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id BC89E40DE3 for ; Mon, 26 Aug 2024 08:37:58 +0000 (UTC) X-FDA: 82493743836.25.FF26123 Received: from pegase2.c-s.fr (pegase2.c-s.fr [93.17.235.10]) by imf06.hostedemail.com (Postfix) with ESMTP id 5A0B8180017 for ; Mon, 26 Aug 2024 08:37:56 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=none; spf=pass (imf06.hostedemail.com: domain of christophe.leroy@csgroup.eu designates 93.17.235.10 as permitted sender) smtp.mailfrom=christophe.leroy@csgroup.eu; dmarc=pass (policy=quarantine) header.from=csgroup.eu ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724661433; a=rsa-sha256; cv=none; b=aRSuwGjpRugtCGVYbuuUTDr27zdabAghNUh6UFNKROBL/ctdglFaNc/xcqdXcHM4IHDM/r 6tCaA25whjPEWzhuD/8AQStWurGbaE4jRnAHZHCJhueh2xe1AYzt5drcHm4sKFh7ZQiG++ UbOBiYR1N4nf/2plLHbxrQgBPuq7geo= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=none; spf=pass (imf06.hostedemail.com: domain of christophe.leroy@csgroup.eu designates 93.17.235.10 as permitted sender) smtp.mailfrom=christophe.leroy@csgroup.eu; dmarc=pass (policy=quarantine) header.from=csgroup.eu ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1724661433; 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=PQCP88GgdkOkepkRupPeG/h7Vum0yoix8K+AR3rbeTk=; b=Afwz2b+zcernoltlLkoB90zAevzDpT6CPaOimEXkkzpEIY/s5UYcltsbKYVe6l+PmQiZkl nKpLPnR0MymMDfaofOFiAZgbr2v/8ATaYzqR4EFnnnR8YVJ1G2hjAHgTWZhhYjEOd7NKmG h1d+Rfy76ajrt+0StwKcWcLzdrB8juQ= Received: from localhost (mailhub3.si.c-s.fr [172.26.127.67]) by localhost (Postfix) with ESMTP id 4WskZl5slLz9sRr; Mon, 26 Aug 2024 10:37:51 +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 qtZt4nGFX6b0; Mon, 26 Aug 2024 10:37:51 +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 4WskZl4WrZz9sRk; Mon, 26 Aug 2024 10:37:51 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 85D558B773; Mon, 26 Aug 2024 10:37:51 +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 g2eIkF1jnL0E; Mon, 26 Aug 2024 10:37:51 +0200 (CEST) Received: from [192.168.233.85] (PO17705.IDSI0.si.c-s.fr [192.168.233.85]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 1399C8B763; Mon, 26 Aug 2024 10:37:50 +0200 (CEST) Message-ID: <7e519ba2-0293-4320-84bf-44f930fc286d@csgroup.eu> Date: Mon, 26 Aug 2024 10:37:49 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 02/17] vdso: Clean header inclusion in getrandom To: "Jason A. Donenfeld" Cc: Michael Ellerman , Nicholas Piggin , Naveen N Rao , Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Theodore Ts'o , Arnd Bergmann , Andrew Morton , Steven Rostedt , Masami Hiramatsu , Mathieu Desnoyers , Vincenzo Frascino , Shuah Khan , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, linux-trace-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org References: <2a081f1fff5e40f496153f8e0162fc7ec5adab2e.1724309198.git.christophe.leroy@csgroup.eu> Content-Language: fr-FR From: Christophe Leroy In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Stat-Signature: nhqpwtdpxiqfzbwc1p1tfma6g9w76fgr X-Rspamd-Queue-Id: 5A0B8180017 X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1724661476-136760 X-HE-Meta: U2FsdGVkX1/hBfzYk4QFkvhYakPTSwhBmFhmLZwFZw2S/Gy0MYrqFU6rXgmERVDVorO1oGtwwWHvAtshUDvU+vb6dttCMDr3YTRK5O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-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Le 26/08/2024 à 10:07, Jason A. Donenfeld a écrit : > On Thu, Aug 22, 2024 at 09:13:10AM +0200, Christophe Leroy wrote: >> >> +#define _PAGE_SIZE (1UL << CONFIG_PAGE_SHIFT) >> +#define _PAGE_MASK (~(_PAGE_SIZE - 1)) > > If PAGE_SIZE isn't defined at this point, why not just call it PAGE_SIZE > instead of _PAGE_SIZE? But if that's the case, why not put the vdso > definition of PAGE_SIZE into some vdso header included by this file? It was working ok on powerpc but on x86 I got: CC arch/x86/entry/vdso/vgetrandom.o In file included from arch/x86/entry/vdso/vgetrandom.c:7: arch/x86/entry/vdso/../../../../lib/vdso/getrandom.c:24: error: "PAGE_SIZE" redefined [-Werror] 24 | #define PAGE_SIZE (1UL << CONFIG_PAGE_SHIFT) | In file included from ./arch/x86/include/asm/page.h:9, from ./arch/x86/include/asm/thread_info.h:12, from ./include/linux/thread_info.h:60, from ./include/linux/smp.h:118, from ./include/linux/alloc_tag.h:14, from ./include/linux/percpu.h:5, from ./arch/x86/include/asm/msr.h:15, from ./arch/x86/include/asm/vdso/gettimeofday.h:19, from ./include/vdso/datapage.h:164, from arch/x86/entry/vdso/../../../../lib/vdso/getrandom.c:7, from arch/x86/entry/vdso/vgetrandom.c:7: ./arch/x86/include/asm/page_types.h:11: note: this is the location of the previous definition 11 | #define PAGE_SIZE (_AC(1,UL) << PAGE_SHIFT) | In file included from arch/x86/entry/vdso/vgetrandom.c:7: arch/x86/entry/vdso/../../../../lib/vdso/getrandom.c:25: error: "PAGE_MASK" redefined [-Werror] 25 | #define PAGE_MASK (~(PAGE_SIZE - 1)) | In file included from ./arch/x86/include/asm/page.h:9, from ./arch/x86/include/asm/thread_info.h:12, from ./include/linux/thread_info.h:60, from ./include/linux/smp.h:118, from ./include/linux/alloc_tag.h:14, from ./include/linux/percpu.h:5, from ./arch/x86/include/asm/msr.h:15, from ./arch/x86/include/asm/vdso/gettimeofday.h:19, from ./include/vdso/datapage.h:164, from arch/x86/entry/vdso/../../../../lib/vdso/getrandom.c:7, from arch/x86/entry/vdso/vgetrandom.c:7: ./arch/x86/include/asm/page_types.h:12: note: this is the location of the previous definition 12 | #define PAGE_MASK (~(PAGE_SIZE-1)) | cc1: all warnings being treated as errors Christophe