[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zsw3xMoX2EI5UUs1@zx2c4.com>
Date: Mon, 26 Aug 2024 10:07:32 +0200
From: "Jason A. Donenfeld" <Jason@...c4.com>
To: Christophe Leroy <christophe.leroy@...roup.eu>
Cc: Michael Ellerman <mpe@...erman.id.au>,
Nicholas Piggin <npiggin@...il.com>,
Naveen N Rao <naveen@...nel.org>, 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>, Theodore Ts'o <tytso@....edu>,
Arnd Bergmann <arnd@...db.de>,
Andrew Morton <akpm@...ux-foundation.org>,
Steven Rostedt <rostedt@...dmis.org>,
Masami Hiramatsu <mhiramat@...nel.org>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Vincenzo Frascino <vincenzo.frascino@....com>,
Shuah Khan <shuah@...nel.org>, linuxppc-dev@...ts.ozlabs.org,
linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
linux-arch@...r.kernel.org, linux-mm@...ck.org,
linux-trace-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org
Subject: Re: [PATCH v2 02/17] vdso: Clean header inclusion in getrandom
On Thu, Aug 22, 2024 at 09:13:10AM +0200, Christophe Leroy wrote:
> diff --git a/arch/x86/include/asm/pvclock.h b/arch/x86/include/asm/pvclock.h
> index 0c92db84469d..6e4f8fae3ce9 100644
> --- a/arch/x86/include/asm/pvclock.h
> +++ b/arch/x86/include/asm/pvclock.h
> @@ -5,6 +5,7 @@
> #include <asm/clocksource.h>
> #include <asm/pvclock-abi.h>
>
> +struct timespec64;
> /* some helper functions for xen and kvm pv clock sources */
> u64 pvclock_clocksource_read(struct pvclock_vcpu_time_info *src);
> u64 pvclock_clocksource_read_nowd(struct pvclock_vcpu_time_info *src);
This change isn't mentioned in the commit message and could probably
benefit from doing so.
> diff --git a/lib/vdso/getrandom.c b/lib/vdso/getrandom.c
> index b230f0b10832..cab153c5f9be 100644
> --- a/lib/vdso/getrandom.c
> +++ b/lib/vdso/getrandom.c
> @@ -3,15 +3,13 @@
> * Copyright (C) 2022-2024 Jason A. Donenfeld <Jason@...c4.com>. All Rights Reserved.
> */
>
> -#include <linux/cache.h>
> -#include <linux/kernel.h>
> -#include <linux/time64.h>
> +#include <linux/minmax.h>
> #include <vdso/datapage.h>
> #include <vdso/getrandom.h>
> +#include <vdso/unaligned.h>
Ah, that's where you do it. Ignore my comment on the previous commit,
then.
> #include <asm/vdso/getrandom.h>
> -#include <asm/vdso/vsyscall.h>
> -#include <asm/unaligned.h>
> #include <uapi/linux/mman.h>
> +#include <uapi/linux/random.h>
>
> #define MEMCPY_AND_ZERO_SRC(type, dst, src, len) do { \
> while (len >= sizeof(type)) { \
> @@ -23,6 +21,9 @@
> } \
> } while (0)
>
> +#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?
Powered by blists - more mailing lists