All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH riscv-next] riscv: bpf: Fix eBPF's exception tables
@ 2022-01-10 16:52 ` Jisheng Zhang
  0 siblings, 0 replies; 14+ messages in thread
From: Jisheng Zhang @ 2022-01-10 16:52 UTC (permalink / raw)
  To: Björn Töpel, Paul Walmsley, Palmer Dabbelt, Albert Ou,
	Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
	Martin KaFai Lau, Song Liu, Yonghong Song, John Fastabend,
	KP Singh
  Cc: netdev, bpf, linux-riscv, linux-kernel, Tong Tiangen

eBPF's exception tables needs to be modified to relative synchronously.

Suggested-by: Tong Tiangen <tongtiangen@huawei.com>
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
 arch/riscv/net/bpf_jit_comp64.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/riscv/net/bpf_jit_comp64.c b/arch/riscv/net/bpf_jit_comp64.c
index 69bab7e28f91..44c97535bc15 100644
--- a/arch/riscv/net/bpf_jit_comp64.c
+++ b/arch/riscv/net/bpf_jit_comp64.c
@@ -498,7 +498,7 @@ static int add_exception_handler(const struct bpf_insn *insn,
 	offset = pc - (long)&ex->insn;
 	if (WARN_ON_ONCE(offset >= 0 || offset < INT_MIN))
 		return -ERANGE;
-	ex->insn = pc;
+	ex->insn = offset;
 
 	/*
 	 * Since the extable follows the program, the fixup offset is always
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2022-01-19 21:46 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-10 16:52 [PATCH riscv-next] riscv: bpf: Fix eBPF's exception tables Jisheng Zhang
2022-01-10 16:52 ` Jisheng Zhang
2022-01-10 16:57 ` Jisheng Zhang
2022-01-10 16:57   ` Jisheng Zhang
2022-01-19 10:24   ` Björn Töpel
2022-01-19 10:24     ` Björn Töpel
2022-01-19 15:42     ` Daniel Borkmann
2022-01-19 15:42       ` Daniel Borkmann
2022-01-19 15:59       ` Björn Töpel
2022-01-19 15:59         ` Björn Töpel
2022-01-19 18:04         ` Palmer Dabbelt
2022-01-19 18:04           ` Palmer Dabbelt
2022-01-19 21:46           ` Palmer Dabbelt
2022-01-19 21:46             ` Palmer Dabbelt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.