]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
riscv: alternative: Pass vDSO start as parameter to apply_vdso_alternatives()
authorThomas Weißschuh <thomas.weissschuh@linutronix.de>
Mon, 4 May 2026 06:30:52 +0000 (08:30 +0200)
committerPaul Walmsley <pjw@kernel.org>
Sun, 7 Jun 2026 07:56:16 +0000 (01:56 -0600)
The dedicated vDSO with CFI should also be patched in the same way.
To prepare for that move the currently hardcoded vDSO start symbol
into a parameter.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Link: https://patch.msgid.link/20260504-riscv-cfi-vdso-alternative-v1-3-bcdf3d37f62e@linutronix.de
Signed-off-by: Paul Walmsley <pjw@kernel.org>
arch/riscv/kernel/alternative.c

index 59991922a5dca577b7b2e9a4cd79aaa6420e18bc..89c283a5cec7ff98e1e1dc6a2da5d43d5212398f 100644 (file)
@@ -173,14 +173,14 @@ static void __init_or_module _apply_alternatives(struct alt_entry *begin,
                                stage);
 }
 
-static void __init apply_vdso_alternatives(void)
+static void __init apply_vdso_alternatives(void *start)
 {
        const Elf_Ehdr *hdr;
        const Elf_Shdr *shdr;
        const Elf_Shdr *alt;
        struct alt_entry *begin, *end;
 
-       hdr = (Elf_Ehdr *)vdso_start;
+       hdr = (Elf_Ehdr *)start;
        shdr = (void *)hdr + hdr->e_shoff;
        alt = find_section(hdr, shdr, ".alternative");
        if (!alt)
@@ -204,7 +204,7 @@ void __init apply_boot_alternatives(void)
                            RISCV_ALTERNATIVES_BOOT);
 
        if (IS_ENABLED(CONFIG_MMU))
-               apply_vdso_alternatives();
+               apply_vdso_alternatives(vdso_start);
 }
 
 /*