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
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
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
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
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
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
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
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
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
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
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
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
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:
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
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
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
> >
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 ++
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
-> *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
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
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.
> >
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
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.
> > *
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
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
.
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
`%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
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
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
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
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
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
> >
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
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
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
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,
> &
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
> >
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,
> >
} 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
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
-> *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 `
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
---
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
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
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):
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
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
>
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
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
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
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
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
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
. 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
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:
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
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
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
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
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]
>
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
::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
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
::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
::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
::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
27;s release callback.
>
> Fixes: 1e4b8896c0f3 ("rust: drm: add device abstraction")
> Signed-off-by: Danilo Krummrich
Reviewed-by: 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
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
.
>
> 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
-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
}
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
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
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
74 matches
Mail list logo