From: Alice Ryhl <aliceryhl@google.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>,
kernel test robot <lkp@intel.com>,
Jakub Acs <acsjakub@amazon.de>,
llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
Linux Memory Management List <linux-mm@kvack.org>,
rust-for-linux@vger.kernel.org
Subject: Re: [linux-next:master 13069/13300] error[E0425]: cannot find value `VM_MERGEABLE` in crate `bindings`
Date: Fri, 3 Oct 2025 00:32:37 +0200 [thread overview]
Message-ID: <CAH5fLggBkR=n-8UfVcOhHTQ-gda0VLBpaK1p5aA=3s=tWSiGRw@mail.gmail.com> (raw)
In-Reply-To: <20251002152753.c756678dfdcf739e2fbf74f7@linux-foundation.org>
On Fri, Oct 3, 2025 at 12:28 AM Andrew Morton <akpm@linux-foundation.org> wrote:
>
> On Thu, 2 Oct 2025 23:42:59 +0200 Miguel Ojeda <miguel.ojeda.sandonis@gmail.com> wrote:
>
> > On Thu, Oct 2, 2025 at 11:19 PM Andrew Morton <akpm@linux-foundation.org> wrote:
> > >
> > > No idea. Let me cc rust-for-linux.
> > >
> > > It's a one-line patch:
> > >
> > > --- a/include/linux/mm.h~mm-ksm-fix-flag-dropping-behavior-in-ksm_madvise
> > > +++ a/include/linux/mm.h
> > > @@ -296,7 +296,7 @@ extern unsigned int kobjsize(const void
> > > #define VM_MIXEDMAP 0x10000000 /* Can contain "struct page" and pure PFN pages */
> > > #define VM_HUGEPAGE 0x20000000 /* MADV_HUGEPAGE marked this vma */
> > > #define VM_NOHUGEPAGE 0x40000000 /* MADV_NOHUGEPAGE marked this vma */
> > > -#define VM_MERGEABLE 0x80000000 /* KSM may merge identical pages */
> > > +#define VM_MERGEABLE BIT(31) /* KSM may merge identical pages */
> > >
> > > #ifdef CONFIG_ARCH_USES_HIGH_VMA_FLAGS
> > > #define VM_HIGH_ARCH_BIT_0 32 /* bit only usable on 64-bit architectures */
> >
> > Yeah, non-trivial macros confuse `bindgen`.
> >
> > For the moment, you can do e.g. [1].
> >
> > Other times, we have changed `#define`s into `enum`s -- that also works.
> >
> > ...
> >
> > --- a/rust/bindings/bindings_helper.h
> > +++ b/rust/bindings/bindings_helper.h
> > @@ -106,3 +106,5 @@ const xa_mark_t RUST_CONST_HELPER_XA_PRESENT = XA_PRESENT;
> >
> > const gfp_t RUST_CONST_HELPER_XA_FLAGS_ALLOC = XA_FLAGS_ALLOC;
> > const gfp_t RUST_CONST_HELPER_XA_FLAGS_ALLOC1 = XA_FLAGS_ALLOC1;
> > +
> > +const vm_flags_t RUST_CONST_HELPER_VM_MERGEABLE = VM_MERGEABLE;
>
> Sorry, this is rather annoying. Rust is breaking the build for a very
> simple patch. Many developers aren't rust-enabled and probably aren't
> even able to test a fix - my attempt to get a rust build setup working
> didn't end happily.
>
> Jakub's patch fixes a kernel crash and needs to be merged into mainline
> and -stable reasonably soon. But that is now blocked until someone who
> knows how to fix this error and how to test it gets down and does those
> things.
>
> Jakub's patch is present in current linux-next. Can someone please
> send us a fix?
I don't have my git-send-mail-capable laptop with me right now, but
the diff Miguel shared that adds one line to
rust/bindings/bindings_helper.h will fix this build error.
Alice
next prev parent reply other threads:[~2025-10-02 22:32 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-02 20:52 kernel test robot
2025-10-02 21:19 ` Andrew Morton
2025-10-02 21:42 ` Miguel Ojeda
2025-10-02 21:51 ` John Hubbard
2025-10-02 22:11 ` Miguel Ojeda
2025-10-02 22:27 ` Andrew Morton
2025-10-02 22:32 ` Alice Ryhl [this message]
2025-10-02 22:39 ` Miguel Ojeda
2025-10-02 22:43 ` Andrew Morton
2025-10-02 22:50 ` Alice Ryhl
2025-10-02 22:50 ` Miguel Ojeda
2025-10-02 23:16 ` Miguel Ojeda
2025-10-03 0:24 ` John Hubbard
2025-10-07 7:07 ` Jakub Acs
2025-10-07 7:15 ` Alice Ryhl
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAH5fLggBkR=n-8UfVcOhHTQ-gda0VLBpaK1p5aA=3s=tWSiGRw@mail.gmail.com' \
--to=aliceryhl@google.com \
--cc=acsjakub@amazon.de \
--cc=akpm@linux-foundation.org \
--cc=linux-mm@kvack.org \
--cc=lkp@intel.com \
--cc=llvm@lists.linux.dev \
--cc=miguel.ojeda.sandonis@gmail.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=rust-for-linux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox