9549fb354e
Add support for enabling and using the binfmt_elf_fdpic program loader on RISC-V platforms. The most important change is to setup registers during program load to pass the mapping addresses to the new process. One of the interesting features of the elf-fdpic loader is that it also allows appropriately compiled ELF format binaries to be loaded on nommu systems. Appropriate being those compiled with -pie. Signed-off-by: Greg Ungerer <gerg@kernel.org> Acked-by: Kees Cook <keescook@chromium.org> Link: https://lore.kernel.org/r/20230711130754.481209-3-gerg@kernel.org Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
34 lines
720 B
C
34 lines
720 B
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* Copyright (C) 2012 Regents of the University of California
|
|
*/
|
|
|
|
|
|
#ifndef _ASM_RISCV_MMU_H
|
|
#define _ASM_RISCV_MMU_H
|
|
|
|
#ifndef __ASSEMBLY__
|
|
|
|
typedef struct {
|
|
#ifndef CONFIG_MMU
|
|
unsigned long end_brk;
|
|
#else
|
|
atomic_long_t id;
|
|
#endif
|
|
void *vdso;
|
|
#ifdef CONFIG_SMP
|
|
/* A local icache flush is needed before user execution can resume. */
|
|
cpumask_t icache_stale_mask;
|
|
#endif
|
|
#ifdef CONFIG_BINFMT_ELF_FDPIC
|
|
unsigned long exec_fdpic_loadmap;
|
|
unsigned long interp_fdpic_loadmap;
|
|
#endif
|
|
} mm_context_t;
|
|
|
|
void __init create_pgd_mapping(pgd_t *pgdp, uintptr_t va, phys_addr_t pa,
|
|
phys_addr_t sz, pgprot_t prot);
|
|
#endif /* __ASSEMBLY__ */
|
|
|
|
#endif /* _ASM_RISCV_MMU_H */
|