linux-stable/arch/loongarch/mm
Youling Tang dbcd7f5faf LoongArch: BPF: Add BPF exception tables
Inspired by commit 800834285361("bpf, arm64: Add BPF exception tables"),
do similar to LoongArch to add BPF exception tables.

When a tracing BPF program attempts to read memory without using the
bpf_probe_read() helper, the verifier marks the load instruction with
the BPF_PROBE_MEM flag. Since the LoongArch JIT does not currently
recognize this flag it falls back to the interpreter.

Add support for BPF_PROBE_MEM, by appending an exception table to the
BPF program. If the load instruction causes a data abort, the fixup
infrastructure finds the exception table and fixes up the fault, by
clearing the destination register and jumping over the faulting
instruction.

To keep the compact exception table entry format, inspect the pc in
fixup_exception(). A more generic solution would add a "handler" field
to the table entry, like on x86, s390 and arm64, etc.

Signed-off-by: Youling Tang <tangyouling@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
2022-12-14 08:36:11 +08:00
..
cache.c LoongArch: Refactor cache probe and flush methods 2022-10-12 16:36:14 +08:00
extable.c LoongArch: BPF: Add BPF exception tables 2022-12-14 08:36:11 +08:00
fault.c LoongArch: mm: Avoid unnecessary page fault retires on shared memory types 2022-08-25 19:34:59 +08:00
hugetlbpage.c LoongArch: Add memory management 2022-06-03 20:09:28 +08:00
init.c LoongArch: Use TLB for ioremap() 2022-10-12 16:36:14 +08:00
ioremap.c LoongArch: Add memory management 2022-06-03 20:09:28 +08:00
maccess.c LoongArch: Add memory management 2022-06-03 20:09:28 +08:00
Makefile
mmap.c LoongArch: Support access filter to /dev/mem interface 2022-10-12 16:36:14 +08:00
page.S LoongArch: Re-tab the assembly files 2022-07-29 18:22:32 +08:00
pgtable.c loongarch: drop definition of PGD_ORDER 2022-07-17 17:14:43 -07:00
tlb.c LoongArch: Flush TLB earlier at initialization 2022-10-12 16:36:08 +08:00
tlbex.S LoongArch: mm: Fix huge page entry update for virtual machine 2022-12-08 14:59:15 +08:00