lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJ+HfNj_p36trWFzdyxVVgykrPVq=OvKcYq61w2QyKsHwa0gDw@mail.gmail.com>
Date:   Wed, 3 Nov 2021 07:10:00 +0100
From:   Björn Töpel <bjorn.topel@...il.com>
To:     tongtiangen <tongtiangen@...wei.com>
Cc:     Paul Walmsley <paul.walmsley@...ive.com>,
        Palmer Dabbelt <palmer@...belt.com>,
        Palmer Dabbelt <palmerdabbelt@...gle.com>,
        Albert Ou <aou@...s.berkeley.edu>,
        Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Andrii Nakryiko <andrii@...nel.org>,
        Martin KaFai Lau <kafai@...com>,
        Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>,
        John Fastabend <john.fastabend@...il.com>,
        KP Singh <kpsingh@...nel.org>,
        linux-riscv <linux-riscv@...ts.infradead.org>,
        LKML <linux-kernel@...r.kernel.org>,
        Netdev <netdev@...r.kernel.org>, bpf <bpf@...r.kernel.org>
Subject: Re: [PATCH bpf-next] riscv, bpf: fix some compiler error

On Wed, 3 Nov 2021 at 04:06, tongtiangen <tongtiangen@...wei.com> wrote:
>
[...]
> >
> Hi Björn:
>  From the perspective of development, introduce asm/extable.h is also prepare for the
> subsequent modification of exception_table_entry, such as:
>    1. https://lkml.org/lkml/2021/10/20/591
>    2. https://lore.kernel.org/linux-arm-kernel/20211019160219.5202-11-mark.rutland@arm.com/
>
> Therefore, the prototype declarations and definitions related to kernel config are placed in head file,
> which can avoid compiler error and simplify the rendering of functions.
>

Sure, but *this* patch is about getting the broken RV32 build to work,
aimed for the bpf tree. Moving the extable.h is unrelated, and should
not be done here. IMO it would be better to have this patch small/easy
to read. I can't really see how this patch helps, when merging with
Jisheng's work.

...and I still think that:
--8<--
diff --git a/arch/riscv/mm/extable.c b/arch/riscv/mm/extable.c
index 18bf338303b6..ddb7d3b99e89 100644
--- a/arch/riscv/mm/extable.c
+++ b/arch/riscv/mm/extable.c
@@ -11,7 +11,7 @@
 #include <linux/module.h>
 #include <linux/uaccess.h>

-#ifdef CONFIG_BPF_JIT
+#if defined(CONFIG_BPF_JIT) && defined(CONFIG_ARCH_RV64I)
 int rv_bpf_fixup_exception(const struct exception_table_entry *ex,
struct pt_regs *regs);
 #endif

@@ -23,7 +23,7 @@ int fixup_exception(struct pt_regs *regs)
        if (!fixup)
                return 0;

-#ifdef CONFIG_BPF_JIT
+#if defined(CONFIG_BPF_JIT) && defined(CONFIG_ARCH_RV64I)
        if (regs->epc >= BPF_JIT_REGION_START && regs->epc < BPF_JIT_REGION_END)
                return rv_bpf_fixup_exception(fixup, regs);
 #endif
diff --git a/arch/riscv/net/bpf_jit_comp64.c b/arch/riscv/net/bpf_jit_comp64.c
index 2ca345c7b0bf..6372a235522d 100644
--- a/arch/riscv/net/bpf_jit_comp64.c
+++ b/arch/riscv/net/bpf_jit_comp64.c
@@ -459,6 +459,8 @@ static int emit_call(bool fixed, u64 addr, struct
rv_jit_context *ctx)
 #define BPF_FIXUP_OFFSET_MASK   GENMASK(26, 0)
 #define BPF_FIXUP_REG_MASK      GENMASK(31, 27)

+int rv_bpf_fixup_exception(const struct exception_table_entry *ex,
+                          struct pt_regs *regs);
 int rv_bpf_fixup_exception(const struct exception_table_entry *ex,
                                struct pt_regs *regs)
 {
-->8--

is much simpler.



Thoughts?
Björn




> Thanks.
> Tong.
>
> >
> > Björn
> > .
> >

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ