| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
Starting 13.1 the amd64 kernel was made relocatable, but the kernel
didn't provide enough information for libkvm to figure out where it was
loaded.
Reviewed by: markj
Approved by: imp (mentor)
Pull Request: https://github.com/freebsd/freebsd-src/pull/1706
Closes: https://github.com/freebsd/freebsd-src/pull/1706
|
|
|
|
|
|
|
|
|
|
|
| |
amd64 kernels don't have to be loaded at 2M physical anymore, they can
be anywhere in the lower 4G of the physical address space. The kernel
now provides its physical address in an ELF section in the dump, so
account for it.
Reviewed by: markj
Approved by: imp (mentor)
Pull Request: https://github.com/freebsd/freebsd-src/pull/1706
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This flag is used in field 'cr_flags', which is never directly visible
outside the kernel. That field is however exported through 'struct
kinfo_proc' objects (field 'ki_cr_flags'), either from the kernel via
sysctls or from libkvm, and is supposed to contain exported flags
prefixed with KI_CRF_ (currently, KI_CRF_CAPABILITY_MODE and
KI_CRF_GRP_OVERFLOW, this second one being a purely userland one
signaling overflow of 'ki_groups').
Make sure that KI_CRF_CAPABILITY_MODE is the flag actually exported and
tested by userland programs, and hide the internal CRED_FLAG_CAPMODE.
As both flags are currently defined to the same value, this doesn't
change the KBI, but of course does change the KPI. A code search via
GitHub and Google fortunately doesn't reveal any outside uses for
CRED_FLAG_CAPMODE.
While here, move assignment of 'ki_uid' to a more logical place in
kvm_proclist(), and definition of XU_NGROUPS as well in 'sys/ucred.h'
(no functional/interface changes intended).
Reviewed by: mhorne
Approved by: markj (mentor)
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D46909
|
|
|
|
|
|
|
| |
This is a residual of the $FreeBSD$ removal.
MFC After: 3 days (though I'll just run the command on the branches)
Sponsored by: Netflix
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.
Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/
Sponsored by: Netflix
|
|
|
|
|
|
|
|
| |
Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.
Sponsored by: Netflix
|
|
|
|
| |
Remove /^\.\\"\s*\$FreeBSD\$$\n/
|
|
|
|
| |
Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/
|
|
|
|
| |
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
|
|
|
|
| |
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
|
|
|
|
| |
Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/
|
|
|
|
| |
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
|
|
|
|
|
|
|
| |
There is no need for this to be versioned after the removal of armv4/v5
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D41139
|
|
|
|
| |
Reported by: GCC
|
|
|
|
|
|
|
|
|
| |
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.
Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix
|
|
|
|
|
| |
PR: 266113
Reviewed by: markj
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
cpu ticks) has some imprecision and, worse, huge timestep (about
20 minutes on 4GHz CPU) near 53.4 days of elapsed time.
kern_time.c/cputick2timespec() (it is used for clock_gettime() for
querying process or thread consumed cpu time) Uses cputick2usec()
and then needlessly converting usec to nsec, obviously losing
precision even with fixed cputick2usec().
kern_time.c/kern_clock_getres() uses some weird (anyway wrong)
formula for getting cputick resolution.
PR: 262215
Reviewed by: gnn
Differential Revision: https://reviews.freebsd.org/D34558
|
|
|
|
|
|
|
|
|
|
| |
To allow for a future 16k or 64k page size we need to tell libkvm which
is being used. Add a flag field in unused space in minidumphdr and use
it to signal between the different options.
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34548
|
|
|
|
|
|
|
| |
libkvm references files in sys/mips, so remove it ahead of removing
sys/mips.
Sponsored by: Netflix
|
|
|
|
|
| |
Document that the 7f911abe "Add support to libkvm for reading vmcores
from other architectures." added functions appeared first in FreeBSD 11.0.
|
|
|
|
|
|
|
|
|
| |
Correct bitmap operations in _kvm_bitmap_next.
Reviewed by: jhb
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D19183
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix kvm_getloadavg() to work correctly on vmcores for modern kernel
versions. The kernels no longer include the `_fscale` symbol causing
the kvm_nlist() invocation to fail. The code seemed to already assume
that `_fscale` could be missing but the early kvm_nlist() result check
has caused the function to fail if any symbol were missing. Modify
it to only treat `_averunnable` as obligatory, and handle missing
`_fscale` gracefully.
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32884
|
|
|
|
|
| |
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
|
|
|
|
|
|
| |
Resort free()'ing memory in kvm_close() to make it easier to MFC.
MFC after: 3 days
|
|
|
|
|
|
|
|
|
|
|
| |
First, r204494 introduced dpcpu_off in struct __kvm and it was allocated
from _kvm_dpcpu_init() but it was not free(3)'ed from kvm_close(3).
Second, r291406 introduced kvm_nlist2(3) and converted kvm_nlist(3) to
use the new function but it did not free the temporary buffer.
Also, check possible calloc(3) failure while I am in the neighborhood.
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D29019
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
KCSAN complains about racy accesses in the locking code. Those races are
fine since they are inside a TD_SET_RUNNING() loop that expects the value
to be changed by another CPU.
Use relaxed atomic stores/loads to indicate that this variable can be
written/read by multiple CPUs at the same time. This will also prevent
the compiler from doing unexpected re-ordering.
Reported by: GENERIC-KCSAN
Test Plan: KCSAN no longer complains, kernel still runs fine.
Reviewed By: markj, mjg (earlier version)
Differential Revision: https://reviews.freebsd.org/D28569
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of trying to maintain pg_jobc counter on each process group
update (and sometimes before), just calculate the counter when needed.
Still, for the benefit of the signal delivery code, explicitly mark
orphaned groups as such with the new process group flag.
This way we prevent bugs in the corner cases where updates to the counter
were missed due to complicated configuration of p_pptr/p_opptr/real_parent
(debugger).
Since we need to iterate over all children of the process on exit, this
change mostly affects the process group entry and leave, where we need
to iterate all process group members to detect orpaned status.
(For MFC, keep pg_jobc around but unused).
Reported by: jhb
Reviewed by: jilles
Tested by: pho
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D27871
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As of r365978, minidumps include a copy of dump_avail[]. This is an
array of vm_paddr_t ranges. libkvm walks the array assuming that
sizeof(vm_paddr_t) is equal to the platform "word size", but that's not
correct on some platforms. For instance, i386 uses a 64-bit vm_paddr_t.
Fix the problem by always dumping 64-bit addresses. On platforms where
vm_paddr_t is 32 bits wide, namely arm and mips (sometimes), translate
dump_avail[] to an array of uint64_t ranges. With this change, libkvm
no longer needs to maintain a notion of the target word size, so get rid
of it.
This is a no-op on platforms where sizeof(vm_paddr_t) == 8.
Reviewed by: alc, kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D27082
Notes:
svn path=/head/; revision=368307
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
No functional change intended.
Tracking these structures separately for each proc enables future work to
correctly emulate clone(2) in linux(4).
__FreeBSD_version is bumped (to 1300130) for consumption by, e.g., lsof.
Reviewed by: kib
Discussed with: markj, mjg
Differential Revision: https://reviews.freebsd.org/D27037
Notes:
svn path=/head/; revision=367777
|
|
|
|
|
|
|
|
|
| |
Only concerns amd64.
Reported by: imp
Notes:
svn path=/head/; revision=366468
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Repeating the default WARNS here makes it slightly more difficult to
experiment with default WARNS changes, e.g. if we did something absolutely
bananas and introduced a WARNS=7 and wanted to try lifting the default to
that.
Drop most of them; there is one in the blake2 kernel module, but I suspect
it should be dropped -- the default WARNS in the rest of the build doesn't
currently apply to kernel modules, and I haven't put too much thought into
whether it makes sense to make it so.
Notes:
svn path=/head/; revision=366304
|
|
|
|
|
|
|
|
|
|
| |
* Add missing _kvm16toh() function.
* Teach libkvm about powerpc64le.
Sponsored by: Tag1 Consulting, Inc.
Notes:
svn path=/head/; revision=366055
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On Ampere Altra systems, the sparse population of RAM within the
physical address space causes the vm_page_dump bitmap to be much
larger than necessary, increasing the size from ~8 Mib to > 2 Gib
(and overflowing `int` for the size).
Changing the page dump bitmap also changes the minidump file
format, so changes are also necessary in libkvm.
Reviewed by: jhb
Approved by: scottl (implicit)
MFC after: 1 week
Sponsored by: Ampere Computing, Inc.
Differential Revision: https://reviews.freebsd.org/D26131
Notes:
svn path=/head/; revision=365978
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This test checks if value received from kvm_read is sane, based on
value returned by sysctl interface.
This should catch regression on bug fixed by r359160
Reviewed by: jhb
Approved by: jhibbits (mentor)
MFC after: 1 week
Sponsored by: Eldorado Research Institute (eldorado.org.br)
Differential Revision: https://reviews.freebsd.org/D23783
Notes:
svn path=/head/; revision=363020
|
|
|
|
|
|
|
|
|
|
|
| |
It seems this manpage was copied from kvm_getloadavg(3), but the
DIAGNOSTICS section was not updated completely. Update the section with
correct information about a return value of -1.
MFC after: 3 days
Notes:
svn path=/head/; revision=362623
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It was used only to store the bounds of each swap device. However,
since swblk_t is a signed 32-bit int and daddr_t is a signed 64-bit
int, swp_pager_isondev() may return an invalid result if swap devices
are repeatedly added and removed and sw_end for a device ends up
becoming a negative number.
Note that the removed comment about maximum swap size still applies.
Reviewed by: jeff, kib
Tested by: pho
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D23666
Notes:
svn path=/head/; revision=358026
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Revert parts of r353274 replacing vnet_state with a shutdown flag.
Not having the state flag for the current SI_SUB_* makes it harder to debug
kernel or module panics related to VNET bringup or teardown.
Not having the state also does not allow us to check for other dependency
levels between components, e.g. for moving interfaces.
Expand the VNET structure with the new boolean flag indicating that we are
doing a shutdown of a given vnet and update the vnet magic cookie for the
change.
Update libkvm to compile with a bool in the kernel struct.
Bump __FreeBSD_version for (external) module builds to more easily detect
the change.
Reviewed by: hselasky
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D23097
Notes:
svn path=/head/; revision=358020
|
|
|
|
|
|
|
|
|
| |
These were disconnected from the build when the kernel was
removed. Since they depend on removed parts of the kernel, remove them
completely.
Notes:
svn path=/head/; revision=357795
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change adds a new libkvm function, kvm_kerndisp(), that can be used to
retrieve the kernel displacement, that is the difference between the kernel's
base virtual address at run time and the kernel base virtual address specified
in the kernel image file.
This will be used by kgdb, to properly relocate kernel symbols, when needed.
Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D23285
Notes:
svn path=/head/; revision=357615
|
|
|
|
|
|
|
|
|
| |
Remove all sparc64 specific files
Remove all sparc64 ifdefs
Removee indireeect sparc64 ifdefs
Notes:
svn path=/head/; revision=357455
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Update a bunch of Makefile.depend files as
a result of adding Makefile.depend.options files
Reviewed by: bdrewery
MFC after: 1 week
Sponsored by: Juniper Networks
Differential Revision: https://reviews.freebsd.org/D22494
Notes:
svn path=/head/; revision=355617
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change adds PowerPC64 support for minidumps on libkvm.
Address translation, page walk, and data retrieval were tested and seem to be
working correctly.
Reviewed by: jhibbits
Differential Revision: https://reviews.freebsd.org/D21555
Notes:
svn path=/head/; revision=355557
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As with other libkvm interfaces use maximum-sized types to support
cross-debugging (e.g. a 64-bit vmcore on a 32-bit host). See
https://lists.freebsd.org/pipermail/svn-src-all/2019-February/176051.html
for further discussion.
This is an API-breaking change, but there are few consumers of this
interface today.
Reviewed by: will
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D21945
Notes:
svn path=/head/; revision=354543
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add support for kernel threads in kvm_getprocs() and the underlying
kvm_proclist() in libkvm when fetching from a kernel core file. This
has been missing/needed for several releases, when kernel threads became
normal threads. The loop over the processes now contains a sub-loop for
threads, which iterates beyond the first thread only when threads are
requested. Also set some fields such as tid that were previously
uninitialized.
Reviewed by: vangyzen jhb(earlier revision)
MFC after: 4 days
Sponsored by: Forcepoint LLC
Differential Revision: https://reviews.freebsd.org/D21461
Notes:
svn path=/head/; revision=352597
|
|
|
|
|
|
|
|
|
|
| |
PowerPC kernels are of DYN type, instead of EXEC.
Reviewed by: jhibbits
Differential Revision: https://reviews.freebsd.org/D21583
Notes:
svn path=/head/; revision=352175
|
|
|
|
|
|
|
|
|
|
|
|
| |
All of them are needed to be able to boot to single user and be able
to repair a existing FreeBSD installation so put them directly into
FreeBSD-runtime.
Reviewed by: bapt, gjb
Differential Revision: https://reviews.freebsd.org/D21503
Notes:
svn path=/head/; revision=351855
|
|
|
|
|
|
|
|
|
| |
Reported by: jenkins
MFC with: r350037
Sponsored by: The FreeBSD Foundation
Notes:
svn path=/head/; revision=350048
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previous spellings of my name (NGie, Ngie) weren't my legal spelling. Use Enji
instead for clarity.
While here, remove "All Rights Reserved" from copyrights I "own".
MFC after: 1 week
Notes:
svn path=/head/; revision=346572
|
|
|
|
|
|
|
|
|
| |
Reviewed by: rgrimes
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D19485
Notes:
svn path=/head/; revision=344855
|
|
|
|
|
|
|
|
| |
Reported by: rgrimes
MFC with: r344829, r344830
Notes:
svn path=/head/; revision=344845
|