summaryrefslogtreecommitdiffstats
path: root/lib/libkvm
Commit message (Collapse)AuthorAgeFilesLines
* MFC r310630: libkvm: support access to vmm guest memory, allow writes toavg2017-01-182-7/+48
| | | | | | fwmem and vmm Sponsored by: Panzura
* MFC r311101:pfg2017-01-163-9/+11
| | | | | | | | | libkvm - extend a bit the swap statistics field. Change ksw_used and ksw_total to unsigned, which increases the maximum total swap that can be displayed properly from ~8TB to ~16TB. Obtained from: DragonflyBSD (ecc2e461)
* MFC r309676vangyzen2016-12-151-2/+0
| | | | | | | | | | | | | Export the whole thread name in kinfo_proc kinfo_proc::ki_tdname is three characters shorter than thread::td_name. Add a ki_moretdname field for these three extra characters. Add the new field to kinfo_proc32, as well. Update all in-tree consumers to read the new field and assemble the full name, except for lldb's HostThreadFreeBSD.cpp, which I will handle separately. Bump __FreeBSD_version. Sponsored by: Dell EMC
* lib: minor spelling fixes in comments.pfg2016-05-013-5/+5
| | | | No functional change.
* Don't leak PML4 in _amd64_initvtop(..) if kvm_read2(..) failsngie2016-04-301-0/+1
| | | | | | | MFC after: 1 week Reported by: Coverity CID: 1341474 Sponsored by: EMC / Isilon Storage Division
* Remove a -Wunused-but-set-variable variable -- `pa`ngie2016-04-301-2/+0
| | | | | Reported by: gcc 5.x Sponsored by: EMC / Isilon Storage Division
* Remove kvm_getfiles(3)ngie2016-04-305-319/+4
| | | | | | | | | | | 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
* Fix memory allocation edgecases in kvm_argv(..)ngie2016-04-301-3/+12
| | | | | | | | | | | | | - Don't leak nbufp on realloc failure in kvm_argv - Catch malloc errors with bufp - Set buflen last in the "buflen == 0" case to ensure that bufp/nbufp is properly reallocated on the next go around Differential Revision: https://reviews.freebsd.org/D6051 MFC after: 1 week Reviewed by: jhb, markj Reported by: cppcheck Sponsored by: EMC / Isilon Storage Division
* Fix up pointer issues with lib/libkvmngie2016-04-2210-35/+52
| | | | | | | | | | | | | | | | In particular, - avoid dereferencing NULL pointers - test pointers against NULL, not 0 - test for errout == NULL in the top-level functions (kvm_open, kvm_openfiles, kvm_open2, etc) - Replace a realloc and free on failure with reallocf Found with: devel/cocchinelle Differential Revision: https://reviews.freebsd.org/D5954 MFC after: 1 week Reviewed by: jhb Sponsored by: EMC / Isilon Storage Division
* MFHgjb2016-04-041-1/+1
|\ | | | | | | Sponsored by: The FreeBSD Foundation
| * Fix parsing of a 1GB page table entry.jhb2016-03-281-1/+1
| | | | | | | | | | | | | | | | Use 'pdpe' to extract the PA of the 1GB page instead of 'pde' (which was a copy and paste bug from the 2MB page case further down). CID: 1341467 Reported by: pfg
* | MFHgjb2016-02-222-8/+7
|\ \ | |/ | | | | Sponsored by: The FreeBSD Foundation
| * Rename pte.h to pte-v4.h and start including directly either pte-v4.hskra2016-02-191-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | or pte-v6.h in files which needs it. There are quite internal definitions in pte-v4.h and pte-v6.h headers specific for corresponding pmap implementation. These headers should be included only in very few files and an intention is to not hide for which implementation such files are. Further, sys/arm/arm/elf_trampoline.c is an example of file which uses armv4 like pmap implementation for both armv4 and armv6 platforms. This is another reason why pte.h which includes specific header according to __ARM_ARCH is not created.
| * Remove redundant ARM_L2_ADDR_BITS and L2_ADDR_BITS definitions andskra2016-02-182-4/+1
| | | | | | | | replace them by primary ones where needed.
* | First pass through library packaging.gjb2016-02-041-0/+1
|/ | | | Sponsored by: The FreeBSD Foundation
* Add mmu format info into ARM vmcore.skra2016-01-152-9/+28
| | | | | | | | Fix kvatop translation for 64K pages. Reviewed by: jhb Approved by: kib (mentor) Differential Revision: https://reviews.freebsd.org/D4942
* Fix building with GCC since PAGE_MASK is signed on i386.jhb2016-01-141-1/+1
| | | | | | Reviewed by: ngie MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D4772
* Add support to libkvm for reading vmcores from other architectures.jhb2015-11-2735-1560/+2352
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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
* Remove trailing whitespace.jhb2015-11-2610-17/+17
|
* Remove kvm_sparc.c. This is for 32-bit sparc support and was importedjhb2015-11-261-236/+0
| | | | from 4.4BSD. It has never been used by FreeBSD.
* META MODE: Prefer INSTALL=tools/install.sh to lessen the need for xinstall.host.bdrewery2015-11-251-1/+0
| | | | | | | | This both avoids some dependencies on xinstall.host and allows bootstrapping on older releases to work due to lack of at least 'install -l' support. Sponsored by: EMC / Isilon Storage Division
* Add support to libkvm for reading minidumps on arm64. The kernel side isandrew2015-08-203-10/+320
| | | | | | | | | missing until it can be cleaned up. Reviewed by: jhb Approved by: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3319
* The si_status field of the siginfo_t, provided by the waitid(2) andkib2015-07-181-1/+3
| | | | | | | | | | | | | | | | SIGCHLD signal, should keep full 32 bits of the status passed to the _exit(2). Split the combined p_xstat of the struct proc into the separate exit status p_xexit for normal process exit, and signalled termination information p_xsig. Kernel-visible macro KW_EXITCODE() reconstructs old p_xstat from p_xexit and p_xsig. p_xexit contains complete status and copied out into si_status. Requested by: Joerg Schilling Reviewed by: jilles (previous version), pho Tested by: pho Sponsored by: The FreeBSD Foundation
* Revert r284417 it is not necessary anymorebapt2015-06-151-1/+1
|
* Enforce overwritting SHLIBDIRbapt2015-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
* Add META_MODE support.sjg2015-06-131-0/+19
|\ | | | | | | | | | | | | | | | | | | | | Off by default, build behaves normally. WITH_META_MODE we get auto objdir creation, the ability to start build from anywhere in the tree. Still need to add real targets under targets/ to build packages. Differential Revision: D2796 Reviewed by: brooks imp
| * dirdeps.mk now sets DEP_RELDIRsjg2015-06-081-2/+0
| |
| * Merge sync of headsjg2015-05-271-0/+64
| |\ | |/ |/|
| * Merge from head@274682sjg2014-11-192-12/+46
| |\
| * \ Merge head from 7/28sjg2014-08-193-379/+2
| |\ \
| * | | Updated dependenciessjg2014-05-161-1/+1
| | | |
| * | | Updated dependenciessjg2014-05-101-0/+2
| | | |
| * | | Merge headsjg2014-04-279-88/+252
| |\ \ \
| * \ \ \ Merge from headsjg2013-09-054-33/+17
| |\ \ \ \
| * \ \ \ \ sync from headsjg2013-04-124-8/+90
| |\ \ \ \ \
| * | | | | | Updated dependenciessjg2013-03-111-0/+1
| | | | | | |
| * | | | | | Updated dependenciessjg2013-02-161-2/+0
| | | | | | |
| | | | | | |
| | \ \ \ \ \
| *-. \ \ \ \ \ Sync from headsjg2012-11-042-3/+10
| |\ \ \ \ \ \ \
| * | | | | | | | Sync FreeBSD's bmake branch with Juniper's internal bmake branch.marcel2012-08-221-0/+19
| | |/ / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | Requested by: Simon Gerraty <sjg@juniper.net>
* | | | | | | | Add stub functions to build libkvm. There will be added, but we need themandrew2015-04-021-0/+64
| |_|_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | now get the toolchain target building. Differential Revision: https://reviews.freebsd.org/D2185 Sponsored by: The FreeBSD Foundation
* | | | | | | Allow libkvm to get the kernel va to pa delta without the need forandrew2014-10-191-10/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | physaddr. This should allow for a kernel where PHYSADDR and KERNPHYSADDR are both undefined. For now libkvm will use the old method of reading physaddr and kernaddr to allow it to work with old kernels. This could be removed in the future when enough time has passed. Differential Revision: https://reviews.freebsd.org/D939 MFC after: 1 week
* | | | | | | Update the ULE scheduler + thread and kinfo structs to use int for cpuidadrian2014-10-181-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rather than u_char. To try and play nice with the ABI, the u_char CPU ID values are clamped at 254. The new fields now contain the full CPU ID, or -1 for no cpu. Differential Revision: D955 Reviewed by: jhb, kib Sponsored by: Norse Corp, Inc.
* | | | | | | Fix the type of pte_pa as when it is passed into _kvm_pa2off it is eitherandrew2014-10-161-2/+2
| |_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | a uint64_t or a pointer to an off_t. With it being a u_long can result in incorrect values being returned.
* | | | | | Remove ia64.marcel2014-07-073-379/+2
| |_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This includes: o All directories named *ia64* o All files named *ia64* o All ia64-specific code guarded by __ia64__ o All ia64-specific makefile logic o Mention of ia64 in comments and documentation This excludes: o Everything under contrib/ o Everything under crypto/ o sys/xen/interface o sys/sys/elf_common.h Discussed at: BSDcan
* | | | | Add a new ARM TARGET_ARCH, armv6hf. This is considered experimental.andrew2014-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.
* | | | | Add kvm_getncpus() to obtain mp_ncpus.glebius2014-02-123-1/+18
| | | | | | | | | | | | | | | | | | | | Sponsored by: Nginx, Inc.
* | | | | Add bounds check for pteindex / pdeindexemaste2014-02-121-0/+4
| | | | |
* | | | | While it isn't too late and kvm_read_zpcpu() function isn't yet usedglebius2014-02-123-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | outside libkvm(3), change its order of arguments, so that it is the same as in kvm_read(). Sponsored by: Nginx, Inc.
* | | | | add support for building a cross-gdb for ARM... This isn't hooked upjmg2014-02-122-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to xdev yet as I don't know how to make it work properly... It also isn't heavily tested... Reviewed by: silence on -arm
* | | | | Handle truncation of the size returned by _kvm_kvatop(). Cores can havemarcel2014-01-161-1/+1
| | | | | | | | | | | | | | | | | | | | segments larger than INT_MAX.
OpenPOWER on IntegriCloud