Skip to content

Commit aa81bd3

Browse files
author
Fox Snowpatch
committed
1 parent 960c1fd commit aa81bd3

File tree

14 files changed

+48
-31
lines changed

14 files changed

+48
-31
lines changed

arch/arm/include/asm/vdso/gettimeofday.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
#include <asm/errno.h>
1212
#include <asm/unistd.h>
1313
#include <asm/vdso/cp15.h>
14+
#include <vdso/clocksource.h>
15+
#include <vdso/time32.h>
1416
#include <uapi/linux/time.h>
1517

1618
#define VDSO_HAS_CLOCK_GETRES 1

arch/arm64/include/asm/vdso/compat_gettimeofday.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77

88
#ifndef __ASSEMBLER__
99

10+
#include <vdso/clocksource.h>
11+
#include <vdso/time32.h>
12+
1013
#include <asm/barrier.h>
1114
#include <asm/unistd_compat_32.h>
1215
#include <asm/errno.h>

arch/arm64/include/asm/vdso/gettimeofday.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
#ifndef __ASSEMBLER__
1111

12+
#include <vdso/clocksource.h>
13+
1214
#include <asm/alternative.h>
1315
#include <asm/arch_timer.h>
1416
#include <asm/barrier.h>

arch/loongarch/kernel/process.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
#include <asm/switch_to.h>
5353
#include <asm/unwind.h>
5454
#include <asm/vdso.h>
55+
#include <asm/vdso/vdso.h>
5556

5657
#ifdef CONFIG_STACKPROTECTOR
5758
#include <linux/stackprotector.h>

arch/loongarch/kernel/vdso.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
#include <asm/page.h>
2020
#include <asm/vdso.h>
21+
#include <asm/vdso/vdso.h>
2122
#include <vdso/helpers.h>
2223
#include <vdso/vsyscall.h>
2324
#include <vdso/datapage.h>

arch/mips/include/asm/vdso/vdso.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
* Author: Alex Smith <alex.smith@imgtec.com>
55
*/
66

7+
#ifndef __ASM_VDSO_VDSO_H
8+
#define __ASM_VDSO_VDSO_H
9+
710
#include <asm/sgidefs.h>
811
#include <vdso/page.h>
912

@@ -70,3 +73,5 @@ static inline void __iomem *get_gic(const struct vdso_time_data *data)
7073
#endif /* CONFIG_CLKSRC_MIPS_GIC */
7174

7275
#endif /* __ASSEMBLER__ */
76+
77+
#endif /* __ASM_VDSO_VDSO_H */

arch/mips/kernel/vdso.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include <asm/mips-cps.h>
2222
#include <asm/page.h>
2323
#include <asm/vdso.h>
24+
#include <asm/vdso/vdso.h>
2425
#include <vdso/helpers.h>
2526
#include <vdso/vsyscall.h>
2627

arch/powerpc/include/asm/vdso/gettimeofday.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <asm/barrier.h>
99
#include <asm/unistd.h>
1010
#include <uapi/linux/time.h>
11+
#include <vdso/time32.h>
1112

1213
#define VDSO_HAS_CLOCK_GETRES 1
1314

arch/powerpc/include/asm/vdso/processor.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
#ifndef __ASSEMBLER__
66

7+
#include <asm/cputable.h>
8+
#include <asm/feature-fixups.h>
9+
710
/* Macros for adjusting thread priority (hardware multi-threading) */
811
#ifdef CONFIG_PPC64
912
#define HMT_very_low() asm volatile("or 31, 31, 31 # very low priority")

drivers/char/random.c

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,7 @@
5656
#include <linux/sched/isolation.h>
5757
#include <crypto/chacha.h>
5858
#include <crypto/blake2s.h>
59-
#ifdef CONFIG_VDSO_GETRANDOM
60-
#include <vdso/getrandom.h>
6159
#include <vdso/datapage.h>
62-
#include <vdso/vsyscall.h>
63-
#endif
6460
#include <asm/archrandom.h>
6561
#include <asm/processor.h>
6662
#include <asm/irq.h>
@@ -276,7 +272,7 @@ static void crng_reseed(struct work_struct *work)
276272
if (next_gen == ULONG_MAX)
277273
++next_gen;
278274
WRITE_ONCE(base_crng.generation, next_gen);
279-
#ifdef CONFIG_VDSO_GETRANDOM
275+
280276
/* base_crng.generation's invalid value is ULONG_MAX, while
281277
* vdso_k_rng_data->generation's invalid value is 0, so add one to the
282278
* former to arrive at the latter. Use smp_store_release so that this
@@ -290,8 +286,9 @@ static void crng_reseed(struct work_struct *work)
290286
* because the vDSO side only checks whether the value changed, without
291287
* actually using or interpreting the value.
292288
*/
293-
smp_store_release((unsigned long *)&vdso_k_rng_data->generation, next_gen + 1);
294-
#endif
289+
if (IS_ENABLED(CONFIG_VDSO_GETRANDOM))
290+
smp_store_release((unsigned long *)&vdso_k_rng_data->generation, next_gen + 1);
291+
295292
if (!static_branch_likely(&crng_is_ready))
296293
crng_init = CRNG_READY;
297294
spin_unlock_irqrestore(&base_crng.lock, flags);
@@ -744,9 +741,8 @@ static void __cold _credit_init_bits(size_t bits)
744741
if (system_dfl_wq)
745742
queue_work(system_dfl_wq, &set_ready);
746743
atomic_notifier_call_chain(&random_ready_notifier, 0, NULL);
747-
#ifdef CONFIG_VDSO_GETRANDOM
748-
WRITE_ONCE(vdso_k_rng_data->is_ready, true);
749-
#endif
744+
if (IS_ENABLED(CONFIG_VDSO_GETRANDOM))
745+
WRITE_ONCE(vdso_k_rng_data->is_ready, true);
750746
wake_up_interruptible(&crng_init_wait);
751747
kill_fasync(&fasync, SIGIO, POLL_IN);
752748
pr_notice("crng init done\n");

0 commit comments

Comments
 (0)