mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-07-16 14:30:06 -04:00
Merge tag 'riscv-for-linus-6.6-mw1' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux
Pull RISC-V updates from Palmer Dabbelt: - Support for the new "riscv,isa-extensions" and "riscv,isa-base" device tree interfaces for probing extensions - Support for userspace access to the performance counters - Support for more instructions in kprobes - Crash kernels can be allocated above 4GiB - Support for KCFI - Support for ELFs in !MMU configurations - ARCH_KMALLOC_MINALIGN has been reduced to 8 - mmap() defaults to sv48-sized addresses, with longer addresses hidden behind a hint (similar to Arm and Intel) - Also various fixes and cleanups * tag 'riscv-for-linus-6.6-mw1' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: (51 commits) lib/Kconfig.debug: Restrict DEBUG_INFO_SPLIT for RISC-V riscv: support PREEMPT_DYNAMIC with static keys riscv: Move create_tmp_mapping() to init sections riscv: Mark KASAN tmp* page tables variables as static riscv: mm: use bitmap_zero() API riscv: enable DEBUG_FORCE_FUNCTION_ALIGN_64B riscv: remove redundant mv instructions RISC-V: mm: Document mmap changes RISC-V: mm: Update pgtable comment documentation RISC-V: mm: Add tests for RISC-V mm RISC-V: mm: Restrict address space for sv39,sv48,sv57 riscv: enable DMA_BOUNCE_UNALIGNED_KMALLOC for !dma_coherent riscv: allow kmalloc() caches aligned to the smallest value riscv: support the elf-fdpic binfmt loader binfmt_elf_fdpic: support 64-bit systems riscv: Allow CONFIG_CFI_CLANG to be selected riscv/purgatory: Disable CFI riscv: Add CFI error handling riscv: Add ftrace_stub_graph riscv: Add types to indirectly called assembly functions ...
This commit is contained in:
@@ -80,9 +80,21 @@ static __always_inline bool should_resched(int preempt_offset)
|
||||
|
||||
#ifdef CONFIG_PREEMPTION
|
||||
extern asmlinkage void preempt_schedule(void);
|
||||
#define __preempt_schedule() preempt_schedule()
|
||||
extern asmlinkage void preempt_schedule_notrace(void);
|
||||
|
||||
#if defined(CONFIG_PREEMPT_DYNAMIC) && defined(CONFIG_HAVE_PREEMPT_DYNAMIC_KEY)
|
||||
|
||||
void dynamic_preempt_schedule(void);
|
||||
void dynamic_preempt_schedule_notrace(void);
|
||||
#define __preempt_schedule() dynamic_preempt_schedule()
|
||||
#define __preempt_schedule_notrace() dynamic_preempt_schedule_notrace()
|
||||
|
||||
#else /* !CONFIG_PREEMPT_DYNAMIC || !CONFIG_HAVE_PREEMPT_DYNAMIC_KEY*/
|
||||
|
||||
#define __preempt_schedule() preempt_schedule()
|
||||
#define __preempt_schedule_notrace() preempt_schedule_notrace()
|
||||
|
||||
#endif /* CONFIG_PREEMPT_DYNAMIC && CONFIG_HAVE_PREEMPT_DYNAMIC_KEY*/
|
||||
#endif /* CONFIG_PREEMPTION */
|
||||
|
||||
#endif /* __ASM_PREEMPT_H */
|
||||
|
||||
@@ -10,13 +10,25 @@
|
||||
|
||||
#include <uapi/linux/elf-fdpic.h>
|
||||
|
||||
#if ELF_CLASS == ELFCLASS32
|
||||
#define Elf_Sword Elf32_Sword
|
||||
#define elf_fdpic_loadseg elf32_fdpic_loadseg
|
||||
#define elf_fdpic_loadmap elf32_fdpic_loadmap
|
||||
#define ELF_FDPIC_LOADMAP_VERSION ELF32_FDPIC_LOADMAP_VERSION
|
||||
#else
|
||||
#define Elf_Sword Elf64_Sxword
|
||||
#define elf_fdpic_loadmap elf64_fdpic_loadmap
|
||||
#define elf_fdpic_loadseg elf64_fdpic_loadseg
|
||||
#define ELF_FDPIC_LOADMAP_VERSION ELF64_FDPIC_LOADMAP_VERSION
|
||||
#endif
|
||||
|
||||
/*
|
||||
* binfmt binary parameters structure
|
||||
*/
|
||||
struct elf_fdpic_params {
|
||||
struct elfhdr hdr; /* ref copy of ELF header */
|
||||
struct elf_phdr *phdrs; /* ref copy of PT_PHDR table */
|
||||
struct elf32_fdpic_loadmap *loadmap; /* loadmap to be passed to userspace */
|
||||
struct elf_fdpic_loadmap *loadmap; /* loadmap to be passed to userspace */
|
||||
unsigned long elfhdr_addr; /* mapped ELF header user address */
|
||||
unsigned long ph_addr; /* mapped PT_PHDR user address */
|
||||
unsigned long map_addr; /* mapped loadmap user address */
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _ASM_RISCV_PERF_EVENT_H
|
||||
#define _ASM_RISCV_PERF_EVENT_H
|
||||
#ifndef _RISCV_PMU_H
|
||||
#define _RISCV_PMU_H
|
||||
|
||||
#include <linux/perf_event.h>
|
||||
#include <linux/ptrace.h>
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
#define RISCV_MAX_COUNTERS 64
|
||||
#define RISCV_OP_UNSUPP (-EOPNOTSUPP)
|
||||
#define RISCV_PMU_PDEV_NAME "riscv-pmu"
|
||||
#define RISCV_PMU_SBI_PDEV_NAME "riscv-pmu-sbi"
|
||||
#define RISCV_PMU_LEGACY_PDEV_NAME "riscv-pmu-legacy"
|
||||
|
||||
#define RISCV_PMU_STOP_FLAG_RESET 1
|
||||
@@ -55,6 +55,10 @@ struct riscv_pmu {
|
||||
void (*ctr_start)(struct perf_event *event, u64 init_val);
|
||||
void (*ctr_stop)(struct perf_event *event, unsigned long flag);
|
||||
int (*event_map)(struct perf_event *event, u64 *config);
|
||||
void (*event_init)(struct perf_event *event);
|
||||
void (*event_mapped)(struct perf_event *event, struct mm_struct *mm);
|
||||
void (*event_unmapped)(struct perf_event *event, struct mm_struct *mm);
|
||||
uint8_t (*csr_index)(struct perf_event *event);
|
||||
|
||||
struct cpu_hw_events __percpu *hw_events;
|
||||
struct hlist_node node;
|
||||
@@ -81,4 +85,4 @@ int riscv_pmu_get_hpm_info(u32 *hw_ctr_width, u32 *num_hw_ctr);
|
||||
|
||||
#endif /* CONFIG_RISCV_PMU */
|
||||
|
||||
#endif /* _ASM_RISCV_PERF_EVENT_H */
|
||||
#endif /* _RISCV_PMU_H */
|
||||
|
||||
@@ -444,7 +444,8 @@ struct pmu {
|
||||
|
||||
/*
|
||||
* Will return the value for perf_event_mmap_page::index for this event,
|
||||
* if no implementation is provided it will default to: event->hw.idx + 1.
|
||||
* if no implementation is provided it will default to 0 (see
|
||||
* perf_event_idx_default).
|
||||
*/
|
||||
int (*event_idx) (struct perf_event *event); /*optional */
|
||||
|
||||
|
||||
@@ -32,4 +32,19 @@ struct elf32_fdpic_loadmap {
|
||||
|
||||
#define ELF32_FDPIC_LOADMAP_VERSION 0x0000
|
||||
|
||||
/* segment mappings for ELF FDPIC libraries/executables/interpreters */
|
||||
struct elf64_fdpic_loadseg {
|
||||
Elf64_Addr addr; /* core address to which mapped */
|
||||
Elf64_Addr p_vaddr; /* VMA recorded in file */
|
||||
Elf64_Word p_memsz; /* allocation size recorded in file */
|
||||
};
|
||||
|
||||
struct elf64_fdpic_loadmap {
|
||||
Elf64_Half version; /* version of these structures, just in case... */
|
||||
Elf64_Half nsegs; /* number of segments */
|
||||
struct elf64_fdpic_loadseg segs[];
|
||||
};
|
||||
|
||||
#define ELF64_FDPIC_LOADMAP_VERSION 0x0000
|
||||
|
||||
#endif /* _UAPI_LINUX_ELF_FDPIC_H */
|
||||
|
||||
Reference in New Issue
Block a user