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)
Mon, Nov 18, 10:01 PM
Unknown Object (File)
Tue, Nov 5, 3:11 AM
Unknown Object (File)
Tue, Oct 22, 2:41 PM
Unknown Object (File)
Oct 21 2024, 9:44 AM
Unknown Object (File)
Oct 21 2024, 3:56 AM
Unknown Object (File)
Oct 20 2024, 11:47 AM
Unknown Object (File)
Oct 19 2024, 11:57 AM
Unknown Object (File)
Oct 17 2024, 7:37 AM

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.