aboutsummaryrefslogtreecommitdiff
path: root/lib/libkvm/Makefile
Commit message (Collapse)AuthorAgeFilesLines
* Remove residual blank line at start of MakefileWarner Losh2024-07-151-1/+0
| | | | | | | 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
* lib: Remove ancient SCCS tags.Warner Losh2023-11-271-1/+0
| | | | | | | | 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 $FreeBSD$: one-line sh patternWarner Losh2023-08-161-1/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* libkvm: Remove mips supportWarner Losh2021-12-311-1/+0
| | | | | | | libkvm references files in sys/mips, so remove it ahead of removing sys/mips. Sponsored by: Netflix
* Do a sweep and remove most WARNS=6 settingsKyle Evans2020-10-011-2/+0
| | | | | | | | | | | | | | | 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
* Implement kvm_kerndispLeandro Lupori2020-02-061-2/+2
| | | | | | | | | | | | | | | 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 sparc64 kernel supportWarner Losh2020-02-031-2/+1
| | | | | | | | | Remove all sparc64 specific files Remove all sparc64 ifdefs Removee indireeect sparc64 ifdefs Notes: svn path=/head/; revision=357455
* [PPC64] Initial libkvm minidump implementationLeandro Lupori2019-12-091-0/+1
| | | | | | | | | | | | | 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
* pkgbase: Put a lot of binaries and lib in FreeBSD-runtimeEmmanuel Vadot2019-09-051-1/+1
| | | | | | | | | | | | 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
* Add riscv minidump support to libkvm.Mark Johnston2019-03-051-0/+1
| | | | | | | | Submitted by: Mitchell Horne <mhorne063@gmail.com> Differential Revision: https://reviews.freebsd.org/D19171 Notes: svn path=/head/; revision=344829
* Use __SCCSID for SCCS IDs in libkvm sources.John Baldwin2018-05-221-1/+1
| | | | | | | | | | | | | | Rather than using #ifdef's around a static char array, use the existing helper macro from <sys/cdefs.h> for SCCS IDs. To preserve existing behavior, add -DNO__SCCSID to CFLAGS to not include SCCS IDs in the built library by default. Reviewed by: brooks, dab (older version) Reviewed by: rgrimes Differential Revision: https://reviews.freebsd.org/D15459 Notes: svn path=/head/; revision=334053
* Add HAS_TESTS to all Makefiles that use the SUBDIR.${MK_TESTS}+= tests idiomEnji Cooper2017-08-021-0/+1
| | | | Notes: svn path=/projects/make-check-sandbox/; revision=321911
* lib/libkvm: start adding basic tests for kvm(3)Enji Cooper2017-03-281-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | - kvm_close: add a testcase to verify support for errno = EINVAL / -1 (see D10065) when kd == NULL is provided to the libcall. - kvm_geterr: -- Add a negative testcase for kd == NULL returning "" (see D10022). -- Add two positive testcases: --- test the error case using kvm_write on a O_RDONLY descriptor. --- test the "no error" case using kvm_read(3) and kvm_nlist(3) as helper routines and by injecting a bogus error message via _kvm_err (an internal API) _kvm_err was used as there isn't a formalized way to clear the error output, and because kvm_nlist always returns ENOENT with the NULL terminator today. - kvm_open, kvm_open2: -- Add some basic negative tests for kvm_open(3) and kvm_open2(3). Testing positive cases with a specific `corefile`/`execfile`/`resolver` requires more work and would require user intervention today in order to reliably test this out. Reviewed by: markj MFC after: 2 months Sponsored by: Dell EMC Isilon Differential Revision: D10024 Notes: svn path=/head/; revision=316099
* libkvm: bump WARNS to 6 after recent commits done to resolve warnings issuesEnji Cooper2017-03-221-1/+1
| | | | | | | | | MFC after: 1 month Tested with: make tinderbox; clang 4.0.0 (amd64), gcc 4.2.1/6.3.0 (amd64) Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=315698
* libkvm: Put private kvm routines in kvm_private.c.Will Andrews2016-07-181-1/+1
| | | | Notes: svn path=/head/; revision=302974
* Remove kvm_getfiles(3)Enji Cooper2016-04-301-3/+3
| | | | | | | | | | | | | | This libcall has been broken since (at least) r174989/8.0-RELEASE. Bump SHLIB_MAJOR for the change Differential Revision: https://reviews.freebsd.org/D6052 Relnotes: yes Reviewed by: jhb, markj Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=298840
* First pass through library packaging.Glen Barber2016-02-041-0/+1
| | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=295278
* Add support to libkvm for reading vmcores from other architectures.John Baldwin2015-11-271-28/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Add a kvaddr_type to represent kernel virtual addresses instead of unsigned long. - Add a struct kvm_nlist which is a stripped down version of struct nlist that uses kvaddr_t for n_value. - Add a kvm_native() routine that returns true if an open kvm descriptor is for a native kernel and memory image. - Add a kvm_open2() function similar to kvm_openfiles(). It drops the unused 'swapfile' argument and adds a new function pointer argument for a symbol resolving function. Native kernels still use _fdnlist() from libc to resolve symbols if a resolver function is not supplied, but cross kernels require a resolver. - Add a kvm_nlist2() function similar to kvm_nlist() except that it uses struct kvm_nlist instead of struct nlist. - Add a kvm_read2() function similar to kvm_read() except that it uses kvaddr_t instead of unsigned long for the kernel virtual address. - Add a new kvm_arch switch of routines needed by a vmcore backend. Each backend is responsible for implementing kvm_read2() for a given vmcore format. - Use libelf to read headers from ELF kernels and cores (except for powerpc cores). - Add internal helper routines for the common page offset hash table used by the minidump backends. - Port all of the existing kvm backends to implement a kvm_arch switch and to be cross-friendly by using private constants instead of ones that vary by platform (e.g. PAGE_SIZE). Static assertions are present when a given backend is compiled natively to ensure the private constants match the real ones. - Enable all of the existing vmcore backends on all platforms. This means that libkvm on any platform should be able to perform KVA translation and read data from a vmcore of any platform. Tested on: amd64, i386, sparc64 (marius) Differential Revision: https://reviews.freebsd.org/D3341 Notes: svn path=/head/; revision=291406
* Revert r284417 it is not necessary anymoreBaptiste Daroussin2015-06-151-1/+1
| | | | Notes: svn path=/head/; revision=284421
* Enforce overwritting SHLIBDIRBaptiste Daroussin2015-06-151-1/+1
| | | | | | | | | | | | Since METAMODE has been added, sys.mk loads bsd.mkopt.mk which ends load loading bsd.own.mk which then defines SHLIBDIR before all the Makefile.inc everywhere. This makes /lib being populated again. Reported by: many Notes: svn path=/head/; revision=284417
* Add a new ARM TARGET_ARCH, armv6hf. This is considered experimental.Andrew Turner2014-03-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This targets the existing ARMv6 and ARMv7 SoCs that contain a VFP unit. This is an optional coprocessors may not be present in all devices, however it appears to be in all current SoCs we support. armv6hf targets the VFP variant of the ARM EABI and our copy of gcc is too old to support this. Because of this there are a number of WITH/WITHOUT options that are unsupported and must be left as the default value. The options and their required value are: * WITH_ARM_EABI * WITHOUT_GCC * WITHOUT_GNUCXX In addition, without an external toolchain, the following need to be left as their default: * WITH_CLANG * WITH_CLANG_IS_CC As there is a different method of passing float and double values to functions the ABI is incompatible with existing armv6 binaries. To use this a full rebuild of world is required. Because no floating point values are passed into the kernel an armv6 kernel with VFP enabled will work with an armv6hf userland and vice versa. Notes: svn path=/head/; revision=263660
* Re-apply the part of r260022 that was reverted by r260030 withMarcel Moolenaar2014-01-131-5/+18
| | | | | | | | | | | | | | | one significant difference: for LIB32 builds both TARGET_ARCH and MACHINE_ARCH are defined. TARGET_ARCH confusingly holds the architecture of the host (e.g. amd64), while MACHINE_ARCH holds the architecture were trying to build (e.g. i386). With both set and different, r260022 changed the behaviour to interpret the condition as building a cross-amd64 libkvm on i386, when obviously we're trying to build an i386 version on amd64. When COMPAT_32BIT is defined, we're building LIB32 and ignore the value of TARGET_ARCH as we did before. Notes: svn path=/head/; revision=260599
* Revert part of r260022: LIB32 builds were broken by it.Marcel Moolenaar2013-12-291-17/+5
| | | | Notes: svn path=/head/; revision=260030
* Allow building a cross libkvm by setting TARGET_ARCH. The library soMarcel Moolenaar2013-12-281-5/+17
| | | | | | | | | | | | | | | produced will be called libkvm-${ARCH} instead of libkvm. This allows installing it alongside the native version. For symbol lookups, use ps_pglobal_lookup() instead of __fdnlist() when building a cross libkvm. It is assumed that the cross tool that uses the cross libkvm also provides an implementation for this proc_services function. Note that this commit does not change any of the architecture-specific code for cross-compilation. Notes: svn path=/head/; revision=260022
* In r227839, when removing libkvm dependency on procfs(5),Mikolaj Golub2013-07-101-0/+1
| | | | | | | | | | | | | | kvm_uread() function, used for reading from /proc/pid/mem, was removed too. But the function declaration remained in kvm.h public header and the soname was not bumped. Remove kvm_uread() from kvm.h and bump the soname. Reported by: rmh Discussed on: arch Notes: svn path=/head/; revision=253167
* Fix typo.Gleb Smirnoff2013-04-111-1/+1
| | | | Notes: svn path=/head/; revision=249358
* o Provide function kvm_read_zpcpu() to access UMA_ZONE_PCPU allocations.Gleb Smirnoff2013-04-101-2/+4
| | | | | | | | | o Provide function kvm_counter_u64_fetch() to fetch valut of a counter(9). Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=249344
* Disconnect sun4v architecture from the three.Attilio Rao2011-05-141-4/+0
| | | | | | | | | | | | Some files keep the SUN4V tags as a code reference, for the future, if any rewamped sun4v support wants to be added again. Reviewed by: marius Tested by: sbruno Approved by: re Notes: svn path=/head/; revision=221869
* libkvm: fix process runtime calculation on crashdumpsUlrich Spörlein2011-01-231-1/+1
| | | | | | | | | | | | | | | | Fix a long standing bug, where the procs ticks where assumed to be in us. Instead, read cpu_tick_frequency from the kernel and use the same logic to convert runtime. This is still too optimistic in that it assumes cpu_tick_frequency is available and fixed. Since this function is only called on crashdumps, I think we can live with that. Testing has shown the values to be correct for different kern.hz inside Virtualbox. Bump WARNS. Alignment issues on some archs mean this is still at 3. Reviewed by: bde Notes: svn path=/head/; revision=217745
* Add minidump support for MIPSOleksandr Tymoshenko2010-11-071-1/+1
| | | | Notes: svn path=/head/; revision=214904
* Repair some build breakage introduced in r211725 and garbage collect someNathan Whitehorn2010-08-281-2/+8
| | | | | | | code made obsolete in the same commit. Notes: svn path=/head/; revision=211934
* MFtbemd:Warner Losh2010-08-231-3/+4
| | | | | | | | Prefer MACHNE_CPUARCH to MACHINE_ARCH in most contexts where you want to test of all the CPUs of a given family conform. Notes: svn path=/head/; revision=211725
* A first cut at teaching libkvm how to deal with dynamic per-CPU storageRobert Watson2010-03-011-0/+1
| | | | | | | | | | | | | | | | | | | | (DPCPU): A new API, kvm_dpcpu_setcpu(3), selects the active CPU for the purposes of DPCPU. Calls to kvm_nlist(3) will automatically translate DPCPU symbols and return a pointer to the current CPU's version of the data. Consumers needing to read the same symbol on several CPUs will invoke a series of setcpu/nlist calls, one per CPU of interest. This addition makes it possible for tools like netstat(1) to query the values of DPCPU variables during crashdump analysis, and is based on similar code handling virtualized global variables. MFC after: 1 week Sponsored by: Juniper Networks, Inc. Notes: svn path=/head/; revision=204494
* Build lib/ with WARNS=6 by default.Ed Schouten2010-01-021-0/+2
| | | | | | | | | | | | Similar to libexec/, do the same with lib/. Make WARNS=6 the norm and lower it when needed. I'm setting WARNS?=0 for secure/. It seems secure/ includes the Makefile.inc provided by lib/. I'm not going to touch that directory. Most of the code there is contributed anyway. Notes: svn path=/head/; revision=201381
* Make libkvm work on live systems and crashdumps with andBjoern A. Zeeb2009-07-231-1/+1
| | | | | | | | | | | | | | | | | | | | | without VIMAGE virtualization in the kernel. If we cannot resolve a symbol try to see if we can find it with prefix of the virtualized subsystem, currently only "vnet_entry" by identifying either the vnet of the current process for a live system or the vnet of proc0 (or of dumptid if compiled in a non-default way). The way this is done currently allows us to only touch libkvm but no single application. Once we are going to virtualize more subsystems we will have to review this decision for better scaling. Submitted by: rwatson (initial version of kvm_vnet.c, lots of ideas) Reviewed by: rwatson Approved by: re (kib) Notes: svn path=/head/; revision=195838
* Support kernel crash mini dumps on ARM architecture.Rafal Jaworowski2008-11-061-1/+1
| | | | | | | Obtained from: Juniper Networks, Semihalf Notes: svn path=/head/; revision=184728
* Add a new routine kvm_getcptime(3) for fetching the equivalent ofJohn Baldwin2008-08-191-3/+4
| | | | | | | | | | | | | 'kern.cp_time'. For a live kernel it uses the sysctl. For a crashdump, it first checks to see if the kernel has a 'cp_time' global symbol. If it does, it uses that. If that doesn't work, when it uses the recently added kvm_getmaxcpu(3) and kvm_getpcpu(3) routines to walk all the CPUs and sum up their counters. MFC after: 1 week Notes: svn path=/head/; revision=181880
* Add two new routines to libkvm for working with per-CPU data:John Baldwin2008-08-191-3/+4
| | | | | | | | | kvm_getmaxcpu() and kvm_getpcpu(). MFC after: 1 week Notes: svn path=/head/; revision=181876
* unbreak build for sparc64 etc.Kip Macy2006-10-091-1/+2
| | | | | | | | | | TARGET won't be defined on non subarches Approved by: rwatson (mentor) Reviewed by: jmg Notes: svn path=/head/; revision=163149
* buildworld fixes for sun4vKip Macy2006-10-091-0/+4
| | | | | | | | | | not sure why pmap.c is included as it is unchanged Approved by: rwatson (mentor) Reviewed by: jmg Notes: svn path=/head/; revision=163148
* Teach libkvm how to read minidumps. It turns out that minidumps arePeter Wemm2006-04-211-0/+3
| | | | | | | | | | | | | | | | | far more convenient for libkvm to work with because of the page table block at the beginning. As a result, the MD code is smaller. libkvm will automatically detect old vs mini dumps on i386 and amd64. libkvm will handle i386 PAE and non-PAE modes. There is a PAE flag in the i386 minidump header to signal the width of the entries in the page table block. Other convenient values are also present, such as kernbase and the direct map addresses on amd64. Notes: svn path=/head/; revision=157911
* style.Makefile(5)David E. O'Brien2003-08-181-1/+1
| | | | Notes: svn path=/head/; revision=119071
* Stage 3 of dynamic root support. Make all the libraries needed to runGordon Tetlow2003-08-171-0/+1
| | | | | | | | | binaries in /bin and /sbin installed in /lib. Only the versioned files reside in /lib, the .so symlink continues to live /usr/lib so the toolchain doesn't need to be modified. Notes: svn path=/head/; revision=119017
* Removed -I${.CURDIR}/.../sys from CFLAGS.Ruslan Ermilov2001-05-181-1/+1
| | | | Notes: svn path=/head/; revision=76812
* MAN[1-9] -> MAN.Ruslan Ermilov2001-03-271-1/+1
| | | | Notes: svn path=/head/; revision=74870
* Find <libkvm.h> in the source tree. This helps standalone builds.Peter Wemm2001-03-211-1/+1
| | | | Notes: svn path=/head/; revision=74605
* Replace beforeinstall target with new variables used by .mk system.Rodney W. Grimes2000-01-141-4/+1
| | | | | | | Reviewed by: marcel, and make world Notes: svn path=/head/; revision=55955
* Install <kvm.h> from here (after repo copy) so it's all in one package.Peter Wemm1999-10-041-0/+5
| | | | Notes: svn path=/head/; revision=51933
* Fixed unsorting of SRCS and MAN3 in previous commit.Bruce Evans1999-01-231-4/+4
| | | | | | | Sorted MLINKS. Notes: svn path=/head/; revision=43089
* Implement kvm_getswapinfo() libkvm function. Will be used byMatthew Dillon1999-01-221-2/+3
| | | | | | | pstat, top, and systat. Notes: svn path=/head/; revision=43045