summaryrefslogtreecommitdiffstats
path: root/sys/compat/linprocfs
Commit message (Collapse)AuthorAgeFilesLines
* MFH: 285685araujo2016-02-241-1/+1
| | | | | | | | | | | 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
* MFC r283478:dchagin2016-01-091-20/+3
| | | | | Simplify linprocfs_doprocenviron(). Remove extra proc visibility checks and initialize pn_vis by well known procfs_candebug().
* MFC r283475:dchagin2016-01-091-16/+14
| | | | | Convert Linux sigsets before showing. Linux kernel displays sigset always as 16x4 bit mask.
* MFC r283473:dchagin2016-01-091-0/+50
| | | | Add support for /proc/<pid>/auxv.
* MFC r283472:dchagin2016-01-091-4/+12
| | | | Add vdso and stack names to the /proc/self/maps.
* MFC r283421:dchagin2016-01-091-10/+35
| | | | | | | | | | | | | | | | | | | 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
* MFC r283414:dchagin2016-01-091-2/+9
| | | | Print out proper procmap entry for 64 bit binaries.
* MFC r280981:trasz2015-10-181-21/+1
| | | | | | Remove unused code. Sponsored by: The FreeBSD Foundation
* MFC r283924vangyzen2015-10-021-8/+4
| | | | | | | | | | | | | | | Provide vnode in memory map info for files on tmpfs When providing memory map information to userland, populate the vnode pointer for tmpfs files. Set the memory mapping to appear as a vnode type, to match FreeBSD 9 behavior. This fixes the use of tmpfs files with the dtrace pid provider, procstat -v, procfs, linprocfs, pmc (pmcstat), and ptrace (PT_VM_ENTRY). Submitted by: Eric Badger <eric@badgerio.us> (initial revision) Obtained from: Dell Inc. PR: 198431
* MFC r262539:eadler2014-03-131-0/+22
| | | | | | linprocfs: add support for /sys/kernel/random/uuid PR: kern/186187
* Relax the vm object locking. Use a read lock.alc2013-06-051-4/+4
| | | | Sponsored by: EMC / Isilon Storage Division
* MFCattilio2013-03-081-4/+2
|\
| * Remove check for NULL prior to free(9) and m_freem(9).eadler2013-03-041-4/+2
| | | | | | | | Approved by: cperciva (mentor)
* | Rename VM_OBJECT_LOCK(), VM_OBJECT_UNLOCK() and VM_OBJECT_TRYLOCK() toattilio2013-02-201-4/+4
|/ | | | | | their "write" versions. Sponsored by: EMC / Isilon storage division
* Reduce duplication between i386/linux/linux.h and amd64/linux32/linux.hjhb2013-01-291-5/+1
| | | | | | | by moving bits that are MI out into headers in compat/linux. Reviewed by: Chagin Dmitry dmitry | gmail MFC after: 2 weeks
* Remove the support for using non-mpsafe filesystem modules.kib2012-10-221-7/+2
| | | | | | | | | | | | In particular, do not lock Giant conditionally when calling into the filesystem module, remove the VFS_LOCK_GIANT() and related macros. Stop handling buffers belonging to non-mpsafe filesystems. The VFS_VERSION is bumped to indicate the interface change which does not result in the interface signatures changes. Conducted and reviewed by: attilio Tested by: pho
* Add procfs to jail-mountable filesystems.mm2012-02-291-1/+1
| | | | | Reviewed by: jamie MFC after: 1 week
* Abrogate nchr argument in proc_getargv() and proc_getenvv(): we always wanttrociny2012-01-151-2/+2
| | | | | | | | | | | | | | | to read strings completely to know the actual size. As a side effect it fixes the issue with kern.proc.args and kern.proc.env sysctls, which didn't return the size of available data when calling sysctl(3) with the NULL argument for oldp. Note, in get_ps_strings(), which does actual work for proc_getargv() and proc_getenvv(), we still have a safety limit on the size of data read in case of a corrupted procces stack. Suggested by: kib MFC after: 3 days
* Protect process environment variables with p_candebug().trociny2011-12-041-1/+1
| | | | | Discussed with: jilles, kib, rwatson MFC after: 2 weeks
* Retire linprocfs_doargv(). Instead use new functions, proc_getargv()trociny2011-11-221-146/+14
| | | | | | | | | | and proc_getenvv(), which were implemented using linprocfs_doargv() as a reference. Suggested by: kib Reviewed by: kib Approved by: des (linprocfs maintainer) MFC after: 2 weeks
* Implement the linprocfs swaps file, providing information about thekib2011-08-011-0/+29
| | | | | | | | | | configured swap devices in the Linux-compatible format. Based on the submission by: Robert Millan <rmh debian org> PR: kern/159281 Reviewed by: bde Approved by: re (kensmith) MFC after: 2 weeks
* Return empty cmdline/environ string for processes with kernel addresspluknet2011-06-171-0/+18
| | | | | | | | | | space. This is consistent with the behavior in linux. PR: kern/157871 Reported by: Petr Salinger <Petr Salinger att seznam cz> Verified on: GNU/kFreeBSD debian 8.2-1-amd64 (by reporter) Reviewed by: kib (some time ago) MFC after: 2 weeks
* Use atomic load & store for TSC frequency. It may be overkill for amd64 butjkim2011-04-071-3/+5
| | | | | | | | | safer for i386 because it can be easily over 4 GHz now. More worse, it can be easily changed by user with 'machdep.tsc_freq' tunable (directly) or cpufreq(4) (indirectly). Note it is intentionally not used in performance critical paths to avoid performance regression (but we should, in theory). Alternatively, we may add "virtual TSC" with lower frequency if maximum frequency overflows 32 bits (and ignore possible incoherency as we do now).
* Fix some locking nits with the p_state field of struct proc:jhb2011-03-241-2/+0
| | | | | | | | | | | | | | | | | | - Hold the proc lock while changing the state from PRS_NEW to PRS_NORMAL in fork to honor the locking requirements. While here, expand the scope of the PROC_LOCK() on the new process (p2) to avoid some LORs. Previously the code was locking the new child process (p2) after it had locked the parent process (p1). However, when locking two processes, the safe order is to lock the child first, then the parent. - Fix various places that were checking p_state against PRS_NEW without having the process locked to use PROC_LOCK(). Every place was already locking the process, just after the PRS_NEW check. - Remove or reduce the use of PROC_SLOCK() for places that were checking p_state against PRS_NEW. The PROC_LOCK() alone is sufficient for reading the current state. - Reorder fill_kinfo_proc() slightly so it only acquires PROC_SLOCK() once. MFC after: 1 week
* Update interface stats counters to match the current format in linux andbz2011-01-311-8/+31
| | | | | | | | try to export as much information as we can match. Requested on: Debian GNU/kFreeBSD list (debian-bsd lists.debian.org) 2010-12 Tested by: Mats Erik Andersson (mats.andersson gisladisker.se) MFC after: 10 days
* Add macro to test the sv_flags of any process. Change some places to testdchagin2011-01-261-1/+1
| | | | | | | the flags instead of explicit comparing with address of known sysentvec structures. MFC after: 1 month
* Break long line.des2010-11-081-1/+2
|
* Fix CPU ID in /proc/cpuinfo.des2010-11-081-4/+4
| | | | | | PR: kern/56451 Submitted by: arundel@ MFC after: 3 weeks
* In linprocfs_doargv():kib2010-09-281-97/+117
| | | | | | | | | | | | | | | | | | | | | | | - handle compat32 processes; - remove the checks for copied in addresses to belong into valid usermode range, proc_rwmem() does this; - simplify loop reading single string, limit the total amount of strings collected by ARG_MAX bytes; - correctly add '\0' at the end of each copied string; - fix style. In linprocfs_doprocenviron(): - unlock the process before calling copyin code [1]. The process is held by pseudofs. In linprocfs_doproccmdline: - use linprocfs_doargv() to handle !curproc case for which p_args is not cached. Reported by: plulnet [1] Tested by: pluknet Approved by: des (linprocfs maintainer, previous version of the patch) MFC after: 3 weeks
* Implement proc/$$/environment.des2010-09-161-2/+110
| | | | | Submitted by: Fernando ApesteguĂ­a <fernando.apesteguia@gmail.com> MFC after: 3 weeks
* Update several places that iterate over CPUs to use CPU_FOREACH().jhb2010-06-111-3/+1
|
* Linux puts a blank line between each CPU.emaste2010-04-141-1/+1
|
* Re-apply r205683 with some modifications:netchild2010-04-021-15/+23
| | | | | | | | | | Fix some bogus values in linprocfs. Submitted by: Petr Salinger <Petr.Salinger@seznam.cz> Verified on: GNU/kFreeBSD debian 8.0-1-686 (by submitter) PR: 144584 Reviewed by / discussed with: kib, des, jhb, submitter
* Revert r205683 to resolve some code quality issues which do not affect thenetchild2010-03-261-54/+14
| | | | | | build or use of linprocfs, before committing the reworked patch again. Requested by: des
* Fix some bogus values in linprocfs.netchild2010-03-261-14/+54
| | | | | | Submitted by: Petr Salinger <Petr.Salinger@seznam.cz> Verified on: GNU/kFreeBSD debian 8.0-1-686 (by submitter) PR: 144584
* Add missing Giant locking for the vfsconf list.jhb2010-03-241-0/+2
| | | | Submitted by: kib
* Implement /proc/filesystems.jhb2010-03-231-0/+18
| | | | Submitted by: Fernando Apesteguia fernando.apesteguia (gmail)
* Make /proc/self/fd `work'.ed2010-03-071-0/+16
| | | | | | | | | | | | | | | | On Linux, /proc/<pid>/fd is comparable to fdescfs, where it allows you to inspect the file descriptors used by each process. Glibc's ttyname() works by performing a readlink() on these nodes, since all nodes in this directory are symlinks. It is a bit hard to implement this in linprocfs right now, so I am not going to bother. Add a way to make ttyname(3) work, by adding a /proc/<pid>/fd symlink, which points to /dev/fd only if the calling process matches. When fdescfs is mounted, this will cause the readlink() in ttyname() to fail, causing it to fall back on manually finding a matching node in /dev. Discussed on: emulation@
* Fix a few panics in linuxulator + VIMAGE due to curvnet not being set.zec2009-08-281-0/+2
| | | | | | | This change affects only options VIMAGE builds. Reviewed by: julian MFC after: 3 days
* Merge the remainder of kern_vimage.c and vimage.h into vnet.c andrwatson2009-08-011-1/+0
| | | | | | | | | | vnet.h, we now use jails (rather than vimages) as the abstraction for virtualization management, and what remained was specific to virtual network stacks. Minor cleanups are done in the process, and comments updated to reflect these changes. Reviewed by: bz Approved by: re (vimage blanket)
* Build on Jeff Roberson's linker-set based dynamic per-CPU allocatorrwatson2009-07-141-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (DPCPU), as suggested by Peter Wemm, and implement a new per-virtual network stack memory allocator. Modify vnet to use the allocator instead of monolithic global container structures (vinet, ...). This change solves many binary compatibility problems associated with VIMAGE, and restores ELF symbols for virtualized global variables. Each virtualized global variable exists as a "reference copy", and also once per virtual network stack. Virtualized global variables are tagged at compile-time, placing the in a special linker set, which is loaded into a contiguous region of kernel memory. Virtualized global variables in the base kernel are linked as normal, but those in modules are copied and relocated to a reserved portion of the kernel's vnet region with the help of a the kernel linker. Virtualized global variables exist in per-vnet memory set up when the network stack instance is created, and are initialized statically from the reference copy. Run-time access occurs via an accessor macro, which converts from the current vnet and requested symbol to a per-vnet address. When "options VIMAGE" is not compiled into the kernel, normal global ELF symbols will be used instead and indirection is avoided. This change restores static initialization for network stack global variables, restores support for non-global symbols and types, eliminates the need for many subsystem constructors, eliminates large per-subsystem structures that caused many binary compatibility issues both for monitoring applications (netstat) and kernel modules, removes the per-function INIT_VNET_*() macros throughout the stack, eliminates the need for vnet_symmap ksym(2) munging, and eliminates duplicate definitions of virtualized globals under VIMAGE_GLOBALS. Bump __FreeBSD_version and update UPDATING. Portions submitted by: bz Reviewed by: bz, zec Discussed with: gnn, jamie, jeff, jhb, julian, sam Suggested by: peter Approved by: re (kensmith)
* After cleaning up rt_tables from vnet.h and cleaning up opt_route.hbz2009-06-231-1/+0
| | | | | a lot of files no longer need route.h either. Garbage collect them. While here remove now unneeded vnet.h #includes as well.
* Get vnets from creds instead of threads where they're available, and fromjamie2009-06-151-1/+1
| | | | | | | passed threads instead of curthread. Reviewed by: zec, julian Approved by: bz (mentor)
* After r193232 rt_tables in vnet.h are no longer indirectly dependent onbz2009-06-081-1/+0
| | | | | | | | | the ROUTETABLES kernel option thus there is no need to include opt_route.h anymore in all consumers of vnet.h and no longer depend on it for module builds. Remove the hidden include in flowtable.h as well and leave the two explicit #includes in ip_input.c and ip_output.c.
* Add stuff to support upcoming BMC/IPMI flashing of newer Dell machineambrisko2009-03-261-0/+72
| | | | | | | | | | | | | | | | | | | | via the Linux tool. - Add Linux shim to ipmi(4) - Create a partitions file to linprocfs to make Linux fdisk see disks. This file is dynamic so we can see disks come and go. - Convert msdosfs to vfat in mtab since Linux uses that for msdosfs. - In the Linux mount path convert vfat passed in to msdosfs so Linux mount works on FreeBSD. Note that tasting works so that if da0 is a msdos file system /compat/linux/bin/mount /dev/da0 /mnt works. - fix a 64it bug for l_off_t. Grabing sh, mount, fdisk, df from Linux, creating a symlink of mtab to /compat/linux/etc/mtab and then some careful unpacking of the Linux bmc update tool and hacking makes it work on newer Dell boxes. Note, probably if you can't figure out how to do this, then you probably shouldn't be doing it :-)
* For all files including net/vnet.h directly include opt_route.h andbz2009-02-271-0/+2
| | | | | | | | | | | | | | net/route.h. Remove the hidden include of opt_route.h and net/route.h from net/vnet.h. We need to make sure that both opt_route.h and net/route.h are included before net/vnet.h because of the way MRT figures out the number of FIBs from the kernel option. If we do not, we end up with the default number of 1 when including net/vnet.h and array sizes are wrong. This does not change the list of files which depend on opt_route.h but we can identify them now more easily.
* Fix a bug in the previous change to the mtab handler: use the path returnedjhb2009-02-131-1/+1
| | | | | | | by vn_fullpath() when vn_fullpath() succeeds instead of when it fails. Submitted by: Artem Belevich fbsdlist of src.cx MFC after: 3 days
* Replace couple of strcmp(cpu_vendor, "foo") with cpu_vendor_id for i386jkim2009-01-221-3/+9
| | | | and hide i386-specific code under #ifdef.
* vm_map_lock_read() does not increment map->timestamp, so we shouldkib2008-12-291-1/+1
| | | | | | | | | | compare map->timestamp with saved timestamp after map read lock is reacquired, not with saved timestamp + 1. The only consequence of the +1 was unconditional lookup of the next map entry, though. Tested by: pho Approved by: des MFC after: 2 weeks
* Reference the vmspace of the process being inspected by procfs, linprocfskib2008-12-121-1/+8
| | | | | | | | and sysctl kern_proc_vmmap handlers. Reported and tested by: pho Reviewed by: rwatson, des MFC after: 1 week
OpenPOWER on IntegriCloud