- Remove unnecessary headers
- Fix style(9) formatting
- Queries
- All Stories
- Search
- Advanced Search
- Transactions
- Transaction Logs
Advanced Search
Feb 16 2023
Feb 15 2023
Feb 14 2023
In D38459#877486, @kib wrote:Please take a look at the D29106 review. Are the reasoning from the review applicable to the timerfd facility as well?
Feb 13 2023
Please take a look at the D29106 review. Are the reasoning from the review applicable to the timerfd facility as well?
Here's a rough outline of the changes for 32-bit compat. Untested in any way, but hopefully points in the right direction.
Use TFD_SETFLAGS ioctl() to set tfd flags during timerfd_settime()
- Grab struct timerfd through struct file instead of fd in timerfd_gettime_common() and timerfd_settime_common().
- Add timerfd_getflags() to update struct timerfd flags for use in timerfd_settime_common().
Feb 12 2023
test from man page is not enough, at least test also should check poll or kevent on timerfd fd.
It's a good practice to add tests for new things to our tests suite, just my 2c.
Address all of @kib's inline comments
Update syscall wrappers for timerfd_gettime() and timerfd_settime()
to use an ioctl() entry point.
Use ioctl() instead of specialfd as kernel entry point for timerfd_gettime() and timerfd_settime() pseudo syscalls.
Feb 10 2023
In D38459#875880, @kib wrote:I suggest to add ioctl's to perform the ops on the descriptor, instead of filling the syscall table with more one-purpose entries.
In D38459#875880, @kib wrote:I suggest to add ioctl's to perform the ops on the descriptor, instead of filling the syscall table with more one-purpose entries.
I suggest to add ioctl's to perform the ops on the descriptor, instead of filling the syscall table with more one-purpose entries.
BTW, just to be clear, I'm really happy to see this work. It's a portability gap that has caused issues for multiple users of Morello and CheriBSD so I'm looking forward to seeing it landed.
In D38459#875687, @jfree wrote:Also, should I move all 3 syscalls (timerfd_create, timerfd_settime, timerfd_gettime) to standard syscalls? Or should I keep timerfd_create inside __specialfd? I'm not exactly clear on the purpose of __specialfd at this point.
In D38459#875687, @jfree wrote:Thanks everyone for the feedback. I am not quite sure how to proceed here. I just got done familiarizing myself with kevents and as @markj mentioned, a good amount of timerfd is just redundant code when EVFILT_TIMER exists. I want to do what's proper here, but @val_packett.cool mentioned that CLOCK_REALTIME support is absent in EVFILT_TIMER. Would adding REALTIME support be a large undertaking? I have never worked on time in the kernel - I have heard it isn't pleasant.
Thanks everyone for the feedback. I am not quite sure how to proceed here. I just got done familiarizing myself with kevents and as @markj mentioned, a good amount of timerfd is just redundant code when EVFILT_TIMER exists. I want to do what's proper here, but @val_packett.cool mentioned that CLOCK_REALTIME support is absent in EVFILT_TIMER. Would adding REALTIME support be a large undertaking? I have never worked on time in the kernel - I have heard it isn't pleasant.
Feb 9 2023
In D38459#875436, @markj wrote:One wrinkle that I can see is that timerfd lets you specify a clock ID, but this implementation doesn't really do anything with it...
So, this really replicates a lot of the functionality provided by an EVFILT_TIMER kevent. And it's missing some of the bug fixes we've made in kevent over time. For instance, kqueue maintains a global limit of user-created callouts, kq_calloutmax. I'm actually not really sure this limit makes sense anymore, but this new code doesn't have such a limit. Another example is commit 2fd1ffefaa4d2cd99a19f866a949cb2cd58ef998, which makes it possible for signals to stop a kevent callout from re-arming itself, in case a user does something stupid like schedule a periodic callout with a period of 1ns (which generally results in an unkillable loop).
just implement these to as syscalls leaving __specialfd for descriptor creation
The overall interface has ABI compatibility issues.
Hi, nice.. it would be nice to see some tests for a native timerfd syscalls
Remove AUE_TIMERFD from audit_kevents.h since timerfd uses specialfd's AUE_SPECIALFD audit event.
Update diff to avoid patch application conflict on latest src main commit
Feb 6 2023
I'll take it and commit it given all other consumers but the one amdgpu one seem to be in my wireless driver tree.
Rebase after D38222
Feb 5 2023
Rebased. Ping!
Dec 21 2022
Hey @bz, what is the status for passing userspace buffers into write
fops for iwlwifi? DRM drivers expect a userspace buffer. I know you
mentioned earlier that iwlwifi expects a kernel buffer?
Dec 15 2022
Oct 25 2022
Add check to make sure ->read() > 0 before copying to sbuf.
Thanks to @bz for pointing this out.
Oct 24 2022
Use copyout() instead of memcpy() for lindebugfs's kernel sb to userspace buf transfer.
Fix typos in linux_simple_attr.c function documentation
Oct 22 2022
In D35883#842153, @bz wrote:In D35883#842138, @jfree wrote:In D35883#842122, @bz wrote:There's more to fix in this (debugfs) world now it seems beyond the comment. Is anyone still interested please let me know.
I tested with FreeBSD seq_file and simple attribute file implementations. Both of these were modified in this patch to accommodate the kernel buffer. I did not realize that there were more implementations that are commonly used. This is my mistake, so I would be happy to finish the work. Sorry for any inconvenience that I may have caused. I'll start right away.
There is a lot of code using simple_open with a private read function which at the end simply calls simple_read_from_buffer() or even calls the copy_to_user() or for write copy_from_user() itself (e.g. when doing memory dumps). simple_read_from_buffer() as implemented here will also call the linux copy_to_user().
I am under the impression that it should be the implementation's problem to handle that bit and how to hide it (like seq_file does working on the sbuf)?
PS: I am also looking at debugfs_create_blob() and some other bits. If you are happy I'll try to get bits into here Saturday.
In D35883#842138, @jfree wrote:In D35883#842122, @bz wrote:There's more to fix in this (debugfs) world now it seems beyond the comment. Is anyone still interested please let me know.
I tested with FreeBSD seq_file and simple attribute file implementations. Both of these were modified in this patch to accommodate the kernel buffer. I did not realize that there were more implementations that are commonly used. This is my mistake, so I would be happy to finish the work. Sorry for any inconvenience that I may have caused. I'll start right away.
In D35883#842122, @bz wrote:There's more to fix in this (debugfs) world now it seems beyond the comment. Is anyone still interested please let me know.
Oct 21 2022
There's more to fix in this (debugfs) world now it seems beyond the comment. Is anyone still interested please let me know.
Oct 6 2022
Oct 2 2022
Moved struct dev_pm_info power member to bottom of struct device in <linux/device.h>
Oct 1 2022
Sep 27 2022
Various changes to pci_power_name() thanks to @hselasky
- Added bound checking to pci_power_name()
- Made pci_power_names array external
Sep 20 2022
Sep 11 2022
Sep 2 2022
Looks good to me. Make sure you bump the FreeBSD version along this commit.
Sep 1 2022
- Removed unnecessary code from linux_simple_attr.c
- Created default_llseek() function in substitution of macro
- removed i_size_write() comment
Aug 30 2022
Aug 29 2022
Fixed off-by-one error in linux_seq_file.c
Fixed memory leak where lf was not released due to a potential failed malloc() during read. Thanks to @hselasky for pointing this out.
Used memdup_user_nul() instead of memdup_user() to duplicate memory from userspace. Relevant documentation can be found here:
Aug 28 2022
- Updated seq_file seq_read() to report number of bytes read correctly
- Adjusted lindebugfs.c module declaration - this is done through the PSEUDOFS() macro
- Changed internal debugfs filesystem name to lindebugfs
- Modified man page to reflect changes
- Corrected off-by-one errors in linux_simple_attr.c
Aug 27 2022
Removed NULL pointer error checking thanks to @markj. General user pointers are safely checked in memdup_user().
Corrected pointer position errors in linux_simple_attr.c thanks to hselasky@
Aug 26 2022
Looks good!
Aug 25 2022
Removed return statements from void functions per hselasky's advice
Added simple error checking
Assuming there is no special case for n = 0.
Fixed function parameter list indentation
Updated diff per markj@'s review and comments