Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: torvalds/linux
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: Rust-for-Linux/linux
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: rust-next
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 7 commits
  • 13 files changed
  • 5 contributors

Commits on May 11, 2025

  1. rust: page: optimize rust symbol generation for Page

    When build the kernel using the llvm-18.1.3-rust-1.85.0-x86_64
    with ARCH=arm64, the following symbols are generated:
    
    $nm vmlinux | grep ' _R'.*Page | rustfilt
    ffff8000805b6f98 T <kernel::page::Page>::alloc_page
    ffff8000805b715c T <kernel::page::Page>::fill_zero_raw
    ffff8000805b720c T <kernel::page::Page>::copy_from_user_slice_raw
    ffff8000805b6fb4 T <kernel::page::Page>::read_raw
    ffff8000805b7088 T <kernel::page::Page>::write_raw
    ffff8000805b72fc T <kernel::page::Page as core::ops::drop::Drop>::drop
    
    These Rust symbols(alloc_page and drop) are trivial wrappers around the C
    functions alloc_pages and __free_pages. It doesn't make sense to go
    through a trivial wrapper for these functions, so mark them inline.
    
    Link: Rust-for-Linux#1145
    Suggested-by: Alice Ryhl <[email protected]>
    Co-developed-by: Grace Deng <[email protected]>
    Signed-off-by: Grace Deng <[email protected]>
    Signed-off-by: Kunwu Chan <[email protected]>
    Reviewed-by: Alice Ryhl <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    [ Removed spurious colon in title. - Miguel ]
    Signed-off-by: Miguel Ojeda <[email protected]>
    KunWuChan authored and ojeda committed May 11, 2025
    Configuration menu
    Copy the full SHA
    878620c View commit details
    Browse the repository at this point in the history
  2. docs: rust: explain that /// vs. // applies to private items too

    Sometimes kernel developers use `//` for documenting private items,
    since those do not get rendered at the moment.
    
    That is reasonable, but the intention behind `///` (and `//!`) vs. `//`
    is to convey the distinction between documentation and other kinds of
    comments, such as implementation details or TODOs.
    
    It also increases consistency with the public items and thus e.g. allows
    to change visibility of an item with less changes involved.
    
    It is not just useful for human readers, but also tooling. For instance,
    we may want to eventually generate documentation for private items
    (perhaps as a toggle in the HTML UI). On top of that, `rustdoc` lints
    as usual for those, too, so we may want to do it even if we do not use
    the result.
    
    Thus document this explicitly.
    
    Link: https://lore.kernel.org/rust-for-linux/CANiq72n_C7exSOMe5yf-7jKKnhSCv+a9QcD=OE2B_Q2UFBL3Xg@mail.gmail.com/
    Link: Rust-for-Linux#1157
    Reviewed-by: Alice Ryhl <[email protected]>
    Reviewed-by: Christian Schrefl <[email protected]>
    Reviewed-by: Viresh Kumar <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    [ Fixed typo. - Miguel ]
    Signed-off-by: Miguel Ojeda <[email protected]>
    ojeda committed May 11, 2025
    Configuration menu
    Copy the full SHA
    79d04e7 View commit details
    Browse the repository at this point in the history
  3. rust: static_assert: add optional message

    Add an optional panic message to the `static_assert!` macro.
    
    The panic message doesn't support argument formatting, because the
    `assert!` macro only supports formatting in non-const contexts.
    
    Suggested-by: Miguel Ojeda <[email protected]>
    Link: Rust-for-Linux#1149
    Signed-off-by: Altan Ozlu <[email protected]>
    Reviewed-by: Benno Lossin <[email protected]>
    Reviewed-by: Trevor Gross <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Miguel Ojeda <[email protected]>
    altanozlu authored and ojeda committed May 11, 2025
    Configuration menu
    Copy the full SHA
    0fa5f8c View commit details
    Browse the repository at this point in the history
  4. rust: uaccess: take advantage of the prelude and Result's defaults

    The `kernel` prelude brings `Result` and the error codes; and the prelude
    itself is already available in the examples automatically.
    
    In addition, `Result` already defaults to `T = ()`.
    
    Thus simplify.
    
    Reviewed-by: Alice Ryhl <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Miguel Ojeda <[email protected]>
    ojeda committed May 11, 2025
    Configuration menu
    Copy the full SHA
    7d8dee4 View commit details
    Browse the repository at this point in the history
  5. rust: clarify the language unstable features in use

    We track the details of which Rust features we use at our usual "live
    list" [1] (and its sub-lists), but in light of a discussion in the LWN
    article [2], it would help to clarify it in the source code.
    
    In particular, we are very close to rely only on stable Rust language-wise
    -- essentially only two language features remain (including the `kernel`
    crate).
    
    Thus add some details in both the feature list of the `kernel` crate as
    well as the list of allowed features.
    
    This does not over every single feature, and there are quite a few
    non-language features that we use too. To have the full picture, please
    refer to [1].
    
    Link: Rust-for-Linux#2 [1]
    Link: https://lwn.net/Articles/1015409/ [2]
    Suggested-by: Andreas Hindborg <[email protected]>
    Reviewed-by: Benno Lossin <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    [ Improved comments with suggestions from the list. - Miguel ]
    Signed-off-by: Miguel Ojeda <[email protected]>
    ojeda committed May 11, 2025
    Configuration menu
    Copy the full SHA
    b9b701f View commit details
    Browse the repository at this point in the history
  6. rust: convert raw URLs to Markdown autolinks in comments

    Some comments in Rust files use raw URLs (http://example.com) rather
    than Markdown autolinks <URL>. This inconsistency makes the
    documentation less uniform and harder to maintain.
    
    This patch converts all remaining raw URLs in Rust code comments to use
    the Markdown autolink format, maintaining consistency with the rest of
    the codebase which already uses this style.
    
    Suggested-by: Miguel Ojeda <[email protected]>
    Link: Rust-for-Linux#1153
    Signed-off-by: Xizhe Yin <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    [ Used From form for Signed-off-by. Sorted tags. - Miguel ]
    Signed-off-by: Miguel Ojeda <[email protected]>
    xizheyin authored and ojeda committed May 11, 2025
    Configuration menu
    Copy the full SHA
    86d990c View commit details
    Browse the repository at this point in the history
  7. rust: replace rustdoc references to alloc::format

    Replace alloc::format[1] in the pr_* and dev_* macros' doc comments
    with std::format[2] because they are identical but less likely to get
    confused with the kernel's alloc crate.
    
    And add a url link for the std::format! macro.
    
    Link: https://doc.rust-lang.org/alloc/macro.format.html [1]
    Link: https://doc.rust-lang.org/std/macro.format.html [2]
    Reviewed-by: Benno Lossin <[email protected]>
    Signed-off-by: Andrew Ballance <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    [ Fixed typo and reworded slightly. - Miguel ]
    Signed-off-by: Miguel Ojeda <[email protected]>
    mrwigglewaffles authored and ojeda committed May 11, 2025
    Configuration menu
    Copy the full SHA
    edc5e6e View commit details
    Browse the repository at this point in the history
Loading