[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <d0bcd439-0972-496a-8d77-bfbe10e0cd6a@arm.com>
Date: Thu, 29 Aug 2024 16:34:53 +0100
From: Vincenzo Frascino <vincenzo.frascino@....com>
To: Christophe Leroy <christophe.leroy@...roup.eu>,
Arnd Bergmann <arnd@...db.de>, "Jason A . Donenfeld" <Jason@...c4.com>
Cc: Theodore Ts'o <tytso@....edu>, Andy Lutomirski <luto@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>,
Borislav Petkov <bp@...en8.de>, Dave Hansen <dave.hansen@...ux.intel.com>,
x86@...nel.org, "H. Peter Anvin" <hpa@...or.com>,
linux-kernel@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
Linux-Arch <linux-arch@...r.kernel.org>
Subject: Re: [PATCH] random: vDSO: Redefine PAGE_SIZE and PAGE_MASK
...
>>> Without linux/array_size.h:
>>>
>>> VDSO32C arch/powerpc/kernel/vdso/vgetrandom-32.o
>>> In file included from <command-line>:
>>> /home/chleroy/linux-powerpc/lib/vdso/getrandom.c: In function
>>> '__cvdso_getrandom_data':
>>> /home/chleroy/linux-powerpc/lib/vdso/getrandom.c:89:40: error: implicit
>> If this is the case, those headers should be defined for the powerpc
>> implementation only. The generic implementation should be interpreted as the
>> minimum common denominator in between all the architectures for what concerns
>> the headers.
>>
>
> Sorry, I disagree. You can't rely on necessary headers being included indirectly
> by other arch specific headers. getrandom.c uses ARRAY_SIZE(), it must include
> the header that defines ARRAY_SIZE().
>
> At the moment, on x86 you get linux/array.h by change through the following
> chain, that the reason why the build doesn't break:
>
> In file included from ./include/linux/kernel.h:16,
> from ./include/linux/cpumask.h:11,
> from ./arch/x86/include/asm/cpumask.h:5,
> from ./arch/x86/include/asm/msr.h:11,
> from ./arch/x86/include/asm/vdso/gettimeofday.h:19,
> from ./include/vdso/datapage.h:164,
> from arch/x86/entry/vdso/../../../../lib/vdso/getrandom.c:9,
>
> From my point of view you can't expect such a chain from each architecture.
>
--->8---
> I can't see which header provides you with min_t() or ARRAY_SIZE().
>
Good point, this needs to be addressed by my patch, I will extend it, do some
more testing and post it again next week.
--->8---
As I explained in my other email (snippet above), my patch should address the
cases of ARRAY_SIZE() and min_t() which are directly used by getrandom.c. My
comment here refers to the cases not directly used by getrandom.c or the Generic
vDSO library more in general (if any).
Hope this clarifies.
> Christophe
--
Regards,
Vincenzo
Powered by blists - more mailing lists