public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Vincenzo Frascino <vincenzo.frascino@arm.com>
To: Christophe Leroy <christophe.leroy@csgroup.eu>,
	Arnd Bergmann <arnd@arndb.de>,
	"Jason A . Donenfeld" <Jason@zx2c4.com>
Cc: Theodore Ts'o <tytso@mit.edu>, Andy Lutomirski <luto@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	Linux-Arch <linux-arch@vger.kernel.org>
Subject: Re: [PATCH] random: vDSO: Redefine PAGE_SIZE and PAGE_MASK
Date: Thu, 29 Aug 2024 16:34:53 +0100	[thread overview]
Message-ID: <d0bcd439-0972-496a-8d77-bfbe10e0cd6a@arm.com> (raw)
In-Reply-To: <0085b19d-bb87-45bc-8a74-7464316f86a1@csgroup.eu>


...


>>> 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

  reply	other threads:[~2024-08-29 15:34 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-27  7:31 [PATCH 0/4] Fixups for random vDSO Christophe Leroy
2024-08-27  7:31 ` [PATCH 1/4] asm-generic/unaligned.h: Extract common header for vDSO Christophe Leroy
2024-08-27  7:31 ` [PATCH 2/4] random: vDSO: Don't use PAGE_SIZE and PAGE_MASK Christophe Leroy
2024-08-27  7:49   ` Jason A. Donenfeld
2024-08-27  8:16     ` Christophe Leroy
2024-08-27  8:23       ` Jason A. Donenfeld
2024-08-27  8:26   ` [PATCH] random: vDSO: Redefine " Christophe Leroy
2024-08-27  8:40     ` Jason A. Donenfeld
2024-08-27  8:55       ` Christophe Leroy
2024-08-27  9:59       ` Arnd Bergmann
2024-08-27 10:49         ` Christophe Leroy
2024-08-27 16:05           ` Vincenzo Frascino
2024-08-27 17:14             ` Christophe Leroy
2024-08-29 12:01               ` Vincenzo Frascino
2024-08-29 15:00                 ` Christophe Leroy
2024-08-29 15:34                   ` Vincenzo Frascino [this message]
2024-08-27 17:38             ` LEROY Christophe
2024-08-29 14:07               ` Vincenzo Frascino
2024-08-27  7:31 ` [PATCH 3/4] random: vDSO: Clean header inclusion in getrandom Christophe Leroy
2024-08-27  7:31 ` [PATCH 4/4] random: vDSO: don't use 64 bits atomics on 32 bits architectures Christophe Leroy
2024-08-27  8:03   ` Jason A. Donenfeld

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d0bcd439-0972-496a-8d77-bfbe10e0cd6a@arm.com \
    --to=vincenzo.frascino@arm.com \
    --cc=Jason@zx2c4.com \
    --cc=arnd@arndb.de \
    --cc=bp@alien8.de \
    --cc=christophe.leroy@csgroup.eu \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=luto@kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=tytso@mit.edu \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox