Skip to content

Commit 3b6ab10

Browse files
committed
Merge tag 'riscv-for-linus-5.8-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux
Pull RISC-V fixes from Palmer Dabbelt: "This contains a handful of fixes I'd like to target for rc3. Most of them fix issues with the conversion of our vDSO to C. There is also one fix to the SiFive PRCI driver that I picked up as it's causing boot issues on the hardware. - A fix to allow kernels with dynamic ftrace to use the vDSO. - Some build fixes for the C vDSO functions. - A fix to the PRCI driver's memory allocation, which was the cause of some boot panics with FREELIST_RANDOM" * tag 'riscv-for-linus-5.8-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: riscv: Fixup __vdso_gettimeofday broke dynamic ftrace riscv: Add extern declarations for vDSO time-related functions clk: sifive: allocate sufficient memory for struct __prci_data riscv: Add -fPIC option to CFLAGS_vgettimeofday.o
2 parents 8530684 + e05d57d commit 3b6ab10

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

arch/riscv/kernel/vdso/Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ vdso-syms += flush_icache
1717
obj-vdso = $(patsubst %, %.o, $(vdso-syms)) note.o
1818

1919
ifneq ($(c-gettimeofday-y),)
20-
CFLAGS_vgettimeofday.o += -include $(c-gettimeofday-y)
20+
CFLAGS_vgettimeofday.o += -fPIC -include $(c-gettimeofday-y)
2121
endif
2222

2323
# Build rules
@@ -27,6 +27,9 @@ obj-vdso := $(addprefix $(obj)/, $(obj-vdso))
2727
obj-y += vdso.o vdso-syms.o
2828
CPPFLAGS_vdso.lds += -P -C -U$(ARCH)
2929

30+
# Disable -pg to prevent insert call site
31+
CFLAGS_REMOVE_vgettimeofday.o = $(CC_FLAGS_FTRACE) -Os
32+
3033
# Disable gcov profiling for VDSO code
3134
GCOV_PROFILE := n
3235

arch/riscv/kernel/vdso/vgettimeofday.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,22 @@
99
#include <linux/time.h>
1010
#include <linux/types.h>
1111

12+
extern
13+
int __vdso_clock_gettime(clockid_t clock, struct __kernel_timespec *ts);
1214
int __vdso_clock_gettime(clockid_t clock, struct __kernel_timespec *ts)
1315
{
1416
return __cvdso_clock_gettime(clock, ts);
1517
}
1618

19+
extern
20+
int __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz);
1721
int __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz)
1822
{
1923
return __cvdso_gettimeofday(tv, tz);
2024
}
2125

26+
extern
27+
int __vdso_clock_getres(clockid_t clock_id, struct __kernel_timespec *res);
2228
int __vdso_clock_getres(clockid_t clock_id, struct __kernel_timespec *res)
2329
{
2430
return __cvdso_clock_getres(clock_id, res);

drivers/clk/sifive/fu540-prci.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,10 @@ static int sifive_fu540_prci_probe(struct platform_device *pdev)
586586
struct __prci_data *pd;
587587
int r;
588588

589-
pd = devm_kzalloc(dev, sizeof(*pd), GFP_KERNEL);
589+
pd = devm_kzalloc(dev,
590+
struct_size(pd, hw_clks.hws,
591+
ARRAY_SIZE(__prci_init_clocks)),
592+
GFP_KERNEL);
590593
if (!pd)
591594
return -ENOMEM;
592595

0 commit comments

Comments
 (0)