Skip to content

Commit a031e15

Browse files
committed
Merge tag 'riscv-for-linus-6.11-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux
Pull RISC-V fixes from Palmer Dabbelt: - Avoid accessing the early boot ACPI tables via unsafe memory attributes, which can result in incorrect ACPI table data appearing. This can cause all sorts of bad behavior. - Avoid compiler-inserted library calls in the VDSO. - GCC+Rust builds have been disabled, to avoid issues related to ISA string mismatched between the GCC and LLVM Rust implementations. - The NX flag is now set in the EFI PE/COFF headers, which is necessary for some distro GRUB versions to boot images. - A fix to avoid leaking DT node reference counts on ACPI systems during cache info parsing. - CPU numbers are now printed as unsigned values during hotplug. - A pair of build fixes for usused macros, which can trigger warnings on some configurations. * tag 'riscv-for-linus-6.11-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: riscv: Remove duplicated GET_RM riscv: Remove unused GENERATING_ASM_OFFSETS riscv: Use '%u' to format the output of 'cpu' riscv: Prevent a bad reference count on CPU nodes riscv: efi: Set NX compat flag in PE/COFF header RISC-V: disallow gcc + rust builds riscv: Do not use fortify in early code RISC-V: ACPI: fix early_ioremap to early_memremap riscv: vdso: Prevent the compiler from inserting calls to memset()
2 parents 3dfffd5 + 5f153a6 commit a031e15

File tree

12 files changed

+28
-13
lines changed

12 files changed

+28
-13
lines changed

Documentation/rust/arch-support.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Architecture Level of support Constraints
1717
============= ================ ==============================================
1818
``arm64`` Maintained Little Endian only.
1919
``loongarch`` Maintained \-
20-
``riscv`` Maintained ``riscv64`` only.
20+
``riscv`` Maintained ``riscv64`` and LLVM/Clang only.
2121
``um`` Maintained \-
2222
``x86`` Maintained ``x86_64`` only.
2323
============= ================ ==============================================

arch/riscv/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ config RISCV
177177
select HAVE_REGS_AND_STACK_ACCESS_API
178178
select HAVE_RETHOOK if !XIP_KERNEL
179179
select HAVE_RSEQ
180-
select HAVE_RUST if RUSTC_SUPPORTS_RISCV
180+
select HAVE_RUST if RUSTC_SUPPORTS_RISCV && CC_IS_CLANG
181181
select HAVE_SAMPLE_FTRACE_DIRECT
182182
select HAVE_SAMPLE_FTRACE_DIRECT_MULTI
183183
select HAVE_STACKPROTECTOR

arch/riscv/errata/Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ ifdef CONFIG_RELOCATABLE
22
KBUILD_CFLAGS += -fno-pie
33
endif
44

5+
ifdef CONFIG_RISCV_ALTERNATIVE_EARLY
6+
ifdef CONFIG_FORTIFY_SOURCE
7+
KBUILD_CFLAGS += -D__NO_FORTIFY
8+
endif
9+
endif
10+
511
obj-$(CONFIG_ERRATA_ANDES) += andes/
612
obj-$(CONFIG_ERRATA_SIFIVE) += sifive/
713
obj-$(CONFIG_ERRATA_THEAD) += thead/

arch/riscv/kernel/Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ KASAN_SANITIZE_alternative.o := n
3636
KASAN_SANITIZE_cpufeature.o := n
3737
KASAN_SANITIZE_sbi_ecall.o := n
3838
endif
39+
ifdef CONFIG_FORTIFY_SOURCE
40+
CFLAGS_alternative.o += -D__NO_FORTIFY
41+
CFLAGS_cpufeature.o += -D__NO_FORTIFY
42+
CFLAGS_sbi_ecall.o += -D__NO_FORTIFY
43+
endif
3944
endif
4045

4146
extra-y += vmlinux.lds

arch/riscv/kernel/acpi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,15 +210,15 @@ void __init __iomem *__acpi_map_table(unsigned long phys, unsigned long size)
210210
if (!size)
211211
return NULL;
212212

213-
return early_ioremap(phys, size);
213+
return early_memremap(phys, size);
214214
}
215215

216216
void __init __acpi_unmap_table(void __iomem *map, unsigned long size)
217217
{
218218
if (!map || !size)
219219
return;
220220

221-
early_iounmap(map, size);
221+
early_memunmap(map, size);
222222
}
223223

224224
void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size)

arch/riscv/kernel/asm-offsets.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* Copyright (C) 2017 SiFive
55
*/
66

7-
#define GENERATING_ASM_OFFSETS
8-
97
#include <linux/kbuild.h>
108
#include <linux/mm.h>
119
#include <linux/sched.h>

arch/riscv/kernel/cacheinfo.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,7 @@ int populate_cache_leaves(unsigned int cpu)
8080
{
8181
struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu);
8282
struct cacheinfo *this_leaf = this_cpu_ci->info_list;
83-
struct device_node *np = of_cpu_device_node_get(cpu);
84-
struct device_node *prev = NULL;
83+
struct device_node *np, *prev;
8584
int levels = 1, level = 1;
8685

8786
if (!acpi_disabled) {
@@ -105,6 +104,10 @@ int populate_cache_leaves(unsigned int cpu)
105104
return 0;
106105
}
107106

107+
np = of_cpu_device_node_get(cpu);
108+
if (!np)
109+
return -ENOENT;
110+
108111
if (of_property_read_bool(np, "cache-size"))
109112
ci_leaf_init(this_leaf++, CACHE_TYPE_UNIFIED, level);
110113
if (of_property_read_bool(np, "i-cache-size"))

arch/riscv/kernel/cpu-hotplug.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ void arch_cpuhp_cleanup_dead_cpu(unsigned int cpu)
5858
if (cpu_ops->cpu_is_stopped)
5959
ret = cpu_ops->cpu_is_stopped(cpu);
6060
if (ret)
61-
pr_warn("CPU%d may not have stopped: %d\n", cpu, ret);
61+
pr_warn("CPU%u may not have stopped: %d\n", cpu, ret);
6262
}
6363

6464
/*

arch/riscv/kernel/efi-header.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ extra_header_fields:
6464
.long efi_header_end - _start // SizeOfHeaders
6565
.long 0 // CheckSum
6666
.short IMAGE_SUBSYSTEM_EFI_APPLICATION // Subsystem
67-
.short 0 // DllCharacteristics
67+
.short IMAGE_DLL_CHARACTERISTICS_NX_COMPAT // DllCharacteristics
6868
.quad 0 // SizeOfStackReserve
6969
.quad 0 // SizeOfStackCommit
7070
.quad 0 // SizeOfHeapReserve

arch/riscv/kernel/pi/Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,12 @@ KBUILD_CFLAGS := $(filter-out $(CC_FLAGS_LTO), $(KBUILD_CFLAGS))
1616
KBUILD_CFLAGS += -mcmodel=medany
1717

1818
CFLAGS_cmdline_early.o += -D__NO_FORTIFY
19-
CFLAGS_lib-fdt_ro.o += -D__NO_FORTIFY
2019
CFLAGS_fdt_early.o += -D__NO_FORTIFY
20+
# lib/string.c already defines __NO_FORTIFY
21+
CFLAGS_ctype.o += -D__NO_FORTIFY
22+
CFLAGS_lib-fdt.o += -D__NO_FORTIFY
23+
CFLAGS_lib-fdt_ro.o += -D__NO_FORTIFY
24+
CFLAGS_archrandom_early.o += -D__NO_FORTIFY
2125

2226
$(obj)/%.pi.o: OBJCOPYFLAGS := --prefix-symbols=__pi_ \
2327
--remove-section=.note.gnu.property \

0 commit comments

Comments
 (0)