History log of /freebsd-head/sys/compat/linsysfs/linsysfs.c
Revision Date Author Comments
4f67284a103d25c93dde61db7056cc0509cfca8c 04-Sep-2020 markj <markj@FreeBSD.org> Add emulation support for the Linux kcov(4) ioctl API.

This makes it possible to run an unmodified Linux syzkaller executor
against the Linuxulator, and have it gather code coverage information.

Sponsored by: The FreeBSD Foundation
4e5e35021fb910eab0c282b0ef59ff920fcefcf5 04-Jul-2020 trasz <trasz@FreeBSD.org> Make linprocfs(5) create /proc/bus/pci/devices/, and linsysfs(5)
create /sys/class/power_supply/. This silences some warnings
from biology/linux-foldingathome.

Reported by: 0mp
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D25557
bee4305eb617c95a636245f57f2d5f7952b8c4f1 23-Sep-2019 tijl <tijl@FreeBSD.org> Create a "drm" subdirectory for drm devices in linsysfs. Recent versions of
linux libdrm check for the existence of this directory:

https://cgit.freedesktop.org/mesa/drm/commit/?id=f8392583418aef5e27bfed9989aeb601e20cc96d

MFC after: 2 weeks
ff74a853f511b8d9f96e533b28fadbbc7dff313d 07-May-2019 dchagin <dchagin@FreeBSD.org> Remove wrong copyright line. Discussed with Carlos Neira.

Reported by: Rodney W. Grimes
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D13656
2c9faf1048125eb00f2662bf826b10eea67f1c80 06-May-2019 dchagin <dchagin@FreeBSD.org> Adds sys/class/net devices to linsysfs.

Only two interfaces are created eth0 and lo and they expose
the following properties:
address, addr_len, flags, ifindex, mty, tx_queue_len and type.

Initial patch developed by Carlos Neira in 2017 and finished by me.

PR: 223722
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D13656
39598707e2fd41a532a1c5379665778f78a649f9 02-May-2019 dchagin <dchagin@FreeBSD.org> Remove unneeded includes.

MFC after: 2 week
c5cd7639a03a170b2f78a6383357a709704b2131 02-May-2019 trasz <trasz@FreeBSD.org> Add sys/devices/system/cpu/{possible,present} to linsysfs(5).
That makes Linux lscpu(1) work.

Reviewed by: dchagin
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D20131
ef0811c8894556145e56b806d38a321a840c4548 07-Jul-2018 imp <imp@FreeBSD.org> Create PCI_MATCH and pci_match_device

Create a covenience function to match PCI device IDs. It's about 15
years overdue.

Differential Revision: https://reviews.freebsd.org/D15999
d3d3a0ddfe86ff2d4f860209cfe3e936777c6bd3 18-Jun-2018 emaste <emaste@FreeBSD.org> linsysfs: depend on linux_common module on arm64, as on amd64

Sponsored by: Turing Robotic Industries
1c11f552d63c8d13159b579aed059a7649bbf5aa 04-May-2018 jamie <jamie@FreeBSD.org> Make it easier for filesystems to count themselves as jail-enabled,
by doing most of the work in a new function prison_add_vfs in kern_jail.c
Now a jail-enabled filesystem need only mark itself with VFCF_JAIL, and
the rest is taken care of. This includes adding a jail parameter like
allow.mount.foofs, and a sysctl like security.jail.mount_foofs_allowed.
Both of these used to be a static list of known filesystems, with
predefined permission bits.

Reviewed by: kib
Differential Revision: D14681
2a03579eb7145d8a82cc4bedb4307626f7c1b0ba 27-Nov-2017 pfg <pfg@FreeBSD.org> sys/compat: further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.
d0053c9a3497be9b2c7a67d1d4cdecc4372fe9bd 15-Oct-2017 tijl <tijl@FreeBSD.org> Add information needed by Linux libdrm 2.4.74 (shipped with CentOS 7.4).

Create a config file for PCI devices that exposes their configuration
space. Only fields needed by libdrm are filled in (vendor, device,
revision, subvendor and subdevice).

Link /sys/class/drm/card%d/device to the PCI device directory.
50660d4b5aae676da405a31127aa0bf97fabd822 15-Oct-2017 tijl <tijl@FreeBSD.org> Set DEVNAME to dri/card%d. This works with both in-tree drm and drm-next
and is also the value used on Linux.

Tested by: Greg V <greg@unrelenting.technology>
10c470434ca41fbb953aa8e6fe2d393c66ce57f6 18-Sep-2017 rlibby <rlibby@FreeBSD.org> linsysfs: quiet gcc -Wformat after r323692

Reviewed by: cem
Sponsored by: Dell EMC Isilon
59d84271534db60758fbc21d3c96d5d6ca2c0cdd 18-Sep-2017 cem <cem@FreeBSD.org> linsysfs(5): Fix two unrelated issues

1. Swap the order of device_get_ivars with device_get_devclass and devclass
name validation. This bug was introduced in r323692.

2. Error check device_get_children and free the returned list. This bug was
introduced in the original linsysfs commit.

Reported by: Oleg V. Nauman <oleg AT theweb.org.ua>, hselasky (1); hselasky (2)
Reviewed by: hselasky
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12407
09ad0b962f3029e47b3f430948933b6fe066ccdf 17-Sep-2017 cem <cem@FreeBSD.org> linsysfs(5): Add support for recent libdrm

Expose more information about PCI devices (and GPUs in particular) via
linsysfs to libdrm.

This allows unmodified modern 64-bit Linux libdrm to work, which allows
modern Linux Mesa to work. The submitter reports that he tested the change
with an Ubuntu 16.04 chroot + amdgpu from graphics/drm-next-kmod.

PR: 222375
Submitted by: Greg V <greg AT unrelenting.technology>
5451804107bd7fd8ab0fccba0293f3def6ccf0be 18-Mar-2017 dchagin <dchagin@FreeBSD.org> Glibc get_nprocs() and get_nprocs_conf() uses the sysfs cpu infrastructure
to get number of processors. Implement /sys/devices/system/cpu/.

MFC after: 1 month
00d578928eca75be320b36d37543a7e2a4f9fbdb 27-May-2016 grehan <grehan@FreeBSD.org> Create branch for bhyve graphics import.
b357db3ca617d62e83fa0db20ccacbcd001761a6 24-Feb-2016 araujo <araujo@FreeBSD.org> MFH: 285685
Add support to the jail framework to be able to mount linsysfs(5) and linprocfs(5).

PR: 207179
Requested by: thomas@gibfest.dk
Reviewed by: jamie, bapt
Approved by: re (gjb)
Sponsored by: gandi.net
Differential Revision: https://reviews.freebsd.org/D5390
d30e84112a87337209ea45237f3d9b12e29abaa9 09-Jan-2016 dchagin <dchagin@FreeBSD.org> MFC r283421:

Introduce a new module linux_common.ko which is intended for the
following primary purposes:

1. Remove the dependency of linsysfs and linprocfs modules from linux.ko,
which will be architecture specific on amd64.

2. Incorporate into linux_common.ko general code for platforms on which
we'll support two Linuxulator modules (for both instruction set - 32 & 64 bit).

3. Move malloc(9) declaration to linux_common.ko, to enable getting memory
usage statistics properly.

Currently linux_common.ko incorporates a code from linux_mib.c and linux_util.c
and linprocfs, linsysfs and linux kernel modules depend on linux_common.ko.

Temporarily remove dtrace garbage from linux_mib.c and linux_util.c
61ced0e48d315a8b265712d5f6c61496403cfbec 19-Jul-2015 araujo <araujo@FreeBSD.org> Add support to the jail framework to be able to mount linsysfs(5) and
linprocfs(5).

Differential Revision: D2846
Submitted by: Nikolai Lifanov <lifanov@mail.lifanov.com>
Reviewed by: jamie
b08f3f43f9e901fdb2194f84eb02093e60665bab 24-May-2015 dchagin <dchagin@FreeBSD.org> Introduce a new module linux_common.ko which is intended for the
following primary purposes:

1. Remove the dependency of linsysfs and linprocfs modules from linux.ko,
which will be architecture specific on amd64.

2. Incorporate into linux_common.ko general code for platforms on which
we'll support two Linuxulator modules (for both instruction set - 32 & 64 bit).

3. Move malloc(9) declaration to linux_common.ko, to enable getting memory
usage statistics properly.

Currently linux_common.ko incorporates a code from linux_mib.c and linux_util.c
and linprocfs, linsysfs and linux kernel modules depend on linux_common.ko.

Temporarily remove dtrace garbage from linux_mib.c and linux_util.c

Differential Revision: https://reviews.freebsd.org/D1072
In collaboration with: Vassilis Laganakos.

Reviewed by: trasz
eb1a5f8de9f7ea602c373a710f531abbf81141c4 21-Feb-2014 gjb <gjb@FreeBSD.org> Move ^/user/gjb/hacking/release-embedded up one directory, and remove
^/user/gjb/hacking since this is likely to be merged to head/ soon.

Sponsored by: The FreeBSD Foundation
6b01bbf146ab195243a8e7d43bb11f8835c76af8 27-Dec-2013 gjb <gjb@FreeBSD.org> Copy head@r259933 -> user/gjb/hacking/release-embedded for initial
inclusion of (at least) arm builds with the release.

Sponsored by: The FreeBSD Foundation
2c1ec831c915278de463c18f392c618182c48c35 26-Oct-2013 glebius <glebius@FreeBSD.org> Provide includes that are needed in these files, and before were read
in implicitly via if.h -> if_var.h pollution.

Sponsored by: Netflix
Sponsored by: Nginx, Inc.
77766742e1d536bb65e0b2b9b7bab06d722ccb58 29-Feb-2012 mm <mm@FreeBSD.org> Add procfs to jail-mountable filesystems.

Reviewed by: jamie
MFC after: 1 week
b0df1c137c1d7cc6c086e8c3de63b91a97e180c7 16-Nov-2010 dim <dim@FreeBSD.org> Sync: merge r215319 through r215395 from ^/head, so ports can actually
build! :)
5c90ddd6c46db716a3668dccfa293df8935cf0d6 15-Nov-2010 des <des@FreeBSD.org> Remove no-op assignment.

Submitted by: clang via arundel@
MFC after: 2 weeks
09f9c897d33c41618ada06fbbcf1a9b3812dee53 19-Oct-2010 jamie <jamie@FreeBSD.org> A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.
f1216d1f0ade038907195fc114b7e630623b402c 19-Mar-2010 delphij <delphij@FreeBSD.org> Create a custom branch where I will be able to do the merge.
19b6af98ec71398e77874582eb84ec5310c7156f 22-Nov-2008 dfr <dfr@FreeBSD.org> Clone Kip's Xen on stable/6 tree so that I can work on improving FreeBSD/amd64
performance in Xen's HVM mode.
cf5320822f93810742e3d4a1ac8202db8482e633 19-Oct-2008 lulf <lulf@FreeBSD.org> - Import the HEAD csup code which is the basis for the cvsmode work.
3d3e50beaf534ec30b151614f684eccd85ef5782 12-Mar-2007 des <des@FreeBSD.org> Add a pn_destroy field to pfs_node. This field points to a destructor
function which is called from pfs_destroy() before the node is reclaimed.

Modify pfs_create_{dir,file,link}() to accept a pointer to a destructor
function in addition to the usual attr / fill / vis pointers.

This breaks both the programming and binary interfaces between pseudofs
and its consumers. It is believed that there are no pseudofs consumers
outside the source tree, so that the impact of this change is minimal.

Submitted by: Aniruddha Bohra <bohra@cs.rutgers.edu>
05483cfbc2deab0d4786fd0495b74142cecf30fc 03-Dec-2006 netchild <netchild@FreeBSD.org> MFP4 (110957)

Use TAILQ_FOREACH_SAFE instead of the unsafe one where an item is removed
from the queue.

This prevents a panic on kldunload.

Submitted by: rdivacky
Tested by: bsam
47d76a2b9160177d179fb8b5141b88cbd5fb022c 25-May-2006 cvs2svn <cvs2svn@FreeBSD.org> This commit was manufactured by cvs2svn to create branch 'RELENG_6'.
d502b8db327ed1c4004cb613de7a3a75220bc904 11-May-2006 ambrisko <ambrisko@FreeBSD.org> Remove the dependency on procfs since it isn't used.

Noticed by: des
f7d4a6b03b3e365a6b195691fd0483d357a11451 09-May-2006 ambrisko <ambrisko@FreeBSD.org> Add in linsysfs. A linux 2.6 like sys filesystem to pacify the Linux
LSI MegaRAID SAS utility.

Sponsored by: IronPort Systems
Man page help from: brueffer