Page MenuHomeFreeBSD

LinuxKPI: Add linux/capability.h header
ClosedPublic

Authored by wulf on Dec 19 2021, 11:22 AM.
Tags
None
Referenced Files
F156710988: D33559.id101236.diff
Fri, May 15, 8:15 PM
F156709759: D33559.id100282.diff
Fri, May 15, 8:03 PM
F156709071: D33559.diff
Fri, May 15, 7:58 PM
Unknown Object (File)
Tue, May 12, 8:36 AM
Unknown Object (File)
Fri, May 8, 7:13 PM
Unknown Object (File)
Wed, May 6, 1:15 AM
Unknown Object (File)
Fri, May 1, 9:19 PM
Unknown Object (File)
Thu, Apr 30, 7:29 PM

Details

Summary

Required by drm-kmod.

Obtained from: DragonflyBSD
MFC after: 1 week

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 43469
Build 40357: arc lint + arc unit

Event Timeline

wulf requested review of this revision.Dec 19 2021, 11:22 AM
hselasky added inline comments.
sys/compat/linuxkpi/common/include/linux/capability.h
34

This line you can remove. Doesn't say anything useful.

This revision is now accepted and ready to land.Dec 19 2021, 11:27 AM
sys/compat/linuxkpi/common/include/linux/capability.h
45

Currently in drm-kmod for CAP_SYS_NICE we check PRIV_DRIVER too. But I'm not familiar with this subsystem to check if this one is better.

sys/compat/linuxkpi/common/include/linux/capability.h
45

Currently in drm-kmod for CAP_SYS_NICE we check PRIV_DRIVER too. But I'm not familiar with this subsystem to check if this one is better.

Here is comments of CAP_SYS_NICE and PRIV_SCHED_SETPRIORITY collected in code and docs:

Linux capabilities(7): CAP_SYS_NICE Lower the process nice value
FreeBSD sys/priv.h: #define PRIV_SCHED_SETPRIORITY 201 /* Can set lower nice value for proc. */
drm-kmod include/uapi/drm/amdgpu_drm.h: * When used in struct drm_amdgpu_ctx_in, a priority above NORMAL requires CAP_SYS_NICE
drm-kmod i915 code:

if (priority > I915_CONTEXT_DEFAULT_PRIORITY &&
    !capable(CAP_SYS_NICE))
        return -EPERM;

It looks that PRIV_SCHED_SETPRIORITY matches CAP_SYS_NICE better than PRIV_DRIVER

manu added inline comments.
sys/compat/linuxkpi/common/include/linux/capability.h
45

Fine by me then.

This revision was automatically updated to reflect the committed changes.