aboutsummaryrefslogtreecommitdiff
path: root/lib/libkvm/kvm_ia64.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove ia64.Marcel Moolenaar2014-07-071-375/+0
| | | | | | | | | | | | | | | | | | | | 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
* 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
* 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
* 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
* Add support for PBVM addresses. In a nutshell this means:Marcel Moolenaar2011-08-061-7/+81
| | | | | | | | | | | | | | | | | | o get the physical address and size of the PBVM page table. This can be found in the bootinfo structure, of which the physical address is recorded as the ELF entry point. o translate region 4 virtual addresses to physical addresses using the PBVM page table. In _kvm_kvatop() make the distinction between physical address and core file offset a little clearer to avoid confusion. To further enhance readability, always store the translated address into pa so that it's obvious how the translation from va to pa happened. Approved by: re (blanket) Notes: svn path=/head/; revision=224680
* libkvm code janitoringUlrich Spörlein2011-01-231-5/+6
| | | | | | | | | | | | | | | - make WARNS=6 clean for archs w/o strict alignment requirments - add const, ANSIfy, remove unused vars, cast types for comparison - thanks to differing definitions of VM_MIN_ADDRESS across our archs, we need to trick the compiler to not complain about signedness. We could either fix VM_MIN_ADDRESS to always be a simple integer or make the check conditional on $ARCH. Closes PRs: kern/42386, kern/83364 Reviewed by: bde Notes: svn path=/head/; revision=217744
* Add a level of indirection to the kernel PTE table. The oldMarcel Moolenaar2007-05-191-8/+16
| | | | | | | | | | | | scheme allowed for 1024 PTE pages, each containing 256 PTEs. This yielded 2GB of KVA. This is not enough to boot a kernel on a 16GB box and in general too low for a 64-bit machine. By adding a level of indirection we now have 1024 2nd-level directory pages, each capable of supporting 2GB of KVA. This brings the grand total to 2TB of KVA. Notes: svn path=/head/; revision=169760
* Support crash dumps > 4GB in size on 32 bit platforms. _kvm_kvatop()Peter Wemm2005-06-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | returned an lseek offset in a "u_long *" value, which can't express >4GB offsets on 32 bit machines (eg: PAE). Change to "off_t *" for all. Support ELF crashdumps on i386 and amd64. Support PAE crashdumps on i386. This is done by auto-detecting the presence of the IdlePDPT which means that PAE is active. I used Marcel's _kvm_pa2off strategy and ELF header reader for ELF support on amd64. Paul Saab ported the amd64 changes to i386 and we implemented the PAE support from there. Note that gdb6 in the src tree uses whatever libkvm supports. If you want to debug an old crash dump, you might want to keep an old libkvm.so handy and use LD_PRELOAD or the like. This does not detect the old raw dump format. Approved by: re Notes: svn path=/head/; revision=147672
* Redefine a PTE as a 64-bit integral type instead of a struct ofMarcel Moolenaar2004-09-231-2/+2
| | | | | | | | bit-fields. Unify the PTE defines accordingly and update all uses. Notes: svn path=/head/; revision=135590
* The offset argument to mmap(2) is not a pointer. Use 0 instead of NULL.Marcel Moolenaar2004-09-221-1/+1
| | | | Notes: svn path=/head/; revision=135585
* Revamp of the syscall path, exception and context handling. TheMarcel Moolenaar2003-05-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | prime objectives are: o Implement a syscall path based on the epc inststruction (see sys/ia64/ia64/syscall.s). o Revisit the places were we need to save and restore registers and define those contexts in terms of the register sets (see sys/ia64/include/_regset.h). Secundairy objectives: o Remove the requirement to use contigmalloc for kernel stacks. o Better handling of the high FP registers for SMP systems. o Switch to the new cpu_switch() and cpu_throw() semantics. o Add a good unwinder to reconstruct contexts for the rare cases we need to (see sys/contrib/ia64/libuwx) Many files are affected by this change. Functionally it boils down to: o The EPC syscall doesn't preserve registers it does not need to preserve and places the arguments differently on the stack. This affects libc and truss. o The address of the kernel page directory (kptdir) had to be unstaticized for use by the nested TLB fault handler. The name has been changed to ia64_kptdir to avoid conflicts. The renaming affects libkvm. o The trapframe only contains the special registers and the scratch registers. For syscalls using the EPC syscall path no scratch registers are saved. This affects all places where the trapframe is accessed. Most notably the unaligned access handler, the signal delivery code and the debugger. o Context switching only partly saves the special registers and the preserved registers. This affects cpu_switch() and triggered the move to the new semantics, which additionally affects cpu_throw(). o The high FP registers are either in the PCB or on some CPU. context switching for them is done lazily. This affects trap(). o The mcontext has room for all registers, but not all of them have to be defined in all cases. This mostly affects signal delivery code now. The *context syscalls are as of yet still unimplemented. Many details went into the removal of the requirement to use contigmalloc for kernel stacks. The details are mostly CPU specific and limited to exception_save() and exception_restore(). The few places where we create, destroy or switch stacks were mostly simplified by not having to construct physical addresses and additionally saving the virtual addresses for later use. Besides more efficient context saving and restoring, which of course yields a noticable speedup, this also fixes the dreaded SMP bootup problem as a side-effect. The details of which are still not fully understood. This change includes all the necessary backward compatibility code to have it handle older userland binaries that use the break instruction for syscalls. Support for break-based syscalls has been pessimized in favor of a clean implementation. Due to the overall better performance of the kernel, this will still be notived as an improvement if it's noticed at all. Approved by: re@ (jhb) Notes: svn path=/head/; revision=115084
* Implement working on ELF corefiles. Use kvm_read() when readingMarcel Moolenaar2002-10-211-121/+134
| | | | | | | | | | memory while mapping a virtual address to a physical address. This allows us to work with virtual addresses for page tables, provided it doesn't cause infinite recursion. Currently all page tables are direct mapped. Notes: svn path=/head/; revision=105607
* Implement va->pa translation for kernel virtual addresses. This isDoug Rabson2001-10-251-30/+59
| | | | | | | untested - it only seems to be used for crashdumps. Notes: svn path=/head/; revision=85478
* Partially port kvm to ia64 - virtual to physical translation is incomplete.Doug Rabson2001-10-231-0/+167
Notes: svn path=/head/; revision=85361