aboutsummaryrefslogtreecommitdiff
path: root/lib/libkvm
Commit message (Collapse)AuthorAgeFilesLines
...
| * Remove redundant ARM_L2_ADDR_BITS and L2_ADDR_BITS definitions andSvatopluk Kraus2016-02-182-4/+1
| | | | | | | | | | | | | | replace them by primary ones where needed. Notes: svn path=/head/; revision=295752
* | 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 mmu format info into ARM vmcore.Svatopluk Kraus2016-01-152-9/+28
| | | | | | | | | | | Fix kvatop translation for 64K pages. Reviewed by: jhb Approved by: kib (mentor) Differential Revision: https://reviews.freebsd.org/D4942 Notes: svn path=/head/; revision=294098
* Fix building with GCC since PAGE_MASK is signed on i386.John Baldwin2016-01-141-1/+1
| | | | | | | | | Reviewed by: ngie MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D4772 Notes: svn path=/head/; revision=293979
* Add support to libkvm for reading vmcores from other architectures.John Baldwin2015-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 Notes: svn path=/head/; revision=291406
* Remove trailing whitespace.John Baldwin2015-11-2610-17/+17
| | | | Notes: svn path=/head/; revision=291372
* Remove kvm_sparc.c. This is for 32-bit sparc support and was importedJohn Baldwin2015-11-261-236/+0
| | | | | | | from 4.4BSD. It has never been used by FreeBSD. Notes: svn path=/head/; revision=291371
* META MODE: Prefer INSTALL=tools/install.sh to lessen the need for xinstall.host.Bryan Drewery2015-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 Notes: svn path=/head/; revision=291307
* Add support to libkvm for reading minidumps on arm64. The kernel side isAndrew Turner2015-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 Notes: svn path=/head/; revision=286953
* The si_status field of the siginfo_t, provided by the waitid(2) andKonstantin Belousov2015-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 Notes: svn path=/head/; revision=285670
* 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 META_MODE support.Simon J. Gerraty2015-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 Notes: svn path=/head/; revision=284345
| * dirdeps.mk now sets DEP_RELDIRSimon J. Gerraty2015-06-081-2/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=284172
| * Merge sync of headSimon J. Gerraty2015-05-271-0/+64
| |\ | |/ |/| | | Notes: svn path=/projects/bmake/; revision=283595
| * Merge from head@274682Simon J. Gerraty2014-11-192-12/+46
| |\ | | | | | | | | | Notes: svn path=/projects/bmake/; revision=274683
| * \ Merge head from 7/28Simon J. Gerraty2014-08-193-379/+2
| |\ \ | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=270164
| * | | Updated dependenciesSimon J. Gerraty2014-05-161-1/+1
| | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=266219
| * | | Updated dependenciesSimon J. Gerraty2014-05-101-0/+2
| | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=265802
| * | | Merge headSimon J. Gerraty2014-04-279-88/+252
| |\ \ \ | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=265006
| * \ \ \ Merge from headSimon J. Gerraty2013-09-054-33/+17
| |\ \ \ \ | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=255263
| * \ \ \ \ sync from headSimon J. Gerraty2013-04-124-8/+90
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=249429
| * | | | | | Updated dependenciesSimon J. Gerraty2013-03-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=248169
| * | | | | | Updated dependenciesSimon J. Gerraty2013-02-161-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=246868
| * | | | | | Sync from headSimon J. Gerraty2012-11-042-3/+10
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=242545
| * | | | | | | Sync FreeBSD's bmake branch with Juniper's internal bmake branch.Marcel Moolenaar2012-08-221-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Requested by: Simon Gerraty <sjg@juniper.net> Notes: svn path=/projects/bmake/; revision=239572
* | | | | | | | Add stub functions to build libkvm. There will be added, but we need themAndrew Turner2015-04-021-0/+64
| |_|_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | now get the toolchain target building. Differential Revision: https://reviews.freebsd.org/D2185 Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=280997
* | | | | | | Allow libkvm to get the kernel va to pa delta without the need forAndrew Turner2014-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 Notes: svn path=/head/; revision=273284
* | | | | | | Update the ULE scheduler + thread and kinfo structs to use int for cpuidAdrian Chadd2014-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. Notes: svn path=/head/; revision=273266
* | | | | | | Fix the type of pte_pa as when it is passed into _kvm_pa2off it is eitherAndrew Turner2014-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. Notes: svn path=/head/; revision=273166
* | | | | | Remove ia64.Marcel Moolenaar2014-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 Notes: svn path=/head/; revision=268351
* | | | | 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
* | | | | Add kvm_getncpus() to obtain mp_ncpus.Gleb Smirnoff2014-02-123-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=261805
* | | | | Add bounds check for pteindex / pdeindexEd Maste2014-02-121-0/+4
| | | | | | | | | | | | | | | | | | | | Notes: svn path=/head/; revision=261799
* | | | | While it isn't too late and kvm_read_zpcpu() function isn't yet usedGleb Smirnoff2014-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. Notes: svn path=/head/; revision=261796
* | | | | add support for building a cross-gdb for ARM... This isn't hooked upJohn-Mark Gurney2014-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 Notes: svn path=/head/; revision=261788
* | | | | Handle truncation of the size returned by _kvm_kvatop(). Cores can haveMarcel Moolenaar2014-01-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | segments larger than INT_MAX. Notes: svn path=/head/; revision=260701
* | | | | We don't have to worry about page sizes when working on virtualMarcel Moolenaar2014-01-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cores (i.e. minidumps). Every segment is virtually contiguous. Notes: svn path=/head/; revision=260600
* | | | | 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
* | | | | Add support for virtual cores (aka minidumps). To that end, refactor thisMarcel Moolenaar2013-12-291-72/+141
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | file as follows: 1. Common ia64-specific support functions have the ia64_ prefix. 2. Functions that work on physical cores have the phys_ prefix. 3. Functions that work on virtual cores have the virt_ prefix. With that: 1. _kvm_kvatop() has been renamed to phys_kvatop() as it handles physical cores only. 2. The new _kvm_kvatop() is nothing but a wrapper that calls either phys_kvatop() or virt_kvatop() by virtue of the kvatop function pointer in the vmstate structure. 3. virt_kvatop() is nothing but a wrapper around virt_addr2off(). 4. virt_addr2off() iterates over the Phdrs to find the segment in which the address falls and return the file offset for it. Now it's up to the kernel to populate the core file appropriately. Notes: svn path=/head/; revision=260028
* | | | | Allow building a cross libkvm for ia64.Marcel Moolenaar2013-12-281-0/+10
| | | | | | | | | | | | | | | | | | | | Notes: svn path=/head/; revision=260023
* | | | | Allow building a cross libkvm by setting TARGET_ARCH. The library soMarcel Moolenaar2013-12-282-7/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | | Fix "kptdir is itself virtual" error, caused by having the kptdir in PBVM.Marcel Moolenaar2013-12-261-7/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While here improve errors by having them include addresses (either virtual or physical). Notes: svn path=/head/; revision=259910
* | | | | Revert r256514 for libkvm. It wasn't correct actually and breaks build.Gleb Smirnoff2013-10-151-3/+1
| | | | | | | | | | | | | | | | | | | | Notes: svn path=/head/; revision=256539
* | | | | - While we are spreading the counter(9) across network stack, more userlandGleb Smirnoff2013-10-151-1/+3
| |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tools would need to know about the counter_u64_t type. Allow to include sys/counter.h from userspace. - Utilize now defined type in kvm_counter_u64_fetch(). Sponsored by: Netflix Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=256514
* | | | In r227839, when removing libkvm dependency on procfs(5),Mikolaj Golub2013-07-102-2/+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
* | | | Switch to 2-clause license and standard textEd Maste2013-06-061-15/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Approved by: bms@ Notes: svn path=/head/; revision=251475
* | | | libkvm: Make second /dev/null file descriptor close-on-exec as well.Jilles Tjoelker2013-05-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=250231
* | | | libkvm: Use O_CLOEXEC instead of separate fcntl(F_SETFD) call.Jilles Tjoelker2013-05-041-15/+4
| |_|/ |/| | | | | | | | | | | | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=250230