Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'riscv-for-linus-5.9-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux

Pull RISC-V fixes from Palmer Dabbelt:
"Two fixes for this week:

- The addition of a symbol export for clint_time_val, which has been
inlined into some timex functions and can be used by drivers.

- A fix to avoid calling get_cycles() before the timers have been
probed.

These both only effect !MMU systems"

* tag 'riscv-for-linus-5.9-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
RISC-V: Check clint_time_val before use
clocksource: clint: Export clint_time_val for modules

+14 -4
-4
arch/riscv/include/asm/stackprotector.h
··· 5 5 6 6 #include <linux/random.h> 7 7 #include <linux/version.h> 8 - #include <asm/timex.h> 9 8 10 9 extern unsigned long __stack_chk_guard; 11 10 ··· 17 18 static __always_inline void boot_init_stack_canary(void) 18 19 { 19 20 unsigned long canary; 20 - unsigned long tsc; 21 21 22 22 /* Try to get a semi random initial value. */ 23 23 get_random_bytes(&canary, sizeof(canary)); 24 - tsc = get_cycles(); 25 - canary += tsc + (tsc << BITS_PER_LONG/2); 26 24 canary ^= LINUX_VERSION_CODE; 27 25 canary &= CANARY_MASK; 28 26
+13
arch/riscv/include/asm/timex.h
··· 33 33 #define get_cycles_hi get_cycles_hi 34 34 #endif /* CONFIG_64BIT */ 35 35 36 + /* 37 + * Much like MIPS, we may not have a viable counter to use at an early point 38 + * in the boot process. Unfortunately we don't have a fallback, so instead 39 + * we just return 0. 40 + */ 41 + static inline unsigned long random_get_entropy(void) 42 + { 43 + if (unlikely(clint_time_val == NULL)) 44 + return 0; 45 + return get_cycles(); 46 + } 47 + #define random_get_entropy() random_get_entropy() 48 + 36 49 #else /* CONFIG_RISCV_M_MODE */ 37 50 38 51 static inline cycles_t get_cycles(void)
+1
drivers/clocksource/timer-clint.c
··· 38 38 39 39 #ifdef CONFIG_RISCV_M_MODE 40 40 u64 __iomem *clint_time_val; 41 + EXPORT_SYMBOL(clint_time_val); 41 42 #endif 42 43 43 44 static void clint_send_ipi(const struct cpumask *target)