Page MenuHomeFreeBSD

lindebugfs: Add `debugfs_create_str()`
ClosedPublic

Authored by dumbbell on Feb 19 2025, 9:33 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Oct 14, 2:58 AM
Unknown Object (File)
Thu, Oct 2, 11:41 AM
Unknown Object (File)
Wed, Oct 1, 9:04 AM
Unknown Object (File)
Wed, Oct 1, 8:15 AM
Unknown Object (File)
Mon, Sep 29, 2:15 AM
Unknown Object (File)
Sun, Sep 28, 9:50 AM
Unknown Object (File)
Sun, Sep 28, 4:01 AM
Unknown Object (File)
Sat, Sep 27, 3:48 PM
Subscribers

Details

Summary

This function is used by the i915 DRM driver starting with Linux 6.8.

This is part of the update of DRM drivers to Linux 6.8.

Sponsored by: The FreeBSD Foundation

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bz requested changes to this revision.Feb 22 2025, 1:10 PM
bz added a subscriber: bz.
bz added inline comments.
sys/compat/lindebugfs/lindebugfs.c
645

To my understanding this is not going to work.

simple_attr_read uses a 24 byte buffer. That's going to overflow for (assumed) most strings.
Also the default write routine will try to convert the string to a number using strtoq in the end.

This revision now requires changes to proceed.Feb 22 2025, 1:10 PM
sys/compat/lindebugfs/lindebugfs.c
645

You are right, I didn’t look at the implementation of DEFINE_DEBUGFS_ATTRIBUTE() and assumed something more involved :-) I will rework the patch.

Reimplement patch entirely

It depends on D49374.

dumbbell retitled this revision from lindebugfs: Add `debugfs_str_get()` to lindebugfs: Add `debugfs_create_str()`.Mar 15 2025, 11:39 AM
dumbbell edited the summary of this revision. (Show Details)
bz requested changes to this revision.Apr 2 2025, 4:29 PM
bz added inline comments.
sys/compat/lindebugfs/lindebugfs.c
703

This seems wrong. Should it be old_len + write_size or simply new_len?

This revision now requires changes to proceed.Apr 2 2025, 4:29 PM

debugfs_create_str needs to be added to the export list in sys/modules/lindebugfs/Makefile (see rG:516adf364cabe7d840129a12c71434793739dc81)

emaste requested changes to this revision.Apr 8 2025, 9:34 PM
dumbbell marked an inline comment as done.

Address feedback from @bz and @emaste.

This revision is now accepted and ready to land.Apr 12 2025, 10:14 PM
This revision was automatically updated to reflect the committed changes.