Page MenuHomeFreeBSD

lindebugfs: Update fops_blob_read to operate on a kernel pointer.
AbandonedPublic

Authored by jhb on Feb 7 2023, 6:02 PM.
Tags
None
Referenced Files
Unknown Object (File)
Oct 4 2024, 9:53 PM
Unknown Object (File)
Oct 4 2024, 2:58 PM
Unknown Object (File)
Oct 4 2024, 11:45 AM
Unknown Object (File)
Oct 2 2024, 12:08 AM
Unknown Object (File)
Sep 30 2024, 5:30 PM
Unknown Object (File)
Sep 29 2024, 11:15 PM
Unknown Object (File)
Sep 24 2024, 9:47 PM
Unknown Object (File)
Sep 24 2024, 4:10 AM
Subscribers

Details

Reviewers
bz
jfree
Summary

lindebugfs allocates an intermediate kernel buffer that is passed to
the read callback rather than passing a user pointer.

Obtained from: CheriBSD
Sponsored by: DARPA

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 49605
Build 46495: arc lint + arc unit

Event Timeline

jhb requested review of this revision.Feb 7 2023, 6:02 PM

This is what I used locally in CheriBSD for now and might be an alternative to D37101.

I'll have a look and give it a try and let you know.

EAFNOTSUP; sorry, I'll try to give it a try within 48 hours. @jfree can you do drm testing?

In D38420#881831, @bz wrote:

EAFNOTSUP; sorry, I'll try to give it a try within 48 hours. @jfree can you do drm testing?

A quick grep -r "debugfs_create_blob" drm yields only two results:

amd/amdgpu/amdgpu_debugfs.c:	debugfs_create_blob("amdgpu_vbios", 0444, root,
amd/amdgpu/amdgpu_debugfs.c:	debugfs_create_blob("amdgpu_discovery", 0444, root,

Unfortunately, I do not have access to AMD hardware, so I cannot test this. It doesn't look like the debugfs blob interface is used very much in drm.

Is this a similar problem to 5668c22a13c6befa9b8486387d38457c40ce7af4 ? Is this still a problem?

Looks kind of similar. I have it as a downstream diff in CheriBSD as otherwise it don't compile at all. (CheriBSD doesn't let you mix and match user vs kernel pointers willy-nilly as they are different types.) I guess I'll have to deal with the merge conflict when merging your other change.

I'll go and test/review it on iwlwifi once the update is through. mvm/debugfs is using it too these days.

FYI, when merging the commit you mentioned to CheriBSD, I ended up dropping this change since simple_read_from_buffer() now assumes a kernel pointer.