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: <CAJF2gTSR+jh04BT7rCjALL6eWek=VWm7nFTW57vzwshkTbrtVg@mail.gmail.com>
Date: Thu, 27 Mar 2025 20:47:15 +0800
From: Guo Ren <guoren@...nel.org>
To: "Liam R. Howlett" <Liam.Howlett@...cle.com>, guoren@...nel.org, arnd@...db.de, 
	gregkh@...uxfoundation.org, torvalds@...ux-foundation.org, 
	paul.walmsley@...ive.com, palmer@...belt.com, anup@...infault.org, 
	atishp@...shpatra.org, oleg@...hat.com, kees@...nel.org, tglx@...utronix.de, 
	will@...nel.org, mark.rutland@....com, brauner@...nel.org, 
	akpm@...ux-foundation.org, rostedt@...dmis.org, edumazet@...gle.com, 
	unicorn_wang@...look.com, inochiama@...look.com, gaohan@...as.ac.cn, 
	shihua@...as.ac.cn, jiawei@...as.ac.cn, wuwei2016@...as.ac.cn, drew@...7.com, 
	prabhakar.mahadev-lad.rj@...renesas.com, ctsai390@...estech.com, 
	wefu@...hat.com, kuba@...nel.org, pabeni@...hat.com, josef@...icpanda.com, 
	dsterba@...e.com, mingo@...hat.com, peterz@...radead.org, 
	boqun.feng@...il.com, xiao.w.wang@...el.com, qingfang.deng@...lower.com.cn, 
	leobras@...hat.com, jszhang@...nel.org, conor.dooley@...rochip.com, 
	samuel.holland@...ive.com, yongxuan.wang@...ive.com, 
	luxu.kernel@...edance.com, david@...hat.com, ruanjinjie@...wei.com, 
	cuiyunhui@...edance.com, wangkefeng.wang@...wei.com, qiaozhe@...as.ac.cn, 
	ardb@...nel.org, ast@...nel.org, linux-kernel@...r.kernel.org, 
	linux-riscv@...ts.infradead.org, kvm@...r.kernel.org, 
	kvm-riscv@...ts.infradead.org, linux-mm@...ck.org, 
	linux-crypto@...r.kernel.org, bpf@...r.kernel.org, 
	linux-input@...r.kernel.org, linux-perf-users@...r.kernel.org, 
	linux-serial@...r.kernel.org, linux-fsdevel@...r.kernel.org, 
	linux-arch@...r.kernel.org, maple-tree@...ts.infradead.org, 
	linux-trace-kernel@...r.kernel.org, netdev@...r.kernel.org, 
	linux-atm-general@...ts.sourceforge.net, linux-btrfs@...r.kernel.org, 
	netfilter-devel@...r.kernel.org, coreteam@...filter.org, 
	linux-nfs@...r.kernel.org, linux-sctp@...r.kernel.org, 
	linux-usb@...r.kernel.org, linux-media@...r.kernel.org
Subject: Re: [RFC PATCH V3 31/43] rv64ilp32_abi: maple_tree: Use BITS_PER_LONG
 instead of CONFIG_64BIT

On Wed, Mar 26, 2025 at 3:10 AM Liam R. Howlett <Liam.Howlett@...cle.com> wrote:
>
> * guoren@...nel.org <guoren@...nel.org> [250325 08:24]:
> > From: "Guo Ren (Alibaba DAMO Academy)" <guoren@...nel.org>
> >
> > The Maple tree algorithm uses ulong type for each element. The
> > number of slots is based on BITS_PER_LONG for RV64ILP32 ABI, so
> > use BITS_PER_LONG instead of CONFIG_64BIT.
> >
> > Signed-off-by: Guo Ren (Alibaba DAMO Academy) <guoren@...nel.org>
> > ---
> >  include/linux/maple_tree.h | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/include/linux/maple_tree.h b/include/linux/maple_tree.h
> > index cbbcd18d4186..ff6265b6468b 100644
> > --- a/include/linux/maple_tree.h
> > +++ b/include/linux/maple_tree.h
> > @@ -24,7 +24,7 @@
> >   *
> >   * Nodes in the tree point to their parent unless bit 0 is set.
> >   */
> > -#if defined(CONFIG_64BIT) || defined(BUILD_VDSO32_64)
> > +#if (BITS_PER_LONG == 64) || defined(BUILD_VDSO32_64)
>
> This will break my userspace testing, if you do not update the testing as
> well.  This can be found in tools/testing/radix-tree.  Please also look
> at the Makefile as well since it will generate a build flag for the
> userspace.
I think you are talking about the following:
============================================================
../shared/shared.mk:
ifndef LONG_BIT
LONG_BIT := $(shell getconf LONG_BIT)
endif

generated/bit-length.h: FORCE
        @mkdir -p generated
        @if ! grep -qws CONFIG_$(LONG_BIT)BIT generated/bit-length.h; then   \
                echo "Generating $@";                                        \
                echo "#define CONFIG_$(LONG_BIT)BIT 1" > $@;                 \
                echo "#define CONFIG_PHYS_ADDR_T_$(LONG_BIT)BIT 1" >> $@;    \
        fi

$ grep CONFIG_64BIT * -r -A 2
generated/bit-length.h:#define CONFIG_64BIT 1
generated/bit-length.h-#define CONFIG_PHYS_ADDR_T_64BIT 1
--
maple.c:#if defined(CONFIG_64BIT)
maple.c-static noinline void __init check_erase2_testset(struct maple_tree *mt,
maple.c-                const unsigned long *set, unsigned long size)
--
maple.c:#if CONFIG_64BIT
maple.c-        MT_BUG_ON(mt, data_end != mas_data_end(&mas));
maple.c-#endif
--
maple.c:#if CONFIG_64BIT
maple.c-        MT_BUG_ON(mt, data_end - 2 != mas_data_end(&mas));
maple.c-#endif
--
maple.c:#if CONFIG_64BIT
maple.c-        MT_BUG_ON(mt, data_end - 4 != mas_data_end(&mas));
maple.c-#endif
--
maple.c:#if defined(CONFIG_64BIT)
maple.c-        /* Captures from VMs that found previous errors */
maple.c-        mt_init_flags(&tree, 0);
============================================================

First, we don't introduce rv64ilp32-abi user space, which means these
testing codes can't run on rv64ilp32-abi userspace currently. So, the
problem you mentioned doesn't exist.

Second, CONFIG_32BIT is determined by LONG_BIT, so there's no issue in
maple.c with future rv64ilp32-abi userspace.
That means rv64ilp32-abi userspace would use CONFIG_32BIT to test
radix-tree. It's okay.

>
> This raises other concerns as the code is found with a grep command, so
> I'm not sure why it was missed and if anything else is missed?
>
> If you consider this email to be the (unasked) question about what to do
> here, then please CC me, the maintainer of the files including the one
> you are updating here.
>
> Thank you,
> Liam
>


-- 
Best Regards
 Guo Ren

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ