Re: [PATCH 4/4] drm/panic: Add a qr_code panic screen

2024-07-04 Thread Alice Ryhl
Jocelyn Falempe wrote: > This patch adds a new panic screen, with a QR code and the kmsg data > embedded. > If DRM_PANIC_SCREEN_QR_CODE_URL is set, then the kmsg data will be > compressed with zlib and encoded as a numerical segment, and appended > to the url as a url parameter. This allows to sav

Re: [PATCH 0/4] drm/panic: Add a qr_code panic screen

2024-07-04 Thread Alice Ryhl
On Thu, Jul 4, 2024 at 7:03 AM Greg KH wrote: > > On Wed, Jul 03, 2024 at 05:33:57PM +0200, Jocelyn Falempe wrote: > > Jocelyn Falempe (4): > > drm/panic: Add integer scaling to blit() > > drm/rect: add drm_rect_overlap() > > drm/panic: simplify logo handling > > drm/panic: Add a qr_code p

Re: [PATCH 0/4] drm/panic: Add a qr_code panic screen

2024-07-04 Thread Alice Ryhl
On Wed, Jul 3, 2024 at 5:44 PM Jocelyn Falempe wrote: > > This series adds a new panic screen, with the kmsg data embedded in a QR-code. > > The main advantage of QR-code, is that you can copy/paste the debug data to a > bug report. > > The QR-code encoder is written in rust, and is very specific

Re: [PATCH 4/4] drm/panic: Add a qr_code panic screen

2024-07-04 Thread Alice Ryhl
On Thu, Jul 4, 2024 at 11:28 AM Greg KH wrote: > > On Thu, Jul 04, 2024 at 09:11:09AM +, Alice Ryhl wrote: > > As long as the above requirements are satisfied, calling > > `drm_panic_qr_generate` should never cause memory unsafety, so this is > > an appropriate lis

Re: [PATCH v2 4/4] drm/panic: Add a qr_code panic screen

2024-07-09 Thread Alice Ryhl
encoded as binary segment (ie raw > ascii) and only a maximum of 2953 bytes of kmsg data will be > available in the QR code. > > You can also limit the QR code size with DRM_PANIC_SCREEN_QR_VERSION. > > v2: > * Rewrite the rust comments with Markdown (Alice Ryhl) > * Mark drm

Re: [PATCH v3 4/4] drm/panic: Add a QR code panic screen

2024-07-11 Thread Alice Ryhl
coded as a binary segment (ie raw > ascii) and only a maximum of 2953 bytes of kmsg data will be > available in the QR code. > > You can also limit the QR code size with DRM_PANIC_SCREEN_QR_VERSION. > > v2: > * Rewrite the rust comments with Markdown (Alice Ryhl) > * Mark drm

Re: [PATCH v4 4/4] drm/panic: Add a QR code panic screen

2024-07-22 Thread Alice Ryhl
coded as a binary segment (ie raw > ascii) and only a maximum of 2953 bytes of kmsg data will be > available in the QR code. > > You can also limit the QR code size with DRM_PANIC_SCREEN_QR_VERSION. > > Signed-off-by: Jocelyn Falempe Reviewed-by: Alice Ryhl Alice > v2: &g

Re: [RFC PATCH] drm: panthor: add dev_coredumpv support

2024-07-23 Thread Alice Ryhl
On Mon, Jul 15, 2024 at 11:12 AM Steven Price wrote: > >>> + > >>> +pub(crate) const GPU_ID: GpuRegister = GpuRegister(0x0); > >>> +pub(crate) const fn gpu_arch_major(x: u64) -> GpuRegister { > >>> +GpuRegister((x) >> 28) > >>> +} > >>> +pub(crate) const fn gpu_arch_minor(x: u64) -> GpuRegiste

Re: [RFC PATCH] drm: panthor: add dev_coredumpv support

2024-07-23 Thread Alice Ryhl
On Thu, Jul 11, 2024 at 12:52 AM Daniel Almeida wrote: > > Dump the state of the GPU. This feature is useful for debugging purposes. > --- > Hi everybody! > > For those looking for a branch instead, see [0]. > > I know this patch has (possibly many) issues. It is meant as a > discussion around the

Re: [RFC PATCH] drm: panthor: add dev_coredumpv support

2024-07-23 Thread Alice Ryhl
On Tue, Jul 23, 2024 at 3:41 PM Daniel Almeida wrote: > > Hi Alice, thanks for the review! > > > >> +fn alloc_mem(&mut self, size: usize) -> Option<*mut u8> { > >> +assert!(size % 8 == 0, "Allocation size must be 8-byte > >> aligned"); > >> +if isize::try_from(size

Re: [PATCH] drm/panthor: Convert IOCTL defines to an enum

2025-02-05 Thread Alice Ryhl
On Wed, Feb 5, 2025 at 12:30 AM Rob Herring (Arm) wrote: > > Use an enum instead of #defines for panthor IOCTLs. This allows the > header to be used with Rust code as bindgen can't handle complex > defines. > > Cc: Beata Michalska > Signed-off-by: Rob Herring (Arm) Reviewed-by: Alice Ryhl

Re: [PATCH] drm/sched: Extend and update documentation

2024-11-21 Thread Alice Ryhl
On Fri, Nov 15, 2024 at 11:36 AM Philipp Stanner wrote: > > The various objects defined and used by the GPU scheduler are currently > not fully documented. Furthermore, there is no documentation yet > informing drivers about how they should handle timeouts. > > Add documentation describing the sch

Re: [WIP RFC v2 02/35] WIP: rust: drm: Add traits for registering KMS devices

2024-12-06 Thread Alice Ryhl
On Tue, Oct 1, 2024 at 1:37 AM Lyude Paul wrote: > > This commit adds some traits for registering DRM devices with KMS support, > implemented through the kernel::drm::kms::Kms trait. Devices which don't > have KMS support can simply use PhantomData. > > Signed-off-by: Lyude Paul > > --- > > TODO:

Re: [PATCH] drm/panic: fix compilation issue on ARM

2025-01-21 Thread Alice Ryhl
On 1/20/25 10:52 PM, Miguel Ojeda wrote: Hi Emmanuel, On Mon, Jan 20, 2025 at 1:45 PM Emmanuel Gil Peyrot wrote: In C, the char type is specified with “The implementation shall define char to have the same range, representation, and behavior as either signed char or unsigned char.” On x86 it

Re: [PATCH 0/4] Check Rust signatures at compile time

2025-02-28 Thread Alice Ryhl
On Fri, Feb 28, 2025 at 8:19 AM Andreas Hindborg wrote: > > "Alice Ryhl" writes: > > > Signed-off-by: Alice Ryhl > > What is going on with the cover letter of this one? It's empty. Alice

Re: [PATCH 1/4] rust: fix signature of rust_fmt_argument

2025-02-28 Thread Alice Ryhl
On Fri, Feb 28, 2025 at 9:20 AM Andreas Hindborg wrote: > > "Alice Ryhl" writes: > > > Without this change, the rest of this series will emit the following > > error message: > > > > error[E0308]: `if` and `else` have incompatible types > >

[PATCH 2/4] rust: add #[export] macro

2025-02-27 Thread Alice Ryhl
c_void) -> *mut u8 {bindings::rust_fmt_argument}` found fn item `unsafe extern "C" fn(*mut i8, *mut i8, *const c_void) -> *mut i8 {print::rust_fmt_argument}` Signed-off-by: Alice Ryhl --- rust/kernel/prelude.rs | 2 +- rust/macros/export.rs | 25 ++

[PATCH 0/4] Check Rust signatures at compile time

2025-02-27 Thread Alice Ryhl
Signed-off-by: Alice Ryhl --- Alice Ryhl (4): rust: fix signature of rust_fmt_argument rust: add #[export] macro print: use new #[export] macro for rust_fmt_argument panic_qr: use new #[export] macro drivers/gpu/drm/drm_panic.c | 5 - drivers/gpu/drm

[PATCH 1/4] rust: fix signature of rust_fmt_argument

2025-02-27 Thread Alice Ryhl
-> *mut i8 {print::rust_fmt_argument}` The error may be different depending on the architecture. Fixes: 787983da7718 ("vsprintf: add new `%pA` format specifier") Signed-off-by: Alice Ryhl --- lib/vsprintf.c | 2 +- rust/kernel/print.rs | 8 2 files changed, 5 insertion

[PATCH 4/4] panic_qr: use new #[export] macro

2025-02-27 Thread Alice Ryhl
pected unsafe fn, found safe fn | = note: expected fn item `unsafe extern "C" fn(_, _) -> _ {kernel::bindings::drm_panic_qr_max_data_size}` found fn item `extern "C" fn(_, _) -> _ {drm_panic_qr_max_data_size}` Signed-off-by: Alice Ryhl --- drivers/g

Re: [PATCH 2/4] rust: add #[export] macro

2025-02-28 Thread Alice Ryhl
On Fri, Feb 28, 2025 at 9:20 AM Andreas Hindborg wrote: > > "Alice Ryhl" writes: > > > This macro behaves like #[no_mangle], but also performs an assertion > > that the Rust function has the same signature as what is declared in the > > C header. > >

Re: [PATCH 0/4] Check Rust signatures at compile time

2025-02-28 Thread Alice Ryhl
On Thu, Feb 27, 2025 at 8:31 PM Greg Kroah-Hartman wrote: > > On Thu, Feb 27, 2025 at 05:01:58PM +, Alice Ryhl wrote: > > Signed-off-by: Alice Ryhl > > It's a bit odd to sign off on a 0/X email with no patch or description > :) > > Seriously, nice work! Thi

Re: [PATCH v2 2/5] rust: macros: support additional tokens in quote!

2025-03-03 Thread Alice Ryhl
On Fri, Feb 28, 2025 at 4:26 PM Tamir Duberstein wrote: > > On Fri, Feb 28, 2025 at 7:42 AM Alice Ryhl wrote: > > > > This gives the quote! macro support for the following additional tokens: > > > > * The = token. > > * The _ token. > > *

Re: [PATCH v2 3/5] rust: add #[export] macro

2025-03-03 Thread Alice Ryhl
On Fri, Feb 28, 2025 at 4:40 PM Tamir Duberstein wrote: > > On Fri, Feb 28, 2025 at 7:40 AM Alice Ryhl wrote: > > > > Rust has two different tools for generating function declarations to > > call across the FFI boundary: > > > > * bindgen. Generat

[PATCH v3 4/5] print: use new #[export] macro for rust_fmt_argument

2025-03-03 Thread Alice Ryhl
This moves the rust_fmt_argument function over to use the new #[export] macro, which will verify at compile-time that the function signature matches what is in the header file. Reviewed-by: Andreas Hindborg Reviewed-by: Tamir Duberstein Acked-by: Greg Kroah-Hartman Signed-off-by: Alice Ryhl

[PATCH v3 3/5] rust: add #[export] macro

2025-03-03 Thread Alice Ryhl
. Reviewed-by: Tamir Duberstein Reviewed-by: Andreas Hindborg Acked-by: Greg Kroah-Hartman Signed-off-by: Alice Ryhl --- rust/kernel/prelude.rs | 2 +- rust/macros/export.rs | 29 + rust/macros/helpers.rs | 19 ++- rust/macros/lib.rs | 24

[PATCH v3 1/5] rust: fix signature of rust_fmt_argument

2025-03-03 Thread Alice Ryhl
`%pA` format specifier") Reviewed-by: Tamir Duberstein Acked-by: Greg Kroah-Hartman Signed-off-by: Alice Ryhl --- lib/vsprintf.c | 2 +- rust/kernel/print.rs | 7 +++ 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 56fe96319292..a

[PATCH v3 0/5] Check Rust signatures at compile time

2025-03-03 Thread Alice Ryhl
The main commit of this series is "rust: add #[export] macro". Signed-off-by: Alice Ryhl --- Changes in v3: - Reword commit message about cbindgen to remove cargo comment. - Add # token to quote! macro and mention allow(unused_mut) warning. - Use quote! macro for #[no_mangle] in #[export

[PATCH v3 5/5] panic_qr: use new #[export] macro

2025-03-03 Thread Alice Ryhl
a header file so it can be included in the Rust bindings helper, and the extern keyword is removed as it is unnecessary. Reviewed-by: Andreas Hindborg Reviewed-by: Tamir Duberstein Acked-by: Simona Vetter Acked-by: Greg Kroah-Hartman Signed-off-by: Alice Ryhl --- drivers/gpu/drm/d

Re: [PATCH v2 5/5] panic_qr: use new #[export] macro

2025-03-03 Thread Alice Ryhl
On Fri, Feb 28, 2025 at 6:15 PM Tamir Duberstein wrote: > > On Fri, Feb 28, 2025 at 12:08 PM Alice Ryhl wrote: > > > > On Fri, Feb 28, 2025 at 4:55 PM Tamir Duberstein wrote: > > > > > > On Fri, Feb 28, 2025 at 7:41 AM Alice Ryhl wrote: > > > &g

[PATCH v3 2/5] rust: macros: support additional tokens in quote!

2025-03-03 Thread Alice Ryhl
Kroah-Hartman Signed-off-by: Alice Ryhl --- rust/macros/quote.rs | 27 +-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/rust/macros/quote.rs b/rust/macros/quote.rs index 33a199e4f176..31b7ebe504f4 100644 --- a/rust/macros/quote.rs +++ b/rust/macros/quo

Re: [PATCH v3 4/5] print: use new #[export] macro for rust_fmt_argument

2025-03-03 Thread Alice Ryhl
On Mon, Mar 3, 2025 at 10:46 AM Andy Shevchenko wrote: > > On Mon, Mar 03, 2025 at 08:45:15AM +, Alice Ryhl wrote: > > This moves the rust_fmt_argument function over to use the new #[export] > > macro, which will verify at compile-time that the function signature > >

Re: [PATCH 0/4] Check Rust signatures at compile time

2025-02-27 Thread Alice Ryhl
On Thu, Feb 27, 2025 at 8:31 PM Greg Kroah-Hartman wrote: > > On Thu, Feb 27, 2025 at 05:01:58PM +, Alice Ryhl wrote: > > Signed-off-by: Alice Ryhl > > It's a bit odd to sign off on a 0/X email with no patch or description > :) What b4 does, I do. ;) > Serious

[PATCH 3/4] print: use new #[export] macro for rust_fmt_argument

2025-02-27 Thread Alice Ryhl
This moves the rust_fmt_argument function over to use the new #[export] macro, which will verify at compile-time that the function signature matches what is in the header file. Signed-off-by: Alice Ryhl --- I'm not sure which header file to put this in. Any advice? --- include/linux/spri

Re: [PATCH 4/4] panic_qr: use new #[export] macro

2025-02-27 Thread Alice Ryhl
On Thu, Feb 27, 2025 at 10:29 PM Boqun Feng wrote: > > On Thu, Feb 27, 2025 at 05:02:02PM +, Alice Ryhl wrote: > > This validates at compile time that the signatures match what is in the > > header file. It highlights one annoyance with the compile-time check, > > whic

Re: [PATCH v2 5/5] panic_qr: use new #[export] macro

2025-02-28 Thread Alice Ryhl
On Fri, Feb 28, 2025 at 4:34 PM Andy Shevchenko wrote: > > On Fri, Feb 28, 2025 at 12:39:34PM +, Alice Ryhl wrote: > > This validates at compile time that the signatures match what is in the > > header file. It highlights one annoyance with the compile-time check, > &

Re: [PATCH v2 4/5] print: use new #[export] macro for rust_fmt_argument

2025-02-28 Thread Alice Ryhl
On Fri, Feb 28, 2025 at 4:37 PM Andy Shevchenko wrote: > > On Fri, Feb 28, 2025 at 12:39:33PM +, Alice Ryhl wrote: > > This moves the rust_fmt_argument function over to use the new #[export] > > macro, which will verify at compile-time that the function signature > >

Re: [PATCH v2 5/5] panic_qr: use new #[export] macro

2025-02-28 Thread Alice Ryhl
On Fri, Feb 28, 2025 at 4:55 PM Tamir Duberstein wrote: > > On Fri, Feb 28, 2025 at 7:41 AM Alice Ryhl wrote: > > > > This validates at compile time that the signatures match what is in the > > header file. It highlights one annoyance with the compile-time check, > >

[PATCH v2 2/5] rust: macros: support additional tokens in quote!

2025-02-28 Thread Alice Ryhl
} else { #name }; }; where #name has type Ident. Signed-off-by: Alice Ryhl --- rust/macros/quote.rs | 21 +++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/rust/macros/quote.rs b/rust/macros/quote.rs index 33a199e4f176

Re: [PATCH v2 0/5] Check Rust signatures at compile time

2025-02-28 Thread Alice Ryhl
On Fri, Feb 28, 2025 at 2:12 PM Miguel Ojeda wrote: > > On Fri, Feb 28, 2025 at 1:40 PM Alice Ryhl wrote: > > > > This is because cbindgen assumes a > > cargo-based buildsystem, so it is not compatible with the kernel's build > > system. > > I don't

[PATCH v2 1/5] rust: fix signature of rust_fmt_argument

2025-02-28 Thread Alice Ryhl
-> *mut i8 {print::rust_fmt_argument}` The error may be different depending on the architecture. To fix this, change the void pointer argument to use a const pointer, and change the imports to use crate::ffi instead of core::ffi for integer types. Fixes: 787983da7718 ("vsprintf: add new `

[PATCH v2 3/5] rust: add #[export] macro

2025-02-28 Thread Alice Ryhl
c_void) -> *mut i8 {print::rust_fmt_argument}` It is unfortunate that the error message starts out by saying "`if` and `else` have incompatible types", but I believe the rest of the error message is reasonably clear and not too confusing. Signed-off-by: Alice Ryhl ---

[PATCH v2 5/5] panic_qr: use new #[export] macro

2025-02-28 Thread Alice Ryhl
pected unsafe fn, found safe fn | = note: expected fn item `unsafe extern "C" fn(_, _) -> _ {kernel::bindings::drm_panic_qr_max_data_size}` found fn item `extern "C" fn(_, _) -> _ {drm_panic_qr_max_data_size}` Reviewed-by: Andreas Hindborg Signe

[PATCH v2 4/5] print: use new #[export] macro for rust_fmt_argument

2025-02-28 Thread Alice Ryhl
This moves the rust_fmt_argument function over to use the new #[export] macro, which will verify at compile-time that the function signature matches what is in the header file. Reviewed-by: Andreas Hindborg Signed-off-by: Alice Ryhl --- I'm not sure which header file to put this in. Any a

[PATCH v2 0/5] Check Rust signatures at compile time

2025-02-28 Thread Alice Ryhl
Please see its commit message for more details. Signed-off-by: Alice Ryhl --- Changes in v2: - Various improvements to documentation. - Split out quote! changes into its own commit. - Link to v1: https://lore.kernel.org/r/20250227-export-macro-v1-0-948775fc3...@google.com --- Alice Ryhl (5):

Re: [PATCH v10 0/5] rust: replace kernel::str::CStr w/ core::ffi::CStr

2025-05-28 Thread Alice Ryhl
On Sat, May 24, 2025 at 04:33:00PM -0400, Tamir Duberstein wrote: > This picks up from Michal Rostecki's work[0]. Per Michal's guidance I > have omitted Co-authored tags, as the end result is quite different. > > Link: > https://lore.kernel.org/rust-for-linux/20240819153656.28807-2-vadorov...@pro

Re: [PATCH v10 4/5] rust: replace `kernel::c_str!` with C-Strings

2025-05-28 Thread Alice Ryhl
On Mon, May 26, 2025 at 06:29:46PM -0400, Tamir Duberstein wrote: > On Mon, May 26, 2025 at 11:04 AM Benno Lossin wrote: > > > > On Sat May 24, 2025 at 10:33 PM CEST, Tamir Duberstein wrote: > > > +macro_rules! c_str_avoid_literals { > > > > I don't like this name, how about `concat_to_c_str` or >

Re: [PATCH v10 2/5] rust: support formatting of foreign types

2025-05-27 Thread Alice Ryhl
On Tue, May 27, 2025 at 12:18 AM Tamir Duberstein wrote: > > > +} > > > + > > > +fn make_ident<'a, T: IntoIterator>( > > > +span: Span, > > > +names: T, > > > +) -> impl Iterator + use<'a, T> { > > > +names.into_iter().flat_map(move |name| { > > > +[ > > > +TokenTre

Re: [PATCH v4 04/20] rust: add new `num` module with useful integer operations

2025-05-28 Thread Alice Ryhl
On Wed, May 21, 2025 at 8:45 AM Alexandre Courbot wrote: > > Introduce the `num` module, featuring the `NumExt` extension trait > that expands unsigned integers with useful operations for the kernel. > > These are to be used by the nova-core driver, but they are so ubiquitous > that other drivers

Re: [PATCH v11 3/5] rust: replace `CStr` with `core::ffi::CStr`

2025-06-02 Thread Alice Ryhl
On Fri, May 30, 2025 at 08:27:44AM -0400, Tamir Duberstein wrote: > `kernel::ffi::CStr` was introduced in commit d126d2380131 ("rust: str: > add `CStr` type") in November 2022 as an upstreaming of earlier work > that was done in May 2021[0]. That earlier work, having predated the > inclusion of `CS

Re: [PATCH] rust: types: add Opaque::from_raw

2025-06-18 Thread Alice Ryhl
On Tue, Jun 17, 2025 at 03:54:19PM +0200, Danilo Krummrich wrote: > On Tue, Jun 17, 2025 at 01:36:47PM +0000, Alice Ryhl wrote: > > Since commit b20fbbc08a36 ("rust: check type of `$ptr` in > > `container_of!`") we have enforced that the field pointer passed to > &g

Re: [PATCH v2 0/6] rust: add support for port io

2025-06-16 Thread Alice Ryhl
On Wed, May 14, 2025 at 12:58 PM Andrew Ballance wrote: > > currently the rust `Io` type maps to the c read{b, w, l, q}/write{b, w, l, q} > functions and have no support for port io. this can be a problem for pci::Bar > because the pointer returned by pci_iomap can be either PIO or MMIO [0]. > > t

Re: [PATCH] rust: drm: Drop the use of Opaque for ioctl arguments

2025-06-19 Thread Alice Ryhl
On Thu, Jun 19, 2025 at 1:01 PM Benno Lossin wrote: > > On Thu Jun 19, 2025 at 12:55 PM CEST, Danilo Krummrich wrote: > > On Thu, Jun 19, 2025 at 12:21:02PM +0200, Beata Michalska wrote: > >> diff --git a/rust/kernel/drm/ioctl.rs b/rust/kernel/drm/ioctl.rs > >> index 445639404fb7..12b296131672 100

[PATCH v2 2/2] rust: types: rename Opaque::raw_get to cast_into

2025-06-24 Thread Alice Ryhl
. However, I could not find a great naming scheme that works with raw_get(). The previous version of this patch used from_raw(), but functions of that name typically have a different signature, so that's not a great option. Suggested-by: Danilo Krummrich Signed-off-by: Alice Ryhl --- rust/k

[PATCH v2 0/2] Add Opaque::cast_from

2025-06-24 Thread Alice Ryhl
t changing the inner type. Also rename raw_get() to cast_into() for naming consistency. Signed-off-by: Alice Ryhl --- Changes in v2: - Use new naming, and rename raw_get(). - Link to v1: https://lore.kernel.org/r/20250617-opaque-from-raw-v1-1-a2e99efa3...@google.com --- Alice Ryhl (2): rust:

[PATCH v2 1/2] rust: types: add Opaque::cast_from

2025-06-24 Thread Alice Ryhl
t changing the inner type. Also update the docs to reflect this as well as some existing users. Signed-off-by: Alice Ryhl --- rust/kernel/drm/device.rs | 4 +--- rust/kernel/drm/gem/mod.rs | 4 +--- rust/kernel/lib.rs | 7 +++ rust/kernel/types.rs | 5 + 4 files changed, 14

[PATCH] rust: types: add Opaque::from_raw

2025-06-17 Thread Alice Ryhl
anging the inner type. Signed-off-by: Alice Ryhl --- rust/kernel/drm/device.rs | 4 +--- rust/kernel/drm/gem/mod.rs | 4 +--- rust/kernel/lib.rs | 7 +++ rust/kernel/types.rs | 5 + 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/rust/kernel/drm/device

Re: [PATCH v11 4/5] rust: replace `kernel::c_str!` with C-Strings

2025-06-02 Thread Alice Ryhl
On Fri, May 30, 2025 at 08:27:45AM -0400, Tamir Duberstein wrote: > C-String literals were added in Rust 1.77. Replace instances of > `kernel::c_str!` with C-String literals where possible and rename > `kernel::c_str!` to `str_to_cstr!` to clarify its intended use. > > Closes: https://github.com/R

Re: [PATCH v2] gpu: nova-core: vbios: change PmuLookupTableEntry to relax alignment

2025-07-14 Thread Alice Ryhl
On Mon, Jul 14, 2025 at 4:49 PM Joel Fernandes wrote: > > Hello, Rhys, > > On Mon, Jul 14, 2025 at 04:02:23AM -0700, Rhys Lloyd wrote: > > Instead of the data field containing a u32 and changing the alignment, > > change data to [u8; 4] and convert to u32 with a helper function. > > Removes anothe

Re: [PATCH] drm/panic: Add a u64 divide by 10 for arm32

2025-06-27 Thread Alice Ryhl
On Fri, Jun 27, 2025 at 11:41 AM Jocelyn Falempe wrote: > > On 32bits ARM, u64 divided by a constant is not optimized to a > multiply by inverse by the compiler [1]. > So do the multiply by inverse explicitly for this architecture. > > Link: https://github.com/llvm/llvm-project/issues/37280 [1] >

Re: [PATCH] drm: rust: rename Device::as_ref() to Device::from_raw()

2025-07-09 Thread Alice Ryhl
On Wed, Jul 9, 2025 at 4:07 PM Danilo Krummrich wrote: > > On Wed Jul 9, 2025 at 3:53 PM CEST, Alice Ryhl wrote: > > The prefix as_* should not be used for a constructor. Constructors > > usually use the prefix from_* instead. > > > > Some prior art in the stdlib: Bo

[PATCH] drm: rust: rename Device::as_ref() to Device::from_raw()

2025-07-09 Thread Alice Ryhl
::from_raw, fs::File::from_raw_file, Kuid::from_raw, ARef::from_raw, SeqFile::from_raw, VmaNew::from_raw, Io::from_raw. Link: https://lore.kernel.org/r/aCZYcs6Aj-cz81qs@pollux Signed-off-by: Alice Ryhl --- rust/kernel/auxiliary.rs | 2 +- rust/kernel/cpu.rs | 2 +- rust/kernel

Re: [PATCH 0/6] Replace `kernel::str::CStr` with `core::ffi::CStr` (cycle 1)

2025-07-10 Thread Alice Ryhl
str.rs| 97 > --- > samples/rust/rust_print_main.rs | 2 +- > 10 files changed, 83 insertions(+), 50 deletions(-) > --- > base-commit: 769e324b66b0d92d04f315d0c45a0f72737c7494 > change-id: 20250704-core-cstr-prepare-9b9e6a7bd57e > > Best regards, > -- > Tamir Duberstein > Reviewed-by: Alice Ryhl

[PATCH v2 0/2] Rename Device::as_ref() to from_raw()

2025-07-11 Thread Alice Ryhl
::from_raw, fs::File::from_raw_file, Kuid::from_raw, ARef::from_raw, SeqFile::from_raw, VmaNew::from_raw, Io::from_raw. For more, see: https://lore.kernel.org/r/aCd8D5IA0RXZvtcv@pollux Signed-off-by: Alice Ryhl --- Changes in v2: - Split into two patches. - Use a different lore link. - Link to v1

[PATCH v2 2/2] drm: rust: rename as_ref() to from_raw() for drm constructors

2025-07-11 Thread Alice Ryhl
::from_raw, fs::File::from_raw_file, Kuid::from_raw, ARef::from_raw, SeqFile::from_raw, VmaNew::from_raw, Io::from_raw. Link: https://lore.kernel.org/r/aCd8D5IA0RXZvtcv@pollux Signed-off-by: Alice Ryhl --- rust/kernel/drm/device.rs | 2 +- rust/kernel/drm/file.rs| 8 rust/kernel

[PATCH v2 1/2] device: rust: rename Device::as_ref() to Device::from_raw()

2025-07-11 Thread Alice Ryhl
::from_raw, fs::File::from_raw_file, Kuid::from_raw, ARef::from_raw, SeqFile::from_raw, VmaNew::from_raw, Io::from_raw. Link: https://lore.kernel.org/r/aCd8D5IA0RXZvtcv@pollux Signed-off-by: Alice Ryhl --- rust/kernel/auxiliary.rs | 2 +- rust/kernel/cpu.rs| 2 +- rust/kernel/device.rs

Re: [PATCH] rust: drm: device: drop_in_place() the drm::Device in release()

2025-07-03 Thread Alice Ryhl
27;s release callback. > > Fixes: 1e4b8896c0f3 ("rust: drm: add device abstraction") > Signed-off-by: Danilo Krummrich Reviewed-by: Alice Ryhl

Re: [PATCH 4/6] rust: str: remove unnecessary qualification

2025-07-05 Thread Alice Ryhl
On Fri, Jul 4, 2025 at 10:16 PM Tamir Duberstein wrote: > > `core::ffi::*` is in the prelude, which is imported here. > > Signed-off-by: Tamir Duberstein Reviewed-by: Alice Ryhl

Re: [PATCH v12 0/5] rust: replace kernel::str::CStr w/ core::ffi::CStr

2025-07-01 Thread Alice Ryhl
people to never use core::ffi as the integer types are wrong, and I think it would be nice if we can continue to tell people "never use core::ffi". Either way, for the whole series: Reviewed-by: Alice Ryhl Alice

Re: [PATCH v5] rust: drm: Drop the use of Opaque for ioctl arguments

2025-07-21 Thread Alice Ryhl
. > > Signed-off-by: Beata Michalska > Acked-by: Danilo Krummrich > Reviewed-by: Boqun Feng I'm guessing this should go through the DRM tree? Reviewed-by: Alice Ryhl

Re: [PATCH v2] drm/panic: Add a u64 divide by 10 for arm32

2025-08-01 Thread Alice Ryhl
-project/issues/37280 [1] > Reported-by: Andrei Lalaev > Closes: > https://lore.kernel.org/dri-devel/c0a2771c-f3f5-4d4c-aa82-d673b3c5c...@gmail.com/ > Fixes: 675008f196ca ("drm/panic: Use a decimal fifo to avoid u64 by u64 > divide") > Signed-off-by: Jocelyn Falempe Reviewed-by: Alice Ryhl

Re: [PATCH 4/4] rust: drm: don't pass the address of drm::Device to drm_dev_put()

2025-08-01 Thread Alice Ryhl
} I think it would somewhat more consistent to use the naming raw_get() or cast_into(), but I am ok with this naming too. Reviewed-by: Alice Ryhl Alice

Re: [PATCH 1/4] rust: alloc: replace aligned_size() with Kmalloc::aligned_layout()

2025-08-01 Thread Alice Ryhl
h have to call subsystem specific kmalloc() based > allocation primitives directly, can make use of it. > > Fixes: 8a799831fc63 ("rust: alloc: implement `ReallocFunc`") > Signed-off-by: Danilo Krummrich I guess vmalloc handles alignment in a different way ... ok makes sense to me. Reviewed-by: Alice Ryhl

Re: [PATCH 2/4] rust: drm: ensure kmalloc() compatible Layout

2025-08-01 Thread Alice Ryhl
On Thu, Jul 31, 2025 at 05:48:07PM +0200, Danilo Krummrich wrote: > drm::Device is allocated through __drm_dev_alloc() (which uses > kmalloc()) and the driver private data, ::Data, is > initialized in-place. > > Due to the order of fields in drm::Device > > pub struct Device { > dev: Opaqu