Re: [RFC PATCH 1/1] kbuild: add Makefile.container with CONTAINER option

2025-10-14 Thread Miguel Ojeda
ur feedback. I can spend some time investigating > alternative approaches if they seem worthwhile. I'd be interested to > know what others think of this too. You're welcome! I hope that helped at least. Cc'ing David/Rae/Shuah as well for the KUnit bits. Cheers, Miguel

Re: next-20250818: rust: `ARCH_KMALLOC_MINALIGN` is defined multiple times

2025-08-19 Thread Miguel Ojeda
ext. Thanks! Cheers, Miguel

Re: [PATCH] rust: kernel: remove support for unused host `#[test]`s

2025-08-16 Thread Miguel Ojeda
el too). I have sent a patch for that here: https://lore.kernel.org/rust-for-linux/20250816211900.2731720-1-oj...@kernel.org/ Cheers, Miguel

[PATCH] rust: kernel: remove support for unused host `#[test]`s

2025-07-26 Thread Miguel Ojeda
ate. This still maintains the support for the `macros` crate, even though we do not have any such tests there. Link: https://lore.kernel.org/rust-for-linux/CABVgOS=AKHSfifp0S68K3jgNZAkALBr=7iFb=niryg5wdxj...@mail.gmail.com/ [1] Signed-off-by: Miguel Ojeda --- rust/Makefile| 9 +

Re: [PATCH v5 07/10] modpost: Add modname to mod_device_table alias

2025-07-24 Thread Miguel Ojeda
t very pretty, but it's possible for now. > > Cc: Miguel Ojeda Thanks for the ping -- Cc'ing as well Andreas who is working on module bits lately (but is away right now) and Danilo who maintains the modified file: Cc: Andreas Hindborg Cc: Danilo Krummrich Cheers, Miguel

Re: [PATCH v2 0/2] rust: minor idiomatic fixes to doctest generator

2025-07-20 Thread Miguel Ojeda
On Thu, May 29, 2025 at 3:15 PM Tamir Duberstein wrote: > > Please see individual commit messages. > > Signed-off-by: Tamir Duberstein Applied to `rust-next` -- thanks everyone! [ Reworded title. - Miguel ] [ Kept newlines using `writeln!`. Used new message from Tam

Re: [PATCH v2 2/2] rust: emit path candidates in panic message

2025-07-20 Thread Miguel Ojeda
On Thu, May 29, 2025 at 3:15 PM Tamir Duberstein wrote: > > +write!(&mut candidates, "{path:?}").unwrap(); I assume this was supposed to be `writeln!`; otherwise, we lose the newlines and the indent does not make much sense. I will fix it when applying. Cheers, Miguel

Re: [PATCH v2 1/7] compiler_types.h: add "auto" as a macro for "__auto_type"

2025-07-20 Thread Miguel Ojeda
happened to invent an attribute which requires using "auto" in it, since it is not reserved there in C23 AFAIU. So FWIW: Acked-by: Miguel Ojeda > + * so it has always been "namespace reserved." Not sure what this means (could we just say reserved?). Thanks! Relatedly,

Re: [PATCH v15 0/7] rust: extend `module!` macro with integer parameter support

2025-07-07 Thread Miguel Ojeda
>From our discussion in Zulip: the code itself is older than that the merge above. I think you wanted an example sentence for this -- something simple could be e.g. Based on the original module parameter support by Miguel [1], later extended and generalized by Adam for more types [2][3]. Origin

Re: [PATCH v4 2/6] rust: switch to `#[expect(...)]` in init and kunit

2025-07-07 Thread Miguel Ojeda
On Wed, Jul 2, 2025 at 8:47 PM Benno Lossin wrote: > > @Miguel are you going to pick this eventually, or do you think it should > have a new version with the right splitting? I guess I could take it since the series can only introduce build failures at worst. However, I thought we were

Re: [PATCH v14 3/7] rust: introduce module_param module

2025-07-06 Thread Miguel Ojeda
old so I would suggest taking a look at naming etc. with fresh eyes. Cheers, Miguel

Re: [PATCH v13 2/6] rust: introduce module_param module

2025-07-01 Thread Miguel Ojeda
On Tue, Jul 1, 2025 at 5:43 PM Benno Lossin wrote: > > Ultimately this is something for Miguel to decide. Only if you all cannot get to an agreement ;) If Andreas wants to have it already added, then I would say just mark it `unsafe` as Benno recommends (possibly with an overb

Re: [PATCH v4 6/6] rust: remove `#[allow(clippy::non_send_fields_in_send_ty)]`

2025-07-01 Thread Miguel Ojeda
but if you do, then please reword it). Cheers, Miguel

Re: [PATCH v4 0/6] replace `allow(...)` lints with `expect(...)`

2025-07-01 Thread Miguel Ojeda
, maintainers still have to coordinate, which isn't a big deal, since the changes are small and straightforward, but the purpose of the split was to avoid that. Cheers, Miguel

Re: [PATCH v3 3/3] rust: remove `#[allow(clippy::non_send_fields_in_send_ty)]`

2025-06-28 Thread Miguel Ojeda
en if it gets reviewed, you can still split, keeping their tag. Thanks! Cheers, Miguel

Re: [PATCH v3 3/3] rust: remove `#[allow(clippy::non_send_fields_in_send_ty)]`

2025-06-28 Thread Miguel Ojeda
ps we cannot convert due to that -- I didn't check) Cheers, Miguel

Re: [PATCH v3 3/3] rust: remove `#[allow(clippy::non_send_fields_in_send_ty)]`

2025-06-28 Thread Miguel Ojeda
hanks for doing these cleanups! They are appreciated. Cheers, Miguel

Re: [PATCH v3 3/3] rust: remove `#[allow(clippy::non_send_fields_in_send_ty)]`

2025-06-28 Thread Miguel Ojeda
ctually enabled the lint with e.g. #![warn(clippy::non_send_fields_in_send_ty)] at the top of the file, and then used `expect`, it will build fine. Cheers, Miguel

Re: [PATCH v3 3/3] rust: remove `#[allow(clippy::non_send_fields_in_send_ty)]`

2025-06-28 Thread Miguel Ojeda
). I am not sure if it is worth enforcing it for every single case, though. It would be nice if `clippy::allow_attributes_without_reason` could be enabled just for `allow`, or ignore it for certain lints. Cheers, Miguel

Re: [PATCH v2 0/3] replace `allow(...)` lints with `expect(...)`

2025-06-28 Thread Miguel Ojeda
On Sat, Jun 28, 2025 at 6:03 AM Onur wrote: > > I already tried that but it didn't helped. I was able to make it work > with manually hacking the `init/Kconfig` file. That should not be needed -- the `/` command should tell you what you are missing. Cheers, Miguel

Re: [PATCH v3 3/3] rust: remove `#[allow(clippy::non_send_fields_in_send_ty)]`

2025-06-28 Thread Miguel Ojeda
don't need it anymore? For instance, please how I reasoned about it in commit 5e7c9b84ad08 ("rust: sync: remove unneeded `#[allow(clippy::non_send_fields_in_send_ty)]`"). (It may happen to be the same reason, or not.) Thanks! Cheers, Miguel

Re: [PATCH v2 0/3] replace `allow(...)` lints with `expect(...)`

2025-06-27 Thread Miguel Ojeda
else may be missing to enable a symbol. I hope that helps. Cheers, Miguel

Re: [PATCH 2/2] rust: drop unnecessary lints caught by `#[expect(...)]`

2025-06-26 Thread Miguel Ojeda
om FFI mappings `c_long` is always `isize` now, which is always different from `c_int` (`i32`). By the way, please Cc the rust-for-linux list too. Thanks! Cheers, Miguel

Re: [PATCH v3] rust: kunit: use crate-level mapping for `c_void`

2025-06-23 Thread Miguel Ojeda
kely. > > Reviewed-by: Benno Lossin > Signed-off-by: Jesung Yang > Link: > https://rust-for-linux.zulipchat.com/#narrow/channel/288089/topic/x/near/520452733 Applied to `rust-next` -- thanks everyone! Cheers, Miguel

Re: [PATCH v13 2/6] rust: introduce module_param module

2025-06-23 Thread Miguel Ojeda
On Mon, Jun 23, 2025 at 1:48 PM Benno Lossin wrote: > > Another way would be to use a `Once`-like type (does that exist on the C > side?) so a type that can be initialized once and then never changes. There are `DO_ONCE{,_SLEEPABLE,_LITE}`. Cheers, Miguel

Re: [PATCH v4 6/7] modpost: Add modname to mod_device_table alias

2025-06-21 Thread Miguel Ojeda
/kernel/net/phy.rs`? Should we factor out the formatting? Thanks! Cheers, Miguel

Re: [PATCH v4 6/7] modpost: Add modname to mod_device_table alias

2025-06-21 Thread Miguel Ojeda
On Sat, Jun 21, 2025 at 3:57 PM Alexey Gladkov wrote: > > rust/kernel/device_id.rs | 8 Cc'ing maintainers and list. Cheers, Miguel

Re: [PATCH v12 2/3] rust: add parameter support to the `module!` macro

2025-06-11 Thread Miguel Ojeda
se `c_*` should be unqualified). Cheers, Miguel

Re: [PATCH v12 2/3] rust: add parameter support to the `module!` macro

2025-06-11 Thread Miguel Ojeda
ot really useful vs. having some docs. But another question is: if the docs are not useful, should an item be hidden to begin with? (By the way, that one is `rustc`, not Clippy) Cheers, Miguel

Re: [PATCH v3 0/4] KVM: arm64: selftests: arch_timer_edge_cases fixes

2025-06-09 Thread Miguel Luis
ginal (!HAS_EL2 && !HAS_EL2_E2H0) 2) HAS_EL2 && HAS_EL2_E2H0 3) HAS_EL2 && !HAS_EL2_E2H0 Tests 1) and 2) returned in approx. the same amount of real time (about 12s) although 3) doesn’t seem to return at all. I’ve tested it on ampere-one. Miguel > Changes since v1: >

Re: [RFC PATCH v2 0/9] KVM: Enable Nested Virt selftests

2025-05-30 Thread Miguel Luis
> The following two tests arch_timer and vgic_lpi_stress pass for a guest in VHE mode but in a nVHE mode guest they are failing for me. I’ve tested them on Marc’s repo tag 'kvmarm-fixes-6.16-1' on an AmpereOne. Do you have plans to add nvhe mode testing to this series? Than

Re: [PATCH v2 2/2] rust: emit path candidates in panic message

2025-05-29 Thread Miguel Ojeda
or if this is ok > to do on apply. Thanks! No worries, I can do that on apply. Cheers, Miguel

Re: [PATCH v2 2/2] rust: emit path candidates in panic message

2025-05-29 Thread Miguel Ojeda
On Thu, May 29, 2025 at 3:15 PM Tamir Duberstein wrote: > > Include all information in the panic message rather than emit fragments > to stderr. Could we explain the "why" as well in the message? (i.e. not just the "what") Thanks! Cheers, Miguel

Re: [PATCH v3] rust: kunit: use crate-level mapping for `c_void`

2025-05-29 Thread Miguel Ojeda
kely. > > Reviewed-by: Benno Lossin > Signed-off-by: Jesung Yang > Link: > https://rust-for-linux.zulipchat.com/#narrow/channel/288089/topic/x/near/520452733 Looks good to me, thanks! If KUnit picks this next cycle: Acked-by: Miguel Ojeda Otherwise, I am happy to take it too. Cheers, Miguel

Re: [PATCH v2] rust: kunit: use crate-level mapping for `c_void`

2025-05-28 Thread Miguel Ojeda
you will see the prelude there :) Thanks! Cheers, Miguel

Re: [PATCH 0/7] Rust KUnit `#[test]` support improvements

2025-05-28 Thread Miguel Ojeda
On Tue, May 27, 2025 at 2:10 AM Miguel Ojeda wrote: > > [ Used the `cfg_attr` from the TODO comment and clarified its comment > now that the stabilization is in beta and thus quite likely stable > in Rust 1.88.0. Simplified the `new_body` code by introducing a new >

Re: [PATCH 2/7] rust: kunit: support checked `-> Result`s in KUnit `#[test]`s

2025-05-27 Thread Miguel Ojeda
every `Result` in the kernel), so I suggested doing that but opt-in, i.e. with a Kconfig option that would be in e.g. the debug menu. Then people could typically run their debug kernels and things like KUnit with it enabled, but production kernels without it. Then later on, if it proves useful for other things, we could try to figure out ways to do it without too much cost. Cheers, Miguel

Re: [PATCH] rust: kunit: use crate-level mapping for `c_void`

2025-05-27 Thread Miguel Ojeda
elude is (so far) not a "real prelude" that gets injected automatically. So I guess you mean importing the prelude instead. (It is imported in the KUnit series anyway, so it will llikely be there either way) Thanks! Cheers, Miguel

Re: [PATCH 0/7] Rust KUnit `#[test]` support improvements

2025-05-26 Thread Miguel Ojeda
On Tue, May 27, 2025 at 2:10 AM Miguel Ojeda wrote: > > [ Split from the next commit as suggested by Tamir. - Miguel ] > > [ Split the `CString` simplification into a new commit. - Miguel ] By the way, I kept the tags from David and Danilo in that new commit, since it was r

Re: [PATCH 0/7] Rust KUnit `#[test]` support improvements

2025-05-26 Thread Miguel Ojeda
On Fri, May 2, 2025 at 11:51 PM Miguel Ojeda wrote: > > Improvements that build on top of the very basic `#[test]` support merged in > v6.15. > > They are fairly minimal changes, but they allow us to map `assert*!`s back to > KUnit, plus to add support for test functions tha

Re: [PATCH 1/7] rust: kunit: support KUnit-mapped `assert!` macros in `#[test]`s

2025-05-26 Thread Miguel Ojeda
soon, I did a few final minor tweaks and I am applying it. Cheers, Miguel

Re: [PATCH 1/7] rust: kunit: support KUnit-mapped `assert!` macros in `#[test]`s

2025-05-26 Thread Miguel Ojeda
od first issue", since that would be a good one I think). Thanks! Cheers, Miguel

Re: [PATCH] rust: kunit: use crate-level mapping for `c_void`

2025-05-26 Thread Miguel Ojeda
t;Link:" tag to the discussion in Zulip.) Cheers, Miguel

Re: [PATCH 0/7] Rust KUnit `#[test]` support improvements

2025-05-05 Thread Miguel Ojeda
right? I think we can wait to see if we need it, or we can also just remove it and re-introduce later if needed. Thanks for taking a look! Cheers, Miguel

Re: [PATCH 5/7] rust: str: take advantage of the `-> Result` support in KUnit `#[test]`'s

2025-05-04 Thread Miguel Ojeda
Sure, the line would need to change again later, but that is fine too, we can do a separate commit. Cheers, Miguel

Re: [PATCH 4/7] rust: str: convert `rusttest` tests into KUnit

2025-05-04 Thread Miguel Ojeda
plans on their side here. For instance, for Rust, we wanted to eventually have a way to tag stuff as kernel vs. host etc., but that is longer term. Cheers, Miguel

Re: [PATCH 4/7] rust: str: convert `rusttest` tests into KUnit

2025-05-04 Thread Miguel Ojeda
uilding the kernel normally. In a way, these restricted host tests actually are an extra hassle, in that you have to deal with yet another test environment and special restrictions. But which host tests are you referring to? Thanks for reviewing! Cheers, Miguel

Re: [PATCH 5/7] rust: str: take advantage of the `-> Result` support in KUnit `#[test]`'s

2025-05-04 Thread Miguel Ojeda
to differentiate between code under test vs. other code failing. > These changes don't depend on returning `Result` from the tests > AFAICT. Can they be in a separate patch? Not sure what you mean. The change below uses `?`, which is what allows this to be removed. Thanks! Cheers, Miguel

Re: [PATCH 2/7] rust: kunit: support checked `-> Result`s in KUnit `#[test]`s

2025-05-04 Thread Miguel Ojeda
aps printing it "manually" in the log, possibly in a KUnit `# ...`. David can probably suggest the "proper" way. Thanks! Cheers, Miguel

[PATCH 6/7] Documentation: rust: rename `#[test]`s to "`rusttest` host tests"

2025-05-02 Thread Miguel Ojeda
Now that `rusttest`s are not really used much, clarify the section of the documentation that describes them. In addition, free the section name for the KUnit-based `#[test]`s that will be added afterwards. To do so, rename the section into `rusttest` host tests. Signed-off-by: Miguel Ojeda

[PATCH 7/7] Documentation: rust: testing: add docs on the new KUnit `#[test]` tests

2025-05-02 Thread Miguel Ojeda
There was no documentation yet on the KUnit-based `#[test]`s. Thus add it now. It includes an explanation about the `assert*!` macros being mapped to KUnit and the support for `-> Result` introduced in these series. Signed-off-by: Miguel Ojeda --- Documentation/rust/testing.rst |

[PATCH 4/7] rust: str: convert `rusttest` tests into KUnit

2025-05-02 Thread Miguel Ojeda
In general, we should aim to test as much as possible within the actual kernel, and not in the build host. Thus convert these `rusttest` tests into KUnit tests. Signed-off-by: Miguel Ojeda --- rust/kernel/str.rs | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a

[PATCH 5/7] rust: str: take advantage of the `-> Result` support in KUnit `#[test]`'s

2025-05-02 Thread Miguel Ojeda
!`s. Signed-off-by: Miguel Ojeda --- rust/kernel/str.rs | 68 -- 1 file changed, 30 insertions(+), 38 deletions(-) diff --git a/rust/kernel/str.rs b/rust/kernel/str.rs index cf2caa2db168..8dcfb11013f2 100644 --- a/rust/kernel/str.rs +++ b/rust/kernel/str

[PATCH 3/7] rust: add `kunit_tests` to the prelude

2025-05-02 Thread Miguel Ojeda
It is convenient to have certain things in the `kernel` prelude, and means kernel developers will find it even easier to start writing tests. And, anyway, nobody should need to use this identifier for anything else. Thus add it to the prelude. Signed-off-by: Miguel Ojeda --- rust/kernel

[PATCH 2/7] rust: kunit: support checked `-> Result`s in KUnit `#[test]`s

2025-05-02 Thread Miguel Ojeda
747345] not ok 4 my_test_suite Signed-off-by: Miguel Ojeda --- rust/kernel/kunit.rs | 25 + rust/macros/kunit.rs | 3 ++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/rust/kernel/kunit.rs b/rust/kernel/kunit.rs index 2659895d4c5d..f43e3ed460c2 100644 ---

[PATCH 1/7] rust: kunit: support KUnit-mapped `assert!` macros in `#[test]`s

2025-05-02 Thread Miguel Ojeda
t ok 2 my_second_test [1.930032] # my_test_suite: pass:0 fail:2 skip:0 total:2 [1.930153] # Totals: pass:0 fail:2 skip:0 total Link: https://github.com/rust-lang/rust/pull/140514 [1] Signed-off-by: Miguel Ojeda --- init/Kconfig | 3 +++ rust/Makefile | 3 ++- rust/

[PATCH 0/7] Rust KUnit `#[test]` support improvements

2025-05-02 Thread Miguel Ojeda
documentation tests. I also took the chance to convert some host `#[test]`s we had to KUnit in order to showcase the feature. Finally, I added documentation that was lacking from the original submission. I hope this helps. Miguel Ojeda (7): rust: kunit: support KUnit-mapped `assert!` macros in

Re: [PATCH v10 1/3] rust: str: add radix prefixed integer parsing functions

2025-05-02 Thread Miguel Ojeda
On Fri, May 2, 2025 at 2:08 PM Andreas Hindborg wrote: > > And I don't have the same built-in linter in my mind as you have 😅 I am not sure having one is a good or a bad thing, to be honest! :) Cheers, Miguel

Re: [PATCH v10 1/3] rust: str: add radix prefixed integer parsing functions

2025-05-01 Thread Miguel Ojeda
// integer. We choose u64 as sufficiently large. `u64` (These were all in the range-diff :) Cheers, Miguel

Re: [PATCH 12/14] torture: Add testing of RCU's Rust bindings to torture.sh

2025-04-18 Thread Miguel Ojeda
133 ok 2 rust_doctests_kernel Cheers, Miguel

Re: [PATCH 12/14] torture: Add testing of RCU's Rust bindings to torture.sh

2025-04-18 Thread Miguel Ojeda
.sh to make > the user explicitly ask for it? One may run KUnit without using `kunit.py`, i.e. by enabling the Kconfigs and booting the kernel. Would that help? Cheers, Miguel

Re: [PATCH v5 08/17] rust: kunit: refactor to use `&raw [const|mut]`

2025-04-05 Thread Miguel Ojeda
each patch (unless you think there are enough changes that it should not be done anymore etc.). For instance, in v4, this one was Reviewed-by: David, and a couple others were Reviewed-by Boqun; and from what I can tell, they didn't change. Thanks! Cheers, Miguel

Re: [PATCH v8 5/7] rust: str: add radix prefixed integer parsing functions

2025-04-04 Thread Miguel Ojeda
hus it does not fit since it is 2's complement, even if later the complement would. In fact, it is caught by the doctest when run with debug assertions enabled: /// assert_eq!(Ok(-128), i8::from_str(b_str!("-128"))); We try to put 128 into `i8`, which of course does not work... Cheers, Miguel

Re: [PATCH v9 1/3] rust: str: add radix prefixed integer parsing functions

2025-03-31 Thread Miguel Ojeda
or the `rusttest` target. - Miguel ] Attached range diff of what I did. I hope that helps! Cheers, Miguel +@@ rust/kernel/str.rs: macro_rules! c_str { + } + + #[cfg(test)] +-#[expect(clippy::items_after_test_module)] + mod tests { + use super::*; + @@ rust/kernel/str.rs: fn fmt(&self, f: &am

Re: [PATCH v8 0/7] rust: extend `module!` macro with integer parameter support

2025-03-27 Thread Miguel Ojeda
chi-Kaye lifted from the original `rust` branch > [1]. > > Link: > https://github.com/Rust-for-Linux/linux/tree/bc22545f38d74473cfef3e9fd65432733435b79f > [1] > Signed-off-by: Andreas Hindborg Applied (1-4) to `rust-next` -- thanks everyone! [ Pluralized section name. Hid `u

Re: [PATCH v4 08/16] rust: kunit: refactor to use `&raw [const|mut]`

2025-03-21 Thread Miguel Ojeda
ike a good idea to me. Cheers, Miguel

Re: [PATCH v4 08/16] rust: kunit: refactor to use `&raw [const|mut]`

2025-03-20 Thread Miguel Ojeda
Anyway, KUnit `#[test]`s are in -- I was not planning to merge this now anyway, it should be reviewed a bit more. Thanks! Cheers, Miguel

Re: [PATCH v8 0/3] rust: kunit: Support KUnit tests with a user-space like syntax

2025-03-20 Thread Miguel Ojeda
amir's) are independent, and in my view they shouldn't delay something (a feature) like this series. Cheers, Miguel

Re: [PATCH v8 0/7] rust: extend `module!` macro with integer parameter support

2025-03-20 Thread Miguel Ojeda
On Thu, Mar 20, 2025 at 11:26 AM Andreas Hindborg wrote: > > As far as I understand, Miguel would take patch 1-5 for v6.15 and > modules would take patch 6-7 for v6.16. At least that is my > understanding from [1], @Petr and @Miguel please correct me if I am > wrong. So I off

Re: [PATCH v8 0/3] rust: kunit: Support KUnit tests with a user-space like syntax

2025-03-20 Thread Miguel Ojeda
d-to-go for 6.15, so we can start using it concurrently with > making any additional improvements we may wish. Applied to `rust-next` -- thanks everyone! [ Applied Markdown in comment. - Miguel ] [ Removed spurious (in rendered form) newline in docs. - Miguel ] (finally! Speci

Re: [PATCH] rust: sync: rcu: Mark Guard methods as inline

2025-03-14 Thread Miguel Ojeda
On Thu, Mar 13, 2025 at 5:30 AM Joel Fernandes wrote: > > Reviewed-by: Joel Fernandes > > If no objections, I can queue it for 6.16 but let me know if Rust maintainers > prefer to take it. Thanks! That would be great -- FWIW: Acked-by: Miguel Ojeda By the way, should `read_lo

Re: [PATCH] rust: enable `clippy::ptr_as_ptr` lint

2025-03-14 Thread Miguel Ojeda
On Thu, Mar 13, 2025 at 1:41 AM Philip Li wrote: > > Sorry about this, I will implement this to make it clear asap. The bot is great -- thanks for all the resources you have put so far into it :) Cheers, Miguel

Re: [PATCH] rust: enable `clippy::ptr_as_ptr` lint

2025-03-11 Thread Miguel Ojeda
nfig (i.e. `CONFIG_RUSTC_VERSION_TEXT`). Cheers, Miguel

Re: [PATCH] rust: enable `clippy::ptr_as_ptr` lint

2025-03-07 Thread Miguel Ojeda
On Fri, Mar 7, 2025 at 5:58 PM Benno Lossin wrote: > > You link to the `ptr_as_ptr` lint though, is this a typo? I think Tamir was following the pattern of commit 3fcc23397628 ("rust: enable `clippy::ignored_unit_patterns` lint"), which I appreciate! :) Cheers, Miguel

Re: [PATCH v7 07/16] rust: add `io::{Io, IoRaw}` base types

2025-02-28 Thread Miguel Ojeda
ugging features, but also docs, KUnit, and so on. That is why we would like to improve it and why we have it in our upstream Rust wishlist and so on. In other words, it is not that we do not see the issue! I hope that clarifies. Cheers, Miguel

Re: [PATCH v7 07/16] rust: add `io::{Io, IoRaw}` base types

2025-02-27 Thread Miguel Ojeda
t has a hint, though that may have disadvantages. Cheers, Miguel

Re: [PATCH v7 0/6] rust: extend `module!` macro with integer parameter support

2025-02-27 Thread Miguel Ojeda
rust/macros/module.rs, then yes, I'd say > it should be ok to take the patches through the modules tree. Yeah, that should be the case. Worst case, we can do the delay-a-cycle thing, or if urgent create a small branch, etc. Cheers, Miguel

Re: [PATCH v7 0/6] rust: extend `module!` macro with integer parameter support

2025-02-25 Thread Miguel Ojeda
lback would be putting it in the Rust tree as a sub-entry or similar. I hope that clarifies (and thanks whatever you decide!). https://lore.kernel.org/rust-for-linux/caniq72mpyoig2ro76k0e-sutp31fw+0403zywd6mumcgfkf...@mail.gmail.com/ Would any of those other options work for you? Thanks! Cheers, Miguel

Re: [PATCH v7 5/6] rust: str: add radix prefixed integer parsing functions

2025-02-24 Thread Miguel Ojeda
though). So we should do one of the other approaches discussed in the previous versions, like call into the C one. Cheers, Miguel

Re: [PATCH v7 07/16] rust: add `io::{Io, IoRaw}` base types

2025-02-20 Thread Miguel Ojeda
w, because it is indeed confusing. I hope that helps. Cheers, Miguel

Re: [PATCH v6 0/3] rust: kunit: Support KUnit tests with a user-space like syntax

2025-02-14 Thread Miguel Ojeda
we land this, the easier it may be...). Cheers, Miguel

Re: [PATCH v6 2/3] rust: macros: add macro to easily run KUnit tests

2025-02-14 Thread Miguel Ojeda
o have "attributes" or "tags" like `#[test(host, kernel)]`. But, again, something for later -- I would rather we finally land `#[test]`s. Cheers, Miguel

Re: rust/kernel/lib.rs:17:12 : warning: the feature `new_uninit` has been stable since 1.82.0 and no longer requires an attribute to enable

2025-01-05 Thread Miguel Ojeda
On Sun, Jan 5, 2025 at 2:33 PM Miguel Ojeda wrote: > > Thanks for the report! I think there is nothing to be done here given > the details above. To clarify: v6.11.y is newer (and EOL), v6.12.y LTS is newer, and older LTSs had the Rust toolchain pinned. If there is something I a

Re: rust/kernel/lib.rs:17:12 : warning: the feature `new_uninit` has been stable since 1.82.0 and no longer requires an attribute to enable

2025-01-05 Thread Miguel Ojeda
-rc1). > toolchain: rustgcc > compiler: 'name': 'gcc', 'version': '14', 'version_full': 'gcc > (Debian 14.2.0-8) 14.2.0' By the way, it would be nice to mention here the Rust compiler too, if used. Thanks for the report! I think there is nothing to be done here given the details above. Cheers, Miguel

Re: [PATCH v5 0/3] rust: kunit: Support KUnit tests with a user-space like syntax

2025-01-03 Thread Miguel Ojeda
esult in the list for a few days (and/or put it early next cycle) given the magnitude of the changes. Finally, it is not a blocker for 6.14 or otherwise, but we should eventually add/explain the new features in `Documentation/rust/testing.rst`. Thanks again! Cheers, Miguel

Re: [PATCH v5 3/3] rust: kunit: allow to know if we are in a test

2025-01-03 Thread Miguel Ojeda
g to say here? i.e. it is always safe to call from both C and Rust, no? Or is there something I am missing? > +// when KUnit is not enabled), and we're only comparing the result to > NULL. Does "and we're only comparing the result to NULL" need to be part of the safety comment? i.e. comparing a pointer is safe (and `is_null()` too). > +let in_kunit = in_kunit_test(); > +assert!(in_kunit); I would simplify and call directly the function. Cheers, Miguel

Re: [PATCH v5 2/3] rust: macros: add macro to easily run KUnit tests

2025-01-03 Thread Miguel Ojeda
} // // static mut TEST_CASES: [kernel::bindings::kunit_case; 3] = [ // kernel::kunit::kunit_case(kernel::c_str!("foo"), kunit_rust_wrapper_foo), // kernel::kunit::kunit_case(kernel::c_str!("bar"), kunit_rust_wrapper_bar), // kernel::kunit::kunit_case_null() // ]; // // kernel::kunit_unsafe_test_suite!(kunit_test_suit_name, TEST_CASES); // ``` ...with the corresponding removals in the actual generation code below, of course. Cheers, Miguel

Re: [PATCH v5 1/3] rust: kunit: add KUnit case and suite macros

2025-01-03 Thread Miguel Ojeda
t::kunit_case_null(), ]; And then: test_cases: unsafe { ::core::ptr::addr_of_mut!($test_cases).cast::<::kernel::bindings::kunit_case>() }, So no mutable references in sight. > #![feature(unsize)] > +#![feature(const_mut_refs)] The list should be kept sorted. However, we can avoid enabling the feature I think, if we avoid the `&mut`s (please see above). Cheers, Miguel

Re: [PATCH v6 15/16] samples: rust: add Rust platform sample driver

2024-12-16 Thread Miguel Ojeda
ot break anything in your case, i.e. it is just a replacement. Thanks! Cheers, Miguel

Re: [PATCH v6 00/18] Implement DWARF modversions

2024-11-25 Thread Miguel Ojeda
Acked-bys the way they prefer, yet record your own Acked-by in a separate category. - Another idea that the maintainer may accept is an Acked-by with a "# suffix" comment that clarifies the meaning in this particular case, e.g.: Acked-by: Neal Gompa # As primary consumer (Fedora Asahi kernel maintainer). Cheers, Miguel

Re: [PATCH v4 1/3] rust: kunit: add KUnit case and suite macros

2024-11-09 Thread Miguel Ojeda
: const _: () = { static mut X: i32 = 42; #[allow(unused_unsafe)] static mut S: *const i32 = unsafe { core::ptr::addr_of_mut!(X) }; }; Cheers, Miguel

Re: [PATCH v4 2/3] rust: macros: add macro to easily run KUnit tests

2024-11-03 Thread Miguel Ojeda
ut we could mimic that behavior. (Personally, I don't particularly enjoy exceptional/context-dependent cases, unless it is something used everywhere, like `use`ing the prelude that we have). Cheers, Miguel

Re: [PATCH v4 2/3] rust: macros: add macro to easily run KUnit tests

2024-11-01 Thread Miguel Ojeda
we can drop it globally. Cheers, Miguel

Re: [RFC v2 00/13] LKMM *generic* atomics in Rust

2024-11-01 Thread Miguel Ojeda
h, even when he wasn't (and maybe still isn't) convinced. Cheers, Miguel

Re: rustgcc-kselftest: error: unknown unstable option: `patchable-function-entry`

2024-09-16 Thread Miguel Ojeda
org7xutjueqssxgcbqb7dqfpul0sfj...@mail.gmail.com/ If you can confirm it is, that would be great, thanks! i.e. you will need either to disable `CALL_PADDING` or use a newer Rust compiler version. By the way, I think you meant next-202409176, not next-20240917? Cheers, Miguel

Re: [PATCH v8 2/4] kbuild: generate offset range data for builtin modules

2024-08-24 Thread Miguel Ojeda
On Fri, Aug 23, 2024 at 7:24 PM Sami Tolvanen wrote: > > I assume they wanted to avoid conflicts between Rust-specific > environment variables and existing Kbuild variables. Note that > KBUILD_MODFILE is also double quoted for the C preprocessor, which > isn't needed for

Re: [PATCH v7 5/5] rust: add arch_static_branch

2024-08-21 Thread Miguel Ojeda
comes from my prototype I gave Alice. Please see the attached diff. Cheers, Miguel diff --git a/rust/kernel/jump_label.rs b/rust/kernel/jump_label.rs index 7757e4f8e85e..ccfd20589c21 100644 --- a/rust/kernel/jump_label.rs +++ b/rust/kernel/jump_label.rs @@ -36,7 +36,7 @@ macro_rules! static_key_false

Re: [PATCH] rust: add `module_params` macro

2024-07-09 Thread Miguel Ojeda
k if more core/common subsystems start doing that -- linux-next could be broken a lot of the time for the Rust side). But, yes, I think Rust is a great opportunity to get new co-maintainers, as well as getting new developers involved with kernel maintenance in general, which could help with other issues too. Cheers, Miguel

Re: [PATCH 1/3] rust: add static_call support

2024-06-07 Thread Miguel Ojeda
best for a long time to get the best we can for the kernel -- just 2 days ago we told the Rust project in one of our meetings that it would be nice to see that particular "project goal" from that document realized (among others). Cheers, Miguel

Re: [PATCH 1/3] rust: add static_call support

2024-06-06 Thread Miguel Ojeda
hing we could do to help here? I think Alice and others would be happy to explain how it works and/or help maintain it in the future if you prefer. Cheers, Miguel

  1   2   3   4   5   6   7   8   9   10   >