Page MenuHomeFreeBSD

LinuxKPI: Add linux/capability.h header
ClosedPublic

Authored by wulf on Dec 19 2021, 11:22 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Oct 22, 2:41 PM
Unknown Object (File)
Mon, Oct 21, 9:44 AM
Unknown Object (File)
Mon, Oct 21, 3:56 AM
Unknown Object (File)
Sun, Oct 20, 11:47 AM
Unknown Object (File)
Sat, Oct 19, 11:57 AM
Unknown Object (File)
Thu, Oct 17, 7:37 AM
Unknown Object (File)
Thu, Oct 17, 6:11 AM
Unknown Object (File)
Mon, Oct 7, 12:09 PM

Details

Summary

Required by drm-kmod.

Obtained from: DragonflyBSD
MFC after: 1 week

Diff Detail

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

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
35

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
46

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
46

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
46

Fine by me then.

This revision was automatically updated to reflect the committed changes.